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 #199: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:168: +volatile __u32 flow_mask; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #200: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:169: +volatile __u32 cold_lru; WARNING: line length of 83 exceeds 80 columns #207: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:176: +static __always_inline int encap_v4(struct xdp_md *xdp, __be32 saddr, __be32 daddr, WARNING: line length of 83 exceeds 80 columns #224: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:193: + if (new_eth + 1 > data_end || old_eth + 1 > data_end || iph + 1 > data_end) WARNING: line length of 88 exceeds 80 columns #227: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:196: + __builtin_memcpy(new_eth->h_source, old_eth->h_dest, sizeof(new_eth->h_source)); WARNING: line length of 91 exceeds 80 columns #245: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:214: + const __be32 daddr[4], __u8 nexthdr, __u16 payload_len, WARNING: line length of 84 exceeds 80 columns #262: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:231: + if (new_eth + 1 > data_end || old_eth + 1 > data_end || ip6h + 1 > data_end) WARNING: line length of 88 exceeds 80 columns #265: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:234: + __builtin_memcpy(new_eth->h_source, old_eth->h_dest, sizeof(new_eth->h_source)); WARNING: line length of 85 exceeds 80 columns #328: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:297: +static __always_inline struct real_definition *connection_table_lookup(void *lru_map, WARNING: line length of 93 exceeds 80 columns #329: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:298: + struct flow_key *flow, WARNING: line length of 86 exceeds 80 columns #330: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:299: + __u32 *out_pos) WARNING: line length of 96 exceeds 80 columns #355: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:324: +static __always_inline bool get_packet_dst(struct real_definition **real, struct flow_key *flow, WARNING: line length of 96 exceeds 80 columns #356: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:325: + struct vip_meta *vip_info, bool is_v6, void *lru_map, WARNING: line length of 93 exceeds 80 columns #396: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:365: +static __always_inline void update_vip_lru_miss_stats(struct vip_definition *vip, bool is_v6, WARNING: line length of 97 exceeds 80 columns #408: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:377: + if (miss_vip->vipv6[0] != vip->vipv6[0] || miss_vip->vipv6[1] != vip->vipv6[1] || WARNING: line length of 95 exceeds 80 columns #409: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:378: + miss_vip->vipv6[2] != vip->vipv6[2] || miss_vip->vipv6[3] != vip->vipv6[3]) WARNING: line length of 84 exceeds 80 columns #465: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:434: + payload_len = sizeof(struct ipv6hdr) + bpf_ntohs(ip6h->payload_len); WARNING: line length of 85 exceeds 80 columns #470: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:439: + __builtin_memcpy(vip_def.vipv6, &ip6h->daddr, sizeof(vip_def.vipv6)); WARNING: line length of 94 exceeds 80 columns #546: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:515: + if (!get_packet_dst(&dst, &flow, vip_info, is_v6, lru_map, is_rst, &real_pos)) WARNING: line length of 93 exceeds 80 columns #563: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:532: + if (encap_v6(xdp, tnl_src, dst->dstv6, IPPROTO_IPV6, payload_len, cval->mac)) WARNING: line length of 93 exceeds 80 columns #567: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:536: + if (encap_v6(xdp, tnl_src, dst->dstv6, IPPROTO_IPIP, payload_len, cval->mac)) WARNING: line length of 92 exceeds 80 columns #570: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:539: + if (encap_v4(xdp, create_encap_ipv4_src(flow.port16[0], flow.src), dst->dst, WARNING: line length of 90 exceeds 80 columns #582: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:551: +static __always_inline int strip_encap(struct xdp_md *xdp, const struct ethhdr *saved_eth) WARNING: line length of 86 exceeds 80 columns #592: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:561: + hdr_sz = (eth->h_proto == bpf_htons(ETH_P_IPV6)) ? (int)sizeof(struct ipv6hdr) WARNING: line length of 85 exceeds 80 columns #593: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:562: + : (int)sizeof(struct iphdr); WARNING: line length of 95 exceeds 80 columns #609: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:578: +static __always_inline void randomize_src(struct xdp_md *xdp, int saddr_off, __u32 *rand_state) WARNING: line length of 86 exceeds 80 columns #642: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:611: + saddr_off = sizeof(struct ethhdr) + (is_v6 ? offsetof(struct ipv6hdr, saddr) : WARNING: line length of 88 exceeds 80 columns #652: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:621: + batch_hash = (batch_gen ^ bpf_get_smp_processor_id()) * KNUTH_HASH_MULT; CHECK: Lines should not end with a '(' #657: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:626: + return BENCH_BPF_LOOP( WARNING: line length of 83 exceeds 80 columns #664: FILE: tools/testing/selftests/bpf/progs/xdp_lb_bench.c:633: + randomize_src(xdp, saddr_off, &rand_state); total: 0 errors, 30 warnings, 5 checks, 647 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 71f20a8632a2 ("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, 30 warnings, 5 checks, 647 lines checked