[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+FuTSeavsMkRtuLO1EqWjod9ua=Yp4UHnV15+xJJ_6P1gxc7w@mail.gmail.com>
Date: Wed, 25 Aug 2021 12:17:45 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Shuah Khan <shuah@...nel.org>, Coco Li <lixiaoyan@...gle.com>
Subject: Re: [PATCH net-next] selftests/net: allow GRO coalesce test on veth
On Wed, Aug 25, 2021 at 6:25 AM Paolo Abeni <pabeni@...hat.com> wrote:
>
> 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.
> +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}"
> + fi
unused? setup_veth_ns is always called with four arguments.
> +
> + ip netns exec "${ns_name}" ethtool -K "${ns_dev}" gro on tso off
> +}
> +
> +setup_ns() {
> + # Set up server_ns namespace and client_ns namespace
> + ip link add name server type veth peer name client
> +
> + setup_veth_ns "${dev}" server_ns server "${SERVER_MAC}"
> + setup_veth_ns "${dev}" client_ns client "${CLIENT_MAC}"
> +}
Powered by blists - more mailing lists