aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/mscc/ocelot.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2022-02-16 16:30:07 +0200
committerDavid S. Miller <davem@davemloft.net>2022-02-17 14:06:51 +0000
commitb9bace6e534d431871a9d69cbd06d3a798f5086d (patch)
tree94df8138e35c5a6ce44081c5aa5912993cdba3cf /drivers/net/ethernet/mscc/ocelot.c
parentnet: mscc: ocelot: delete OCELOT_MRP_CPUQ (diff)
downloadwireguard-linux-b9bace6e534d431871a9d69cbd06d3a798f5086d.tar.xz
wireguard-linux-b9bace6e534d431871a9d69cbd06d3a798f5086d.zip
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>
Diffstat (limited to 'drivers/net/ethernet/mscc/ocelot.c')
-rw-r--r--drivers/net/ethernet/mscc/ocelot.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index 6039c9cb09c7..502e64764cbd 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -1468,9 +1468,8 @@ ocelot_populate_ipv6_ptp_general_trap_key(struct ocelot_vcap_filter *trap)
trap->key.ipv6.dport.mask = 0xffff;
}
-static int ocelot_trap_add(struct ocelot *ocelot, int port,
- unsigned long cookie,
- void (*populate)(struct ocelot_vcap_filter *f))
+int ocelot_trap_add(struct ocelot *ocelot, int port, unsigned long cookie,
+ void (*populate)(struct ocelot_vcap_filter *f))
{
struct ocelot_vcap_block *block_vcap_is2;
struct ocelot_vcap_filter *trap;
@@ -1515,8 +1514,7 @@ static int ocelot_trap_add(struct ocelot *ocelot, int port,
return 0;
}
-static int ocelot_trap_del(struct ocelot *ocelot, int port,
- unsigned long cookie)
+int ocelot_trap_del(struct ocelot *ocelot, int port, unsigned long cookie)
{
struct ocelot_vcap_block *block_vcap_is2;
struct ocelot_vcap_filter *trap;