summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mscc/ocelot_vcap.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2020-09-30 01:27:33 +0300
committerDavid S. Miller <davem@davemloft.net>2020-09-29 18:26:24 -0700
commit98642d1aa2c68840c9d0d8386986bcf662f3cd30 (patch)
tree146452a808c299a5e54ec21dfa1edf4f7c673f0d /drivers/net/ethernet/mscc/ocelot_vcap.c
parent085f5b91629f65fa1bce19e9dd65a2e46457fe27 (diff)
net: mscc: ocelot: look up the filters in flower_stats() and flower_destroy()
Currently a new filter is created, containing just enough correct information to be able to call ocelot_vcap_block_find_filter_by_index() on it. This will be limiting us in the future, when we'll have more metadata associated with a filter, which will matter in the stats() and destroy() callbacks, and which we can't make up on the spot. For example, we'll start "offloading" some dummy tc filter entries for the TCAM skeleton, but we won't actually be adding them to the hardware, or to block->rules. So, it makes sense to avoid deleting those rules too. That's the kind of thing which is difficult to determine unless we look up the real filter. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc/ocelot_vcap.c')
-rw-r--r--drivers/net/ethernet/mscc/ocelot_vcap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot_vcap.c b/drivers/net/ethernet/mscc/ocelot_vcap.c
index aa6f6a770199..75eca3457e6e 100644
--- a/drivers/net/ethernet/mscc/ocelot_vcap.c
+++ b/drivers/net/ethernet/mscc/ocelot_vcap.c
@@ -994,7 +994,7 @@ int ocelot_vcap_filter_stats_update(struct ocelot *ocelot,
struct ocelot_vcap_filter *filter)
{
struct ocelot_vcap_block *block = &ocelot->block;
- struct ocelot_vcap_filter *tmp;
+ struct ocelot_vcap_filter tmp;
int index;
index = ocelot_vcap_block_get_filter_index(block, filter);
@@ -1004,9 +1004,9 @@ int ocelot_vcap_filter_stats_update(struct ocelot *ocelot,
vcap_entry_get(ocelot, filter, index);
/* After we get the result we need to clear the counters */
- tmp = ocelot_vcap_block_find_filter_by_index(block, index);
- tmp->stats.pkts = 0;
- is2_entry_set(ocelot, index, tmp);
+ tmp = *filter;
+ tmp.stats.pkts = 0;
+ is2_entry_set(ocelot, index, &tmp);
return 0;
}