Skip to content

Commit

Permalink
net: mscc: ocelot: use a consistent cookie for MRP traps
Browse files Browse the repository at this point in the history
The driver uses an identifier equal to (ocelot->num_phys_ports + port)
for MRP traps installed when the system is in the role of an MRC, and an
identifier equal to (port) otherwise.

Use the same identifier in both cases as a consolidation for the various
cookie values spread throughout the driver.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Feb 17, 2022
1 parent c8b441d commit e3c02b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mscc/ocelot_mrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ int ocelot_mrp_add_ring_role(struct ocelot *ocelot, int port,
ocelot_mrp_save_mac(ocelot, ocelot_port);

if (mrp->ring_role != BR_MRP_RING_ROLE_MRC)
return ocelot_mrp_copy_add_vcap(ocelot, port, 1, port);
return ocelot_mrp_copy_add_vcap(ocelot, port, 1,
port + ocelot->num_phys_ports);

dst_port = ocelot_mrp_find_partner_port(ocelot, ocelot_port);
if (dst_port == -1)
Expand Down

0 comments on commit e3c02b7

Please sign in to comment.