diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-01-30 09:48:43 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-30 14:49:58 -0500 |
commit | 7318166cacad158b46240f66250d7cc5a481653b (patch) | |
tree | 3362ad3da2cbfccbc591a04a47d9e5846a0e620f /drivers/net/dsa/bcm_sf2.c | |
parent | 853458087ef0e5300fa978dccef40b73d411c6e6 (diff) |
net: dsa: bcm_sf2: Add support for ethtool::rxnfc
Add support for configuring classification rules using the
ethtool::rxnfc API. This is useful to program the switch's CFP/TCAM to
redirect specific packets to specific ports/queues for instance. For
now, we allow any kind of IPv4 5-tuple matching.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/bcm_sf2.c')
-rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 637072da3acf..be282b430c50 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -1045,6 +1045,8 @@ static const struct dsa_switch_ops bcm_sf2_ops = { .port_fdb_dump = b53_fdb_dump, .port_fdb_add = b53_fdb_add, .port_fdb_del = b53_fdb_del, + .get_rxnfc = bcm_sf2_get_rxnfc, + .set_rxnfc = bcm_sf2_set_rxnfc, }; struct bcm_sf2_of_data { @@ -1168,6 +1170,12 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) spin_lock_init(&priv->indir_lock); mutex_init(&priv->stats_mutex); + mutex_init(&priv->cfp.lock); + + /* CFP rule #0 cannot be used for specific classifications, flag it as + * permanently used + */ + set_bit(0, priv->cfp.used); bcm_sf2_identify_ports(priv, dn->child); @@ -1197,6 +1205,12 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) return ret; } + ret = bcm_sf2_cfp_rst(priv); + if (ret) { + pr_err("failed to reset CFP\n"); + goto out_mdio; + } + /* Disable all interrupts and request them */ bcm_sf2_intr_disable(priv); |