summaryrefslogtreecommitdiffstats
path: root/src/plugins/af_xdp/device.c
AgeCommit message (Collapse)AuthorFilesLines
2021-08-26af_xdp: fix stale rx/tx pointers in xsk objectsBenoît Ganne1-10/+47
xsk objects keep pointers to the rx and tx objects. If we re-allocate the rx and tx vectors after initializing the associated xsk object, the pointers in the xsk object will be staled. To avoid this, we allocate the vectors to the max expected size instead of growing them. Type: fix Change-Id: If30433a28c186787d66c12dbab34bf210c95b519 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-08-23af_xdp: fix xsk_socket__delete left un-cleanuparikachen1-3/+3
Type: fix while xsk fd closed by clib_file_del_by_index fisrt, xsk_get_mmap_offsets will get wrong off in xsk_socket__delete, so munmap wrong place. Signed-off-by: arikachen <eaglesora@gmail.com> Change-Id: I95464e9b4eec99814bd32d7402c0d60a0605cef5
2021-05-21af_xdp: use desc offset on rxBenoît Ganne1-12/+1
Instead of pre-programming the data offset on rx, use offset passed in the descriptor. This is more robust and future-proof. Type: fix Change-Id: I2bd910d92b8b03d17be5be85a24108be711dc7b9 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-05-21af_xdp: refill rx rings when interface goes upBenoît Ganne1-0/+1
If interrupt mode is configured through startup.conf exec script, the input function will not be polled and the rx ring will never be filled. Always refill the ring when interface goes up so it is ready to receive packets. Type: fix Change-Id: I4cf22c8ae00638679f2e8650303a6fe916c1319b Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-05-21af_xdp: workaround kernel race between poll() and sendmsg()Benoît Ganne1-43/+99
Prior to Linux 5.6 there is a race condition between poll() and sendmsg() in the kernel. This patch protects the syscalls with a lock to prevent it, unless the NO_SYSCALL_LOCK flag is set at create time. See https://lore.kernel.org/bpf/BYAPR11MB365382C5DB1E5FCC53242609C1549@BYAPR11MB3653.namprd11.prod.outlook.com/ Type: fix Change-Id: Ie7d4f5cb41f697b11a09b6046e54d190430d76df Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne1-0/+12
trajectory trace has been broken for a while because we used to save the buffer trajectory in a vector pointed to in opaque2. This does not work well when opaque2 is copied (eg. because of a clone) as 2 buffers end up sharing the same vector. This dedicates a full cacheline in the buffer metadata instead when trajectory is compiled in. No dynamic allocation, no sharing, no tears. Type: refactor Change-Id: I6a028ca1b48d38f393a36979e5e452c2dd48ad3f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-03-19interface: add capabilities flagsMohsin Kazmi1-1/+1
Type: improvement This patch adds flags to represent the modern NICs capabilities. Change-Id: I96d38d9ab7eac55974d72795cd100d8337168e1e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-01-26interface: remove vnet_device_input_runtime_tMohammed Hawari1-2/+1
Change-Id: I85a463b4ca15baf11e3eb70189f5190ba2585170 Type: refactor Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-01-21af_xdp: update interrupt mode to new infraBenoît Ganne1-14/+61
Type: improvement Change-Id: Icb23af5f5e458a555f416cb0a829e84646b25dd9 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-10-24af_xdp: add option to claim all available rx queuesBenoît Ganne1-18/+29
Type: feature Change-Id: I97176c2c90ea664a68078b3a7b7d44eb237a7f13 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-10-21af_xdp: fix NUMA node parsingBenoît Ganne1-11/+9
Non-NUMA systems might report -1 as NUMA node. Type: fix Change-Id: I092c817ea670009d6f530cc70ad13d45e15fd363 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-08-31af_xdp: AF_XDP input pluginBenoît Ganne1-0/+533
Type: feature Change-Id: I85aa4ad6b68c1aa0e51938002dc691a4b11c545c Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Benoît Ganne <bganne@cisco.com>