bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] seltests: bpf: test_tunnel: use ip neigh
@ 2021-09-21 14:59 Jiri Benc
  2021-09-21 15:23 ` David Ahern
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Benc @ 2021-09-21 14:59 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, William Tu, netdev

The 'arp' command is deprecated and is another dependency of the selftest.
Just use 'ip neigh', the test depends on iproute2 already.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
---
 tools/testing/selftests/bpf/test_tunnel.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_tunnel.sh b/tools/testing/selftests/bpf/test_tunnel.sh
index 1ccbe804e8e1..ca1372924023 100755
--- a/tools/testing/selftests/bpf/test_tunnel.sh
+++ b/tools/testing/selftests/bpf/test_tunnel.sh
@@ -168,14 +168,15 @@ add_vxlan_tunnel()
 	ip netns exec at_ns0 \
 		ip link set dev $DEV_NS address 52:54:00:d9:01:00 up
 	ip netns exec at_ns0 ip addr add dev $DEV_NS 10.1.1.100/24
-	ip netns exec at_ns0 arp -s 10.1.1.200 52:54:00:d9:02:00
+	ip netns exec at_ns0 \
+		ip neigh add 10.1.1.200 lladdr 52:54:00:d9:02:00 dev $DEV_NS
 	ip netns exec at_ns0 iptables -A OUTPUT -j MARK --set-mark 0x800FF
 
 	# root namespace
 	ip link add dev $DEV type $TYPE external gbp dstport 4789
 	ip link set dev $DEV address 52:54:00:d9:02:00 up
 	ip addr add dev $DEV 10.1.1.200/24
-	arp -s 10.1.1.100 52:54:00:d9:01:00
+	ip neigh add 10.1.1.100 lladdr 52:54:00:d9:01:00 dev $DEV
 }
 
 add_ip6vxlan_tunnel()
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] seltests: bpf: test_tunnel: use ip neigh
  2021-09-21 14:59 [PATCH bpf-next] seltests: bpf: test_tunnel: use ip neigh Jiri Benc
@ 2021-09-21 15:23 ` David Ahern
  2021-09-21 16:31   ` Jiri Benc
  0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2021-09-21 15:23 UTC (permalink / raw)
  To: Jiri Benc, bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, William Tu, netdev

On 9/21/21 8:59 AM, Jiri Benc wrote:
> The 'arp' command is deprecated and is another dependency of the selftest.
> Just use 'ip neigh', the test depends on iproute2 already.
> 
> Signed-off-by: Jiri Benc <jbenc@redhat.com>
> ---
>  tools/testing/selftests/bpf/test_tunnel.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/test_tunnel.sh b/tools/testing/selftests/bpf/test_tunnel.sh
> index 1ccbe804e8e1..ca1372924023 100755
> --- a/tools/testing/selftests/bpf/test_tunnel.sh
> +++ b/tools/testing/selftests/bpf/test_tunnel.sh
> @@ -168,14 +168,15 @@ add_vxlan_tunnel()
>  	ip netns exec at_ns0 \
>  		ip link set dev $DEV_NS address 52:54:00:d9:01:00 up
>  	ip netns exec at_ns0 ip addr add dev $DEV_NS 10.1.1.100/24
> -	ip netns exec at_ns0 arp -s 10.1.1.200 52:54:00:d9:02:00
> +	ip netns exec at_ns0 \
> +		ip neigh add 10.1.1.200 lladdr 52:54:00:d9:02:00 dev $DEV_NS

I realize you are just following suit with this change, but ip can
change namespaces internally:

ip -netns at_ns0 neigh add 10.1.1.200 lladdr 52:54:00:d9:02:00 dev $DEV_NS

All of the 'ip netns exec ... ip ...' commands can be simplified.


>  	ip netns exec at_ns0 iptables -A OUTPUT -j MARK --set-mark 0x800FF
>  
>  	# root namespace
>  	ip link add dev $DEV type $TYPE external gbp dstport 4789
>  	ip link set dev $DEV address 52:54:00:d9:02:00 up
>  	ip addr add dev $DEV 10.1.1.200/24
> -	arp -s 10.1.1.100 52:54:00:d9:01:00
> +	ip neigh add 10.1.1.100 lladdr 52:54:00:d9:01:00 dev $DEV
>  }
>  
>  add_ip6vxlan_tunnel()
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] seltests: bpf: test_tunnel: use ip neigh
  2021-09-21 15:23 ` David Ahern
@ 2021-09-21 16:31   ` Jiri Benc
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Benc @ 2021-09-21 16:31 UTC (permalink / raw)
  To: David Ahern
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	William Tu, netdev

On Tue, 21 Sep 2021 09:23:06 -0600, David Ahern wrote:
> I realize you are just following suit with this change, but ip can
> change namespaces internally:
> 
> ip -netns at_ns0 neigh add 10.1.1.200 lladdr 52:54:00:d9:02:00 dev $DEV_NS
> 
> All of the 'ip netns exec ... ip ...' commands can be simplified.

I know and I don't like the superfluous exec, either. But that's
something for a different patch. As you said, I'm just following what's
already there. There's ton of different stuff that can be cleaned up in
this and other selftests, unfortunately.

 Jiri


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-21 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-21 14:59 [PATCH bpf-next] seltests: bpf: test_tunnel: use ip neigh Jiri Benc
2021-09-21 15:23 ` David Ahern
2021-09-21 16:31   ` Jiri Benc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).