1 // SPDX-License-Identifier: GPL-2.0
2 #include <test_progs.h>
4 void test_xdp_perf(void)
6 const char *file
= "./xdp_dummy.o";
7 __u32 duration
, retval
, size
;
8 struct bpf_object
*obj
;
9 char in
[128], out
[128];
12 err
= bpf_prog_load(file
, BPF_PROG_TYPE_XDP
, &obj
, &prog_fd
);
16 err
= bpf_prog_test_run(prog_fd
, 1000000, &in
[0], 128,
17 out
, &size
, &retval
, &duration
);
19 CHECK(err
|| retval
!= XDP_PASS
|| size
!= 128,
21 "err %d errno %d retval %d size %d\n",
22 err
, errno
, retval
, size
);
24 bpf_object__close(obj
);