OSDN Git Service

net: dsa: bcm_sf2: Keep copy of inserted rules
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 6 Nov 2018 20:58:37 +0000 (12:58 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Nov 2018 23:05:22 +0000 (15:05 -0800)
commitae7a5aff783c79d5ca87867df84b08c43447159b
tree013b5889ed4b2ab0ed2eff07c786ccfe5c91f3d8
parent95772ec991f2df6ed20c070803dde5716d1a78fa
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>
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/bcm_sf2.h
drivers/net/dsa/bcm_sf2_cfp.c