[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67b3e0b53f246_c0e25294ee@willemb.c.googlers.com.notmuch>
Date: Mon, 17 Feb 2025 20:21:57 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jakub Kicinski <kuba@...nel.org>,
davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
andrew+netdev@...n.ch,
horms@...nel.org,
willemdebruijn.kernel@...il.com,
petrm@...dia.com,
stfomichev@...il.com,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next v3 4/4] selftests: drv-net: add a simple TSO test
Jakub Kicinski wrote:
> Add a simple test for TSO. Send a few MB of data and check device
> stats to verify that the device was performing segmentation.
> Do the same thing over a few tunnel types.
>
> Injecting GSO packets directly would give us more ability to test
> corner cases, but perhaps starting simple is good enough?
>
> # ./ksft-net-drv/drivers/net/hw/tso.py
> # Detected qstat for LSO wire-packets
> KTAP version 1
> 1..14
> ok 1 tso.ipv4 # SKIP Test requires IPv4 connectivity
> ok 2 tso.vxlan4_ipv4 # SKIP Test requires IPv4 connectivity
> ok 3 tso.vxlan6_ipv4 # SKIP Test requires IPv4 connectivity
> ok 4 tso.vxlan_csum4_ipv4 # SKIP Test requires IPv4 connectivity
> ok 5 tso.vxlan_csum6_ipv4 # SKIP Test requires IPv4 connectivity
> ok 6 tso.gre4_ipv4 # SKIP Test requires IPv4 connectivity
> ok 7 tso.gre6_ipv4 # SKIP Test requires IPv4 connectivity
> ok 8 tso.ipv6
> ok 9 tso.vxlan4_ipv6
> ok 10 tso.vxlan6_ipv6
> ok 11 tso.vxlan_csum4_ipv6
> ok 12 tso.vxlan_csum6_ipv6
> ok 13 tso.gre4_ipv6
> ok 14 tso.gre6_ipv6
> # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:7 error:0
>
> Note that the test currently depends on the driver reporting
> the LSO count via qstat, which appears to be relatively rare
> (virtio, cisco/enic, sfc/efc; but virtio needs host support).
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> v3:
> - rework after the v4/v6 address split
> v2: https://lore.kernel.org/20250214234631.2308900-4-kuba@kernel.org
> - lower max noise
> - mention header overhead in the comment
> - fix the basic v4 TSO feature name
> - also run a stream with just GSO partial for tunnels
> v1: https://lore.kernel.org/20250213003454.1333711-4-kuba@kernel.org
> +def test_builder(name, cfg, ipver, feature, tun=None, inner_ipver=None):
> + """Construct specific tests from the common template."""
> + def f(cfg):
> + cfg.require_ipver(ipver)
> +
> + if not cfg.have_stat_super_count and \
> + not cfg.have_stat_wire_count:
> + raise KsftSkipEx(f"Device does not support LSO queue stats")
> +
> + if tun:
> + remote_v4, remote_v6 = build_tunnel(cfg, ipver, tun)
> + else:
> + remote_v4 = cfg.remote_addr_v["4"]
> + remote_v6 = cfg.remote_addr_v["6"]
> +
> + tun_partial = tun and tun[1]
> + has_gso_partial = tun and 'tx-gso-partial' in cfg.features
> +
> + # First test without the feature enabled.
> + ethtool(f"-K {cfg.ifname} {feature} off")
> + if has_gso_partial:
> + ethtool(f"-K {cfg.ifname} tx-gso-partial off")
> + run_one_stream(cfg, ipver, remote_v4, remote_v6, should_lso=False)
> +
> + # Now test with the feature enabled.
> + # For compatible tunnels only - just GSO partial, not specific feature.
> + if has_gso_partial:
> + ethtool(f"-K {cfg.ifname} tx-gso-partial on")
> + run_one_stream(cfg, ipver, remote_v4, remote_v6,
> + should_lso=tun_partial)
> +
> + # Full feature enabled.
> + if feature in cfg.features:
> + ethtool(f"-K {cfg.ifname} {feature} on")
> + run_one_stream(cfg, ipver, remote_v4, remote_v6, should_lso=True)
> + else:
> + raise KsftXfailEx(f"Device does not support {feature}")
> +
> + f.__name__ = name + ((ipver + "_") if tun else "") + "ipv" + ipver
use inner_ipver if tun?
based on previous version of the patch:
+ if tun:
+ name += ("4" if inner_ipv4 else "6") + "_"
> + return f
> +
Powered by blists - more mailing lists