mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-03 23:37:40 -04:00
net: dsa: tag_yt921x: add priority support
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> Link: https://patch.msgid.link/20260131021854.3405036-3-mmyangfl@gmail.com Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user