summaryrefslogtreecommitdiffstats
path: root/src/svm
AgeCommit message (Collapse)AuthorFilesLines
2020-02-29svm: add explicit dependency on lock for fifo typesFlorin Coras1-0/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib363d8167102f4b05bec0624494481d572096c9f
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-26tls session: fix unlistenFlorin Coras1-1/+0
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie3bc31fc3df662e087f7931de6c274eb3608a2d8
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 Coras4-53/+98
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I606eabbe0f3f387529e77d2483f5d63db7bde88a
2020-02-25svm: minimal initial fifoFlorin Coras3-11/+12
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4ee46a6c3c53c58199c275e20702f7fd11b60d9a
2020-02-25session svm: tracking segment memory usageRyujiro Shibuya3-13/+208
1. segment manager would attempt to balance the usages across the segments, when it allocate fifos 2. the memory presure level is determined per fifo-segment 3. updated unit test 4. updated cli output for segments Type: feature Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: I2923f3e0a43dd919196a0cb2cd55e098fde6cf66
2020-02-25svm: refactor fifoFlorin Coras6-881/+782
Type: refactor Switch from a wrapped byte space to a "continuous" one wherein fifo chunks are appended to the fifo as more data is enqueued and chunks are removed as data is dequeued. The fifo is still subject to a maximum size, i.e., maximum number of bytes that can be enqueued, so the max number of chunks associated to the fifo is also constrained. When enqueueing data, which must fit within the available free space, if not enough "supporting" chunk memory is available, the fifo asks the fifo segment for enough chunk memory to ensure that the write can succeed. To avoid allocating large amounts of small chunks due to small writes, if possible, the size of the chunks requested is lower capped by min_alloc. When dequeuing data, all the chunks that have been completely drained, i.e., head moved beyond the chunks’ end bytes, are unlinked from the fifo and returned to the fifo segment. The one exception to this is the last chunk which is never unlinked. Change-Id: I98c1dbd9135fb79650365c7e40c29238b96cd4ee Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-02-25svm: refactor fifo chunk trackingFlorin Coras3-82/+294
Avoid tracking with rbtrees all of the chunks associated to a fifo. Instead, only track chunks when doing out-of-order operations (peek or ooo enqueue). Type: refactor Change-Id: I9f8bd266211746637d98e6a12ffc4b2d6346950a Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-02-11vppinfra: remove the historical mheap memory allocatorDave Barach3-49/+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 Coras2-25/+30
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I999836a7893a89aac5243b111eac35fddd03e2a6
2020-01-31session: fix chunk batch alloc for large fifosFlorin Coras1-6/+8
Type: fix Change-Id: Ibfac65b516f20d25d91f6d0cf86491353811b8be Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-01-08svm: fix eventfd signal write error checkFlorin Coras1-2/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I706c8642ca0877430a42cc0ca5bc61a45428fc98
2020-01-03session: fix per slice fifo preallocFlorin Coras1-8/+10
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If6db37af6c2863a80d0787a98026b3b8171dad37
2019-12-30svm: broadcast on raw dequeues and full ringsFlorin Coras3-7/+28
Type: fix Change-Id: I0cac9001290e7ed4e2e318ae62c56e97ec75a3db Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-20svm: fix multichunk alloc with not enough spaceFlorin Coras1-2/+32
Type: fix Change-Id: Ia89c76b0e897fc3a3ebbc8dcba25e8ac9974b7fa Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-20svm: fix sh ssvm size for private segmentsFlorin Coras2-11/+10
Type: fix Change-Id: Id11cb596923541c12d37f1afa00416d73c6ff5e3 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-19session: reserve memory for rbtreeFlorin Coras2-4/+44
Type: fix Change-Id: I2b89f6e4c09297e3712d88cd25c80a806d3005aa Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-18svm: decrease svm map verbosityFlorin Coras1-1/+1
Type: fix Change-Id: I833b6c23c376f1e806f94f0780be365c82ad1f88 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-12session svm: support for segments larger than 4GBFlorin Coras4-13/+12
Type: feature Change-Id: I7d3017bbb369261d74f51807a226f2c12f45291c Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-12session svm: per thread fifo segment slicesFlorin Coras3-205/+324
Type: refactor Change-Id: I9be652e56cdb48b0aee3253f7ce8d9bed299d824 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2019-12-11session: Add mq debug cliNathan Skrzypczak2-0/+20
Type: feature This add a `show app message queue` cli command that shows mq size per app & thread. Change-Id: I5c6ce024b149fb7a47d899bc514c5a4887429982 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-10api: multiple connections per processDave Barach1-1/+1
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
2019-11-27misc: add address sanitizer heap instrumentationBenoît Ganne2-0/+8
Introduce AddressSanitizer support: https://github.com/google/sanitizers/ This starts with heap instrumentation. vlib_buffer, bihash and stack instrumentation should follow. Type: feature Change-Id: I7f20e235b2f79db72efd0e756f22c75f717a9884 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-11-12svm: improve fifo segment verbose cliFlorin Coras2-9/+37
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-11-07svm: fix byte accounting when allocating fifo headerFlorin Coras1-0/+1
Type: fix Change-Id: Ie50625271d257da814445ce13c2e6cd98986d523 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-10-16svm: immediate fifo growth even when wrappedRyujiro Shibuya2-8/+117
Type: fix - when the fifo is wrapped, and if applicable, insert a new chunk after the tail-chunk and rebuild the rb_tree. - make sure that this new algorithm can be applied only when the fifo is used by a single thread (master-thread of the fifo). Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: I3fc187bc496ea537ca24381e4abc08d2906c9e03
2019-09-20session: fix msg freeing on errorNathan Skrzypczak1-5/+0
Type: fix Change-Id: I0807f84737d5e98e69e9ed27a1de6813b2ddd138 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-08-29svm: fix fifo hdr freelist allocationFlorin Coras2-1/+5
Type: fix Change-Id: Ia362ad821db1fd506e973e1844cc3ec74703cc17 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-13svm: fix svmtool and svmdbtool segment fault.Guanghua Zhang2-0/+4
Type: fix Signed-off-by: Guanghua Zhang <ghzhang@fiberhome.com> Change-Id: Ifd3abaa5ec912378dbc7b73c4863aad26777dd7e
2019-08-08svm: fix fifo max writeable chunk computationFlorin Coras1-1/+1
Type:fix Change-Id: I60fdd7651a3d3fac505e7aec7a41f9d096022895 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-05svm: fix fifo growth on dequeue with dropFlorin Coras1-0/+6
Type:fix Change-Id: I39c339abf1b51105ef1bcf3d6f0f4f6ded54f32d Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-30vppinfra: refactor use of CLIB_MEMORY_BARRIER ()jaszha031-4/+2
All instances of test_and_set locks used the following sequence to release the locks: CLIB_MEMORY_BARRIER (); p->lock = 0; // p is a generic struct with a TAS lock Use clib_atomic_release to generate more efficient assembly code. Type: refactor Change-Id: Idca3a38b1cf43578108bdd1afe83b6ebc17a4c68 Signed-off-by: Jason Zhang <jason.zhang2@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-07-30vppinfra: conformed spinlocks to use CLIB_PAUSEjaszha031-2/+3
Modified test-and-set spin locks to call CLIB_PAUSE () when spinning for code consistency. Decreases the memory bandwidth consumed. Type: fix Change-Id: I1cca4f87f44f23f257c7a35466cd2e7767072f51 Signed-off-by: Jason Zhang <jason.zhang2@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-07-29session: fix vpp to app msg generationFlorin Coras1-2/+4
Type:fix Freeing mq messages in vpp (producer), if enqueueing fails, invalidates consumer assumption that messages can be freed without a lock. Change-Id: I748a33b8846597bdad865945d8e899346d482434 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Tal Saiag <tal.saiag@gmail.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-03svm: fix multi-chunk fifo alloc and add more testsFlorin Coras3-10/+127
Type: fix - make sure that chunks and the rbtree are initialized if fifo segment allocates multiple chunks for the fifo. - ensure head/tail chunks are updated on all enqueue/dequeue events, including when dropping data. - more unit tests Also fixes dequeue drop updates of head chunk. Change-Id: I77f3550bc4e8b4e077f80ea87fe82b83ed013aeb Signed-off-by: Florin Coras <fcoras@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-29svm: rename fifo tx notifications to reflect useFlorin Coras1-42/+42
Type: refactor Change-Id: I651db44acdcb666a9c63e1037352cf88c68795b5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-28quic : Use TX event for app read notificationNathan Skrzypczak1-3/+7
Type: feature Change-Id: I1846cdeb35f079249f66a0351aa244c540923a43 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-26svm: fix fifo segment free chunk bytes accountingFlorin Coras2-4/+9
Type:fix Change-Id: Icab89337eb3dbdc93d0fb453cfd34090026072b7 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-25svm: make sure chunk search does not return tnilFlorin Coras1-0/+2
Type:fix Change-Id: I8405bf8d93b4468c54f4f3c5dcd21ef91a6b1048 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-24session: full lock on session_send_evt_to_threadNathan Skrzypczak1-2/+2
Type: fix This was causing issues in QUIC when an app client & the protocol app compete for the worker msg_queue. Might not be ideal performance- wise. Change-Id: I629892253d5b5d968f31ad1d56f18463e143d6b4 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-18session: fix memory out of bound issueLijian.Zhang1-1/+1
Ring data space is following ring vec_header_t and ring elements immediately. Add verification code in session_test. Type: fix Change-Id: I0bfa096a9f459128a588821d99b5cdb4f10ede38 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Sirshak Das <Sirshak.Das@arm.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 Coras2-7/+34
Type: refactor Change-Id: I6933205cfb04bc31cabe6e3b1a8044cace93f84c Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-21svm_queue_timedwait_inline: lock after waitVratko Polak1-1/+1
This fixes a typo introduced in https://gerrit.fd.io/r/18198 Change-Id: I634a06be95154d3e1c5e5711ea69f19c9c4cca44 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-05-20consolidate all mutux opertionPing Yu1-17/+17
replace all pthread_mutex_lock/unlock to be svm_queue_lock/unlock So there all operation is based on defined mutux, and it can help us to debug or replace mutux locking method Change-Id: I9aeeb03bbbbf3d7a824c06a535e5d6a6b463b42c Signed-off-by: Ping Yu <ping.yu@intel.com>
2019-05-14svm: improve fifo segment prealloc supportFlorin Coras3-196/+349
- 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>