From: Paolo Abeni Date: Thu, 2 Apr 2026 10:11:05 +0000 (+0200) Subject: Merge branch 'selftests-drivers-bash-support-for-remote-traffic-generators' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae04bff949c50921c2af2a14def112a2c47e649d;p=thirdparty%2Flinux.git Merge branch 'selftests-drivers-bash-support-for-remote-traffic-generators' Ioana Ciornei says: ==================== selftests: drivers: bash support for remote traffic generators This patch set aims to add the necessary support so that bash written selftests are also able to easily run with a remote traffic generator system, either be it in another netns or one accessible through ssh. This patch set is a result of the discussion from v1: https://lore.kernel.org/all/20260303084330.340b6459@kernel.org/ Even though the python infrastructure is already established, some things are easier in bash and it would be a shame to leave behind the bash tests that we already have. This support is based on the requirements described in the tools/testing/selftests/drivers/net/README.rst file. Mainly, the drivers/net selftests should be able to run on a interface specified through the NETIF env variable. On top of that, variables such as REMOTE_TYPE and REMOTE_ARGS define how the remote traffic generator can be accessed. Patch 3/10 parses these env variables and constructs the NETIFS array that bash tests are accustomed to. This is with the intention of enabling already written tests to incur minimal changes. The second patch also defines the TARGETS array which will hold the necessary information about the target on which a specific interface is located. For example, a net.config which looks like below: NETIF=eth0 LOCAL_V4=192.168.1.1 REMOTE_V4=192.168.1.2 REMOTE_TYPE=ssh REMOTE_ARGS=root@192.168.1.2 will generate the NETIFS and TARGETS arrays with the following data. NETIFS[p1]="eth0" NETIFS[p2]="eth2" TARGETS[eth0]="local:" TARGETS[eth2]="ssh:root@192.168.1.2" The above will be true if on the remote target, the interface which has the 192.168.1.2 address is named eth2. The values held in the TARGETS array will be used by the new 'run_on' helper added in patch 2/10 to know how to run a specific command, on the local system, on another netns or by using ssh. Patch 4/10 updates some helpers to use run_on so that, for example, lib.sh is able to ensure stable MAC addresses even with the remote interface located in another netns. The next 5 patches, 5/10-9/10 update the ethtool_rmon.sh script so that it can work with the kselftest infrastructure and the new NETIF/REMOTE_TYPE etc way of working. Beside updating each ip link or ethtool command to use the run_on helper, the patches also remove any testing done on the remote interface. The last patch adds a new test which checks the standard counters - eth-ctrl, eth-mac and pause - and uses the new infrastructure put in place by the first patches. With this patch set, both tests can be run using a net.config file and run_kselftest.sh as shown below. $ make -C tools/testing/selftests/ TARGETS="drivers/net drivers/net/hw" \ install INSTALL_PATH=/tmp/ksft-net-drv $ cd /tmp/ksft-net-drv/ $ cat > ./drivers/net/net.config < --- ae04bff949c50921c2af2a14def112a2c47e649d