Re: [PATCH bpf-next,v2] selftests/bpf: add lwt ip encap tests to test_progs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daniel,

On Wed, Aug 24, 2022 at 1:43 AM Daniel Borkmann <daniel@xxxxxxxxxxxxx> wrote:
>
> On 8/22/22 3:08 PM, Eyal Birger wrote:
> > Port test_lwt_ip_encap.sh tests onto test_progs.
> >
> > In addition, this commit adds "egress_md" tests which test a similar
> > flow as egress tests only they use gre devices in collect_md mode
> > for encapsulation and set the tunnel key using bpf_set_tunnel_key().
> >
> > This introduces minor changes to test_lwt_ip_encap.{sh,c} for consistency
> > with the new tests:
> >
> > - GRE key must exist as bpf_set_tunnel_key() explicitly sets the
> >    TUNNEL_KEY flag
> >
> > - Source address for GRE traffic is set to IP*_5 instead of IP*_1 since
> >    GRE traffic is sent via veth5 so its address is selected when using
> >    bpf_set_tunnel_key()
> >
> > Note: currently these programs use the legacy section name convention
> > as iproute2 lwt configuration does not support providing function names.
> >
> > Signed-off-by: Eyal Birger <eyal.birger@xxxxxxxxx>
> [...]
>
> Thanks for following up. Is there now anything that test_lwt_ip_encap.c
> doesn't cover over test_lwt_ip_encap.sh? If not, I'd vote for removing
> the latter given the port is then covered in CI via test_progs.

The .c version includes all tests in the .sh and two more.
At least when I tried using vmtest the .sh version seems broken.

I can resubmit with an additional patch removing it, or send a follow
up patch as you prefer.

Thanks,
Eyal.
>
> > diff --git a/tools/testing/selftests/bpf/test_lwt_ip_encap.sh b/tools/testing/selftests/bpf/test_lwt_ip_encap.sh
> > index 6c69c42b1d60..a79f7840ceb1 100755
> > --- a/tools/testing/selftests/bpf/test_lwt_ip_encap.sh
> > +++ b/tools/testing/selftests/bpf/test_lwt_ip_encap.sh
> > @@ -238,7 +238,8 @@ setup()
> >       ip -netns ${NS3} -6 route add ${IPv6_6}/128 dev veth8 via ${IPv6_7}
> >
> >       # configure IPv4 GRE device in NS3, and a route to it via the "bottom" route
> > -     ip -netns ${NS3} tunnel add gre_dev mode gre remote ${IPv4_1} local ${IPv4_GRE} ttl 255
> > +     ip -netns ${NS3} tunnel add gre_dev mode gre remote ${IPv4_5} \
> > +             local ${IPv4_GRE} ttl 255 key 0
> >       ip -netns ${NS3} link set gre_dev up
> >       ip -netns ${NS3} addr add ${IPv4_GRE} dev gre_dev
> >       ip -netns ${NS1} route add ${IPv4_GRE}/32 dev veth5 via ${IPv4_6} ${VRF}
> > @@ -246,7 +247,8 @@ setup()
> >
> >
> >       # configure IPv6 GRE device in NS3, and a route to it via the "bottom" route
> > -     ip -netns ${NS3} -6 tunnel add name gre6_dev mode ip6gre remote ${IPv6_1} local ${IPv6_GRE} ttl 255
> > +     ip -netns ${NS3} -6 tunnel add name gre6_dev mode ip6gre remote ${IPv6_5} \
> > +             local ${IPv6_GRE} ttl 255 key 0
> >       ip -netns ${NS3} link set gre6_dev up
> >       ip -netns ${NS3} -6 addr add ${IPv6_GRE} nodad dev gre6_dev
> >       ip -netns ${NS1} -6 route add ${IPv6_GRE}/128 dev veth5 via ${IPv6_6} ${VRF}
> >
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux