On Thu, 2022-04-07 at 17:22 +0200, Daniel Borkmann wrote:
Hi Lina,
On 4/7/22 10:47 AM, Lina Wang wrote:
The code is copied from the Android Open Source Project and the author( Maciej ��enczykowski) has gave permission to relicense it under GPLv2.
The test is to change input IPv6 packets to IPv4 ones and output IPv4 to IPv6 with bpf_skb_change_proto.
Your patch 2/3 is utilizing this program out of selftests/net/udpgro_frglist.sh, however, this is a bit problematic given BPF CI which runs on every BPF submitted patch. Meaning, udpgro_frglist.sh won't be covered by CI and only needs to be run manually. Could you properly include this into test_progs from BPF suite (that way, BPF CI will also pick it up)? See also [2] for more complex netns setups.
more complex netns setups? Do u mean I should c code netns setups to make a complete bpf test?It is complicated for my case, i just want to simulate udp gro+ bpf to verify my fix-issue patch. maybe I can move nat6to4.c to net/, not bpf/prog_test, then udpgro_frglist.sh is complete.
+// bionic kernel uapi linux/udp.h header is munged...
nit: Throughout the file, please use C style comments as per kernel coding convention.
Np
+#define __kernel_udphdr udphdr +#include <linux/udp.h>
+#include <bpf/bpf_helpers.h>
+#define htons(x) (__builtin_constant_p(x) ? ___constant_swab16(x) : __builtin_bswap16(x)) +#define htonl(x) (__builtin_constant_p(x) ? ___constant_swab32(x) : __builtin_bswap32(x)) +#define ntohs(x) htons(x) +#define ntohl(x) htonl(x)
nit: Please use libbpf's bpf_htons() and friends helpers [3].
OK
OT: In Cilium we run similar NAT46/64 translation for XDP and tc/BPF for our LB services [4] (that is, v4 VIP with v6 backends, and v6 VIP with v4 backends).
[4] https://github.com/cilium/cilium/blob/master/bpf/lib/nat_46x64.h https://github.com/cilium/cilium/blob/master/test/nat46x64/test.sh
It is complicated for me, my case doesnot use XDP driver.I use xdp_dummy just to enable veth NAPI GRO, not real XDP driver code. My test case is simple and enough for my patch, I think. I have covered tcp and udp, normal and SO_SEGMENT.
Thanks!