summaryrefslogtreecommitdiffstats
path: root/src/svm/ssvm.c
AgeCommit message (Collapse)AuthorFilesLines
2022-04-05vppinfra: refactor address sanitizerDamjan Marion1-1/+1
Type: refactor Change-Id: I5ca142ec1557d5b5c3806b43553ad9d3b5ea1112 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-03svm: Close client shm fdroot1-0/+1
Type: fix Signed-off-by: Emmanuel Scaria <emmanuelscaria11@gmail.com> Change-Id: I41bb6e16735b77efa744b0368eed7dfa9583e960
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-08svm: fix ssvm_va for private segmentsFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8288a1ed97b375626d69ac7efa0256211834d89c
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-13svm: fix coverity warningFlorin Coras1-2/+2
Type: fix Change-Id: I6c6255e66dd4cd0e4174b2a1658a3b8be40f0f7a Signed-off-by: Florin Coras <fcoras@cisco.com>
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 Marion1-2/+1
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 Coras1-39/+39
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-42/+65
"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-17/+10
- 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-22svm: asan: fix asan supportBenoît Ganne1-0/+1
- 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-02-11vppinfra: remove the historical mheap memory allocatorDave Barach1-15/+0
The mheap allocator has been turned off for several releases. This commit removes the cmake config parameter, parallel support for dlmalloc and mheap, and the mheap allocator itself. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I104f88a1f06e47e90e5f7fb3e11cd1ca66467903
2020-02-11svm: numa awareness for ssvm segmentsFlorin Coras1-24/+28
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I999836a7893a89aac5243b111eac35fddd03e2a6
2019-12-20svm: fix sh ssvm size for private segmentsFlorin Coras1-0/+1
Type: fix Change-Id: Id11cb596923541c12d37f1afa00416d73c6ff5e3 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-12session svm: support for segments larger than 4GBFlorin Coras1-2/+1
Type: feature Change-Id: I7d3017bbb369261d74f51807a226f2c12f45291c Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-11-12svm: improve fifo segment verbose cliFlorin Coras1-0/+5
Type: feature Also make sure that size for dlmalloc allocated private segments is accurate. Change-Id: I6ec81ff99a13dd29b9664d768835a68019f0c96c Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-12svm: handles heap dlmalloc allocation failureBenoît Ganne1-0/+6
Type: fix Fixes: 6a5adc3695 Change-Id: I21091fc2938cababeb28bacf7c5e457a05ab6272 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-02svm: fix shm segment deleteFlorin Coras1-1/+1
Type:fix Change-Id: Ia8f3496bf24a7dbe0a295b038aa6dfa24f034989 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-11ssvm: disable private segment expandFlorin Coras1-0/+1
Change-Id: I893621d9a6520c6e24026a9bbaf44e9e69f60bcb Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-09svm: improve fifo segment showFlorin Coras1-0/+1
Type: refactor Change-Id: I6933205cfb04bc31cabe6e3b1a8044cace93f84c Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-14svm: improve fifo segment prealloc supportFlorin Coras1-2/+2
- track fifo segment free and chunk freelist memory - improve fifo alloc. If there are enough chunks to satisfy a fifo allocation request but not enough free memory, allocate a multi-chunk fifo - add apis to preallocate chunks and fifo headers - more tests Change-Id: If18dba7ab856272c9f565d36ac36365139793e0b Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-09session: segment manager fixesFlorin Coras1-0/+1
- fix segment size rounding for 4GB segments - fix initialization of first segment size - cleanup fifo segment info retrieval Change-Id: I5ebf20f71ea797087653e7e76fa2e37b2686ec40 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-08host stack: update stale copyrightFlorin Coras1-1/+1
Change-Id: I33cd6e44d126c73c1f4c16b2041ea607b4d7f39f Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-02Fixes for buliding for 32bit targets:David Johnson1-1/+1
* u32/u64/uword mismatches * pointer-to-int fixes * printf formatting issues * issues with incorrect "ULL" and related suffixes * structure alignment and padding issues Change-Id: I70b989007758755fe8211c074f651150680f60b4 Signed-off-by: David Johnson <davijoh3@cisco.com>
2018-10-25pmalloc: support for 4K pagesDamjan Marion1-2/+2
Change-Id: Iecceffe06a92660976ebb58cd3cbec4be8931db0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-23c11 safe string handling supportDave Barach1-1/+1
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-16Fix coverity issue for potentially overflowing of page sizeHaiyang Tan1-1/+1
Change-Id: I2779626d745badb63386efcf729da7a094a4f297 Signed-off-by: Haiyang Tan <haiyangtan@tencent.com>
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach1-14/+45
Configure w/ --enable-dlmalloc, see .../build-data/platforms/vpp.mk src/vppinfra/dlmalloc.[ch] are slightly modified versions of the well-known Doug Lea malloc. Main advantage: dlmalloc mspaces have no inherent size limit. Change-Id: I19b3f43f3c65bcfb82c1a265a97922d01912446e Signed-off-by: Dave Barach <dave@barachs.net>
2018-07-17session: make sure segment sizes are page alignedFlorin Coras1-2/+3
Change-Id: Ibbba75d069ca1bbf9e5a1b8bd2f405d32021c656 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-06svm: add unidirectional message queueFlorin Coras1-3/+7
Meant for single reader/writer message exchanges. Supports multiple message rings. Change-Id: I925de9a6ae19226c5c39a63caff76424ed123a13 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-02-14session: support local sessions and deprecate redirectsFlorin Coras1-3/+6
Memfd backed shared memory segments can only be negotiated over sockets. For such scenarios, the existing redirect mechanism that establishes cut-through sessions does not work anymore as the two peer application do not share such a socket. This patch adds support for local sessions, as opposed to sessions backed by a transport connection, in a way that is almost transparent to the two applications by reusing the existing binary api messages. Moreover, all segment allocations are now entirely done through the segment manager valloc, so segment overlaps due to independent allocations previously required for redirects are completely avoided. The one notable characteristic of local sessions (cut-through from app perspective) notification messages is that they carry pointers to two event queues, one for each app peer, instead of one. For transport-backed sessions one of the queues can be inferred but for local session they cannot. Change-Id: Ia443fb63e2d9d8e43490275062a708f039038175 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-02-05session: segment manager refactorFlorin Coras1-3/+56
- use valloc as a 'central' segment baseva manager - use per segment manager segment pools and use rwlocks to guard them - add session test that exercises segment creation - embed segment manager properties into application since they're shared - fix rw locks Change-Id: I761164c147275d9e8a926f1eda395e090d231f9a Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-25session: add support for memfd segmentsFlorin Coras1-49/+80
- update segment manager and session api to work with both flavors of ssvm segments - added generic ssvm slave/master init and del functions - cleanup/refactor tcp_echo - fixed uses of svm fifo pool as vector Change-Id: Ieee8b163faa407da6e77e657a2322de213a9d2a0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-17ssvm: reuse clib mem infra for memfd segmentsFlorin Coras1-55/+53
Change-Id: I67648dbed3c7ed291b3e1ce617d83a776d3623bb Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-15svm: refactor memfd and remove ssvm_ethFlorin Coras1-2/+115
Change-Id: Icde296e956eb89ea3a17d547f04a833916ec6440 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-09-06Set uid/gid on ssvm segment file.Dave Wallace1-0/+7
Change-Id: I482bb9654f4dfe240bace5c2b61056cfd04cf018 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-07-31ssvm->name must be a vector containing a c-string.Dave Wallace1-0/+2
Change-Id: I14a97a7fdd000da62d2ed4bea71f55ee34a21311 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-07-17Fix unlinking of /dev/shm files.Dave Wallace1-1/+10
- api-segment prefix not used when unlinking shm files - unlink root region on exit if no clients referenced - stale reference to freed segment name - don't add fake client to /db unless CLIB_DEBUG > 2 - turn off the gmond plugin - clean up unused vars in vpp/api Change-Id: I66451fcfd6ee64a12466c2d6c209050e3cdb74b7 Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Signed-off-by: Dave Barach <dave@barachs.net>
2017-03-01VPP-598: tcp stack initial commitDave Barach1-0/+16
Change-Id: I49e5ce0aae6e4ff634024387ceaf7dbc432a0351 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Florin Coras <fcoras@cisco.com>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+178
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>