44 Commits

Author SHA1 Message Date
Jan Cavojsky
fd24264763 libmemif: don't consume rx queue interrupt, if memif_rx_burst fails
Type: fix

Signed-off-by: Jan Cavojsky <jan.cavojsky@pantheon.tech>
Change-Id: Ic6c15c88c80c4045c290cd78533be6f070c7470a
(cherry picked from commit 77a95cdce2f3d80dac2832b68310eb5b23769c0e)
2020-08-07 20:49:18 +00:00
Jakub Grajciar
ffa14d74be libmemif: memif_control_fd_update always pass context from libmemif_main
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
(cherry picked from commit 6f090fa1fa44bb2de0565bbedb2756e37ea35040)
2020-08-07 20:49:18 +00:00
Jakub Grajciar
329c884aa2 libmemif: reset number of queues on disconnect
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: If4df47b1109ac90d4d5834b3aa7d326f6b3761d2
(cherry picked from commit 718a19b8f9aa3dca26aaf4eb6bd9f60eb6376d30)
2019-11-18 13:17:43 +00:00
Jakub Grajciar
4aee015225 libmemif: prevent crash in case of invalid connection handle
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I803c86a48e0148ef143026a5cd93e4510c4f0611
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
(cherry picked from commit bdf3ebe358787ef240dc9fadc515dfd178dfef7b)
2019-09-30 00:10:30 +00:00
Jakub Grajciar
2736fc7fcf libmemif: introduce 'memif_per_thread_' namespace
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>
(cherry picked from commit 17f2a7bbf25f54dbd71aa8f377875828b7b88e35)
2019-09-25 22:09:12 +00:00
Jakub Grajciar
272e2e456d libmemif: fix autoconnect
Type: fix

Change-Id: I426e210c47869904a01712b765db2356439f706f
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-07-26 14:51:59 +00:00
Jakub Grajciar
cbd179cd39 libmemif: fix chained buffer flag
fixes issue: MEMIF_DESC_FLAG_NEXT persisted when enqueueing
stored buffers

Type: fix

Change-Id: I9e973ed6e0339612fe1dd3e3bd80ed7c05093791
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-07-25 08:55:17 +00:00
Jakub Grajciar
12df497bb6 libmemif: version 3.0
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-07-02 14:06:46 +00:00
Jakub Grajciar
389c82286d libmemif: icmp-responder example buffer management fix
Type: fix

Change-Id: Ieeb763f282ee929a121585747119f458c00056ae
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-07-01 15:17:13 +00:00
Benoît Ganne
49ee68443d build: add -Wall and -fno-common, fix reported issues
Type: refactor
Change-Id: I8489ccd54411c2aa9355439c5641dc31012c64a2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-06-07 11:21:59 +00:00
Jim Thompson
f324dec0a3 fixing typos
Change-Id: I215e1e0208a073db80ec6f87695d734cf40fabe3
Signed-off-by: Jim Thompson <jim@netgate.com>
2019-04-08 21:54:17 +00:00
Jakub Grajciar
84b83776d3 libmemif: Connection request APIs
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>
2019-03-04 14:06:37 +00:00
Koichiro Den
33331edd3a libmemif: fix incorrect write leading to memory corruption
in the worst case scenario this leads to segfault in a hard-to-debug way.

Change-Id: I165adae0bd2dee26af777a2665c8c124d3a49808
Signed-off-by: Koichiro Den <den@klaipeden.com>
2019-01-04 19:55:33 +00:00
Mauro Sardara
ec0cc2cf05 Remove autotools files from extras/libmemif
Change-Id: I6c5f7ab5bb6c0022746d3feedd71b5981f31c7fb
Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
2018-12-18 09:35:08 +00:00
Koichiro Den
be420e59e9 libmemif: fix possible segfault on memif_get_details
insufficient buflen does not mean immediate return but
fallthrough by design so assigning values to these
array elements should just be skipped in that case.

Change-Id: Iaa9718db073108e44a9b05e1c8ffb0725147ff1f
Signed-off-by: Koichiro Den <den@klaipeden.com>
2018-12-17 10:52:34 +00:00
msardara
8f554b793c Added CMake building system for libmemif
Added Cpack support for building libmemif DEB/RPM packages
Fixed compilation errors in libmemif test and examples

Change-Id: I59a237a4ca8eb08840857d5b0e666f3a8d74411d
Signed-off-by: msardara <msardara+fdio@cisco.com>
2018-12-17 09:25:18 +00:00
Jakub Grajciar
412e7b64f9 libmemif: external region bugfix
Change-Id: I7dbece80dda917ff78f53f8f4074132895aed316
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-09-27 18:32:22 +00:00
Jakub Grajciar
568cc4674e libmemif: slave connecting bugfix
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-09-07 07:28:17 +00:00
Jakub Grajciar
93a5dd1723 libmemif: external region support
region 0: descriptors
region 1: buffers (external)

Change-Id: Ia728967817b4c78bc00f8eed44606d0c5bc386b0
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-08-30 12:35:46 +00:00
Damjan Marion
20728d40d9 memif: fix max number of rings
Change-Id: Ie7621a38a44e7c692e23e58c43d27d8d2aab43e6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-11 13:23:03 +00:00
Milan Lenco
f8b43e5421 libmemif: fixing head/tail arithmetics & queue reallocation
Change-Id: Ibc1f01b1cc99e7be77e892e53b7e1283f2a145cf
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2018-06-28 13:50:28 +00:00
Damjan Marion
2cdc2bde95 libmemif: fix build on ununtu 18.04 (VPP-1244)
Change-Id: If830dc0c8171b14c8a686db899885e26628a6f91
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-26 18:40:16 +02:00
Jakub Grajciar
435f500215 libmemif: fix implicit declaration of memfd_create
Change-Id: Icdeaad1d5df63bd5e9426958a3b73582bbd226b7
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-04-24 18:40:01 +00:00
Jakub Grajciar
5e1f69a4eb libmemif: fix clang compilation errors/warnings
Change-Id: I09444281a932d367162a10b90c3759db71c03350
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-04-12 14:05:05 +00:00
Jakub Grajciar
3744fc7abc libmemif: zero-copy-slave mode + header space
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-30 20:48:36 +00:00
Damjan Marion
23d4e8a6b5 Build libmemif as part of verify job
Change-Id: I7e808b5bcbb74343a4ed6782f115ed07e9bfe3a6
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-28 13:41:15 +00:00
Jakub Grajciar
ab7c2b012d libmemif: add private header size field
Change-Id: I09567c8ee9c92e91918840f80942a005069d9842
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-28 13:35:40 +00:00
Jakub Grajciar
ecfa2aaa63 libmemif: version 2
Change-Id: Ia2532695aa9199d2a7b684aebef43df0b8235531
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-26 12:01:49 +00:00
Jakub Grajciar
1941871e26 libmemif: ubuntu 18.04 build fix
Change-Id: I6624cacd625eea6a9b8214f67d14ec162e2c0195
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-13 16:13:46 +01:00
Chun Li
5dca5465f5 libmemif: cleanup queue info while memif connecting
Change-Id: I4265fd0606f87f80f43f7f59ced1c3a73de82776
Signed-off-by: Chun Li <chunl2@cisco.com>
2018-02-07 10:02:20 +08:00
Dave Wallace
6cd396cec3 docs: Clean up TOC
Change-Id: I5415c002a431d84372f56d4a77dc2aabd6ef55f7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 1eb970d16028e9a987c1dd2bfe217d1313262b81)
2018-01-24 01:23:34 +00:00
Jakub Grajciar
c62a63dd05 libmemif: unit test update, continue configure if check module missing
Change-Id: I11ef4e7dcf1759eb3545be5db2a7196d1217a6dd
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-11-21 14:34:57 +00:00
Jakub Grajciar
8419755d4c libmemif: unmask head/tail pointers fix, additional ring info in memif_queue_details_t
Change-Id: I1dbf91c2a1575d5a82af70bfccdd990310323a8c
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-11-16 14:22:46 +00:00
Damjan Marion
6d56fa4b0a memif: do not mask head and tail pointers
Change-Id: Ie849ab713ff086187c18a91ab32e58207fe94033
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-11-08 19:52:38 +00:00
Jakub Grajciar
6e39d62643 libmmeif: Makefile fix
Change-Id: Id3fae50714802a4e2a5a82fcdfcee5b640f47e37
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-11-07 17:06:46 +00:00
Jakub Grajciar
fab3890eab libmemif: add dep to Makefile
Change-Id: I7a14474e4545016f0de97f92602e1dfcc0ffac12
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-11-07 12:23:53 +00:00
Jakub Grajciar
e4bb5bc7c1 libmemif: example app can generate ICMP, dev perf tests (using icmpr-epoll)
Change-Id: Ib72ede51559754f606c0a1d57f4fb624d032caa6
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-11-05 11:35:47 +00:00
Jakub Grajciar
04b68bdc48 libmemif: perf optimization
Change-Id: Ie3bd75e0e98c7ecb4c66dba701131363e5ec89a2
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-10-30 11:06:47 +00:00
Milan Lenco
0a47c99aed libmemif: Add memif_cancel_poll_event() + bug fixing.
Change-Id: I27d6bf93216f1f639f01fad730506afdc7115e46
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2017-10-12 18:18:54 +00:00
Jakub Grajciar
e2a4f07200 libmemif: memif_rx_burst fix
Change-Id: I2f488fef828df8915b57552567e1be79efe69700
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-10-04 09:48:00 +00:00
Chris Luke
64ebb5ff13 General documentation updates
- We now have several developer-focused docs, so create an index page
  for them.
- Rework several docs to fit into the index structure.
- Experiment with code highlighting; tweak the CSS slightly to make
  it slightly nicer to look at.

Change-Id: I4185a18f84fa0764745ca7a3148276064a3155c6
Signed-off-by: Chris Luke <chrisy@flirble.org>
2017-09-28 01:04:56 +00:00
Jakub Grajciar
ba3c4e88c1 libmemif: Jumbo frames data/buffer length fix
Change-Id: Icadf1c28b4ab712a210a8e037200ab29d6c53fe4
Signed-off-by: Jakub Grajciar <grajciar.jakub@gmail.com>
2017-09-23 23:24:49 +00:00
Jakub Grajciar
b467b2a02b libmemif: Jumbo frames support
Change-Id: I2b316358dcd2de7168a860541bcca35c3dd44649
Signed-off-by: Jakub Grajciar <grajciar.jakub@gmail.com>
2017-09-15 08:33:43 +00:00
Jakub Grajciar
7c5c40db2a Shared memory packet interface (memif) library
Change-Id: I5097462ae85acd705f19e92517c01094dba7565f
Signed-off-by: Jakub Grajciar <grajciar.jakub@gmail.com>
2017-09-13 20:12:54 +00:00