summaryrefslogtreecommitdiffstats
path: root/extras/libmemif/src/libmemif.h
AgeCommit message (Collapse)AuthorFilesLines
2021-10-27libmemif: fix gcc strict-proto errorMatthew Giassa1-3/+3
- Changing function prototypes for a couple libmemif functions so that gcc will successfully compile with the "-Wstrict-prototypes" flag enabled. - Re-ran unit tests via "make test" locally on Ubuntu 20.04 LTS x64. One issue (likely unrelated to patch): * Testcase name: Bidirectional Forwarding Detection (BFD) ERROR: put session admin-up and admin-down [test_bfd.BFD4TestCase.test_admin_up_down] Type: fix Change-Id: Ibcb7210873d39aec9348fe8ac7eebc78d089d8e0 Signed-off-by: Matthew Giassa <mgiassa@cisco.com>
2021-09-27libmemif: refactor connection establishmentJakub Grajciar1-148/+183
per_thread_ namespace fuctionality replaced by memif socket. Interfaces are grouped by memif socket which holds interface database. Each thread can create it's unique memif socket. The path name can be equal across threads so that the app only uses one UNIX socket. In case of listener socket, listener fd can be obtained and set using APIs. This change allows: - No lookup on file descriptor events - improves interrupt handling - Loopback support (connect two interfaces in one app) - usefull for debugging and testing - Improves code readability by providing control channel abstraction for each interface and listener sockets Type: refactor Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I1b8261042431c0376646ab4c4c831f6e59dd3eed
2021-09-27libmemif: remove per_thread_ namespaceJakub Grajciar1-94/+1
Type: refactor Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ib5a88132ad28860553fc82f5aaaf84e0a1b8e8bf
2021-03-15libmemif: fix the include for ssize_tAndrew Yourtchenko1-0/+1
Change-Id: I83830e64fb0fc302474837ebfa4f8cb133b1dccf Type: fix Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-03-12libmemif: add an include of sys/types.h header fileAndrew Yourtchenko1-0/+1
the ssize_t is defined there. Change-Id: Ie46d196347ab91d0a92c15f331db14fe3b57061c Type: fix Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-02-05libmemif: set next free bufferJakub Grajciar1-0/+11
Adds memif_set_next_free_buffer - set internal pointer to next free descriptor for any tx queue. Type: feature Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ia24345a886a52c25c1723c6dbce023f2aed4a42c
2021-01-21libmemif: buffer enqueue refactorJakub Grajciar1-5/+14
Refactored memif_buffer_enq_tx - dequeue buffers from any queue (rx/tx) and enqueue them to any tx queue. Added memif_buffer_requeue - swap descriptors of provided buffers. Type: refactor Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I8482824df920aaaf8325d52a297ed57a815aaba6
2020-12-04libmemif: clean up typosPaul Vinciguerra1-7/+7
Type: style Change-Id: I0d25d922312dfd60a665916cf47c3d2faa29ea49 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-05-18libmemif: cleanup typosPaul Vinciguerra1-32/+32
cleaned up typos in documetation while doing a read through. Type: style Change-Id: Id8abbd8d6297ee10490c12a8e62097224f7ec1e1 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-05-06docs: clean up make docs jobPaul Vinciguerra1-1/+1
Type: docs Change-Id: I9b5e5137eb4c1e89f6e8d7a278cd11a0fd496471 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-03-21libmemif: don't consume rx queue interrupt, if memif_rx_burst failsJan Cavojsky1-0/+3
Type: fix Signed-off-by: Jan Cavojsky <jan.cavojsky@pantheon.tech> Change-Id: Ic6c15c88c80c4045c290cd78533be6f070c7470a
2020-01-27libmemif: memif_control_fd_update always pass context from libmemif_mainJakub Grajciar1-0/+5
Event polling instance is always identified by libmemif main private context. Fixes event polling handled by libmemif. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I51dcdb279b18f8ce97bad3b2695848e0b25a232d
2019-08-21libmemif: introduce 'memif_per_thread_' namespaceJakub Grajciar1-4/+132
APIs in 'memif_per_thread_' namespace are used to split the global database into separate databases, to improve multi-thread use cases. Using 'memif_per_thread_init' client can create separate libmemif databases (libmemif_main_t). Client will reference these databases using memif_per_thread_handle_t. Each database requires unique socket. Created interface will be stored in the same database as the socket passed in connection arguments. Example code: extras/libmemif/examples/icmp_responder_3-1/main.c Type: feature Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I261563ecc34761a76e94f20c20015394398ddfd7 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-07-02libmemif: version 3.0Jakub Grajciar1-7/+41
Add support for multi-thread connection establishment. - control_fd_update() callback now passes private context associated with updated file descriptor. File descriptor can belong to memif socket, memif connection or timerfd. In case of timerfd the context is NULL. - memif_create_socket() new API. Creates memif socket handle to be passed to memif_create() in memif_conn_args_t. This API allows to pass private context whenever the file descriptor is updated. - memif_delete_socket() new API. Deletes memif socket. Socket must not be in use by any interface. Type: feature Change-Id: I7ca4e4349595d4477195f1c32403d3e3a6eb5361 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-03-04libmemif: Connection request APIsJakub Grajciar1-13/+33
Add APIs that allow changing reconnect timer and request connection. First connection request is automatically sent once slave interface is created. Change-Id: Ie3558b7b94a780b046755f7f0ac6c3dcf07633e4 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-09-07libmemif: slave connecting bugfixJakub Grajciar1-0/+3
in case first connecting slave fails continue connecting others add disconnect string to memif details Change-Id: I9d83db4724de1cab60786dca566e004016cf1e59 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-08-30libmemif: external region supportJakub Grajciar1-2/+96
region 0: descriptors region 1: buffers (external) Change-Id: Ia728967817b4c78bc00f8eed44606d0c5bc386b0 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-30libmemif: zero-copy-slave mode + header spaceJakub Grajciar1-2/+24
Slave is now able to dequeue buffers from rx queue and enqueue them to tx queue (zero-copy operation). Slave can produce buffers with headroom, which will allow adding encap without copy. Change-Id: Ia189f8de1a68be787545ed46cf78d36403e7e9bf Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-28libmemif: add private header size fieldJakub Grajciar1-0/+1
Change-Id: I09567c8ee9c92e91918840f80942a005069d9842 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-26libmemif: version 2Jakub Grajciar1-21/+48
Change-Id: Ia2532695aa9199d2a7b684aebef43df0b8235531 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-13libmemif: ubuntu 18.04 build fixJakub Grajciar1-2/+2
Change-Id: I6624cacd625eea6a9b8214f67d14ec162e2c0195 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-01-24docs: Clean up TOCDave Wallace1-2/+8
Change-Id: I5415c002a431d84372f56d4a77dc2aabd6ef55f7 Signed-off-by: Dave Wallace <dwallacelf@gmail.com> (cherry picked from commit 1eb970d16028e9a987c1dd2bfe217d1313262b81)
2017-11-16libmemif: unmask head/tail pointers fix, additional ring info in ↵Jakub Grajciar1-1/+8
memif_queue_details_t Change-Id: I1dbf91c2a1575d5a82af70bfccdd990310323a8c Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-11-08memif: do not mask head and tail pointersDamjan Marion1-0/+1
Change-Id: Ie849ab713ff086187c18a91ab32e58207fe94033 Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-10-12libmemif: Add memif_cancel_poll_event() + bug fixing.Milan Lenco1-0/+16
Change-Id: I27d6bf93216f1f639f01fad730506afdc7115e46 Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2017-09-15libmemif: Jumbo frames supportJakub Grajciar1-1/+2
Change-Id: I2b316358dcd2de7168a860541bcca35c3dd44649 Signed-off-by: Jakub Grajciar <grajciar.jakub@gmail.com>
2017-09-13Shared memory packet interface (memif) libraryJakub Grajciar1-0/+442
Change-Id: I5097462ae85acd705f19e92517c01094dba7565f Signed-off-by: Jakub Grajciar <grajciar.jakub@gmail.com>