]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: use a single VCAP filter for all MRP traps
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 16 Feb 2022 14:30:07 +0000 (16:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Feb 2022 14:06:51 +0000 (14:06 +0000)
commitcb8937c3ab31d079e9b79b82a5e6cceb95845119
tree94df8138e35c5a6ce44081c5aa5912993cdba3cf
parente466a5b1d94a74ddc77574e73b9e41b270d46b95
net: mscc: ocelot: use a single VCAP filter for all MRP traps

The MRP assist code installs a VCAP IS2 trapping rule for each port, but
since the key and the action is the same, just the ingress port mask
differs, there isn't any need to do this. We can save some space in the
TCAM by using a single filter and adjusting the ingress port mask.

Reuse the ocelot_trap_add() and ocelot_trap_del() functions for this
purpose.

Now that the cookies are no longer per port, we need to change the
allocation scheme such that MRP traps use a fixed number.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/mscc/ocelot.h
drivers/net/ethernet/mscc/ocelot_mrp.c
include/soc/mscc/ocelot_vcap.h