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=1796429735; b=IFQCFML1sRBjMGzbFwsNR/Ou8S+0xnTJrXHKOFsQoXKQZDOsscDvZGlVb+wzhsw7rydv usE3js1x9WR5qvxlFKk6xRLlT3748MEgh0OWNP0Co/Jj4gHKppl9/fWw4c0jahRoLLEaz Wb3TL+PWS/wsIJ0d5IraRIic/zkcVD1jkuKJCA4rzclSg/oDr2lb1wyWF0qWSDBKGE9ka Z1Rn28zr/SH/dEjcgExPkXosvm1pa+JGWyim4KZmJHC5+FhCr++SwRVfa23iIY41/15GR GI9dE2mHzfgp/Hko9X/Jf8KLwGrfpUDX93qGVttav2UOBeZEy61IM+YZZpXwdtrcLmg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796429735; 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=eZH3FHFIfUj4Dlsu0KTmC192PS5Tyuq72meMwqv/094=; b=xvc65HXmRAb+/tZSeio7u+z4qwnAiAziIsgyKcCxfGRMtKfrBlgAQARujkHlvBzuPW0Z YSn6EKv5w9JS/KmfbhyDW/8sFpmlAvpl58YpLZW20G2dHf0eYaAFD1nljZK4A0tO3cO4m sPECoav49FjZNY0FMrf8pIKf/9Do0lK5QKj4iXuxJ98cY/uH3/KpwyNDCGC1MwUtl6DfO V3s2Yv63i2ZVuT+G+SvRXa+0Y9ARNSGV+8pic++Alt6xCasRZ27BbWIUoEIf8hkJwGYCb EILpt82LRY/ILb3G/Gx2mJQEE3lb7CmPpA0vhSw2qNZkTTuF6T1Ey82mjotJJdSplGA== 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=iVTWqqbP; 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 D6E43606A33D; Sat, 5 Dec 2026 00:15:35 +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=iVTWqqbP Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EFAC1F00A18; Sat, 5 Dec 2026 00:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796429735; bh=eZH3FHFIfUj4Dlsu0KTmC192PS5Tyuq72meMwqv/094=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=iVTWqqbPdGv4plNEFnuAqdtt/KnawaIqZlBecGQipJ2Dryg1WIh7DxHLcKQYzZPEe eNzGIorot/7w3hq/NY0iLMylCg9ufM2Ir7u8lYCMFfS032++8adR9bCHUgdgwNvvST JDXF9BKH7t24Z9M58EhZLsuJN9Jwpk5qodBdA1+9neX16gnPUP0CgQw2WwY08Q5OEJ SYkbWZxFfhLk1GAxoPpA0vLWeF7JGsb7F6ZwmOMpTx6/9WqgtTFLNO1CWUbNwODocZ o3026ct6zZMPFTGhyueJON/m2TE9IewrADqNJ8bd59GS+Bp8qPPOGSIyzEBlcbgKOE dCByxyDPMBlEw== Subject: Re: [PATCH net-next 09/11] selftests: drv-net: tc_flower_police: Test policing across reconfiguration From: netdev-bot+sashiko@kernel.org To: mohsin.bashr@gmail.com Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 05 Dec 2026 00:15:34 +0000 Message-ID: <179642973473.3146.8383978706124841606@kernel.org> In-Reply-To: <20261204000521.3396802-10-mohsin.bashr@gmail.com> References: <20261204000521.3396802-10-mohsin.bashr@gmail.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 4 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 3 · Low: 1 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] police_channels() and police_ring_size() in tools/testing/selftests/drivers/net/hw/tc_flower_police.py lack… - [Medium] police_ring_size() requests new = cur*2 (or cur//2 if doubling would exceed rx-max). - [Medium] selftests: drv-net: premature defer() in police_channels()/police_ring_size() - [Low] The attribution tags conflict with the author field. -- selftests: drv-net: tc_flower_police: Test policing across reconfiguration This adds tests to tc_flower_police.py that check a flower police rule keeps limiting traffic across a channel count change, an RX ring size change and a link flap. It also checks that a rule added while the link is down takes effect once the link comes back up. > Signed-off-by: Jakub Kicinski > Signed-off-by: Mohsin Bashir [Severity: Low] Is a Co-developed-by: Jakub Kicinski tag missing here? The Author line says Mohsin Bashir, but the first Signed-off-by is Jakub's. Documentation/process/submitting-patches.rst says the first SoB entry signals primary authorship. It also says co-authors get a Co-developed-by: tag immediately followed by their Signed-off-by. As written, the trailers make Jakub look like the primary author, but the From: line names someone else. The other tc_flower_police commits in the series use the same pattern. > diff --git a/tools/testing/selftests/drivers/net/hw/tc_flower_police.py b/tools/testing/selftests/drivers/net/hw/tc_flower_police.py > index 73162c31bd59a..368882984411a 100755 > --- a/tools/testing/selftests/drivers/net/hw/tc_flower_police.py > +++ b/tools/testing/selftests/drivers/net/hw/tc_flower_police.py [ ... ] > @@ -495,9 +495,139 @@ def police_delete(cfg): > _check_unpoliced(got, RATE_MBIT, "after delete") > > > +def police_channels(cfg): > + """ > + Check that a police rule keeps working after the channel count changes. > + """ [ ... ] > + defer(wait_file, f"/sys/class/net/{cfg.ifname}/carrier", > + lambda x: x.strip() == "1", deadline=30) > + defer(cfg.ethnl.channels_set, ehdr | {"combined-count": cnt}) > + try: > + cfg.ethnl.channels_set(ehdr | {"combined-count": new}) > + except NlError as ex: > + raise KsftSkipEx(f"Cannot change the channel count to {new}: " > + f"{ex}") from ex > + wait_file(f"/sys/class/net/{cfg.ifname}/carrier", > + lambda x: x.strip() == "1", deadline=30) [Severity: Medium] Is the restore deferred too early here? The carrier wait and the channels_set() restore are both queued before channels_set(new) has succeeded. Take a driver that implements get_channels but not set_channels. The channels_get() above succeeds. The set then fails with -EOPNOTSUPP from ethnl_set_channels_validate(), and the except branch raises KsftSkipEx. When ksft_run() handles the skip, it flushes the defer queue. The restore to the unchanged cnt also goes through ethnl_default_set_doit(). There, set_validate() runs before ethnl_set_channels() can notice that nothing changed, so the restore fails with -EOPNOTSUPP again. ksft_flush_defer() catches that NlError, prints a Defer Exception traceback and sets KSFT_RESULT = False. The case is reported as a skip, but the whole run exits non-zero. police_ring_size() has the same problem with rings_set() and ethnl_set_rings_validate() when set_ringparam is missing. This is reachable on real hardware. enetc, am65-cpsw and ef100 all offload flower police and have the get callback without the matching set one. On those devices, what the commit message describes as a clean skip turns into a failed run. Would it work to register both defer() calls only after the try/except block, once the new value has actually been applied? [Severity: Medium] Should police_channels() and police_ring_size() be marked @ksft_disruptive? After channels_set() or rings_set(), both tests wait up to 30 seconds for carrier to come back. They wait again in the deferred restore, so they expect the link to drop. tools/testing/selftests/drivers/net/README.rst says: All tests which may disconnect NETIF must be annotated with @ksft_disruptive. This patch does mark police_link_flap() and police_add_while_down(). With DISRUPTIVE=False, these two tests still run. They can drop carrier on the interface used to reach the remote, for up to 30 seconds per step. If the NIC does not come back, wouldn't both the remote session and the deferred restore be lost? > + ksft_eq(cfg.ethnl.channels_get(ehdr)["combined-count"], new, > + "Combined channel count") > + got = _iperf3(cfg, dst, OFFERED_MBIT) > + _check_rate(got, RATE_MBIT, "after channel change") > + > + > +def police_ring_size(cfg): > + """ > + Check that a police rule keeps working after the RX ring size changes. > + """ [ ... ] > + cur = rings["rx"] > + new = cur * 2 if cur * 2 <= rings["rx-max"] else cur // 2 > + if not new: > + raise KsftSkipEx("Cannot change the RX ring size") [ ... ] > + wait_file(f"/sys/class/net/{cfg.ifname}/carrier", > + lambda x: x.strip() == "1", deadline=30) > + ksft_eq(cfg.ethnl.rings_get(ehdr)["rx"], new, "RX ring size") [Severity: Medium] Can this exact comparison fail on drivers that round the requested ring size instead of rejecting it? octeontx2 offloads flower police (FLOW_ACTION_POLICE in otx2_tc.c), and otx2_set_ringparam() only allows 16*4^n sizes: drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c:otx2_set_ringparam() { ... rx_count = Q_COUNT(Q_SIZE(rx_count, 3)); ... } Take a 256 entry ring. Doubling it requests 512, the driver rounds that up to 1024, and rings_get() reports 1024. ksft_eq() then fails even though the resize and the policing both worked. ice_set_ringparam() also rounds silently: new_rx_cnt = ALIGN(ring->rx_pending, ICE_REQ_DESC_MULTIPLE); An E810 ring at its 8160 maximum would request 4080 and read back 4096. ice does not offload police today, so this case is not reachable yet. Would it be enough to check that the reported size differs from cur, or to use the value read back for the later checks? > + got = _iperf3(cfg, dst, OFFERED_MBIT) > + _check_rate(got, RATE_MBIT, "after ring resize") [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204000521.3396802-1-mohsin.bashr%40gmail.com