Article View: linux.kernel.netdev
Article #20267Re: [PATCH net-next v4 2/6] net: mvneta: fix the removal of the mqprio offload
From: netdev-bot+sashiko
Date: Sat, 21 Nov 2026 23:02
Date: Sat, 21 Nov 2026 23:02
108 lines
11781 bytes
11781 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
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] After this patch, every all-zero mqprio teardown runs the full
device-wide reset in mvneta_setup_mqprio()…
--
net: mvneta: fix the removal of the mqprio offload
This patch changes mvneta_setup_mqprio() so that qopt.hw is checked only
when num_tc is non-zero. The all-zero teardown from
mqprio_disable_offload() can then reach the code that clears the RX prio
map, the per-queue rate limits and the netdev TC state.
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index c0abc843b1c1a..06b5453543a19 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -5251,11 +5251,12 @@ static int mvneta_setup_mqprio(struct net_device *dev,
> int rxq, txq, tc, ret;
> u8 num_tc;
>
> - if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS)
> - return 0;
> -
> num_tc = mqprio->qopt.num_tc;
>
> + /* On removal the qdisc passes an all-zero qopt, with hw 0 */
> + if (num_tc && mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS)
> + return 0;
> +
[Severity: Medium]
Can this wipe the configuration of a replacement qdisc? Since the hw
check is now skipped when num_tc == 0, every all-zero teardown goes on
to the device-wide reset further down in mvneta_setup_mqprio():
mvneta_clear_rx_prio_map(pp);
if (!num_tc) {
mvneta_disable_per_queue_rate_limit(pp);
netdev_reset_tc(dev);
return 0;
}
The teardown from mqprio_disable_offload() in net/sched/sch_mqprio.c is
an all-zero struct tc_mqprio_qopt_offload. It does not say which qdisc
instance it belongs to.
Take a replace under a new handle, for example:
tc qdisc replace dev eth2 root handle 200: mqprio ... hw 1
The calls then happen in this order:
qdisc_create()
mqprio_init()
mqprio_enable_offload()
mvneta_setup_mqprio(num_tc=N, hw=1) <- new config programmed
qdisc_graft()
rcu_assign_pointer(dev->qdisc, new ? : &noop_qdisc);
notify_and_destroy(old)
mqprio_destroy(old)
mqprio_disable_offload(old)
mvneta_setup_mqprio(num_tc=0) <- new config cleared
new->ops->attach(new) <- offload not reprogrammed
A software taprio replacement sets its TCs with netdev_set_num_tc() in
taprio_change() before the old offloaded mqprio is destroyed. The
netdev_reset_tc() above then undoes them.
In that case, would a new offloaded mqprio end up without its traffic
classes, its MVNETA_VLAN_PRIO_TO_RXQ mapping and its TX rate limits,
while its priv->hw_offload still reads 1? And would a taprio left
without TCs stop sending?
Before this patch, the early return on hw != TC_MQPRIO_HW_OFFLOAD_TCS
made this teardown a no-op, so the replacement kept its configuration.
The commit message describes this behaviour. The root cause looks like
it is in the qdisc core: it destroys the old qdisc after the new one is
set up, and its teardown does not name the qdisc.
Several other drivers reset the same way on num_tc == 0:
enetc_setup_tc_mqprio(), ocelot_port_mqprio(), am65_cpsw_setup_mqprio(),
dpaa_setup_tc(), dpaa2_eth_setup_mqprio() and bnx2x_setup_tc().
At the end of the series, mvneta_setup_mqprio() still does the full
reset for every num_tc == 0 call.
Would a proper fix need the core to identify the qdisc in the teardown
call, so the removal fix does not cause a regression on replace?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118093012.90121-1-pepe.schlehofer%40gmail.com
Technical Details
Message-ID:
<179530217303.3135.1162900771508007234@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368501-linux-kernel-netdev=dewy.ruReferences:
<20261118093012.90121-3-pepe.schlehofer@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368501-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 2/6] net: mvneta: fix the removal of the mqprio offload Date: Sat, 21 Nov 2026 23:02:53 +0000 Organization: Usenet Network Message-ID: <179530217303.3135.1162900771508007234@kernel.org> References: <20261118093012.90121-3-pepe.schlehofer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3516281"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:eoapUWlc0Q/YHO2yP9qtXpA6tqc= sha256:/8Kb6LSk+bPl6ZedQgXTycYzEUMJVU0Y0whjzFzvjgY= sha1:hjvMv0Mk/HMbyeGe6e56n70AlPM= sha256:lR+gLzTEz/3uet44au5w38PnSGOxo7KuiXK/RPHhRkY= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1960E115C1D; Sun, 22 Nov 2026 02:03:09 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x7Rcjx10rjO5; Sun, 22 Nov 2026 02:03:05 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-368501-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 5E7D0115C11; Sun, 22 Nov 2026 02:02:57 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 06C24316D9; Sat, 21 Nov 2026 23:02:56 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795302175; b=3FY6gm8euLie6QTEOsZYRVBk1pKjdoN5irDXvPqxrx41p5OCqaXPL3l9Cx41pWGH0TTv H7I27WvpL7A9Mo37LV7l11m9H0yWLo3Wxvrqg1Z18YMGCXJkChBbsS9ZMGTIWaNEVZl2c bFazf9XCpa62HpwcldqGA35ENxNNpgATLfnCO3sQXbnlpRoTWoHBNN5p+lRNQkcGOXz1j tVjl11tij1sqCjl3AiUkZYasdlc9yEDElvX+SgbV95I3kDbjjkcqvbKrZ3LQw4Xb0bdgb TU/QAB3Nexyb9Dzdd91skq6+Sr6fSPRRp9OQmColW0WEHDUw07JgYv5N6H8iXQEjoAg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302175; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=EiNrcz/ZXxZYdeBH1eFbaY3DbgX+3ZSe+NGOrjnHYG8=; b=oLd21L6Oa8X32X3Lui2oXcal3elg8yXRiLiE3QE5Alh40Rw6BL0oY5+GNGH680327JHe u6SfzU+DLuQspUGBQAKCyHHlVbN8PJ7gNJFDaEuiewXCMCi72w0rdDL+x93p6s3YIn5zB 0zoOaT7K77/PT9heue6iwAXGd+ZeieOpPaBU4ljvl65/s7t9AS4fM6e3XlwIb0pVIFtbf 1uten92U4cK4fGYUSdWyPdyWZgLbaJWkcMvnj2Uxj9FayabcfCUz3Is+b6Anmr1wOfsGY bA+vMQKOKC3g+lYCPrff5wMUGzGwvXz1aQ8Xv72jpFsst/crGFH9GgA1Qh5/lMFMZqg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=G0yoi6hx; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 601F8606A33C; Sat, 21 Nov 2026 23:02:55 +0000 (UTC) X-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=G0yoi6hx X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302174; b=Wq9ku0RMfVIAItoaHZLnF3nkjb2NJJlKbzOiHt51o6Oe2DPNXgfDpwSNjbtdfc/AZDJE J33oxQgyQCJS2DMlGTcsQE9G7I2a0sa2ivhdjEmsA3XGZJE9ECQvqlIGVp/LhSuftrPVL Jm3nnzF+F4HhyKbXXVAUabsta7nWRuS9wO+1InNuhB8qR+0KUUA/i9S3J1U35mRT7jg6f b6f+1YVfsF8xEKKUd34l5FDXc0+zUsyKTPEcAnb2Y7tmjx0wAE5dreRAuLHAREN7JXADT R/+zLRGgzADctHASVqAO7VJjosQgVORiijh2DdWWHadDlZy9Zkz5cIMB3pXoz1CL6Fw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302174; 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=EiNrcz/ZXxZYdeBH1eFbaY3DbgX+3ZSe+NGOrjnHYG8=; b=x45+GymNe3o3C2d/xkCNJh28Puia2fRT9bDSyQGJyzt2Z6pYewbReNGVE3z+0+2dwx1O CnhHneExGW92e3TkTQxXTNuOjVPJ0zHC0HRd0BEUJDd7YnIAlz8ZpdPGWEIkEAIbBgDAI 8zCMjbvkkV0eETSwnWxL9Pybe7vwb5EKjfWnhIe/khcpIrJf4Bvjfkbc40pnBtVDygGjd wG6Wm64DCTnc+uF3JuvuVwePb3aJo/SoKf2KHVAfzJjpPSKnvCjeYfzcbE0ER4dMCYLsv 4SOK3MI9ME7ivRadTqX+VJw7ZIJTMQwX3CD2XcEf+XLT/cINkQg6vQzSzvFAWpoj2Hg== X-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=G0yoi6hx; arc=none smtp.remote-ip=100.103.45.18 X-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 7E0C4606A32A; Sat, 21 Nov 2026 23:02:54 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76EE21F000C6; Sat, 21 Nov 2026 23:02:53 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795302174; bh=EiNrcz/ZXxZYdeBH1eFbaY3DbgX+3ZSe+NGOrjnHYG8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=G0yoi6hx0MOD6satKt+pgRDwxaQp79LhMqTfqOuQUf470Rzob/aqrm9s1uv8O93Cm jtod5Ys+LsiCyS28kNzGEJYFi69aMvklQ05KVlBADQsS/r4usbhYtbkw3XHPIbOc9L HFdnZ596bbgPqafC1ViCbLqDeYXRi89Y3aTGJaL7pRgvO395GnjtBS4MBieuF2fNSD 9AICf1Q9MZTgum6jIxn5Na1kUtCsvC2aCWEbEQw4wR5Hnizw48gOTUJ4D6WniWIeUJ fGj/degRcTWlyQ3ql79HbMOobO6xdgXRyyPW8/fW6PQ6CcF+koQjUjWaMYFJl11C1w V3MneLbP8n9pw== X-Cc: netdev@vger.kernel.org, marcin.s.wojtas@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, maxime.chevallier@bootlin.com, w@1wt.eu, linux-kernel@vger.kernel.org X-In-Reply-To: <20261118093012.90121-3-pepe.schlehofer@gmail.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list