summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/bcm_sf2.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-01-30 14:49:59 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-30 14:49:59 -0500
commita3a4de056ed5cfb22085173d8f0f13b0ca6b6d60 (patch)
tree3362ad3da2cbfccbc591a04a47d9e5846a0e620f /drivers/net/dsa/bcm_sf2.h
parent40be0dda0725886b623d67868db3219a2e74683b (diff)
parent7318166cacad158b46240f66250d7cc5a481653b (diff)
downloadlinux-a3a4de056ed5cfb22085173d8f0f13b0ca6b6d60.tar.bz2
Merge branch 'net-dsa-bcm_sf2-CFP-support'
Florian Fainelli says: ==================== net: dsa: bcm_sf2: CFP support This patch series adds support for the Broadcom Compact Field Processor (CFP) which is a classification and matching engine built into most Broadcom switches. We support that using ethtool::rxnfc because it allows all known uses cases from the users I support to work, and more importantly, it allows the selection of a target rule index, which is later used by e.g: offloading hardware, this is an essential feature that I could not find being supported with cls_* for instance. Thanks! Changes in v3: - rebased against latest net-next/master after Vivien's changes Changes in v2: - fixed modular builds reported by kbuild test robot ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/bcm_sf2.h')
-rw-r--r--drivers/net/dsa/bcm_sf2.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/dsa/bcm_sf2.h b/drivers/net/dsa/bcm_sf2.h
index 6e1f74e4d471..7d3030e04f11 100644
--- a/drivers/net/dsa/bcm_sf2.h
+++ b/drivers/net/dsa/bcm_sf2.h
@@ -52,6 +52,13 @@ struct bcm_sf2_port_status {
struct ethtool_eee eee;
};
+struct bcm_sf2_cfp_priv {
+ /* Mutex protecting concurrent accesses to the CFP registers */
+ struct mutex lock;
+ DECLARE_BITMAP(used, CFP_NUM_RULES);
+ unsigned int rules_cnt;
+};
+
struct bcm_sf2_priv {
/* Base registers, keep those in order with BCM_SF2_REGS_NAME */
void __iomem *core;
@@ -103,6 +110,9 @@ struct bcm_sf2_priv {
/* Bitmask of ports needing BRCM tags */
unsigned int brcm_tag_mask;
+
+ /* CFP rules context */
+ struct bcm_sf2_cfp_priv cfp;
};
static inline struct bcm_sf2_priv *bcm_sf2_to_priv(struct dsa_switch *ds)
@@ -197,4 +207,11 @@ SF2_IO_MACRO(acb);
SWITCH_INTR_L2(0);
SWITCH_INTR_L2(1);
+/* RXNFC */
+int bcm_sf2_get_rxnfc(struct dsa_switch *ds, int port,
+ struct ethtool_rxnfc *nfc, u32 *rule_locs);
+int bcm_sf2_set_rxnfc(struct dsa_switch *ds, int port,
+ struct ethtool_rxnfc *nfc);
+int bcm_sf2_cfp_rst(struct bcm_sf2_priv *priv);
+
#endif /* __BCM_SF2_H */