summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mscc/ocelot_ace.c
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2020-02-29 17:31:05 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-04 05:57:29 +0300
commit29e59fd4fb488cdafde587c2dca6e8fc4123b6e8 (patch)
treeb5b7f189bb875b9b46068afd82fe0677dd58696f /drivers/net/ethernet/mscc/ocelot_ace.c
parentd658489225271bbe4245c13cd627bcb71b61517b (diff)
downloadlinux-29e59fd4fb488cdafde587c2dca6e8fc4123b6e8.tar.xz
net: mscc: ocelot: make ocelot_ace_rule support multiple ports
The ocelot_ace_rule is port specific now. Make it flexible to be able to support multiple ports too. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: Allan W. Nielsen <allan.nielsen@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc/ocelot_ace.c')
-rw-r--r--drivers/net/ethernet/mscc/ocelot_ace.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot_ace.c b/drivers/net/ethernet/mscc/ocelot_ace.c
index 86fc6e6b46dd..18670645d47f 100644
--- a/drivers/net/ethernet/mscc/ocelot_ace.c
+++ b/drivers/net/ethernet/mscc/ocelot_ace.c
@@ -352,7 +352,7 @@ static void is2_entry_set(struct ocelot *ocelot, int ix,
data.type = IS2_ACTION_TYPE_NORMAL;
VCAP_KEY_ANY_SET(PAG);
- VCAP_KEY_SET(IGR_PORT_MASK, 0, ~BIT(ace->chip_port));
+ VCAP_KEY_SET(IGR_PORT_MASK, 0, ~ace->ingress_port_mask);
VCAP_KEY_BIT_SET(FIRST, OCELOT_VCAP_BIT_1);
VCAP_KEY_BIT_SET(HOST_MATCH, OCELOT_VCAP_BIT_ANY);
VCAP_KEY_BIT_SET(L2_MC, ace->dmac_mc);
@@ -576,7 +576,7 @@ static void is2_entry_set(struct ocelot *ocelot, int ix,
static void is2_entry_get(struct ocelot_ace_rule *rule, int ix)
{
- struct ocelot *op = rule->port->ocelot;
+ struct ocelot *op = rule->ocelot;
struct vcap_data data;
int row = (ix / 2);
u32 cnt;
@@ -655,11 +655,11 @@ int ocelot_ace_rule_offload_add(struct ocelot_ace_rule *rule)
/* Move down the rules to make place for the new rule */
for (i = acl_block->count - 1; i > index; i--) {
ace = ocelot_ace_rule_get_rule_index(acl_block, i);
- is2_entry_set(rule->port->ocelot, i, ace);
+ is2_entry_set(rule->ocelot, i, ace);
}
/* Now insert the new rule */
- is2_entry_set(rule->port->ocelot, index, rule);
+ is2_entry_set(rule->ocelot, index, rule);
return 0;
}
@@ -697,11 +697,11 @@ int ocelot_ace_rule_offload_del(struct ocelot_ace_rule *rule)
/* Move up all the blocks over the deleted rule */
for (i = index; i < acl_block->count; i++) {
ace = ocelot_ace_rule_get_rule_index(acl_block, i);
- is2_entry_set(rule->port->ocelot, i, ace);
+ is2_entry_set(rule->ocelot, i, ace);
}
/* Now delete the last rule, because it is duplicated */
- is2_entry_set(rule->port->ocelot, acl_block->count, &del_ace);
+ is2_entry_set(rule->ocelot, acl_block->count, &del_ace);
return 0;
}
@@ -717,7 +717,7 @@ int ocelot_ace_rule_stats_update(struct ocelot_ace_rule *rule)
/* After we get the result we need to clear the counters */
tmp = ocelot_ace_rule_get_rule_index(acl_block, index);
tmp->stats.pkts = 0;
- is2_entry_set(rule->port->ocelot, index, tmp);
+ is2_entry_set(rule->ocelot, index, tmp);
return 0;
}