summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-10-02 16:15:57 +0300
committerDavid S. Miller <davem@davemloft.net>2021-10-02 16:15:57 +0300
commitfa8274b788a3766c299a3172d4f5416e574ec42d (patch)
tree62942bf9fe56ab22b1800e8e8f1586a79fd76479 /include
parentf533bc14e21a0941b5b878ce5dda90cae65e81c3 (diff)
parent434ef35095d6d9da013d4d8f3777ffd99cce699a (diff)
downloadlinux-fa8274b788a3766c299a3172d4f5416e574ec42d.tar.xz
Merge branch 'ocelot-vlan'
Vladimir Oltean says: ==================== Egress VLAN modification using VCAP ES0 on Ocelot switches This patch set adds support for modifying a VLAN ID at the egress stage of Ocelot/Felix switch ports. It is useful for replicating a packet on multiple ports, and each egress port sends it using a different VLAN ID. Tested by rewriting the VLAN ID of both (a) packets injected from the CPU port (b) packets received from an external station on a front-facing port Adding a selftest to make sure it doesn't bit-rot, and if it does, that it can be traced back easily. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dsa/ocelot.h4
-rw-r--r--include/soc/mscc/ocelot_vcap.h10
2 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/dsa/ocelot.h b/include/linux/dsa/ocelot.h
index 435777a0073c..0fe101e8e190 100644
--- a/include/linux/dsa/ocelot.h
+++ b/include/linux/dsa/ocelot.h
@@ -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
diff --git a/include/soc/mscc/ocelot_vcap.h b/include/soc/mscc/ocelot_vcap.h
index 25fd525aaf92..d45608fc4baf 100644
--- a/include/soc/mscc/ocelot_vcap.h
+++ b/include/soc/mscc/ocelot_vcap.h
@@ -576,6 +576,16 @@ enum ocelot_mask_mode {
OCELOT_MASK_MODE_REDIRECT,
};
+enum ocelot_es0_vid_sel {
+ OCELOT_ES0_VID_PLUS_CLASSIFIED_VID = 0,
+ OCELOT_ES0_VID = 1,
+};
+
+enum ocelot_es0_pcp_sel {
+ OCELOT_CLASSIFIED_PCP = 0,
+ OCELOT_ES0_PCP = 1,
+};
+
enum ocelot_es0_tag {
OCELOT_NO_ES0_TAG,
OCELOT_ES0_TAG,