aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm
AgeCommit message (Collapse)AuthorFilesLines
2021-01-25svm: add custom q implementation for mqFlorin Coras3-95/+288
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-24svm: use standard function to reset stale mutexBenoît Ganne1-2/+7
Avoid accessing the private data structure of mutexes which is implementation-dependent, eg. musl is different from glibc. Type: improvement Change-Id: I20ec0c1c9faef0749d89a1969cd2430c80ac04b3 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-01-20svm: add standard include for __WORDSIZENathan Moos1-0/+1
Type: fix In glibc, the __WORDSIZE macro is defined in a header included indirectly from svm_common.h. In musl, the __WORDSIZE macro is not indirectly included, so this patch directly includes <sys/user.h> to ensure the __WORDSIZE macro is available. Change-Id: If1b1fc97161b7a0b2e82351d4776c81c36a323cb Signed-off-by: Nathan Moos <nmoos@cisco.com>
2021-01-09session svm: fix fifo migrationFlorin Coras3-27/+41
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
2021-01-06svm: force fixed memfd mapping if va providedFlorin Coras1-3/+3
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6a2cc596cf0b7f29d3ae1c05b1bb6b748b558175
2020-12-30svm: fifo segment sptr for fifo hdr free listFlorin Coras4-49/+88
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-29session: remove fifo segment va allocatorFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7b2fd896dfa6df46916f46327975b95561809f00
2020-12-29svm vcl: allow random offsets for fifo segments in appsFlorin Coras2-10/+34
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1658a9c19d8eae4c9a42c0a111d4ad343b8eb8a4
2020-12-29svm: allow mq attachments at random offsetsFlorin Coras6-70/+198
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic373cd2c11272da539eb4b0db27227f36f2f9688
2020-12-28svm: move active fifo list to private sliceFlorin Coras2-16/+30
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7672d0715348d30c0aa718e21ed86c96402c6d69
2020-12-26svm: change fifo pointers to offsetsFlorin Coras4-156/+230
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I113a630d6db4741f54e508f7e0ed77be139df0e4
2020-12-24svm: split fifo into private and shared structsFlorin Coras5-214/+318
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id8e77e8b2623be719fd43a95e181eaa5b7df2b6e
2020-12-23svm: separate private from shared fifo segment ptrsFlorin Coras3-51/+49
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idcc8d862b98dba4a67f829c1778377f35ad47b00
2020-12-23svm: remove fifo segment heapFlorin Coras5-150/+181
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I518e096fe13847759806ff62009e73fd8f7451b7
2020-12-21svm: honor max requested bytes in fifo segmentsFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I00a6be53c4519937ac900560c669587921990821
2020-12-20tls: use fifo segments instead of chunksFlorin Coras2-0/+51
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id67cf8a3e1c5c9b4160689fde5de9ce7ed8a2ee3
2020-12-14misc: move to new pool_foreach macrosDamjan Marion2-6/+6
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-08svm: fix ssvm_va for private segmentsFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8288a1ed97b375626d69ac7efa0256211834d89c
2020-12-03svm: fix mutex consistency on trylockFlorin Coras2-4/+16
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1370943935b460a1a1a22847fed2c97b1272a5e1
2020-11-30svm: make svm queue mutex robustFlorin Coras2-2/+9
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I256774c25b3c4105139a4728724a1a0c775e740f
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-24svm: support for multi-segment enqueuesFlorin Coras2-0/+92
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I06c7022a6afbb146b23cbd3a430497ec9e8be73d
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 Coras2-4/+2
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-19svm: fix high segment base address for ASanBenoît Ganne1-1/+1
AddressSanitizer has specific requirements on memory map. In particular, the range [0x00007fff8000, 0x10007fff7fff] is reserved for ASan use. Type: fix Fixes: f260eb97866978746ebd3f3441dc66e4ff7111cd Change-Id: Ie96c4dd88b4f02d7fc5c24464572ff72cb6fd96b Signed-off-by: Benoît Ganne <bganne@cisco.com>
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-13svm: change high_seg_basevaNathan Skrzypczak1-2/+2
Type: fix It appears that the session layer baseva is conflicting with DPDK. 0x2000000000 seem to be working experimentally Configurable with : session { segment-baseva 0x2000000000 } Change-Id: Ie93b9b9eb56a796877d614f78eb5801ea8e5ab31 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
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-22svm: support large memfd segmentsFlorin Coras1-2/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2221934083eb82183af9159e705833bd0984bd5d
2020-10-21svm: fix ASAN annotations for external chunksBenoît Ganne2-0/+4
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-10-13svm: fix coverity warningFlorin Coras1-2/+2
Type: fix Change-Id: I6c6255e66dd4cd0e4174b2a1658a3b8be40f0f7a Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-10-12vcl svm: segments improvementsFlorin Coras2-10/+22
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I717c64666972bb4e440cb3d1180a5cb26ee25577
2020-10-10misc: clib_unix_warning usage errorjiangxiaoming1-4/+4
Type: fix Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com> Change-Id: Ibc4e961388d0976b55b9b936d6a37d36cddab5fe
2020-10-06vppinfra: add heap header in front of dlmalloc spaceDamjan Marion3-9/+8
This patch adds smal header in front of dlmalloc space, and it stores some additional information about the heap. Immediate benefit of this patch is that we know the underlying page size si we can display heap page statistics / real memory usage. Type: improvement Change-Id: Ibd6989cc2f2f64630ab08734c9552e15029c5f3f Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-01svm: simplify memfd client segment mappingFlorin Coras1-12/+15
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I33c6a5d1686cc32a6cde149083256d6cf0770fc5
2020-09-30svm: harmonize ssvm namesFlorin Coras3-56/+56
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I26e4ad6bfd9e0be7745f6ba948bf51550fd4215e
2020-09-30svm session: use new clib mem apis for segmentsFlorin Coras3-46/+69
"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-29svm: fix max fifo sizeFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I52ac28ed6d420f03852a425b5a16a7eb8e94b628
2020-09-29vcl svm: provide apps access to fifo chunksFlorin Coras2-31/+36
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2191b8594b1e87ecc00f237316457db249f73603
2020-09-28vppinfra: don't call dlmalloc API directly from the codeDamjan Marion9-35/+16
- 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-09-09svm: fix non-null-terminated stringBenoît Ganne1-1/+1
Type: fix Change-Id: Ia9cd71ce12584cd8ef90bfe357cf762dd7653f71 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-08svm session: document unsupported fifo deq combinationsFlorin Coras2-2/+8
Type: fix - Document that ooo dequeues with ooo lookups cannot be done in combination with in order dequeues. - Added assert to capture this scenario and de-initialized rbtrees for cut-through tx fifo Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic40d020b3f0391fcf022ea3c906b86121744144f
2020-08-06misc: harmonize namesDave Barach2-9/+9
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ibad744788e200ce012ad88ff59c2c34920742454
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-22svm: asan: fix asan supportBenoît Ganne2-0/+11
- restrict the unittests SVM address space to what is supported by ASan - mark SVM mmap()ed address space accessible for ASan - SVM shared memory heap scheme means some allocation can happen outside the current process. Lazily mark those accessible for ASan Type: fix Change-Id: I7c196c80b2a5297651d0afa54f1a8e478fcf59b1 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-20svm: check if fifo free list index is valid on allocFlorin Coras2-0/+9
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 Coras2-14/+79
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic5fb0f95c58ad70925a365004fe911ac8f2d2382