6 Commits

Author SHA1 Message Date
Tirthendu Sarkar
66c0394d7c xdpsock: add rx/tx counters for frags
Signed-off-by: Tirthendu Sarkar <tirthendu.sarkar@intel.com>
2023-09-21 10:46:31 +02:00
Tirthendu Sarkar
e5a12a2a72 AF_XDP-example: add multi-buffer support to xdpsock
* Add support for handling multi-buffer packets.
* Add a new CLI option to enable frag support.
* xdpsock_kern.c is modified to use num_socks as updated by userspace
  application.
* MAX_PKT_SIZE is set as 9728 as supported by many NICs.
* xdpsock_kern.o is loaded for both frags and shared uemem cases.

Signed-off-by: Tirthendu Sarkar <tirthendu.sarkar@intel.com>
2023-09-11 18:38:17 +02:00
Tirthendu Sarkar
f27b9881bf AF_XDP-example: fix XDP prog attach for xdp-skb mode
The attach mode is by default set to XDP_MODE_NATIVE and needs to be
overwritten to XDP_MODE_SKB when '-S' option is used. Instead of
overwriting the attach mode was ORed and so was always running in NATIVE
mode. This patch fixes that.

Signed-off-by: Tirthendu Sarkar <tirthendu.sarkar@intel.com>
2023-02-03 17:04:46 +01:00
Toke Høiland-Jørgensen
112cf3e93b AF_XDP-example: Conditionally define socket options
Old system include headers don't have they SO_PREFER_BUSY_POLL and
SO_BUSY_POLL_BUDGET socket option defines. Add conditional defines to the
AF_XDP-example userspace code so we can still compile if they are missing.

Fixes #76.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-11-29 21:42:27 +01:00
Toke Høiland-Jørgensen
b471a6d054 AF_XDP-example: Add -lpthread to linker invocation
Fixes #73.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-11-29 14:16:55 +01:00
Magnus Karlsson
c425a168a1 AF_XDP-example: move xdpsock example to bpf-examples repo
Move the xdpsock sample application from the Linux repo to the
bpf-examples repo. This example demonstrates a number of capabilities
of AF_XDP sockets.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
2022-09-23 06:06:57 +00:00