From: David Yang <mmyangfl@gmail.com>
To: netdev@vger.kernel.org
Cc: David Yang <mmyangfl@gmail.com>, Andrew Lunn <andrew@lunn.ch>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Russell King <linux@armlinux.org.uk>,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next v6 2/5] net: dsa: tag_yt921x: add priority support
Date: Sat, 31 Jan 2026 10:18:48 +0800 [thread overview]
Message-ID: <20260131021854.3405036-3-mmyangfl@gmail.com> (raw)
In-Reply-To: <20260131021854.3405036-1-mmyangfl@gmail.com>
Required by DCB/QoS support of the switch driver, since the rx packets
will have non-zero priorities.
Signed-off-by: David Yang <mmyangfl@gmail.com>
---
net/dsa/tag_yt921x.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/dsa/tag_yt921x.c b/net/dsa/tag_yt921x.c
index 098863d491ff..aefef8c770e3 100644
--- a/net/dsa/tag_yt921x.c
+++ b/net/dsa/tag_yt921x.c
@@ -69,7 +69,9 @@ yt921x_tag_xmit(struct sk_buff *skb, struct net_device *netdev)
tag[0] = htons(ETH_P_YT921X);
/* VLAN tag unrelated when TX */
tag[1] = 0;
- tag[2] = 0;
+ ctrl = YT921X_TAG_CODE(YT921X_TAG_CODE_FORWARD) | YT921X_TAG_CODE_EN |
+ YT921X_TAG_PRIO(skb->priority);
+ tag[2] = htons(ctrl);
ctrl = YT921X_TAG_TX_PORTS(dsa_xmit_port_mask(skb, netdev)) |
YT921X_TAG_PORT_EN;
tag[3] = htons(ctrl);
@@ -112,6 +114,8 @@ yt921x_tag_rcv(struct sk_buff *skb, struct net_device *netdev)
return NULL;
}
+ skb->priority = FIELD_GET(YT921X_TAG_PRIO_M, rx);
+
if (!(rx & YT921X_TAG_CODE_EN)) {
dev_warn_ratelimited(&netdev->dev,
"Tag code not enabled in rx packet\n");
--
2.51.0
next prev parent reply other threads:[~2026-01-31 2:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-31 2:18 [PATCH net-next v6 0/5] net: dsa: yt921x: Add DCB/QoS support David Yang
2026-01-31 2:18 ` [PATCH net-next v6 1/5] net: dsa: tag_yt921x: clarify priority and code fields David Yang
2026-01-31 2:18 ` David Yang [this message]
2026-01-31 2:18 ` [PATCH net-next v6 3/5] net: dsa: yt921x: Refactor VLAN awareness setting David Yang
2026-01-31 2:18 ` [PATCH net-next v6 4/5] net: dsa: yt921x: Refactor yt921x_chip_setup() David Yang
2026-01-31 2:18 ` [PATCH net-next v6 5/5] net: dsa: yt921x: Add DCB/QoS support David Yang
2026-02-02 13:10 ` Vladimir Oltean
2026-02-03 2:18 ` David Yang
2026-02-03 13:14 ` [PATCH net-next v6 0/5] " Vladimir Oltean
2026-02-03 14:20 ` patchwork-bot+netdevbpf
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=20260131021854.3405036-3-mmyangfl@gmail.com \
--to=mmyangfl@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--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