summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2021-04-13 16:24:45 +0300
committerDavid S. Miller <davem@davemloft.net>2021-04-13 15:12:18 -0700
commit2bf90ba5100efa2a06eeecda52fec72a2b024d50 (patch)
tree74b256cabad1330d732cb792a7c10d3f41ae2e06 /drivers/net/ethernet
parent1b0f14b6c218238de8e1e3ebb06a4efad58043b5 (diff)
dpaa2-switch: install default STP trap rule with the highest priority
Change the default ACL trap rule for STP frames to have the highest priority. In the same ACL table will reside both default rules added by the driver for its internal use as well as rules added with tc flower. In this case, the default rules such as the STP one that we already have should have the highest priority. Also, remove the check for a full ACL table since we already know that it's sized so that we don't hit this case. The last thing changes is that default trap filters will not be counted in the acl_tbl's num_rules variable since their number doesn't change. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
index 351ee8f7461c..fc9e2eb0ad11 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
@@ -2700,11 +2700,6 @@ static int dpaa2_switch_port_trap_mac_addr(struct ethsw_port_priv *port_priv,
acl_h = &acl_key.match;
acl_m = &acl_key.mask;
- if (port_priv->acl_tbl->num_rules >= DPAA2_ETHSW_PORT_MAX_ACL_ENTRIES) {
- netdev_err(netdev, "ACL full\n");
- return -ENOMEM;
- }
-
memset(&acl_entry_cfg, 0, sizeof(acl_entry_cfg));
memset(&acl_key, 0, sizeof(acl_key));
@@ -2718,7 +2713,7 @@ static int dpaa2_switch_port_trap_mac_addr(struct ethsw_port_priv *port_priv,
dpsw_acl_prepare_entry_cfg(&acl_key, cmd_buff);
memset(&acl_entry_cfg, 0, sizeof(acl_entry_cfg));
- acl_entry_cfg.precedence = port_priv->acl_tbl->num_rules;
+ acl_entry_cfg.precedence = 0;
acl_entry_cfg.result.action = DPSW_ACL_ACTION_REDIRECT_TO_CTRL_IF;
acl_entry_cfg.key_iova = dma_map_single(dev, cmd_buff,
DPAA2_ETHSW_PORT_ACL_CMD_BUF_SIZE,
@@ -2739,8 +2734,6 @@ static int dpaa2_switch_port_trap_mac_addr(struct ethsw_port_priv *port_priv,
return err;
}
- port_priv->acl_tbl->num_rules++;
-
return 0;
}