From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 997C71391 for ; Fri, 28 Nov 2025 20:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764362564; cv=none; b=GaJupVea0Ws8s4smA7hKnGZEWdfxlyvFCyvbry2wOuGJpSDdc8Kx1t62y5KGUDlIGkN/F4SrJQkYcg794KLqi9/h6iaBT/SCxr9BJtB3li6ic/FOC1dmqnvtUTMosKdiRXgnj1oRdFra7lSjtT14YI79+vr67sBOlhp+iqQ2frA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764362564; c=relaxed/simple; bh=FdLCN53CTxUt6hfjsmo7yzH6TbLjZDUb1d/794EyTeQ=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=ORW5JVgqPNJ9lz/4bsi/VIoEEbGlP3BklUptcMhd8xKz3cT7G/2mFraaxsBpdETiv/fsjwCKUD7u+JhtAdb9WrrWKSJEEi3q+2aVb93DN/IgUQ0Xogade60V5/kUdKh2I+lrSgjM3DPASAUwa9c2VgjhUM6ImHGZS68zOtBnCS4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Tjn0gA6M; arc=none smtp.client-ip=209.85.128.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tjn0gA6M" Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-78a6a7654a4so20719217b3.0 for ; Fri, 28 Nov 2025 12:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764362561; x=1764967361; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=D+7+Hhp2jQFXeR9sNBlLTHUXZh0f0zWtgYdAbER5ats=; b=Tjn0gA6MwkcWaTQZShGGeXmA2bQ3cwEAjhyWvvDOHk3ppe6kcOJC2N/j4wWbEfE7d/ JMZxmZIo9gCL4enP1zoPEAQsWI3YCDmEKKZTdwQedjx3p1tq21fhfZyeVOonGYmg5Vmu Dj4G7RX0IH99vUniFFRXcpA0vIgFB9+bWZgmy65M7UhyBWEFaAtIVYf2lyT91pnYbSLy kLB+1khhHyHbi+5LDgist+VcP5wUBEGmjQzdnB2N3gJQBMjHcBR273phdK1aUoe4r36W uojqF7ejsOMH+DvScl6SqR3M1ukwJ10AIAQjPL/IbeJ9ZlYkewGwGbGMDRitHAPVHWC7 KxDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764362561; x=1764967361; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=D+7+Hhp2jQFXeR9sNBlLTHUXZh0f0zWtgYdAbER5ats=; b=V+Yxd7nvbCMl/dKcCUxrW6Duk/EZkgWilsaEVgUFP9tDd3Y3aykZcbZBiY6p28ahHV /e9K80E65YkXDUtMsj4EA/DA03PSHjQCGUWnveUK/09gqQTTvv5QpcQX2BG5sh9Pi0pi qwmMLHx3JV6t8ioddHwTIc9nlHXhT+mhMCoxsCzSPmRM06sHcIkhh2HpmJbtDLdYj9Ix vyyRLYXhh614A6bDOUJBkmVfVKQtrcYwji8Xa2g+xsULQUlikAWdEi8JTQwCiKjt28io 4A+MComHv2HTpM06uqQW1lw7CVbeqMOsGsGYDRhEDcSnzq6KH1J6IEPTFzuqKwU1zYQn mkdA== X-Gm-Message-State: AOJu0Yz8hmSDo0OeE8jGbE/4kmKKBQ6YqHRkiw+yfHs8YIDPRgGXi371 EOxDx5LsS++8k7VkK7WSp4mXu2xx3Yry51EaSVogt2s9Z2d9PAIIVwQs X-Gm-Gg: ASbGncvI5ViZtaZAxN0j7nz5LLlLgik/xmnt9MjsYc/N3PeshFxisNjoZS4vsU5CZiT xi/Jo6G/A6Ii+F+2IwAcGfVKCaJDDtkPjta0OiHPnBqXP4v6EuILUyOZk5gF4pzTL9/E727YsU6 sXj2lFqKSqmwekqc01l+1klXgou1h2n7eCHDu/1Ptzr2i4LJ2+N9sBpt56RBKa4L8urNv/Nk8fk EpBsrcb70xmsjknc+3cWcp8IyqXhUQAYxuEB/3nviVbr2YdtpBi5GMZHBdvUmRFZ1W/IriZ3rA/ VEHw/xhWrGBKOnJdCE8TX2QPbcD3XstZC57A+/nHdymgfizvY5Fu5zadQiTY235MzPP4X3oCwen Vm+PBYXgqHsCqT6rUbeo7NYbAOzUShFmAs6P1x4hHgDGfr4BJk0cNt+k61+i6ileZ7A1ECdWhzX Y0oBWUzoK39gDtxzsGeTF8RxHk5MsvTsXzs8VkYBu34yr5IlcNBOY1gx1FZDEO0sVzGUc= X-Google-Smtp-Source: AGHT+IGlh3CaKo66q0t/WA7R/9iHG6rR3lNisWg2UxowlWp92jlr5rECxCFCgWZq1RwhOh19sYOsUA== X-Received: by 2002:a05:690c:3690:b0:787:d4db:33be with SMTP id 00721157ae682-78a8b55fad4mr244374977b3.57.1764362561479; Fri, 28 Nov 2025 12:42:41 -0800 (PST) Received: from gmail.com (116.235.236.35.bc.googleusercontent.com. [35.236.235.116]) by smtp.gmail.com with UTF8SMTPSA id 00721157ae682-78ad0d3f5c8sm18737697b3.3.2025.11.28.12.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Nov 2025 12:42:40 -0800 (PST) Date: Fri, 28 Nov 2025 15:42:40 -0500 From: Willem de Bruijn To: Jakub Kicinski , davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, willemdebruijn.kernel@gmail.com, Jakub Kicinski , shuah@kernel.org, sdf@fomichev.me, linux-kselftest@vger.kernel.org Message-ID: In-Reply-To: <20251128005242.2604732-2-kuba@kernel.org> References: <20251128005242.2604732-1-kuba@kernel.org> <20251128005242.2604732-2-kuba@kernel.org> Subject: Re: [PATCH net-next 2/2] selftests: drv-net: gro: run the test against HW GRO and LRO Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Jakub Kicinski wrote: > Run the test against HW GRO and LRO. NICs I have pass the base cases. > Interestingly all are happy to build GROs larger than 64k. > > Signed-off-by: Jakub Kicinski Reviewed-by: Willem de Bruijn > --- > CC: shuah@kernel.org > CC: sdf@fomichev.me > CC: linux-kselftest@vger.kernel.org > --- > tools/testing/selftests/drivers/net/gro.py | 50 ++++++++++++++++------ > 1 file changed, 36 insertions(+), 14 deletions(-) > > diff --git a/tools/testing/selftests/drivers/net/gro.py b/tools/testing/selftests/drivers/net/gro.py > index 6d633bdc7e67..ea7070b033d4 100755 > --- a/tools/testing/selftests/drivers/net/gro.py > +++ b/tools/testing/selftests/drivers/net/gro.py > @@ -91,7 +91,7 @@ from lib.py import ksft_variants > defer(ethtool, " ".join(old), host=host) > > > -def _setup(cfg, test_name): > +def _setup(cfg, mode, test_name): > """ Setup hardware loopback mode for GRO testing. """ > > if not hasattr(cfg, "bin_remote"): > @@ -108,16 +108,37 @@ from lib.py import ksft_variants > _set_mtu_restore(cfg.dev, 4096, None) > _set_mtu_restore(cfg.remote_dev, 4096, cfg.remote) > > - flush_path = f"/sys/class/net/{cfg.ifname}/gro_flush_timeout" > - irq_path = f"/sys/class/net/{cfg.ifname}/napi_defer_hard_irqs" > + if mode == "sw": > + flush_path = f"/sys/class/net/{cfg.ifname}/gro_flush_timeout" > + irq_path = f"/sys/class/net/{cfg.ifname}/napi_defer_hard_irqs" > > - _write_defer_restore(cfg, flush_path, "200000", defer_undo=True) > - _write_defer_restore(cfg, irq_path, "10", defer_undo=True) > + _write_defer_restore(cfg, flush_path, "200000", defer_undo=True) > + _write_defer_restore(cfg, irq_path, "10", defer_undo=True) > > - _set_ethtool_feat(cfg.ifname, cfg.feat, > - {"generic-receive-offload": True, > - "rx-gro-hw": False, > - "large-receive-offload": False}) > + _set_ethtool_feat(cfg.ifname, cfg.feat, > + {"generic-receive-offload": True, > + "rx-gro-hw": False, > + "large-receive-offload": False}) > + elif mode == "hw": > + # The only way to get HW GRO but elide SW GRO is to install > + # a dummy XDP generic program. Disabling SW GRO as a feature > + # would also disable HW GRO. > + prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" > + ip(f"link set dev {cfg.ifname} xdpgeneric obj {prog} sec xdp") > + defer(ip, f"link set dev {cfg.ifname} xdpgeneric off") > + > + # Attaching XDP may change features, fetch the latest state > + feat = ethtool(f"-k {cfg.ifname}", json=True)[0] > + > + _set_ethtool_feat(cfg.ifname, feat, > + {"generic-receive-offload": True, > + "rx-gro-hw": True, > + "large-receive-offload": False}) > + elif mode == "lro": > + _set_ethtool_feat(cfg.ifname, cfg.feat, > + {"generic-receive-offload": False, So GRO off disables HW_GRO, but not LRO? That difference is behavior is confusing. Could we still see this as a regression and make the ethtool HW_GRO feature equally independent from SW_GRO? > + "rx-gro-hw": False, > + "large-receive-offload": True}) > > try: > # Disable TSO for local tests > @@ -132,19 +153,20 @@ from lib.py import ksft_variants > def _gro_variants(): > """Generator that yields all combinations of protocol and test types.""" > > - for protocol in ["ipv4", "ipv6", "ipip"]: > - for test_name in ["data", "ack", "flags", "tcp", "ip", "large"]: > - yield protocol, test_name > + for mode in ["sw", "hw", "lro"]: > + for protocol in ["ipv4", "ipv6", "ipip"]: > + for test_name in ["data", "ack", "flags", "tcp", "ip", "large"]: > + yield mode, protocol, test_name > > > @ksft_variants(_gro_variants()) > -def test(cfg, protocol, test_name): > +def test(cfg, mode, protocol, test_name): > """Run a single GRO test with retries.""" > > ipver = "6" if protocol[-1] == "6" else "4" > cfg.require_ipver(ipver) > > - _setup(cfg, test_name) > + _setup(cfg, mode, test_name) > > base_cmd_args = [ > f"--{protocol}", > -- > 2.51.1 >