WARNING: externs should be avoided in .c files #52: FILE: tools/testing/selftests/bpf/bench.c:286: +extern struct argp bench_trait_argp; WARNING: externs should be avoided in .c files #68: FILE: tools/testing/selftests/bpf/bench.c:554: +extern const struct bench bench_xdp_trait_get; WARNING: externs should be avoided in .c files #69: FILE: tools/testing/selftests/bpf/bench.c:555: +extern const struct bench bench_xdp_trait_set; WARNING: externs should be avoided in .c files #70: FILE: tools/testing/selftests/bpf/bench.c:556: +extern const struct bench bench_xdp_trait_move; WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #85: new file mode 100644 WARNING: line length of 88 exceeds 80 columns #122: FILE: tools/testing/selftests/bpf/benchs/bench_xdp_traits.c:33: + if (args.trait_len != 2 && args.trait_len != 4 && args.trait_len != 8) { WARNING: line length of 83 exceeds 80 columns #142: FILE: tools/testing/selftests/bpf/benchs/bench_xdp_traits.c:53: + fprintf(stderr, "bpf trait benchmark doesn't support consumer!\n"); CHECK: Alignment should match open parenthesis #198: FILE: tools/testing/selftests/bpf/benchs/bench_xdp_traits.c:109: + LIBBPF_OPTS(bpf_test_run_opts, opts, + .data_in = in, WARNING: line length of 83 exceeds 80 columns #210: FILE: tools/testing/selftests/bpf/benchs/bench_xdp_traits.c:121: + fprintf(stderr, "prog didn't return 0: %d\n", opts.retval); CHECK: Macro argument 'val' may be better as '(val)' to avoid precedence issues #281: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:26: +#define BENCH_GET(val, size) do { \ + ret = bpf_xdp_trait_set(xdp, 32, &val, sizeof(val), 0); \ + if (ret != 0) \ + return ret; \ + for (i = 0; i < ITERATIONS; i++) \ + ret = bpf_xdp_trait_get(xdp, 32, &val, sizeof(val)); \ + if (ret != size) \ + return ret; \ + } while (0) CHECK: Macro argument 'size' may be better as '(size)' to avoid precedence issues #281: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:26: +#define BENCH_GET(val, size) do { \ + ret = bpf_xdp_trait_set(xdp, 32, &val, sizeof(val), 0); \ + if (ret != 0) \ + return ret; \ + for (i = 0; i < ITERATIONS; i++) \ + ret = bpf_xdp_trait_get(xdp, 32, &val, sizeof(val)); \ + if (ret != size) \ + return ret; \ + } while (0) WARNING: Macros with flow control statements should be avoided #281: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:26: +#define BENCH_GET(val, size) do { \ + ret = bpf_xdp_trait_set(xdp, 32, &val, sizeof(val), 0); \ + if (ret != 0) \ + return ret; \ + for (i = 0; i < ITERATIONS; i++) \ + ret = bpf_xdp_trait_get(xdp, 32, &val, sizeof(val)); \ + if (ret != size) \ + return ret; \ + } while (0) WARNING: line length of 81 exceeds 80 columns #282: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:27: + ret = bpf_xdp_trait_set(xdp, 32, &val, sizeof(val), 0); \ WARNING: line length of 81 exceeds 80 columns #283: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:28: + if (ret != 0) \ WARNING: line length of 81 exceeds 80 columns #284: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:29: + return ret; \ WARNING: line length of 81 exceeds 80 columns #285: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:30: + for (i = 0; i < ITERATIONS; i++) \ WARNING: line length of 81 exceeds 80 columns #286: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:31: + ret = bpf_xdp_trait_get(xdp, 32, &val, sizeof(val)); \ WARNING: line length of 81 exceeds 80 columns #287: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:32: + if (ret != size) \ WARNING: line length of 81 exceeds 80 columns #288: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:33: + return ret; \ CHECK: Macro argument 'val' may be better as '(val)' to avoid precedence issues #315: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:60: +#define BENCH_SET(val) do { \ + for (i = 0; i < ITERATIONS; i++) \ + ret = bpf_xdp_trait_set(xdp, 32, &val, sizeof(val), 0); \ + } while (0) WARNING: line length of 81 exceeds 80 columns #316: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:61: + for (i = 0; i < ITERATIONS; i++) \ WARNING: line length of 81 exceeds 80 columns #317: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:62: + ret = bpf_xdp_trait_set(xdp, 32, &val, sizeof(val), 0); \ WARNING: Argument 'val' is not used in function-like macro #347: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:92: +#define BENCH_MOVE(val) do { \ + for (i = 0; i < 8; i++) { \ + ret = bpf_xdp_trait_set(xdp, 40+i, &val8, sizeof(val8), 0); \ + if (ret != 0) \ + return ret; \ + } \ + /* We do two operations per iteration, so do half as many to make it WARNING: Macros with flow control statements should be avoided #347: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:92: +#define BENCH_MOVE(val) do { \ + for (i = 0; i < 8; i++) { \ + ret = bpf_xdp_trait_set(xdp, 40+i, &val8, sizeof(val8), 0); \ + if (ret != 0) \ + return ret; \ + } \ + /* We do two operations per iteration, so do half as many to make it WARNING: line length of 89 exceeds 80 columns #348: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:93: + for (i = 0; i < 8; i++) { \ WARNING: line length of 89 exceeds 80 columns #349: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:94: + ret = bpf_xdp_trait_set(xdp, 40+i, &val8, sizeof(val8), 0); \ CHECK: spaces preferred around that '+' (ctx:VxV) #349: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:94: + ret = bpf_xdp_trait_set(xdp, 40+i, &val8, sizeof(val8), 0); \ ^ WARNING: line length of 89 exceeds 80 columns #350: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:95: + if (ret != 0) \ WARNING: line length of 89 exceeds 80 columns #351: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:96: + return ret; \ WARNING: line length of 89 exceeds 80 columns #352: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:97: + } \ WARNING: line length of 84 exceeds 80 columns #353: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:98: + /* We do two operations per iteration, so do half as many to make it WARNING: line length of 89 exceeds 80 columns #355: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:100: + */ \ WARNING: Avoid unnecessary line continuations #355: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:100: + */ \ WARNING: line length of 89 exceeds 80 columns #356: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:101: + for (i = 0; i < ITERATIONS/2; i++) { \ CHECK: spaces preferred around that '/' (ctx:VxV) #356: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:101: + for (i = 0; i < ITERATIONS/2; i++) { \ ^ WARNING: line length of 82 exceeds 80 columns #357: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:102: + /* Need to delete after, otherwise we'll just overwrite an WARNING: line length of 89 exceeds 80 columns #359: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:104: + */ \ WARNING: Avoid unnecessary line continuations #359: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:104: + */ \ WARNING: line length of 89 exceeds 80 columns #360: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:105: + ret = bpf_xdp_trait_set(xdp, 32, &val, sizeof(val), 0); \ WARNING: line length of 89 exceeds 80 columns #361: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:106: + ret_del = bpf_xdp_trait_del(xdp, 32); \ WARNING: line length of 89 exceeds 80 columns #362: FILE: tools/testing/selftests/bpf/progs/bench_xdp_traits.c:107: + } \ total: 0 errors, 35 warnings, 6 checks, 337 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 787800649e8c ("trait: basic XDP benchmark") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 35 warnings, 6 checks, 337 lines checked