lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220418015230.4481-1-Lina.Wang@mediatek.com>
Date:   Mon, 18 Apr 2022 09:52:30 +0800
From:   <Lina.Wang@...iatek.com>
To:     Daniel Borkmann <daniel@...earbox.net>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Shuah Khan <shuah@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>
CC:     Alexei Starovoitov <ast@...nel.org>,
        Andrii Nakryiko <andrii@...nel.org>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        <linux-kernel@...r.kernel.org>,
        Maciej enczykowski <maze@...gle.com>,
        <linux-kselftest@...r.kernel.org>, <netdev@...r.kernel.org>,
        <bpf@...r.kernel.org>
Subject: Re: [PATCH v5 1/3] selftests: bpf: add test for bpf_skb_change_proto

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!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ