treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / testing / selftests / bpf / prog_tests / xdp_perf.c
blob7185bee16fe4fbd5f51a8910e3de0d076a02065b
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];
10 int err, prog_fd;
12 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
13 if (CHECK_FAIL(err))
14 return;
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,
20 "xdp-perf",
21 "err %d errno %d retval %d size %d\n",
22 err, errno, retval, size);
24 bpf_object__close(obj);