From: netdev-bot+sashiko@kernel.org
To: mmyangfl@gmail.com
Cc: netdev@vger.kernel.org, andrew@lunn.ch, olteanv@gmail.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, linux@armlinux.org.uk,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 5/5] net: dsa: motorcomm: Add TC prio support
Date: Mon, 05 Oct 2026 21:16:23 +0000 [thread overview]
Message-ID: <179123498388.434549.1033733684417706688@kernel.org> (raw)
In-Reply-To: <20261001204851.2576101-6-mmyangfl@gmail.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The new comment in yt921x_acl_rule_ext_parse_flow()
(drivers/net/dsa/motorcomm/tc.c) says "map 1...U16_MAX to (ACL_ORD_NUM…
--
net: dsa: motorcomm: Add TC prio support
This commit maps TC flower priorities onto the hardware ACL order field.
TC priorities that are multiples of (U16_MAX + 1) / YT921X_ACL_ORD_NUM are
scaled down. 65535 maps to order 0, and every other value is rejected.
> diff --git a/drivers/net/dsa/motorcomm/tc.c b/drivers/net/dsa/motorcomm/tc.c
> index 95ed0f245b1fa..c5581e85208f3 100644
> --- a/drivers/net/dsa/motorcomm/tc.c
> +++ b/drivers/net/dsa/motorcomm/tc.c
[ ... ]
> @@ -1042,6 +1045,20 @@ yt921x_acl_rule_ext_parse_flow(struct yt921x_acl_rule_ext *ruleext, int port,
> return -EOPNOTSUPP;
> }
>
> + /* TC prio can't be 0 & TC lowest first -> HW highest first
> + * map 1...U16_MAX to (ACL_ORD_NUM - 1)...0
> + */
[Severity: Low]
This isn't a bug, but the comment doesn't match what the code below
does.
With scale = 65536 / 512 = 128, the only values accepted are:
prio == k * 128 (k = 1..511) -> ord = 512 - k
prio == 65535 -> ord = 0
The other values in 1...U16_MAX are rejected with -EOPNOTSUPP. That
includes prio 1, which is where the comment says the range starts.
Ord 511 comes from prio 128, not prio 1.
Could the comment describe the discrete mapping instead, in line with
the extack message "must be a multiple of %u or 65535"?
> + if (prio == U16_MAX) {
> + ord = 0;
> + } else if (!(prio % scale)) {
> + ord = YT921X_ACL_ORD_NUM - prio / scale;
> + } else {
> + NL_SET_ERR_MSG_FMT_MOD(extack,
> + "Invalid priority %u, must be a multiple of %u or 65535",
> + prio, scale);
> + return -EOPNOTSUPP;
> + }
> +
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261001204851.2576101-1-mmyangfl%40gmail.com
prev parent reply other threads:[~2026-10-05 21:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 20:48 [PATCH net-next v2 0/5] net: dsa: motorcomm: TC offload follow-ups David Yang
2026-10-01 20:48 ` [PATCH net-next v2 1/5] net: dsa: motorcomm: Hoist type casting helper into chip.h David Yang
2026-10-04 14:00 ` Andrew Lunn
2026-10-01 20:48 ` [PATCH net-next v2 2/5] net: dsa: motorcomm: Split TC module David Yang
2026-10-04 14:02 ` Andrew Lunn
2026-10-01 20:48 ` [PATCH net-next v2 3/5] net: dsa: motorcomm: Use NSEC_PER_SEC David Yang
2026-10-04 14:02 ` Andrew Lunn
2026-10-01 20:48 ` [PATCH net-next v2 4/5] net: dsa: motorcomm: Enable ACL on demand David Yang
2026-10-04 14:06 ` Andrew Lunn
2026-10-05 21:16 ` netdev-bot+sashiko
2026-10-01 20:48 ` [PATCH net-next v2 5/5] net: dsa: motorcomm: Add TC prio support David Yang
2026-10-04 14:13 ` Andrew Lunn
2026-10-05 21:16 ` netdev-bot+sashiko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179123498388.434549.1033733684417706688@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®