All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: fix load XDP program error in test_xdp_vlan
@ 2020-08-12 14:03 Jianlin Lv
  2020-08-12 20:40 ` sdf
  0 siblings, 1 reply; 2+ messages in thread
From: Jianlin Lv @ 2020-08-12 14:03 UTC (permalink / raw)
  To: bpf
  Cc: davem, kuba, ast, daniel, yhs, Song.Zhu, Jianlin.Lv,
	linux-kernel, netdev

test_xdp_vlan.sh reports the error as below:

$ sudo ./test_xdp_vlan_mode_native.sh
+ '[' -z xdp_vlan_mode_native ']'
+ XDP_MODE=xdpgeneric
……
+ export XDP_PROG=xdp_vlan_remove_outer2
+ XDP_PROG=xdp_vlan_remove_outer2
+ ip netns exec ns1 ip link set veth1 xdpdrv off
Error: XDP program already attached.

ip will throw an error in case a XDP program is already attached to the
networking interface, to prevent it from being overridden by accident.
In order to replace the currently running XDP program with a new one,
the -force option must be used.

Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
---
 tools/testing/selftests/bpf/test_xdp_vlan.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/test_xdp_vlan.sh b/tools/testing/selftests/bpf/test_xdp_vlan.sh
index bb8b0da91686..034e603aeb50 100755
--- a/tools/testing/selftests/bpf/test_xdp_vlan.sh
+++ b/tools/testing/selftests/bpf/test_xdp_vlan.sh
@@ -220,7 +220,7 @@ ip netns exec ns1 ping -i 0.2 -W 2 -c 2 $IPADDR2
 # ETH_P_8021Q indication, and this cause overwriting of our changes.
 #
 export XDP_PROG=xdp_vlan_remove_outer2
-ip netns exec ns1 ip link set $DEVNS1 $XDP_MODE off
+ip netns exec ns1 ip -force link set $DEVNS1 $XDP_MODE off
 ip netns exec ns1 ip link set $DEVNS1 $XDP_MODE object $FILE section $XDP_PROG
 
 # Now the namespaces should still be able reach each-other, test with ping:
-- 
2.17.1


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

* Re: [PATCH bpf-next] bpf: fix load XDP program error in test_xdp_vlan
  2020-08-12 14:03 [PATCH bpf-next] bpf: fix load XDP program error in test_xdp_vlan Jianlin Lv
@ 2020-08-12 20:40 ` sdf
  0 siblings, 0 replies; 2+ messages in thread
From: sdf @ 2020-08-12 20:40 UTC (permalink / raw)
  To: Jianlin Lv
  Cc: bpf, davem, kuba, ast, daniel, yhs, Song.Zhu, linux-kernel, netdev

On 08/12, Jianlin Lv wrote:
> test_xdp_vlan.sh reports the error as below:

> $ sudo ./test_xdp_vlan_mode_native.sh
> + '[' -z xdp_vlan_mode_native ']'
> + XDP_MODE=xdpgeneric
> ……
> + export XDP_PROG=xdp_vlan_remove_outer2
> + XDP_PROG=xdp_vlan_remove_outer2
> + ip netns exec ns1 ip link set veth1 xdpdrv off
> Error: XDP program already attached.

> ip will throw an error in case a XDP program is already attached to the
> networking interface, to prevent it from being overridden by accident.
> In order to replace the currently running XDP program with a new one,
> the -force option must be used.

> Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
> ---
>   tools/testing/selftests/bpf/test_xdp_vlan.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/tools/testing/selftests/bpf/test_xdp_vlan.sh  
> b/tools/testing/selftests/bpf/test_xdp_vlan.sh
> index bb8b0da91686..034e603aeb50 100755
> --- a/tools/testing/selftests/bpf/test_xdp_vlan.sh
> +++ b/tools/testing/selftests/bpf/test_xdp_vlan.sh
> @@ -220,7 +220,7 @@ ip netns exec ns1 ping -i 0.2 -W 2 -c 2 $IPADDR2
>   # ETH_P_8021Q indication, and this cause overwriting of our changes.
>   #
>   export XDP_PROG=xdp_vlan_remove_outer2
> -ip netns exec ns1 ip link set $DEVNS1 $XDP_MODE off
> +ip netns exec ns1 ip -force link set $DEVNS1 $XDP_MODE off
>   ip netns exec ns1 ip link set $DEVNS1 $XDP_MODE object $FILE section  
> $XDP_PROG

>   # Now the namespaces should still be able reach each-other, test with  
> ping:
> --
> 2.17.1

This should be already fixed by:
https://lore.kernel.org/bpf/CAKH8qBuz48Ww6S=DCzKRr3f46Eq3LyknvTjDGP_5QRPxtGZ_Hw@mail.gmail.com/T/#t

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

end of thread, other threads:[~2020-08-12 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 14:03 [PATCH bpf-next] bpf: fix load XDP program error in test_xdp_vlan Jianlin Lv
2020-08-12 20:40 ` sdf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.