]> Gentwo Git Trees - linux/.git/commitdiff
net: dsa: tag_qca: use the dsa_xmit_port_mask() helper
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 27 Nov 2025 12:08:56 +0000 (14:08 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 29 Nov 2025 04:03:40 +0000 (20:03 -0800)
The "qca" tagging protocol populates a bit mask for the TX ports, so we
can use dsa_xmit_port_mask() to centralize the decision of how to set
that field.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251127120902.292555-10-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/tag_qca.c

index 0cf61286b426afbf220dea1b33a1041f76d13924..6d56a28c914c5bb4632dbf41de833767fa5c2881 100644 (file)
@@ -14,7 +14,6 @@
 
 static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       struct dsa_port *dp = dsa_user_to_port(dev);
        __be16 *phdr;
        u16 hdr;
 
@@ -26,7 +25,7 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Set the version field, and set destination port information */
        hdr = FIELD_PREP(QCA_HDR_XMIT_VERSION, QCA_HDR_VERSION);
        hdr |= QCA_HDR_XMIT_FROM_CPU;
-       hdr |= FIELD_PREP(QCA_HDR_XMIT_DP_BIT, BIT(dp->index));
+       hdr |= FIELD_PREP(QCA_HDR_XMIT_DP_BIT, dsa_xmit_port_mask(skb, dev));
 
        *phdr = htons(hdr);