mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01: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:
parent
a63daf73a5
commit
8cdb2cc9a1
1 changed files with 5 additions and 1 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue