net: mscc: ocelot: write full VLAN TCI in the injection header
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 1 Oct 2021 15:15:27 +0000 (18:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Oct 2021 13:15:57 +0000 (14:15 +0100)
The VLAN TCI contains more than the VLAN ID, it also has the VLAN PCP
and Drop Eligibility Indicator.

If the ocelot driver is going to write the VLAN header inside the DSA
tag, it could just as well write the entire TCI.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot.c
include/linux/dsa/ocelot.h

index 559177e..05c456d 100644 (file)
@@ -916,7 +916,7 @@ void ocelot_port_inject_frame(struct ocelot *ocelot, int port, int grp,
        ocelot_ifh_set_bypass(ifh, 1);
        ocelot_ifh_set_dest(ifh, BIT_ULL(port));
        ocelot_ifh_set_tag_type(ifh, IFH_TAG_TYPE_C);
-       ocelot_ifh_set_vid(ifh, skb_vlan_tag_get(skb));
+       ocelot_ifh_set_vlan_tci(ifh, skb_vlan_tag_get(skb));
        ocelot_ifh_set_rew_op(ifh, rew_op);
 
        for (i = 0; i < OCELOT_TAG_LEN / 4; i++)
index 435777a..0fe101e 100644 (file)
@@ -210,9 +210,9 @@ static inline void ocelot_ifh_set_tag_type(void *injection, u64 tag_type)
        packing(injection, &tag_type, 16, 16, OCELOT_TAG_LEN, PACK, 0);
 }
 
-static inline void ocelot_ifh_set_vid(void *injection, u64 vid)
+static inline void ocelot_ifh_set_vlan_tci(void *injection, u64 vlan_tci)
 {
-       packing(injection, &vid, 11, 0, OCELOT_TAG_LEN, PACK, 0);
+       packing(injection, &vlan_tci, 15, 0, OCELOT_TAG_LEN, PACK, 0);
 }
 
 #endif