CHECK: Macro argument 'a' may be better as '(a)' to avoid precedence issues #61: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:30: +#define __jhash_mix(a, b, c) \ +{ \ + a -= c; a ^= rol32(c, 4); c += b; \ + b -= a; b ^= rol32(a, 6); a += c; \ + c -= b; c ^= rol32(b, 8); b += a; \ + a -= c; a ^= rol32(c, 16); c += b; \ + b -= a; b ^= rol32(a, 19); a += c; \ + c -= b; c ^= rol32(b, 4); b += a; \ +} CHECK: Macro argument 'a' may be better as '(a)' to avoid precedence issues #71: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:40: +#define __jhash_final(a, b, c) \ +{ \ + c ^= b; c -= rol32(b, 14); \ + a ^= c; a -= rol32(c, 11); \ + b ^= a; b -= rol32(a, 25); \ + c ^= b; c -= rol32(b, 16); \ + a ^= c; a -= rol32(c, 4); \ + b ^= a; b -= rol32(a, 14); \ + c ^= b; c -= rol32(b, 24); \ +} CHECK: Macro argument 'c' may be better as '(c)' to avoid precedence issues #71: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:40: +#define __jhash_final(a, b, c) \ +{ \ + c ^= b; c -= rol32(b, 14); \ + a ^= c; a -= rol32(c, 11); \ + b ^= a; b -= rol32(a, 25); \ + c ^= b; c -= rol32(b, 16); \ + a ^= c; a -= rol32(c, 4); \ + b ^= a; b -= rol32(a, 14); \ + c ^= b; c -= rol32(b, 24); \ +} CHECK: multiple assignments should be avoided #102: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:71: + a = b = c = JHASH_INITVAL + (4 << 2) + initval; WARNING: function definition argument 'int' should also have an identifier name #119: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:88: + __pragma_loop_unroll_full WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #197: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:166: +volatile __u32 flow_mask; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #198: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:167: +volatile __u32 cold_lru; WARNING: line length of 83 exceeds 80 columns #205: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:174: +static __always_inline int encap_v4(struct xdp_md *xdp, __be32 saddr, __be32 daddr, WARNING: line length of 83 exceeds 80 columns #222: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:191: + if (new_eth + 1 > data_end || old_eth + 1 > data_end || iph + 1 > data_end) WARNING: line length of 88 exceeds 80 columns #225: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:194: + __builtin_memcpy(new_eth->h_source, old_eth->h_dest, sizeof(new_eth->h_source)); WARNING: line length of 84 exceeds 80 columns #260: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:229: + if (new_eth + 1 > data_end || old_eth + 1 > data_end || ip6h + 1 > data_end) WARNING: line length of 88 exceeds 80 columns #263: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:232: + __builtin_memcpy(new_eth->h_source, old_eth->h_dest, sizeof(new_eth->h_source)); WARNING: line length of 81 exceeds 80 columns #395: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:364: +static __always_inline void update_vip_lru_miss_stats(struct vip_definition *vip, WARNING: line length of 81 exceeds 80 columns #396: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:365: + bool is_v6, __u32 real_idx) WARNING: line length of 84 exceeds 80 columns #466: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:435: + payload_len = sizeof(struct ipv6hdr) + bpf_ntohs(ip6h->payload_len); WARNING: line length of 85 exceeds 80 columns #471: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:440: + __builtin_memcpy(vip_def.vipv6, &ip6h->daddr, sizeof(vip_def.vipv6)); WARNING: line length of 93 exceeds 80 columns #565: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:534: + if (encap_v6(xdp, tnl_src, dst->dstv6, IPPROTO_IPV6, payload_len, cval->mac)) WARNING: line length of 93 exceeds 80 columns #569: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:538: + if (encap_v6(xdp, tnl_src, dst->dstv6, IPPROTO_IPIP, payload_len, cval->mac)) WARNING: line length of 82 exceeds 80 columns #572: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:541: + if (encap_v4(xdp, create_encap_ipv4_src(flow.port16[0], flow.src), WARNING: line length of 90 exceeds 80 columns #584: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:553: +static __always_inline int strip_encap(struct xdp_md *xdp, const struct ethhdr *saved_eth) WARNING: line length of 95 exceeds 80 columns #612: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:581: +static __always_inline void randomize_src(struct xdp_md *xdp, int saddr_off, __u32 *rand_state) CHECK: Lines should not end with a '(' #662: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:631: + return BENCH_BPF_LOOP( total: 0 errors, 17 warnings, 5 checks, 653 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 14da648dbf7c ("selftests/bpf: Add XDP load-balancer BPF program") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE FILE_PATH_CHANGES 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, 17 warnings, 5 checks, 653 lines checked