Skip to content

Commit bb11d9a

Browse files
committed
Merge branch 'bridge-mrp-next'
Horatiu Vultur says: ==================== bridge: mrp: Disable roles before deleting The first patch in this series make sures that the driver is notified that the role is disabled before the MRP instance is deleted. The second patch uses this so it can simplify the driver. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 45b85e4 + 5b7c0c3 commit bb11d9a

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

drivers/net/ethernet/mscc/ocelot_mrp.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -154,31 +154,15 @@ int ocelot_mrp_del(struct ocelot *ocelot, int port,
154154
const struct switchdev_obj_mrp *mrp)
155155
{
156156
struct ocelot_port *ocelot_port = ocelot->ports[port];
157-
int i;
158157

159158
if (!ocelot_port)
160159
return -EOPNOTSUPP;
161160

162161
if (ocelot_port->mrp_ring_id != mrp->ring_id)
163162
return 0;
164163

165-
ocelot_mrp_del_vcap(ocelot, port);
166-
ocelot_mrp_del_vcap(ocelot, port + ocelot->num_phys_ports);
167-
168164
ocelot_port->mrp_ring_id = 0;
169165

170-
for (i = 0; i < ocelot->num_phys_ports; ++i) {
171-
ocelot_port = ocelot->ports[i];
172-
173-
if (!ocelot_port)
174-
continue;
175-
176-
if (ocelot_port->mrp_ring_id != 0)
177-
goto out;
178-
}
179-
180-
ocelot_mrp_del_mac(ocelot, ocelot->ports[port]);
181-
out:
182166
return 0;
183167
}
184168
EXPORT_SYMBOL(ocelot_mrp_del);

net/bridge/br_mrp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,13 @@ static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)
411411
cancel_delayed_work_sync(&mrp->in_test_work);
412412
br_mrp_switchdev_send_in_test(br, mrp, 0, 0, 0);
413413

414+
/* Disable the roles */
415+
br_mrp_switchdev_set_ring_role(br, mrp, BR_MRP_RING_ROLE_DISABLED);
416+
p = rtnl_dereference(mrp->i_port);
417+
if (p)
418+
br_mrp_switchdev_set_in_role(br, mrp, mrp->in_id, mrp->ring_id,
419+
BR_MRP_IN_ROLE_DISABLED);
420+
414421
br_mrp_switchdev_del(br, mrp);
415422

416423
/* Reset the ports */

0 commit comments

Comments
 (0)