diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2018-11-06 23:58:37 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-07 02:05:22 +0300 |
commit | ae7a5aff783c79d5ca87867df84b08c43447159b (patch) | |
tree | 013b5889ed4b2ab0ed2eff07c786ccfe5c91f3d8 /drivers/net/dsa/bcm_sf2.h | |
parent | 95772ec991f2df6ed20c070803dde5716d1a78fa (diff) | |
download | linux-ae7a5aff783c79d5ca87867df84b08c43447159b.tar.xz |
net: dsa: bcm_sf2: Keep copy of inserted rules
We tried hard to use the hardware as a storage area, which made things
needlessly complex in that we had to both marshall and unmarshall the
ethtool_rx_flow_spec into what the CFP hardware understands but it did
not require any driver level allocations, so that was nice.
Keep a copy of the ethtool_rx_flow_spec rule we want to insert, and also
make sure we don't have a duplicate rule already. This greatly speeds up
the deletion time since we only need to clear the slice's valid bit and
not perform a full read.
This is a preparatory step for being able to restore rules upon system
resumption where the hardware loses its context partially or entirely.
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.h')
-rw-r--r-- | drivers/net/dsa/bcm_sf2.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/dsa/bcm_sf2.h b/drivers/net/dsa/bcm_sf2.h index cc31e986e6e3..03444982c25e 100644 --- a/drivers/net/dsa/bcm_sf2.h +++ b/drivers/net/dsa/bcm_sf2.h @@ -56,6 +56,7 @@ struct bcm_sf2_cfp_priv { DECLARE_BITMAP(used, CFP_NUM_RULES); DECLARE_BITMAP(unique, CFP_NUM_RULES); unsigned int rules_cnt; + struct list_head rules_list; }; struct bcm_sf2_priv { @@ -213,5 +214,6 @@ int bcm_sf2_get_rxnfc(struct dsa_switch *ds, int port, 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); +void bcm_sf2_cfp_exit(struct dsa_switch *ds); #endif /* __BCM_SF2_H */ |