Skip to contentSkip to conversation

selftests: netdevsim: fix the udp_tunnel_nic test

PATCH Applied Jakub Kicinski 4 participants 6 messages Jan 23, 2024 – Jan 24, 2024

Subsystems (4)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 selftests: netdevsim: fix the udp_tunnel_nic test

This test is missing a whole bunch of checks for interface renaming and one ifup. Presumably it was only used on a system with renaming disabled and NetworkManager running.

Fixes 91f430b2c49d ("selftests: net: add a test for UDP tunnel info infra")

---
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 .../selftests/drivers/net/netdevsim/udp_tunnel_nic.sh    | 9 +++++++++
 1 file changed, 9 insertions(+)
tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh +9 -0
index 4855ef597a15..f98435c502f6 100755
@@ -270,6 +270,7 @@ for port in 0 1; do
 	echo 1 > $NSIM_DEV_SYS/new_port
     fi
     NSIM_NETDEV=`get_netdev_name old_netdevs`
+    ifconfig $NSIM_NETDEV up
 
     msg="new NIC device created"
     exp0=( 0 0 0 0 )
@@ -431,6 +432,7 @@ for port in 0 1; do
     fi
 
     echo $port > $NSIM_DEV_SYS/new_port
+    NSIM_NETDEV=`get_netdev_name old_netdevs`
     ifconfig $NSIM_NETDEV up
 
     overflow_table0 "overflow NIC table"
@@ -488,6 +490,7 @@ for port in 0 1; do
     fi
 
     echo $port > $NSIM_DEV_SYS/new_port
+    NSIM_NETDEV=`get_netdev_name old_netdevs`
     ifconfig $NSIM_NETDEV up
 
     overflow_table0 "overflow NIC table"
@@ -544,6 +547,7 @@ for port in 0 1; do
     fi
 
     echo $port > $NSIM_DEV_SYS/new_port
+    NSIM_NETDEV=`get_netdev_name old_netdevs`
     ifconfig $NSIM_NETDEV up
 
     overflow_table0 "destroy NIC"
@@ -573,6 +577,7 @@ for port in 0 1; do
     fi
 
     echo $port > $NSIM_DEV_SYS/new_port
+    NSIM_NETDEV=`get_netdev_name old_netdevs`
     ifconfig $NSIM_NETDEV up
 
     msg="create VxLANs v6"
@@ -633,6 +638,7 @@ for port in 0 1; do
     fi
 
     echo $port > $NSIM_DEV_SYS/new_port
+    NSIM_NETDEV=`get_netdev_name old_netdevs`
     ifconfig $NSIM_NETDEV up
 
     echo 110 > $NSIM_DEV_DFS/ports/$port/udp_ports_inject_error
@@ -688,6 +694,7 @@ for port in 0 1; do
     fi
 
     echo $port > $NSIM_DEV_SYS/new_port
+    NSIM_NETDEV=`get_netdev_name old_netdevs`
     ifconfig $NSIM_NETDEV up
 
     msg="create VxLANs v6"
@@ -747,6 +754,7 @@ for port in 0 1; do
     fi
 
     echo $port > $NSIM_DEV_SYS/new_port
+    NSIM_NETDEV=`get_netdev_name old_netdevs`
     ifconfig $NSIM_NETDEV up
 
     msg="create VxLANs v6"
@@ -877,6 +885,7 @@ msg="re-add a port"
 
 echo 2 > $NSIM_DEV_SYS/del_port
 echo 2 > $NSIM_DEV_SYS/new_port
+NSIM_NETDEV=`get_netdev_name old_netdevs`
 check_tables
 
 msg="replace VxLAN in overflow table"
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Jakub Kicinski

This test is missing a whole bunch of checks for interface renaming and one ifup. Presumably it was only used on a system with renaming disabled and NetworkManager running.

Fixes 91f430b2c49d ("selftests: net: add a test for UDP tunnel info infra")

---
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 .../selftests/drivers/net/netdevsim/udp_tunnel_nic.sh    | 9 +++++++++
 1 file changed, 9 insertions(+)
tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh +0 -0
index 4855ef597a15..f98435c502f6 100755

tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh for port in 0 1; do · line 273

Quoted 4 lines
tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh +1 -0
@@ -270,6 +270,7 @@ for port in 0 1; do
 	echo 1 > $NSIM_DEV_SYS/new_port
     fi
     NSIM_NETDEV=`get_netdev_name old_netdevs`
+    ifconfig $NSIM_NETDEV up

WoW! I initially thought the above was a typo, before noticing it's actually consistent with the whole script :)

Do you think we should look at dropping ifconfig usage from self-tests? I guess that in the long run most systems should not have such command available in the default install.

In any case the patch LGTM.

Cheers,

Paolo

author maintainer
#2 lore raw
Quoted 9 lines · On Tue, 23 Jan 2024 09:27:17 +0100 Paolo Abeni wrote:

tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh for port in 0 1; do · line 273

Quoted 5 lines
tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh +1 -0
@@ -270,6 +270,7 @@ for port in 0 1; do
 	echo 1 > $NSIM_DEV_SYS/new_port
     fi
     NSIM_NETDEV=`get_netdev_name old_netdevs`
+    ifconfig $NSIM_NETDEV up  

WoW! I initially thought the above was a typo, before noticing it's actually consistent with the whole script :)

Quoted 3 lines

Do you think we should look at dropping ifconfig usage from self-tests? I guess that in the long run most systems should not have such command available in the default install.

Good point, there's only one use outside of this script. I'll queue up a conversion for -next!

author maintainer
#3 lore raw
Quoted 10 lines · On Tue, 23 Jan 2024 07:39:25 -0800 Jakub Kicinski wrote:
Quoted 9 lines · On Tue, 23 Jan 2024 09:27:17 +0100 Paolo Abeni wrote:

tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh for port in 0 1; do · line 273

Quoted 5 lines
tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh +1 -0
@@ -270,6 +270,7 @@ for port in 0 1; do
 	echo 1 > $NSIM_DEV_SYS/new_port
     fi
     NSIM_NETDEV=`get_netdev_name old_netdevs`
+    ifconfig $NSIM_NETDEV up    

WoW! I initially thought the above was a typo, before noticing it's actually consistent with the whole script :)

Quoted 6 lines
Quoted 3 lines

Do you think we should look at dropping ifconfig usage from self-tests? I guess that in the long run most systems should not have such command available in the default install.

Good point, there's only one use outside of this script. I'll queue up a conversion for -next!

Hm, Hi Florian! Is the use of ifconfig in kci_test_promote_secondaries, commit bb2bd090854cc6 on purpose or can I switch that to ip addr, too?

reviewer Reviewed-by on v1 1/1
#4 lore raw
In reply to Jakub Kicinski
Quoted 6 lines · Jakub Kicinski

This test is missing a whole bunch of checks for interface renaming and one ifup. Presumably it was only used on a system with renaming disabled and NetworkManager running.

Fixes 91f430b2c49d ("selftests: net: add a test for UDP tunnel info infra")

I see some discussion of a follow-up to move away from ifconfig which I agree with (which century are we in now?). But this patch looks good in it's own right.

#5 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Mon, 22 Jan 2024 22:05:29 -0800 you wrote:

This test is missing a whole bunch of checks for interface renaming and one ifup. Presumably it was only used on a system with renaming disabled and NetworkManager running.

Fixes 91f430b2c49d ("selftests: net: add a test for UDP tunnel info infra")

[...]

Here is the summary with links:
- [net] selftests: netdevsim: fix the udp_tunnel_nic test

    https://git.kernel.org/netdev/net/c/0879020a7817

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html