Skip to content

Commit bd8e1af

Browse files
Paolo Abenidavem330
authored andcommitted
selftests: add dummy xdp test helper
This trivial XDP program does nothing, but will be used by the next patch to test the GRO path in a net namespace, leveraging the veth XDP implementation. It's added here, despite its 'net' usage, to avoid the duplication of the llc-related makefile boilerplate. rfc v3 -> v1: - move the helper implementation into the bpf directory, don't touch udpgso_bench_rx rfc v2 -> rfc v3: - move 'x' option handling here Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0a9ac2e commit bd8e1af

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o test_tcp_estats.o test
3737
test_lwt_seg6local.o sendmsg4_prog.o sendmsg6_prog.o test_lirc_mode2_kern.o \
3838
get_cgroup_id_kern.o socket_cookie_prog.o test_select_reuseport_kern.o \
3939
test_skb_cgroup_id_kern.o bpf_flow.o netcnt_prog.o \
40-
test_sk_lookup_kern.o test_xdp_vlan.o test_queue_map.o test_stack_map.o
40+
test_sk_lookup_kern.o test_xdp_vlan.o test_queue_map.o test_stack_map.o \
41+
xdp_dummy.o
4142

4243
# Order correspond to 'make run_tests' order
4344
TEST_PROGS := test_kmod.sh \
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#define KBUILD_MODNAME "xdp_dummy"
4+
#include <linux/bpf.h>
5+
#include "bpf_helpers.h"
6+
7+
SEC("xdp_dummy")
8+
int xdp_dummy_prog(struct xdp_md *ctx)
9+
{
10+
return XDP_PASS;
11+
}
12+
13+
char _license[] SEC("license") = "GPL";

0 commit comments

Comments
 (0)