summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/xdpxceiver.h
diff options
context:
space:
mode:
authorWeqaar Janjua <weqaar.janjua@gmail.com>2020-12-08 00:53:33 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2020-12-09 18:44:45 +0300
commit7d20441eb05ec6d8dc7b16381c53b3c0b3ad6e8a (patch)
tree2386e080fb17bc23605886b660e28af710215716 /tools/testing/selftests/bpf/xdpxceiver.h
parent6674bf66560a6c55aada1e3cd4fca7a3ed204075 (diff)
downloadlinux-7d20441eb05ec6d8dc7b16381c53b3c0b3ad6e8a.tar.xz
selftests/bpf: Xsk selftests - Bi-directional Sockets - SKB, DRV
Adds following tests: 1. AF_XDP SKB mode d. Bi-directional Sockets Configure sockets as bi-directional tx/rx sockets, sets up fill and completion rings on each socket, tx/rx in both directions. Only nopoll mode is used 2. AF_XDP DRV/Native mode d. Bi-directional Sockets * Only copy mode is supported because veth does not currently support zero-copy mode Signed-off-by: Weqaar Janjua <weqaar.a.janjua@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Yonghong Song <yhs@fb.com> Acked-by: Björn Töpel <bjorn.topel@intel.com> Link: https://lore.kernel.org/bpf/20201207215333.11586-6-weqaar.a.janjua@intel.com
Diffstat (limited to 'tools/testing/selftests/bpf/xdpxceiver.h')
-rw-r--r--tools/testing/selftests/bpf/xdpxceiver.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/xdpxceiver.h b/tools/testing/selftests/bpf/xdpxceiver.h
index 58185b914f99..61f595b6f200 100644
--- a/tools/testing/selftests/bpf/xdpxceiver.h
+++ b/tools/testing/selftests/bpf/xdpxceiver.h
@@ -22,6 +22,7 @@
#define MAX_INTERFACES_NAMESPACE_CHARS 10
#define MAX_SOCKS 1
#define MAX_TEARDOWN_ITER 10
+#define MAX_BIDI_ITER 2
#define PKT_HDR_SIZE (sizeof(struct ethhdr) + sizeof(struct iphdr) + \
sizeof(struct udphdr))
#define MIN_PKT_SIZE 64
@@ -53,12 +54,15 @@ enum TESTS {
u8 uut;
u8 debug_pkt_dump;
u32 num_frames;
+u8 switching_notify;
+u8 bidi_pass;
static u32 opt_xdp_flags = XDP_FLAGS_UPDATE_IF_NOEXIST;
static int opt_queue;
static int opt_pkt_count;
static int opt_poll;
static int opt_teardown;
+static int opt_bidi;
static u32 opt_xdp_bind_flags = XDP_USE_NEED_WAKEUP;
static u8 pkt_data[XSK_UMEM__DEFAULT_FRAME_SIZE];
static u32 pkt_counter;