diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-04-25 16:59:55 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-26 08:52:03 +0300 |
commit | e05b2d141fef22cfac1928cf0eb6890e5dae4216 (patch) | |
tree | 055d8c4330e6e9002a2bf4e9829febe8df84d59f /tools/testing/selftests/net/rtnetlink.sh | |
parent | 794b2c05ca1c4ded4a023d11833e3855a0ed6ea8 (diff) | |
download | linux-e05b2d141fef22cfac1928cf0eb6890e5dae4216.tar.xz |
netdevsim: move netdev creation/destruction to dev probe
Remove the existing way to create netdevsim over rtnetlink and move the
netdev creation/destruction to dev probe, so for every probed port,
a netdevsim-netdev instance is created.
Adjust selftests to work with new interface.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/rtnetlink.sh')
-rwxr-xr-x | tools/testing/selftests/net/rtnetlink.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh index 311f82bcbe8d..b25c9fe019d2 100755 --- a/tools/testing/selftests/net/rtnetlink.sh +++ b/tools/testing/selftests/net/rtnetlink.sh @@ -696,9 +696,9 @@ kci_test_ipsec_offload() algo="aead rfc4106(gcm(aes)) 0x3132333435363738393031323334353664636261 128" srcip=192.168.123.3 dstip=192.168.123.4 - dev=simx1 sysfsd=/sys/kernel/debug/netdevsim/netdevsim0/ports/0/ sysfsf=$sysfsd/ipsec + sysfsnet=/sys/bus/netdevsim/devices/netdevsim0/net/ # setup netdevsim since dummydev doesn't have offload support modprobe netdevsim @@ -708,7 +708,11 @@ kci_test_ipsec_offload() return 1 fi - ip link add $dev type netdevsim + echo "0" > /sys/bus/netdevsim/new_device + while [ ! -d $sysfsnet ] ; do :; done + udevadm settle + dev=`ls $sysfsnet` + ip addr add $srcip dev $dev ip link set $dev up if [ ! -d $sysfsd ] ; then @@ -781,7 +785,6 @@ EOF fi # clean up any leftovers - ip link del $dev rmmod netdevsim if [ $ret -ne 0 ]; then |