]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: look up the filters in flower_stats() and flower_destroy()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 29 Sep 2020 22:27:33 +0000 (01:27 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Sep 2020 01:26:24 +0000 (18:26 -0700)
commit7f902f5b7f0665b6a5e0f684ecd4d017226b9672
tree146452a808c299a5e54ec21dfa1edf4f7c673f0d
parent168c3165c1dda5e97a32785828f962300937680f
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>
drivers/net/ethernet/mscc/ocelot_flower.c
drivers/net/ethernet/mscc/ocelot_vcap.c