Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: forwarding: Move several selftests

The tests in net/forwarding are generally expected to be HW-independent.
There are however several tests that, while not depending on any HW in
particular, nevertheless depend on being used on HW interfaces. Placing
these selftests to net/forwarding is confusing, because the selftest will
just report it can't be run on veth pairs. At the same time, placing them
to a particular driver's selftests subdirectory would be wrong.

Instead, add a new directory, drivers/net/hw, where these generic but HW
independent selftests should be placed. Move over several such tests
including one helper library.

Since typically these tests will not be expected to run, omit the directory
drivers/net/hw from the TARGETS list in selftests/Makefile. Retain a
Makefile in the new directory itself, so that a user can make -C into that
directory and act on those tests explicitly.

Cc: Roger Quadros <rogerq@kernel.org>
Cc: Tobias Waldekranz <tobias@waldekranz.com>
Cc: Danielle Ratson <danieller@nvidia.com>
Cc: Davide Caratti <dcaratti@redhat.com>
Cc: Johannes Nixdorf <jnixdorf-oss@avm.de>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/e11dae1f62703059e9fc2240004288ac7cc15756.1711464583.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Petr Machata and committed by
Jakub Kicinski
40d269c0 0faa565b

+42 -18
+25
tools/testing/selftests/drivers/net/hw/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0+ OR MIT 2 + 3 + TEST_PROGS = \ 4 + devlink_port_split.py \ 5 + ethtool.sh \ 6 + ethtool_extended_state.sh \ 7 + ethtool_mm.sh \ 8 + ethtool_rmon.sh \ 9 + hw_stats_l3.sh \ 10 + hw_stats_l3_gre.sh \ 11 + loopback.sh \ 12 + # 13 + 14 + TEST_FILES := \ 15 + ethtool_lib.sh \ 16 + # 17 + 18 + TEST_INCLUDES := \ 19 + ../../../net/lib.sh \ 20 + ../../../net/forwarding/lib.sh \ 21 + ../../../net/forwarding/ipip_lib.sh \ 22 + ../../../net/forwarding/tc_common.sh \ 23 + # 24 + 25 + include ../../../lib.mk
+1
tools/testing/selftests/drivers/net/hw/settings
··· 1 + timeout=0
-1
tools/testing/selftests/net/Makefile
··· 20 20 TEST_PROGS += txtimestamp.sh 21 21 TEST_PROGS += vrf-xfrm-tests.sh 22 22 TEST_PROGS += rxtimestamp.sh 23 - TEST_PROGS += devlink_port_split.py 24 23 TEST_PROGS += drop_monitor_tests.sh 25 24 TEST_PROGS += vrf_route_leaking.sh 26 25 TEST_PROGS += bareudp.sh
-8
tools/testing/selftests/net/forwarding/Makefile
··· 15 15 bridge_vlan_unaware.sh \ 16 16 custom_multipath_hash.sh \ 17 17 dual_vxlan_bridge.sh \ 18 - ethtool_extended_state.sh \ 19 - ethtool_mm.sh \ 20 - ethtool_rmon.sh \ 21 - ethtool.sh \ 22 18 gre_custom_multipath_hash.sh \ 23 19 gre_inner_v4_multipath.sh \ 24 20 gre_inner_v6_multipath.sh \ 25 21 gre_multipath_nh_res.sh \ 26 22 gre_multipath_nh.sh \ 27 23 gre_multipath.sh \ 28 - hw_stats_l3.sh \ 29 - hw_stats_l3_gre.sh \ 30 24 ip6_forward_instats_vrf.sh \ 31 25 ip6gre_custom_multipath_hash.sh \ 32 26 ip6gre_flat_key.sh \ ··· 38 44 ipip_hier_gre_keys.sh \ 39 45 ipip_hier_gre.sh \ 40 46 local_termination.sh \ 41 - loopback.sh \ 42 47 mirror_gre_bound.sh \ 43 48 mirror_gre_bridge_1d.sh \ 44 49 mirror_gre_bridge_1d_vlan.sh \ ··· 106 113 vxlan_symmetric.sh 107 114 108 115 TEST_FILES := devlink_lib.sh \ 109 - ethtool_lib.sh \ 110 116 fib_offload_lib.sh \ 111 117 forwarding.config.sample \ 112 118 ip6gre_lib.sh \
+2 -1
tools/testing/selftests/net/forwarding/ethtool.sh tools/testing/selftests/drivers/net/hw/ethtool.sh
··· 10 10 different_speeds_autoneg_on 11 11 " 12 12 NUM_NETIFS=2 13 - source lib.sh 13 + lib_dir=$(dirname "$0") 14 + source "$lib_dir"/../../../net/forwarding/lib.sh 14 15 source ethtool_lib.sh 15 16 16 17 h1_create()
+2 -1
tools/testing/selftests/net/forwarding/ethtool_extended_state.sh tools/testing/selftests/drivers/net/hw/ethtool_extended_state.sh
··· 8 8 " 9 9 10 10 NUM_NETIFS=2 11 - source lib.sh 11 + lib_dir=$(dirname "$0") 12 + source "$lib_dir"/../../../net/forwarding/lib.sh 12 13 source ethtool_lib.sh 13 14 14 15 TIMEOUT=$((WAIT_TIMEOUT * 1000)) # ms
tools/testing/selftests/net/forwarding/ethtool_lib.sh tools/testing/selftests/drivers/net/hw/ethtool_lib.sh
+2 -1
tools/testing/selftests/net/forwarding/ethtool_mm.sh tools/testing/selftests/drivers/net/hw/ethtool_mm.sh
··· 14 14 NUM_NETIFS=2 15 15 REQUIRE_MZ=no 16 16 PREEMPTIBLE_PRIO=0 17 - source lib.sh 17 + lib_dir=$(dirname "$0") 18 + source "$lib_dir"/../../../net/forwarding/lib.sh 18 19 19 20 traffic_test() 20 21 {
+2 -1
tools/testing/selftests/net/forwarding/ethtool_rmon.sh tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
··· 7 7 " 8 8 9 9 NUM_NETIFS=2 10 - source lib.sh 10 + lib_dir=$(dirname "$0") 11 + source "$lib_dir"/../../../net/forwarding/lib.sh 11 12 12 13 ETH_FCS_LEN=4 13 14 ETH_HLEN=$((6+6+2))
+2 -1
tools/testing/selftests/net/forwarding/hw_stats_l3.sh tools/testing/selftests/drivers/net/hw/hw_stats_l3.sh
··· 48 48 test_double_enable 49 49 " 50 50 NUM_NETIFS=4 51 - source lib.sh 51 + lib_dir=$(dirname "$0") 52 + source "$lib_dir"/../../../net/forwarding/lib.sh 52 53 53 54 h1_create() 54 55 {
+3 -2
tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh tools/testing/selftests/drivers/net/hw/hw_stats_l3_gre.sh
··· 12 12 test_stats_tx 13 13 " 14 14 NUM_NETIFS=6 15 - source lib.sh 16 - source ipip_lib.sh 15 + lib_dir=$(dirname "$0") 16 + source "$lib_dir"/../../../net/forwarding/lib.sh 17 + source "$lib_dir"/../../../net/forwarding/ipip_lib.sh 17 18 18 19 setup_prepare() 19 20 {
+3 -2
tools/testing/selftests/net/forwarding/loopback.sh tools/testing/selftests/drivers/net/hw/loopback.sh
··· 6 6 7 7 ALL_TESTS="loopback_test" 8 8 NUM_NETIFS=2 9 - source tc_common.sh 10 - source lib.sh 9 + lib_dir=$(dirname "$0") 10 + source "$lib_dir"/../../../net/forwarding/tc_common.sh 11 + source "$lib_dir"/../../../net/forwarding/lib.sh 11 12 12 13 h1_create() 13 14 {