staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / bpf / prog_tests / xdp_adjust_tail.c
blob922aa0a1976425993719ac46e8909debd0143c46
1 // SPDX-License-Identifier: GPL-2.0
2 #include <test_progs.h>
4 void test_xdp_adjust_tail(void)
6 const char *file = "./test_adjust_tail.o";
7 struct bpf_object *obj;
8 char buf[128];
9 __u32 duration, retval, size;
10 int err, prog_fd;
12 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
13 if (err) {
14 error_cnt++;
15 return;
18 err = bpf_prog_test_run(prog_fd, 1, &pkt_v4, sizeof(pkt_v4),
19 buf, &size, &retval, &duration);
21 CHECK(err || retval != XDP_DROP,
22 "ipv4", "err %d errno %d retval %d size %d\n",
23 err, errno, retval, size);
25 err = bpf_prog_test_run(prog_fd, 1, &pkt_v6, sizeof(pkt_v6),
26 buf, &size, &retval, &duration);
27 CHECK(err || retval != XDP_TX || size != 54,
28 "ipv6", "err %d errno %d retval %d size %d\n",
29 err, errno, retval, size);
30 bpf_object__close(obj);