Commit bb11d9ac authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 45b85e47 5b7c0c32
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ int ocelot_mrp_del(struct ocelot *ocelot, int port,
		   const struct switchdev_obj_mrp *mrp)
{
	struct ocelot_port *ocelot_port = ocelot->ports[port];
	int i;

	if (!ocelot_port)
		return -EOPNOTSUPP;
@@ -162,23 +161,8 @@ int ocelot_mrp_del(struct ocelot *ocelot, int port,
	if (ocelot_port->mrp_ring_id != mrp->ring_id)
		return 0;

	ocelot_mrp_del_vcap(ocelot, port);
	ocelot_mrp_del_vcap(ocelot, port + ocelot->num_phys_ports);

	ocelot_port->mrp_ring_id = 0;

	for (i = 0; i < ocelot->num_phys_ports; ++i) {
		ocelot_port = ocelot->ports[i];

		if (!ocelot_port)
			continue;

		if (ocelot_port->mrp_ring_id != 0)
			goto out;
	}

	ocelot_mrp_del_mac(ocelot, ocelot->ports[port]);
out:
	return 0;
}
EXPORT_SYMBOL(ocelot_mrp_del);
+7 −0
Original line number Diff line number Diff line
@@ -411,6 +411,13 @@ static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)
	cancel_delayed_work_sync(&mrp->in_test_work);
	br_mrp_switchdev_send_in_test(br, mrp, 0, 0, 0);

	/* Disable the roles */
	br_mrp_switchdev_set_ring_role(br, mrp, BR_MRP_RING_ROLE_DISABLED);
	p = rtnl_dereference(mrp->i_port);
	if (p)
		br_mrp_switchdev_set_in_role(br, mrp, mrp->in_id, mrp->ring_id,
					     BR_MRP_IN_ROLE_DISABLED);

	br_mrp_switchdev_del(br, mrp);

	/* Reset the ports */