From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796516593; b=CeoQK8LVa2ccat91mkbetCW4aWamnHTkQXpW7cJ6gWgBLtMGKST6HJUL5a+OBtzHDApq 3xiaFTUSv5iwMAp8w2EX1JsP+134nq24Vd2T85TyXL78KoMFveZ+Uj1iM6/GX2z8zuSy0 jnwUw8K3KjV/m4+Y0PRUp/tESE0xtXW7AXpQA0H9cTBI9Km2M8iar6zhR1e98j0x7T08R 83TeRXlOeeu3H3X2axhEa6d6nQWGN1ojpbNoEcuvE+dpnJKNfprSVIPrpVbRaSclAY1mJ clVrL/NjODbZ24n0UThNUtRodRe5POqCbeCEcsE7HuY8TBRilmPqDUs28Wf86ejibxg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796516593; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=TCdyNuYSZexrRgkhV18FHPRm+dx+AWDTZKnKD/vNTKo=; b=z7W/EbyXHa3N215k6vD3PPgqItApnR3fjSBMUrnj3eYgI0Tdccci8UQ5vB4s5DiolxeM 7ufLM11XJKRahS4zscpJkF20xkNthEUyp1n1143tQdNK7eunnguKFUj9EoawLVc/Jpmqe fwcNzxy+L9MnkMlh2QHKOkp6dFkzHebl0tc48DB+F1yTdHf8S9vRDt5Qn83UI/BooEf70 ngfGfOgUK4653rJOfWDvy2mY/F6/f+E5/e7BajMXdv+WhkOzUZBQyRs/frikEk1nTHiaL /xTVy7cj3kdrW2ikaHfRiPGtWf0PV4Ju3TZfI0hYQ+ydBGq2BVvYx0Tcfq4+/oLdgCg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Fp504yzS; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94223606A330; Sun, 6 Dec 2026 00:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Fp504yzS Received: by smtp.kernel.org (Postfix) with ESMTPSA id 957101F00A13; Sun, 6 Dec 2026 00:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796516593; bh=TCdyNuYSZexrRgkhV18FHPRm+dx+AWDTZKnKD/vNTKo=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Fp504yzSHV379R+f/qdUzZ4BuklTQvC77zC4Sv3kWxHQ1bds+o0cTRkBMXgHc1v82 IfAWSCkkjSasH/6qZGkCIBFNtXQs0svA82H0RTYHaGzefZW9r5ow/Qvz9oU5j84GO+ KY+X/LxXZ4K9Tuu9S8gsvi8jOgIrxPUq1K3gu8VFOn3Tt7nMGvSkwJERzACvrKLlmt M3ZnlQJJD3JrGyWBCJDlncQ7kg/9U/mkBXt6YNynQ8oJCNcFXGbwhFQN24bSaD9+v+ GNF20RSSMpspuFbZiZ3vTcKckpn4yIV5BHj7B/nE+bD0DRWygCmJ2829Y4gi3rtvSZ Cn27uOiU0kjcA== Subject: Re: [PATCH net v3 8/9] selftests: net: test TLS fallback after rerouting to an upper device From: netdev-bot+sashiko@kernel.org To: rjethwani@purestorage.com Cc: netdev@vger.kernel.org, stable@vger.kernel.org, john.fastabend@gmail.com, kuba@kernel.org, sd@queasysnail.net, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, alice.kernel@fastmail.im, tariqt@nvidia.com Date: Sun, 06 Dec 2026 00:23:12 +0000 Message-ID: <179651659216.3148.1788886959208565486@kernel.org> In-Reply-To: <20261204235642.36653-9-rjethwani@purestorage.com> References: <20261204235642.36653-9-rjethwani@purestorage.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 2 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] The cleanup in setup_macvlan() (tools/testing/selftests/drivers/net/hw/tls_hw_offload.py:839-840)… - [Low] main() (tools/testing/selftests/drivers/net/hw/tls_hw_offload.py:883-887)… - [Low] selftests: net: sysctl_set() duplicates ctl_file_write() and breaks on dots -- selftests: net: test TLS fallback after rerouting to an upper device This adds a TLS offload selftest case. It moves an established offloaded connection onto a macvlan upper of the same NIC in the middle of the echo, then checks that the resumed echo goes through the macvlan and matches the original data. It also adds CONFIG_MACVLAN to the hw selftest config. > diff --git a/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py b/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py > index 7d90f1c2024a1..e1382cee8dd13 100755 > --- a/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py > +++ b/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py [ ... ] > +def setup_macvlan(cfg): > + """Add a macvlan upper on the DUT NIC for the rest of the case. > + > + The peer may answer on either MAC, so set loose rp_filter on both. > + """ > + ip(f"link add {MACVLAN_IFNAME} link {cfg.ifname} type macvlan " > + "mode bridge") > + # Runs after the delete: make the peer drop the macvlan's MAC. > + defer(ip, f"neigh flush to {cfg.addr_v['4']}", host=cfg.remote) > + defer(ip, f"link del {MACVLAN_IFNAME}") [Severity: Medium] Can this deferred remote flush stall or time out, given that it needs the same path it is meant to repair? reroute_macvlan() adds the /32 route through tlsmv0 with the DUT's source address, then pings through it: ip(f"route add {peer}/32 dev {MACVLAN_IFNAME} src {cfg.addr_v['4']}") ... wait_reachable(MACVLAN_IFNAME, peer) The macvlan then broadcasts an ARP request. The sender IP is the DUT's IPv4 address and the sender MAC is the macvlan's. On the peer, arp_process() handles it with: n = neigh_event_ns(tbl, sha, &sip, dev); After that, the peer's entry for the DUT address points at the macvlan MAC. The resumed echo and the SSH traffic keep that entry REACHABLE. The defers run in reverse order: route del, the two rp_filter restores, link del tlsmv0, and only then the remote neigh flush. Deleting the macvlan removes its MAC from the NIC unicast filter. The peer, however, keeps sending to that MAC. The README.rst example uses REMOTE_ARGS=root@192.168.1.2 with REMOTE_V4=192.168.1.2, so the SSH connection runs between the test addresses. In that setup, the new ssh for the flush gets its SYN-ACKs sent to the deleted MAC, and they are dropped. This lasts until neighbour state recovers on its own, which can take tens of seconds. cmd() has a 20s default timeout. If this raises TimeoutExpired, ksft_flush_defer() sets KSFT_RESULT=False. That fails a run in which the test itself passed. If the ssh does succeed, the peer's entry has already been corrected, so the flush has no effect. There is also a second gap. Other hosts on the segment that already had an entry for the DUT address are updated to the macvlan MAC by the same broadcast request, through the "Update our ARP tables" path in arp_process(). Nothing flushes those entries. > + sysctl_set(f"net.ipv4.conf.{cfg.ifname}.rp_filter", 2) > + sysctl_set(f"net.ipv4.conf.{MACVLAN_IFNAME}.rp_filter", 2) > + ip(f"link set dev {MACVLAN_IFNAME} up") > + wait_carrier(MACVLAN_IFNAME) [Severity: Low] Is there a reason not to use ctl_file_write() here? tools/testing/selftests/net/lib/py/utils.py already provides it, and drivers/net/hw/lib/py/__init__.py re-exports it for the hw tests. Its docstring names sysctls as a target. It reads and writes the /proc/sys file directly from Python, skips the write when the value is already set, and defers restoring the old value. That is what sysctl_set() reimplements. The hand-rolled version also differs from it in two ways. First, it runs the sysctl binary through cmd(), but the case never calls cfg.require_cmd("sysctl"). On a minimal rootfs without procps, this raises FileNotFoundError from setup_macvlan() instead of skipping. check_tls_support() in this same file already handles a missing modprobe, so that kind of environment looks expected here. Second, setup_macvlan() builds the key with dots: net.ipv4.conf.{cfg.ifname}.rp_filter. sysctl treats dots as path separators. If cfg.ifname itself contains a dot, as a VLAN such as eth0.100 does, the name is split in the wrong place and the lookup fails with ENOENT. Passing /proc/sys/net/ipv4/conf//rp_filter to ctl_file_write() avoids both problems. Minor: the rp_filter restore deferred for tlsmv0 does nothing useful. The link del defer deletes the macvlan right after that restore runs. [ ... ] > @@ -800,6 +883,7 @@ def main() -> None: > # Flap the NIC last, so a slow retrain cannot fail later cases. > ksft_run([test_tls_offload, test_tls_offload_sizes, > test_tls_offload_record_type, test_tls_offload_bond, > + test_tls_offload_upper_reroute, > test_tls_offload_bond_bounce], args=(cfg, )) [Severity: Low] Doesn't this placement go against the comment just above the list? # Flap the NIC last, so a slow retrain cannot fail later cases. test_tls_offload_bond takes cfg.ifname down in setup_bond(). After that, restore_nic() waits for carrier only as a best effort: # Best effort: the next case waits for carrier itself. Before this patch, the next case was test_tls_offload_bond_bounce. Its wait_bond_ready() waits for carrier and calls wait_reachable() for the peer. The new case waits for carrier only indirectly, through wait_carrier(MACVLAN_IFNAME) in setup_macvlan(). It never checks that the peer is reachable over cfg.ifname before run_tls_test() starts the first half of the echo. If reachability lags carrier after the bond case's flap, could the new case fail for a reason that belongs to the previous case? Would listing test_tls_offload_upper_reroute before test_tls_offload_bond follow the documented order? The same placement is still there at the end of the series, where test_tls_offload_frag is also inserted before test_tls_offload_bond_bounce. > ksft_exit() > -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204235642.36653-1-rjethwani%40purestorage.com