Article View: linux.kernel.netdev
Article #25292Re: [PATCH net-next v2 2/2] net: dsa: realtek: rtl8365mb: offload ETS strict priority scheduling
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 13:26
Date: Tue, 01 Dec 2026 13:26
191 lines
15205 bytes
15205 bytes
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] In drivers/net/dsa/realtek/rtl83xx-qos.c,
rtl83xx_port_setup_tc() keeps only one ETS handle per port…
- [Low] rtl83xx_setup_tc_ets_replace() in
drivers/net/dsa/realtek/rtl83xx-qos.c accepts TC_ETS_REPLACE and…
- [Low] The commit body, which is the part that stays in git history
(everything after the first '---' is dropped by git am), describes the…
--
net: dsa: realtek: rtl8365mb: offload ETS strict priority scheduling
This commit adds ETS qdisc offload for rtl8365mb user ports. Installing
a root ETS qdisc with one strict band per queue switches the port from
the default equal-weight WFQ scheduler to strict priority. Deleting the
qdisc, or a refused offload, puts the port back on WFQ, and the priomap
is not offloaded.
> Offload the ETS qdisc so a user port can be switched from the WFQ
> default to strict priority. With WFQ (weighted fair queuing) the
> switch serves all queues of a port in turn, by their weights. By
> default the driver sets equal weights, so no queue is served before
> another. With strict priority a higher queue is always sent first.
> Deleting the qdisc puts the port back on WFQ.
[Severity: Low]
Is the last sentence accurate in all cases? With hw-tc-offload off,
ets_offload_destroy() returns early on !tc_can_offload(dev), so deleting
the qdisc leaves the port strict. The comment in the TC_ETS_DESTROY case
says so, but the commit body does not.
A few other user-visible details appear only in the Q&A below the ---
line, which git am drops:
rtl83xx_port_setup_tc() returns -EOPNOTSUPP for TC_ETS_STATS on purpose.
So qdisc_offload_dump_helper() never sets TCQ_F_OFFLOADED, even while
the QTYPE register is set to strict. Nothing reports whether the port
runs strict or WFQ.
If a replacement root qdisc fails after its REPLACE was accepted, the
port goes back to WFQ while the old strict qdisc stays root.
Could these details go into the commit message itself?
> diff --git a/drivers/net/dsa/realtek/rtl83xx-qos.c b/drivers/net/dsa/realtek/rtl83xx-qos.c
> index f294222987eff..d2b21521b6de4 100644
> --- a/drivers/net/dsa/realtek/rtl83xx-qos.c
> +++ b/drivers/net/dsa/realtek/rtl83xx-qos.c
[ ... ]
> @@ -208,3 +209,110 @@ int rtl83xx_port_set_apptrust(struct dsa_switch *ds, int port, const u8 *sel,
> ARRAY_SIZE(trust));
> }
> EXPORT_SYMBOL_NS_GPL(rtl83xx_port_set_apptrust, "REALTEK_DSA");
> +
> +static int
> +rtl83xx_setup_tc_ets_replace(struct dsa_switch *ds, int port,
> + struct tc_ets_qopt_offload_replace_params *p)
> +{
> + struct realtek_priv *priv = ds->priv;
> + unsigned int nq = ds->num_tx_queues;
> + int i;
> +
> + /* The qdisc must have one band per queue. */
> + if (p->bands != nq) {
[ ... ]
> + /* The switch does not use the priomap. */
> + return priv->ops->qos_set_port_sched(priv, port, nq, true);
> +}
[Severity: Low]
Should a non-default priomap be refused here, or programmed into the
switch?
rtl83xx_setup_tc_ets_replace() checks only p->bands and p->quanta[]. A
priomap that sends every skb->priority to a single band is accepted,
and the port still switches to strict priority based on the switch's
own traffic-type-to-queue map.
ksz_tc_ets_add() in drivers/net/dsa/microchip/ksz_common.c programs the
priomap into the switch's priority-to-queue map
(KSZ9477_PORT_MRI_TC_MAP__4). This chip has a per-port qmap
(rtl8365mb_qos_set_qmap_qid() and rtl8365mb_qos_set_port_qmap()) that
might do the same job.
The commit message documents this limitation, and the qdisc is never
reported as offloaded. The hardware scheduler still changes, though.
> +
> +/* Forget the offloaded ETS qdisc of @port and put the port back on WFQ */
> +static int rtl83xx_setup_tc_ets_restore_wfq(struct dsa_switch *ds, int port)
> +{
> + struct realtek_priv *priv = ds->priv;
> + int ret;
> +
> + priv->ets_handle[port] = 0;
[ ... ]
> + switch (ets->command) {
> + case TC_ETS_REPLACE:
> + /* sch_ets keeps the qdisc when the offload fails. Put the
> + * port back on WFQ so an earlier strict setup does not stay
> + * active.
> + */
> + ret = rtl83xx_setup_tc_ets_replace(ds, port,
> + &ets->replace_params);
> + if (ret) {
> + rtl83xx_setup_tc_ets_restore_wfq(ds, port);
> + return ret;
> + }
> +
> + priv->ets_handle[port] = ets->handle;
> +
> + return 0;
> +
> + case TC_ETS_DESTROY:
> + /* sch_ets offloads a new root qdisc before it destroys the
> + * old one. Put the port back on WFQ only when DESTROY carries
> + * the handle that was offloaded last. The new qdisc can fail
> + * after the driver has offloaded it, for example in its rate
> + * estimator. In that case qdisc_create() destroys the new
> + * qdisc. Its DESTROY carries the handle offloaded last, so the
> + * port goes back to WFQ. The old qdisc keeps running in
> + * software.
> + *
> + * With hw-tc-offload off, sch_ets sends no DESTROY, so the
> + * port stays strict.
> + */
> + if (ets->handle != priv->ets_handle[port])
> + return 0;
> +
> + return rtl83xx_setup_tc_ets_restore_wfq(ds, port);
[Severity: Medium]
Can this leave the port on WFQ while an accepted all-strict root qdisc
is still installed?
Only one handle is tracked per port. So a DESTROY for a new qdisc that
failed after its REPLACE looks the same as a delete of the active
qdisc.
Consider this sequence:
1. Root ETS qdisc 1: with nq strict bands is offloaded. The port is
strict and ets_handle[port] = 1:.
2. tc qdisc replace dev lanX root handle 2: ets bands N strict N ...
3. qdisc_create()->ets_qdisc_init()->ets_qdisc_change()->
ets_offload_change() sends TC_ETS_REPLACE for 2:, which is
accepted, and ets_handle[port] = 2:.
4. qdisc_create() then fails in gen_new_estimator() for TCA_RATE, or
qdisc_graft() fails in tc_modify_qdisc() and calls qdisc_put(q).
5. ets_qdisc_destroy()->ets_offload_destroy() sends TC_ETS_DESTROY
for 2:. That matches ets_handle[port], so
rtl83xx_setup_tc_ets_restore_wfq() clears the handle and writes
WFQ.
The tc command fails and qdisc 1: stays root, but the port now runs
WFQ. Nothing sends the REPLACE for 1: again. A later DESTROY for 1: no
longer matches the cleared handle, so it is ignored.
The comment above describes this outcome. Could the driver remember
the previously offloaded handle and put the port back to strict here?
The two cases look different from the driver's side. On a successful
replace, the old qdisc's DESTROY arrives after the new REPLACE. On a
failed replace, the new qdisc's DESTROY arrives and the old qdisc is
never destroyed.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-rtl8365mb-ets-strict-v2-0-9639f6f40499%40pengutronix.de
Technical Details
Message-ID:
<179613157942.3146.15452909686182465491@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-375109-linux-kernel-netdev=dewy.ruReferences:
<20261130-rtl8365mb-ets-strict-v2-2-9639f6f40499@pengutronix.de>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-375109-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 2/2] net: dsa: realtek: rtl8365mb: offload ETS strict priority scheduling Date: Tue, 01 Dec 2026 13:26:19 +0000 Organization: Usenet Network Message-ID: <179613157942.3146.15452909686182465491@kernel.org> References: <20261130-rtl8365mb-ets-strict-v2-2-9639f6f40499@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1721536"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:hSFl4UZW22DYELRpv04D0tHjsg4= sha256:KJnf+Z7BBp4pW/AfUietKi4vcj78cZTAppeHhgQUFJw= sha1:3OC10+PUdS3FyvpEZZHXobNbQJA= sha256:H4l7+NvidI8eZexjO+T2f5bJxvW0lmRImDArlBMuJDI= 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 DC7C31173B8; Tue, 1 Dec 2026 16:26:47 +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 lD7c9vjtvU7k; Tue, 1 Dec 2026 16:26:40 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375109-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id C1A371173B0; Tue, 1 Dec 2026 16:26:31 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 99A4C32852; Tue, 1 Dec 2026 13:26:27 +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=1796131587; b=hnQDwiZubP++nc/NvNhlmrYh/7Dp2TWZk3+qBvhfWBE7gfXx/Bcg0yWN2zsECjM6/mSZ L6Hbo1x+oLb8ILaWwksTZwjizNC8SgKeKyF/mojgW75e+imtYLSg459FtjUTPp539zPYg yMDGcf5KxELg+Vh+XfwhmKl7D+8LgRUhIT7YLnc03Ey6AQXaICmcE5RVRkAnANTjlmYru 0ToOMxLCbzwUABAnOprSFaY4h5yVfgFexHoKalU5LgDjUVmE/YC92EWT7c4rOpzrxnzJB 0kl6R5Zzsk4tWguDowdZM0dwmmU3yibduYt8t2JLOongNAEViW+Fij6O5mU4w8LpSSg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131587; 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=KS96HcN0cp6Ak3rpHZGQ2zHtHCULt+6KccFteCRwYAs=; b=Zfo9myhwQc4B8vAG06ghwxfLmNS1cYY3kVWX6IQpoG6vAoMWbpFwtG2qopsk7MW2iWaV DojeLKDvkirzOZjURf0Oau4ZY5nr6DxT4pRy5VTH44pishOdx0Jgy/TCyVqOpolxz+IUa 33xn/0tqO/HyQkhE+YPakE2g/zXnC501NqljwYYjOxLUlUKy26/9bdwezBKpAogHx63jG wkXUOkQ5Tsnv5uUqustCitA7JufbtOoprYWw/lfoXueXg/rtOVCtAg1RkGiJc6HAF1OFZ UU+ItXiXIA0wyroV8d3GPSQ8JcqOgkPhRnpOaOInKnhJ7H34Fdz+O/eWM2ifUI447Ug== 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=NYzCQwN7; 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 57157606A32A; Tue, 1 Dec 2026 13:26:27 +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=NYzCQwN7 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=1796131581; b=MNx3LAGwtQTfAbVQvApNa+v5tHlPayIn0dC9ZjyaMRtXVEntkPrjbTt0J60Pgav4Snpd dk8De5MPquJBHtLdHJTIgg9g1VWfBEdotDEhSkQRepR1DnphX/Guv2Gw0uTDYfFu22zUv 8O7X2ZGHzFChxMVxYOCl+u207TxspKDb5zTtoqiHNvZjhT4NFoSMv7hGfua/CxIpf+ZrR KUYw1kGvqcOh1kbytk+GvTR/z9x1ObDIat4wpAu+edQmoqklso7n3yD87RbwY68hHmxbP pOMQsQ79QV1FwA6Kq+/VqSOttcS1ElGyDaoWfnwpxRCQ8RkHeygR0shPFB/5yGTDhNA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131581; 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=KS96HcN0cp6Ak3rpHZGQ2zHtHCULt+6KccFteCRwYAs=; b=OrRrUT2X7pFOBouO4ncVpV22k7tbntnXnEAwRWoO8C+byVNf9nVEPFZCK/UYV5Bd7kHJ EztdgsrldM/PIAUF2uzMok1aPezLe8zdJnaQJtTyCzeWgIBUm6vCKqh9gNGxnZP7u+L1F CjEFDqTU+RdtmBVD3OS/tnOEZ5RU+kRatzfzEG9Ay9VbMYWj1/osteCLuY43W4fROo0+K 0RycQACjzdjnWkDjVGBg4IHtxsbAOfhV2zKXRMvCybrUJkFdUDCBu0+ru6Thd/L6IW1d8 vA4KJm/Ew4GyYXxuYLzR2u0fMcquGDsD0ZS1Tke38pCWsZrQ6K9w7YC/JsIhY3i3I5g== 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=NYzCQwN7; 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 71DD5606A31A; Tue, 1 Dec 2026 13:26:21 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4F771F0089A; Tue, 1 Dec 2026 13:26:19 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796131580; bh=KS96HcN0cp6Ak3rpHZGQ2zHtHCULt+6KccFteCRwYAs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=NYzCQwN7HDhqg22CyfogoQgtpvFi4djiiBy4ApdxD+tZNTklzveMVwnecpoiKbFU4 3SnSUvrFHon/Jevo2gtKMACrstd6QicK//v9XQPxAHeO2g5bDcuN+AAVhviuQUEPgJ ujybgYSi/JcvHrrGMDWBgUvF4YMbi+CW4hYDxu/Jz03kWBRLIeh852jAPkY0X4WQIS dGHKiPo17lZ1/Z8l5ZQeAG9jjzWezV7BOFqahS9aGDKkqbIirUZulIIMa0S/kgjAB7 WDhTawCSafd7TBinrIGl6RlU8Q45dpl/q8wpi3+jCeSZarsT8W4mLIARn6vMLpADUF +mCNQv0MsAKOQ== X-Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, linusw@kernel.org, luizluca@gmail.com, andrew@lunn.ch, olteanv@gmail.com, alvin.sipraga@analog.com, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de X-In-Reply-To: <20261130-rtl8365mb-ets-strict-v2-2-9639f6f40499@pengutronix.de> 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