Re: [PATCH net-next] selftests/net: allow GRO coalesce test on veth
From: Paolo Abeni <pabeni@redhat.com>
Date: 2021-08-25 17:40:07
On Wed, 2021-08-25 at 12:17 -0400, Willem de Bruijn wrote:
On Wed, Aug 25, 2021 at 6:25 AM Paolo Abeni [off-list ref] wrote:quoted
This change extends the existing GRO coalesce test to allow running on top of a veth pair, so that no H/W dep is required to run them. By default gro.sh will use the veth backend, and will try to use exiting H/W in loopback mode if a specific device name is provided with the '-i' command line option. No functional change is intended for the loopback-based tests, just move all the relevant initialization/cleanup code into the related script. Introduces a new initialization helper script for the veth backend, and plugs the correct helper script according to the provided command line. Additionally, enable veth-based tests by default.Very nice. Thanks for extending the test to be run as part of continuous testing over veth, Paolo.quoted
+setup_veth_ns() { + local -r link_dev="$1" + local -r ns_name="$2" + local -r ns_dev="$3" + local -r ns_mac="$4" + local -r addr="$5" + + [[ -e /var/run/netns/"${ns_name}" ]] || ip netns add "${ns_name}" + echo 100000 > "/sys/class/net/${ns_dev}/gro_flush_timeout" + ip link set dev "${ns_dev}" netns "${ns_name}" mtu 65535 + ip -netns "${ns_name}" link set dev "${ns_dev}" up + if [[ -n "${addr}" ]]; then + ip -netns "${ns_name}" addr add dev "${ns_dev}" "${addr}" + fiunused? setup_veth_ns is always called with four arguments.
yep. Too much C&P from esiting code :( I'll send a v2 after some more testing. Thanks! Paolo