All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] selftests/net: fix section name when using xdp_dummy.o
@ 2022-06-30  6:22 Hangbin Liu
  2022-06-30 19:08 ` Andrii Nakryiko
  2022-07-02  3:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Hangbin Liu @ 2022-06-30  6:22 UTC (permalink / raw)
  To: netdev
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Andrii Nakryiko,
	Hangbin Liu

Since commit 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in
selftests") the xdp_dummy.o's section name has changed to xdp. But some
tests are still using "section xdp_dummy", which make the tests failed.
Fix them by updating to the new section name.

Fixes: 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in selftests")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 tools/testing/selftests/net/udpgro.sh         | 2 +-
 tools/testing/selftests/net/udpgro_bench.sh   | 2 +-
 tools/testing/selftests/net/udpgro_frglist.sh | 2 +-
 tools/testing/selftests/net/udpgro_fwd.sh     | 2 +-
 tools/testing/selftests/net/veth.sh           | 6 +++---
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/net/udpgro.sh b/tools/testing/selftests/net/udpgro.sh
index f8a19f548ae9..ebbd0b282432 100755
--- a/tools/testing/selftests/net/udpgro.sh
+++ b/tools/testing/selftests/net/udpgro.sh
@@ -34,7 +34,7 @@ cfg_veth() {
 	ip -netns "${PEER_NS}" addr add dev veth1 192.168.1.1/24
 	ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad
 	ip -netns "${PEER_NS}" link set dev veth1 up
-	ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp_dummy
+	ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp
 }
 
 run_one() {
diff --git a/tools/testing/selftests/net/udpgro_bench.sh b/tools/testing/selftests/net/udpgro_bench.sh
index 820bc50f6b68..fad2d1a71cac 100755
--- a/tools/testing/selftests/net/udpgro_bench.sh
+++ b/tools/testing/selftests/net/udpgro_bench.sh
@@ -34,7 +34,7 @@ run_one() {
 	ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad
 	ip -netns "${PEER_NS}" link set dev veth1 up
 
-	ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp_dummy
+	ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp
 	ip netns exec "${PEER_NS}" ./udpgso_bench_rx ${rx_args} -r &
 	ip netns exec "${PEER_NS}" ./udpgso_bench_rx -t ${rx_args} -r &
 
diff --git a/tools/testing/selftests/net/udpgro_frglist.sh b/tools/testing/selftests/net/udpgro_frglist.sh
index 807b74c8fd80..832c738cc3c2 100755
--- a/tools/testing/selftests/net/udpgro_frglist.sh
+++ b/tools/testing/selftests/net/udpgro_frglist.sh
@@ -36,7 +36,7 @@ run_one() {
 	ip netns exec "${PEER_NS}" ethtool -K veth1 rx-gro-list on
 
 
-	ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp_dummy
+	ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp
 	tc -n "${PEER_NS}" qdisc add dev veth1 clsact
 	tc -n "${PEER_NS}" filter add dev veth1 ingress prio 4 protocol ipv6 bpf object-file ../bpf/nat6to4.o section schedcls/ingress6/nat_6  direct-action
 	tc -n "${PEER_NS}" filter add dev veth1 egress prio 4 protocol ip bpf object-file ../bpf/nat6to4.o section schedcls/egress4/snat4 direct-action
diff --git a/tools/testing/selftests/net/udpgro_fwd.sh b/tools/testing/selftests/net/udpgro_fwd.sh
index 6f05e06f6761..1bcd82e1f662 100755
--- a/tools/testing/selftests/net/udpgro_fwd.sh
+++ b/tools/testing/selftests/net/udpgro_fwd.sh
@@ -46,7 +46,7 @@ create_ns() {
 		ip -n $BASE$ns addr add dev veth$ns $BM_NET_V4$ns/24
 		ip -n $BASE$ns addr add dev veth$ns $BM_NET_V6$ns/64 nodad
 	done
-	ip -n $NS_DST link set veth$DST xdp object ../bpf/xdp_dummy.o section xdp_dummy 2>/dev/null
+	ip -n $NS_DST link set veth$DST xdp object ../bpf/xdp_dummy.o section xdp 2>/dev/null
 }
 
 create_vxlan_endpoint() {
diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
index 19eac3e44c06..430895d1a2b6 100755
--- a/tools/testing/selftests/net/veth.sh
+++ b/tools/testing/selftests/net/veth.sh
@@ -289,14 +289,14 @@ if [ $CPUS -gt 1 ]; then
 	ip netns exec $NS_SRC ethtool -L veth$SRC rx 1 tx 2 2>/dev/null
 	printf "%-60s" "bad setting: XDP with RX nr less than TX"
 	ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o \
-		section xdp_dummy 2>/dev/null &&\
+		section xdp 2>/dev/null &&\
 		echo "fail - set operation successful ?!?" || echo " ok "
 
 	# the following tests will run with multiple channels active
 	ip netns exec $NS_SRC ethtool -L veth$SRC rx 2
 	ip netns exec $NS_DST ethtool -L veth$DST rx 2
 	ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o \
-		section xdp_dummy 2>/dev/null
+		section xdp 2>/dev/null
 	printf "%-60s" "bad setting: reducing RX nr below peer TX with XDP set"
 	ip netns exec $NS_DST ethtool -L veth$DST rx 1 2>/dev/null &&\
 		echo "fail - set operation successful ?!?" || echo " ok "
@@ -311,7 +311,7 @@ if [ $CPUS -gt 2 ]; then
 	chk_channels "setting invalid channels nr" $DST 2 2
 fi
 
-ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o section xdp_dummy 2>/dev/null
+ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o section xdp 2>/dev/null
 chk_gro_flag "with xdp attached - gro flag" $DST on
 chk_gro_flag "        - peer gro flag" $SRC off
 chk_tso_flag "        - tso flag" $SRC off
-- 
2.35.1


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

* Re: [PATCH net] selftests/net: fix section name when using xdp_dummy.o
  2022-06-30  6:22 [PATCH net] selftests/net: fix section name when using xdp_dummy.o Hangbin Liu
@ 2022-06-30 19:08 ` Andrii Nakryiko
  2022-07-01  1:43   ` Hangbin Liu
  2022-07-02  3:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Andrii Nakryiko @ 2022-06-30 19:08 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: Networking, David S . Miller, Jakub Kicinski, Paolo Abeni,
	Andrii Nakryiko

On Wed, Jun 29, 2022 at 11:22 PM Hangbin Liu <liuhangbin@gmail.com> wrote:
>
> Since commit 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in
> selftests") the xdp_dummy.o's section name has changed to xdp. But some
> tests are still using "section xdp_dummy", which make the tests failed.
> Fix them by updating to the new section name.
>
> Fixes: 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in selftests")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---

Thanks for fixing this! BTW, does iproute2 support selecting programs
by its name (not section name)? Only the program name is unique, there
could be multiple programs with the same SEC("xdp").

Acked-by: Andrii Nakryiko <andrii@kernel.org>

>  tools/testing/selftests/net/udpgro.sh         | 2 +-
>  tools/testing/selftests/net/udpgro_bench.sh   | 2 +-
>  tools/testing/selftests/net/udpgro_frglist.sh | 2 +-
>  tools/testing/selftests/net/udpgro_fwd.sh     | 2 +-
>  tools/testing/selftests/net/veth.sh           | 6 +++---
>  5 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/net/udpgro.sh b/tools/testing/selftests/net/udpgro.sh
> index f8a19f548ae9..ebbd0b282432 100755
> --- a/tools/testing/selftests/net/udpgro.sh
> +++ b/tools/testing/selftests/net/udpgro.sh
> @@ -34,7 +34,7 @@ cfg_veth() {
>         ip -netns "${PEER_NS}" addr add dev veth1 192.168.1.1/24
>         ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad
>         ip -netns "${PEER_NS}" link set dev veth1 up
> -       ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp_dummy
> +       ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp
>  }
>
>  run_one() {
> diff --git a/tools/testing/selftests/net/udpgro_bench.sh b/tools/testing/selftests/net/udpgro_bench.sh
> index 820bc50f6b68..fad2d1a71cac 100755
> --- a/tools/testing/selftests/net/udpgro_bench.sh
> +++ b/tools/testing/selftests/net/udpgro_bench.sh
> @@ -34,7 +34,7 @@ run_one() {
>         ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad
>         ip -netns "${PEER_NS}" link set dev veth1 up
>
> -       ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp_dummy
> +       ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp
>         ip netns exec "${PEER_NS}" ./udpgso_bench_rx ${rx_args} -r &
>         ip netns exec "${PEER_NS}" ./udpgso_bench_rx -t ${rx_args} -r &
>
> diff --git a/tools/testing/selftests/net/udpgro_frglist.sh b/tools/testing/selftests/net/udpgro_frglist.sh
> index 807b74c8fd80..832c738cc3c2 100755
> --- a/tools/testing/selftests/net/udpgro_frglist.sh
> +++ b/tools/testing/selftests/net/udpgro_frglist.sh
> @@ -36,7 +36,7 @@ run_one() {
>         ip netns exec "${PEER_NS}" ethtool -K veth1 rx-gro-list on
>
>
> -       ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp_dummy
> +       ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section xdp
>         tc -n "${PEER_NS}" qdisc add dev veth1 clsact
>         tc -n "${PEER_NS}" filter add dev veth1 ingress prio 4 protocol ipv6 bpf object-file ../bpf/nat6to4.o section schedcls/ingress6/nat_6  direct-action
>         tc -n "${PEER_NS}" filter add dev veth1 egress prio 4 protocol ip bpf object-file ../bpf/nat6to4.o section schedcls/egress4/snat4 direct-action
> diff --git a/tools/testing/selftests/net/udpgro_fwd.sh b/tools/testing/selftests/net/udpgro_fwd.sh
> index 6f05e06f6761..1bcd82e1f662 100755
> --- a/tools/testing/selftests/net/udpgro_fwd.sh
> +++ b/tools/testing/selftests/net/udpgro_fwd.sh
> @@ -46,7 +46,7 @@ create_ns() {
>                 ip -n $BASE$ns addr add dev veth$ns $BM_NET_V4$ns/24
>                 ip -n $BASE$ns addr add dev veth$ns $BM_NET_V6$ns/64 nodad
>         done
> -       ip -n $NS_DST link set veth$DST xdp object ../bpf/xdp_dummy.o section xdp_dummy 2>/dev/null
> +       ip -n $NS_DST link set veth$DST xdp object ../bpf/xdp_dummy.o section xdp 2>/dev/null
>  }
>
>  create_vxlan_endpoint() {
> diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
> index 19eac3e44c06..430895d1a2b6 100755
> --- a/tools/testing/selftests/net/veth.sh
> +++ b/tools/testing/selftests/net/veth.sh
> @@ -289,14 +289,14 @@ if [ $CPUS -gt 1 ]; then
>         ip netns exec $NS_SRC ethtool -L veth$SRC rx 1 tx 2 2>/dev/null
>         printf "%-60s" "bad setting: XDP with RX nr less than TX"
>         ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o \
> -               section xdp_dummy 2>/dev/null &&\
> +               section xdp 2>/dev/null &&\
>                 echo "fail - set operation successful ?!?" || echo " ok "
>
>         # the following tests will run with multiple channels active
>         ip netns exec $NS_SRC ethtool -L veth$SRC rx 2
>         ip netns exec $NS_DST ethtool -L veth$DST rx 2
>         ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o \
> -               section xdp_dummy 2>/dev/null
> +               section xdp 2>/dev/null
>         printf "%-60s" "bad setting: reducing RX nr below peer TX with XDP set"
>         ip netns exec $NS_DST ethtool -L veth$DST rx 1 2>/dev/null &&\
>                 echo "fail - set operation successful ?!?" || echo " ok "
> @@ -311,7 +311,7 @@ if [ $CPUS -gt 2 ]; then
>         chk_channels "setting invalid channels nr" $DST 2 2
>  fi
>
> -ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o section xdp_dummy 2>/dev/null
> +ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o section xdp 2>/dev/null
>  chk_gro_flag "with xdp attached - gro flag" $DST on
>  chk_gro_flag "        - peer gro flag" $SRC off
>  chk_tso_flag "        - tso flag" $SRC off
> --
> 2.35.1
>

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

* Re: [PATCH net] selftests/net: fix section name when using xdp_dummy.o
  2022-06-30 19:08 ` Andrii Nakryiko
@ 2022-07-01  1:43   ` Hangbin Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Hangbin Liu @ 2022-07-01  1:43 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: Networking, David S . Miller, Jakub Kicinski, Paolo Abeni,
	Andrii Nakryiko

On Thu, Jun 30, 2022 at 12:08:11PM -0700, Andrii Nakryiko wrote:
> On Wed, Jun 29, 2022 at 11:22 PM Hangbin Liu <liuhangbin@gmail.com> wrote:
> >
> > Since commit 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in
> > selftests") the xdp_dummy.o's section name has changed to xdp. But some
> > tests are still using "section xdp_dummy", which make the tests failed.
> > Fix them by updating to the new section name.
> >
> > Fixes: 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in selftests")
> > Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> > ---
> 
> Thanks for fixing this! BTW, does iproute2 support selecting programs
> by its name (not section name)? Only the program name is unique, there
> could be multiple programs with the same SEC("xdp").

Good point. iproute2 do not support selecting programs by its name yet.
I will working on it to add this support.

Thanks
Hangbin

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

* Re: [PATCH net] selftests/net: fix section name when using xdp_dummy.o
  2022-06-30  6:22 [PATCH net] selftests/net: fix section name when using xdp_dummy.o Hangbin Liu
  2022-06-30 19:08 ` Andrii Nakryiko
@ 2022-07-02  3:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-02  3:20 UTC (permalink / raw)
  To: Hangbin Liu; +Cc: netdev, davem, kuba, pabeni, andrii

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 30 Jun 2022 14:22:28 +0800 you wrote:
> Since commit 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in
> selftests") the xdp_dummy.o's section name has changed to xdp. But some
> tests are still using "section xdp_dummy", which make the tests failed.
> Fix them by updating to the new section name.
> 
> Fixes: 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in selftests")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net] selftests/net: fix section name when using xdp_dummy.o
    https://git.kernel.org/netdev/net/c/d28b25a62a47

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-07-02  3:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30  6:22 [PATCH net] selftests/net: fix section name when using xdp_dummy.o Hangbin Liu
2022-06-30 19:08 ` Andrii Nakryiko
2022-07-01  1:43   ` Hangbin Liu
2022-07-02  3:20 ` patchwork-bot+netdevbpf

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.