summaryrefslogtreecommitdiffstats
path: root/src/svm/fifo_segment.c
AgeCommit message (Collapse)AuthorFilesLines
2021-05-10svm: try chunk alloc only if enough space availableFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c52dd783601d50e981f75bd05a7b95c03bb5c22
2021-04-20svm: allow external chunk alloc on segmentFlorin Coras1-0/+24
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I89f9caa8dd44dc640615a58fe7708f388fdd84e9
2021-04-02svm: lock-free fifo chunk list push and popFlorin Coras1-40/+56
This avoids chunk allocation/collection deadlocks if either of the sides crashes. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I98619e6e035fa8688889ca34db2143c8898732df
2021-03-30svm: cleanup mq private data on fifo segment cleanupFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I65373f2cd5a33381da1e51ed7ab7a8b1358cef29
2021-02-28session svm: segment manager and fifo segment leaksFlorin Coras1-0/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4e00dd7f8ce1e56092dde9a073decae62d5475de
2021-02-26svm: fix shared hdr migrationFlorin Coras1-7/+8
Avoid changing the header on attach as it may be in use. Instead, as for chunks, allocate header to be collected on detach. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib316ecb5d61ae161032869b6f6a1863f1105a1d9
2021-02-22vcl: cleanup fifos detached from segmentsFlorin Coras1-3/+16
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I412024731c1f561680736ad7bfabb99b595e3dff
2021-02-22svm: free shared fifo on detachFlorin Coras1-2/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I639560ee3dd0a1d605ec2866dce5cdd13fda8201
2021-02-20svm: return chunks to slice on fifo detachFlorin Coras1-17/+13
Ensure chunk alloc distribution is maintained on fifo detach. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5aa5524e06a703dc50e90da6d177663d2d997aa4
2021-02-19session vppinfra: asan fixesFlorin Coras1-0/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie709d76438542783cbc8c6174b5e712ef18a6276
2021-02-18svm: fix active fifo ll on attachFlorin Coras1-0/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idf44f8d54c97fc43da5d5760e5ce477af07e5fbf
2021-01-28svm vcl: add helper fn that discovers mqs in segmentFlorin Coras1-0/+33
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1b083ee793a7cf91b1001bfe88353fa5e6515c42
2021-01-25svm: add custom q implementation for mqFlorin Coras1-3/+4
Add separate queue implementation for the message queue as it's custom tailored for fifo segments as opposed to binary api. Also move eventfds to the private data structures. Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6df0c824ecd94c7904516373f92a9fffc6b04736
2021-01-09session svm: fix fifo migrationFlorin Coras1-25/+37
Allocate and attach a new pair of private fifos in the right private slice when a session is cloned. This ensures that private fifos are not shared between workers. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib700d18104d2ca79aa8a07434cdcdcab0bef13a5
2020-12-30svm: fifo segment sptr for fifo hdr free listFlorin Coras1-18/+47
With this there are no more pointers in data structures allocated on fifo segments. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibe584b7b6809fa360a105974655a91674db69ab6
2020-12-29svm vcl: allow random offsets for fifo segments in appsFlorin Coras1-8/+19
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1658a9c19d8eae4c9a42c0a111d4ad343b8eb8a4
2020-12-29svm: allow mq attachments at random offsetsFlorin Coras1-0/+69
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic373cd2c11272da539eb4b0db27227f36f2f9688
2020-12-28svm: move active fifo list to private sliceFlorin Coras1-15/+29
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7672d0715348d30c0aa718e21ed86c96402c6d69
2020-12-26svm: change fifo pointers to offsetsFlorin Coras1-35/+38
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I113a630d6db4741f54e508f7e0ed77be139df0e4
2020-12-24svm: split fifo into private and shared structsFlorin Coras1-44/+114
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id8e77e8b2623be719fd43a95e181eaa5b7df2b6e
2020-12-23svm: separate private from shared fifo segment ptrsFlorin Coras1-45/+34
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idcc8d862b98dba4a67f829c1778377f35ad47b00
2020-12-23svm: remove fifo segment heapFlorin Coras1-117/+107
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I518e096fe13847759806ff62009e73fd8f7451b7
2020-11-26svm: use internal function to prealloc fifo hdrsFlorin Coras1-30/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic13828e235d01ec5b73658e4bdd19e510932713d
2020-11-26svm: only try to pre-allocate requested number of fifo pairsBenoît Ganne1-1/+8
Type: fix Change-Id: I6f7679fd48d0ed98677c58f8c08d7e969e8e8220 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-11-20svm: fix coverity warningFlorin Coras1-6/+7
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Icead1cbff69cf652fa566a79645c89864b6f3a0f
2020-11-19svm: move chunk locks to linked listFlorin Coras1-37/+48
Type: improvement We only need to protect the linked lists. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie1542073f3993acfc66d99096b08bf9ecd10a49b
2020-11-19svm: init chunk rb tree indices in fifoFlorin Coras1-4/+0
Type: improvement Let fifo segment mainly deal with fifo and chunk allocations not initialization. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1f1eb5a1423ba52cb950ae771641fd7eeff4e76c
2020-11-18svm: fifo segment cleanupFlorin Coras1-341/+205
- consolidate chunk freelist functions - remove redundant functions Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idd7e6700e2cc98a0fb9cfe20a2b739218fd48043
2020-11-09session: delegate fifo ooo lookup init to transportsFlorin Coras1-6/+0
Fifo chunk ooo lookup data structures are private (not allocated on segment heap) and should only be initialized by transport protocols that require out-of-order enqueues/dequeues (like tcp). Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iaa15d6850385bf903cc501c54c2752e8e811449e
2020-10-21svm: fix ASAN annotations for external chunksBenoît Ganne1-0/+1
Chunks can be allocated from another process. We need to manually mark them as accessible for ASAN. Type: fix Change-Id: Ifbeef3346e9cee2c1231f80cbcf7f9673b5b54be Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-30svm: harmonize ssvm namesFlorin Coras1-3/+3
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I26e4ad6bfd9e0be7745f6ba948bf51550fd4215e
2020-09-30svm session: use new clib mem apis for segmentsFlorin Coras1-3/+3
"sh memory map" now reports shared memory segments mapped by session layer for applications. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7debdcd06c7728abfb5cf817a1ccc37de495472c
2020-09-28vppinfra: don't call dlmalloc API directly from the codeDamjan Marion1-4/+1
- it is confusing from end consumer perspective that some thing is somewhere called heap and somewhere mspace - this is base for additional work where heap pointer is not the same thing like mspace Type: improvement Change-Id: I644d5a0de17690d65d164d8cec3c5654571629ef Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-28svm: fix fifo alignemnt in batch preallocFlorin Coras1-3/+9
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5cdf3cff820a0679f78b212a277d1873c2cfb980
2020-04-28svm: null instead of panic if fifo hdr alloc failsFlorin Coras1-1/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2c5c9e3e7eff8481e48a940e8420d236a16e7649
2020-04-20svm: check if fifo free list index is valid on allocFlorin Coras1-0/+7
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Benoît Ganne <bganne@cisco.com> Change-Id: Ib85c2f01dc7ec9858f2f88b89e209f989d78c5d9
2020-04-09session: update fifo slice on session migrationFlorin Coras1-14/+75
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic5fb0f95c58ad70925a365004fe911ac8f2d2382
2020-04-09svm: use active fifo count in fifo testFlorin Coras1-12/+8
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id6c9dbf65523274768173e288431d7dbac55676d
2020-03-27vcl: support for uword segmentsFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibfe203fda5a0c88b26eb50bee8a430dd2cfb7dca
2020-03-26svm: correct format_fifo_segmentRyujiro Shibuya1-3/+4
Type: improvement Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: Ia8aef3695f12e09b087be79ebe40e758fb8105ad
2020-03-16svm: chunk alloc statsRyujiro Shibuya1-5/+12
Type: feature Showing number of allocated chunks by size, in addition to the freelist chunks by size. Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: I50f7b695a217f132d5f0b307182a34752d3fe1dc
2020-03-12svm: cleanup chunk and fifo allocationFlorin Coras1-37/+62
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2426211f48b242e51aeb1edc87c1cd21c526dbfa
2020-03-09svm: track fifo segment virtual memory consumptionFlorin Coras1-38/+64
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I89d33d8e7e7ab049750439b22ba50372fd2261ca
2020-03-05session: reduce segment reserved bytesFlorin Coras1-3/+2
Type: refactor Rb-trees are no longer maintained in the segment so we don't need to reserve memory. Keeping the option as a means to avoid underlying infra (dlmalloc) and alignment overhead. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I84741e95d015f7b72c60d9dca20be8e0aee6a915
2020-03-05session: fix segment search on fifo allocFlorin Coras1-0/+6
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iaa4f9b0ec31a58f7406774f73e1a089bfcf4ac30
2020-02-29svm: fix slice locking on fifo allocFlorin Coras1-5/+15
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1fef115ffc2277ad6e0673b49be137147808891c
2020-02-26svm: fix coverity warningsFlorin Coras1-1/+0
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2d5cb7cccb67a3193ce5a25323e70bc05737e023
2020-02-26svm: support multi-chunk fifo chunk allocFlorin Coras1-7/+133
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id601cd241a2d124d3189057edab4299ffde7ee32
2020-02-26svm: remove chunk add functionFlorin Coras1-11/+11
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I606eabbe0f3f387529e77d2483f5d63db7bde88a
2020-02-25svm: minimal initial fifoFlorin Coras1-7/+8
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4ee46a6c3c53c58199c275e20702f7fd11b60d9a