Commit ba0696c2 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: dsa: bcm_sf2: Add support for IPv6 CFP rules

Inserting IPv6 CFP rules complicates the code a little bit in that we
need to insert two rules side by side and chain them to match a full
IPv6 tuple (src, dst IPv6 + port + protocol).
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4daa70cf
...@@ -1067,6 +1067,7 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) ...@@ -1067,6 +1067,7 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
* permanently used * permanently used
*/ */
set_bit(0, priv->cfp.used); set_bit(0, priv->cfp.used);
set_bit(0, priv->cfp.unique);
bcm_sf2_identify_ports(priv, dn->child); bcm_sf2_identify_ports(priv, dn->child);
......
...@@ -54,6 +54,7 @@ struct bcm_sf2_cfp_priv { ...@@ -54,6 +54,7 @@ struct bcm_sf2_cfp_priv {
/* Mutex protecting concurrent accesses to the CFP registers */ /* Mutex protecting concurrent accesses to the CFP registers */
struct mutex lock; struct mutex lock;
DECLARE_BITMAP(used, CFP_NUM_RULES); DECLARE_BITMAP(used, CFP_NUM_RULES);
DECLARE_BITMAP(unique, CFP_NUM_RULES);
unsigned int rules_cnt; unsigned int rules_cnt;
}; };
......
This diff is collapsed.
...@@ -313,6 +313,7 @@ enum bcm_sf2_reg_offs { ...@@ -313,6 +313,7 @@ enum bcm_sf2_reg_offs {
#define SLICE_VALID 3 #define SLICE_VALID 3
#define SLICE_NUM_SHIFT 2 #define SLICE_NUM_SHIFT 2
#define SLICE_NUM(x) ((x) << SLICE_NUM_SHIFT) #define SLICE_NUM(x) ((x) << SLICE_NUM_SHIFT)
#define SLICE_NUM_MASK 0xff
#define CORE_CFP_MASK_PORT_0 0x280c0 #define CORE_CFP_MASK_PORT_0 0x280c0
...@@ -408,6 +409,12 @@ enum bcm_sf2_reg_offs { ...@@ -408,6 +409,12 @@ enum bcm_sf2_reg_offs {
#define CFG_UDF_EOL2 (2 << CFG_UDF_OFFSET_BASE_SHIFT) #define CFG_UDF_EOL2 (2 << CFG_UDF_OFFSET_BASE_SHIFT)
#define CFG_UDF_EOL3 (3 << CFG_UDF_OFFSET_BASE_SHIFT) #define CFG_UDF_EOL3 (3 << CFG_UDF_OFFSET_BASE_SHIFT)
/* IPv6 slices */
#define CORE_UDF_0_B_0_8_PORT_0 0x28500
/* IPv6 chained slices */
#define CORE_UDF_0_D_0_11_PORT_0 0x28680
/* Number of slices for IPv4, IPv6 and non-IP */ /* Number of slices for IPv4, IPv6 and non-IP */
#define UDF_NUM_SLICES 4 #define UDF_NUM_SLICES 4
#define UDFS_PER_SLICE 9 #define UDFS_PER_SLICE 9
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment