I suspect I fall in another issue with verifier.
This code (taking from katran (
https://github.com/facebookincubator/katran/blob/master/katran/lib/bpf/balancer_helpers.h#L62
) : I just changed data_size type to __u32 ):
__attribute__((__always_inline__)) static inline void ipv4_l4_csum(void
*data_start, __u32 data_size, __u64 *csum, struct iphdr *iph) { __u32 tmp = 0;
*csum = bpf_csum_diff(0, 0, &iph->saddr, sizeof(__be32), *csum); *csum =
bpf_csum_diff(0, 0, &iph->daddr, sizeof(__be32), *csum); tmp =
__builtin_bswap32((__u32)(iph->protocol)); *csum = bpf_csum_diff(0, 0, &tmp,
sizeof(__u32), *csum); tmp = __builtin_bswap32((__u32)(data_size)); *csum =
bpf_csum_diff(0, 0, &tmp, sizeof(__u32), *csum); *csum = bpf_csum_diff(0, 0,
data_start, data_size, *csum); *csum = csum_fold_helper(*csum); } But it brings
to this verifier issue : 93: (67) r0 <<= 32 294: (c7) r0 s>>= 32 295: (b7) r1 =
0 296: (b7) r2 = 0 297: (bf) r3 = r8 298: (79) r4 = *(u64 *)(r10 -40) 299: (bf)
r5 = r0 300: (85) call bpf_csum_diff#28 R4 min value is negative, either use
unsigned or 'var &= const' The whole code is available here (
https://github.com/sbernard31/udploadbalancer ).
This is maybe relative to my previous issue (
https://lists.iovisor.org/g/iovisor-dev/topic/math_between_pkt_pointer_and/30285987?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,30285987
).
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1603): https://lists.iovisor.org/g/iovisor-dev/message/1603
Mute This Topic: https://lists.iovisor.org/mt/30315706/21656
Mute #verifier: https://lists.iovisor.org/mk?hashtag=verifier&subid=2590197
Group Owner: [email protected]
Unsubscribe: https://lists.iovisor.org/g/iovisor-dev/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-