Skip to content

Commit 2cfbcc5

Browse files
Daniel Zahkakuba-moo
authored andcommitted
selftests: drv-net: tso: fix vxlan tunnel flags to get correct gso_type
When vxlan is used with ipv6 as the outer network header, the correct ip link parameters for acheiving the SKB_GSO_UDP_TUNNEL gso type is "udp6zerocsumtx udp6zerocsumrx". Otherwise the gso type will be SKB_GSO_UDP_TUNNEL_CSUM. This bug was the reason for the second of the three possible invocations of run_one_stream() invocations, so that can be deleted as well. We only need to test with the feature off and on. Fixes: 0d0f417 ("selftests: drv-net: add a simple TSO test") Signed-off-by: Daniel Zahka <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 266b835 commit 2cfbcc5

File tree

1 file changed

+13
-24
lines changed
  • tools/testing/selftests/drivers/net/hw

1 file changed

+13
-24
lines changed

tools/testing/selftests/drivers/net/hw/tso.py

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def build_tunnel(cfg, outer_ipver, tun_info):
102102
remote_addr = cfg.remote_addr_v[outer_ipver]
103103

104104
tun_type = tun_info[0]
105-
tun_arg = tun_info[2]
105+
tun_arg = tun_info[1]
106106
ip(f"link add {tun_type}-ksft type {tun_type} {tun_arg} local {local_addr} remote {remote_addr} dev {cfg.ifname}")
107107
defer(ip, f"link del {tun_type}-ksft")
108108
ip(f"link set dev {tun_type}-ksft up")
@@ -151,29 +151,17 @@ def f(cfg):
151151
remote_v4 = cfg.remote_addr_v["4"]
152152
remote_v6 = cfg.remote_addr_v["6"]
153153

154-
tun_partial = tun and tun[1]
155-
# Tunnel which can silently fall back to gso-partial
156-
has_gso_partial = tun and 'tx-gso-partial' in cfg.hw_features
157-
158-
# For TSO4 via partial we need mangleid
159-
if ipver == "4" and feature in cfg.partial_features:
160-
ksft_pr("Testing with mangleid enabled")
161-
if 'tx-tcp-mangleid-segmentation' not in cfg.hw_features:
162-
ethtool(f"-K {cfg.ifname} tx-tcp-mangleid-segmentation on")
163-
defer(ethtool, f"-K {cfg.ifname} tx-tcp-mangleid-segmentation off")
164-
165154
# First test without the feature enabled.
166155
ethtool(f"-K {cfg.ifname} {feature} off")
167-
if has_gso_partial:
168-
ethtool(f"-K {cfg.ifname} tx-gso-partial off")
169156
run_one_stream(cfg, ipver, remote_v4, remote_v6, should_lso=False)
170157

171-
# Now test with the feature enabled.
172-
# For compatible tunnels only - just GSO partial, not specific feature.
173-
if has_gso_partial:
158+
ethtool(f"-K {cfg.ifname} tx-gso-partial off")
159+
ethtool(f"-K {cfg.ifname} tx-tcp-mangleid-segmentation off")
160+
if feature in cfg.partial_features:
174161
ethtool(f"-K {cfg.ifname} tx-gso-partial on")
175-
run_one_stream(cfg, ipver, remote_v4, remote_v6,
176-
should_lso=tun_partial)
162+
if ipver == "4":
163+
ksft_pr("Testing with mangleid enabled")
164+
ethtool(f"-K {cfg.ifname} tx-tcp-mangleid-segmentation on")
177165

178166
# Full feature enabled.
179167
ethtool(f"-K {cfg.ifname} {feature} on")
@@ -239,13 +227,14 @@ def main() -> None:
239227
query_nic_features(cfg)
240228

241229
test_info = (
242-
# name, v4/v6 ethtool_feature tun:(type, partial, args)
230+
# name, v4/v6 ethtool_feature tun:(type, args)
243231
("", "4", "tx-tcp-segmentation", None),
244232
("", "6", "tx-tcp6-segmentation", None),
245-
("vxlan", "", "tx-udp_tnl-segmentation", ("vxlan", True, "id 100 dstport 4789 noudpcsum")),
246-
("vxlan_csum", "", "tx-udp_tnl-csum-segmentation", ("vxlan", False, "id 100 dstport 4789 udpcsum")),
247-
("gre", "4", "tx-gre-segmentation", ("gre", False, "")),
248-
("gre", "6", "tx-gre-segmentation", ("ip6gre", False, "")),
233+
("vxlan", "4", "tx-udp_tnl-segmentation", ("vxlan", "id 100 dstport 4789 noudpcsum")),
234+
("vxlan", "6", "tx-udp_tnl-segmentation", ("vxlan", "id 100 dstport 4789 udp6zerocsumtx udp6zerocsumrx")),
235+
("vxlan_csum", "", "tx-udp_tnl-csum-segmentation", ("vxlan", "id 100 dstport 4789 udpcsum")),
236+
("gre", "4", "tx-gre-segmentation", ("gre", "")),
237+
("gre", "6", "tx-gre-segmentation", ("ip6gre", "")),
249238
)
250239

251240
cases = []

0 commit comments

Comments
 (0)