* [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting
@ 2021-03-23 8:33 Horatiu Vultur
2021-03-23 8:33 ` [PATCH net-next 1/2] bridge: mrp: Disable roles before deleting the MRP instance Horatiu Vultur
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Horatiu Vultur @ 2021-03-23 8:33 UTC (permalink / raw)
To: davem, kuba, roopa, nikolay, vladimir.oltean, claudiu.manoil,
alexandre.belloni
Cc: UNGLinuxDriver, netdev, linux-kernel, bridge, Horatiu Vultur
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.
Horatiu Vultur (2):
bridge: mrp: Disable roles before deleting the MRP instance
net: ocelot: Simplify MRP deletion
drivers/net/ethernet/mscc/ocelot_mrp.c | 16 ----------------
net/bridge/br_mrp.c | 7 +++++++
2 files changed, 7 insertions(+), 16 deletions(-)
--
2.30.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] bridge: mrp: Disable roles before deleting the MRP instance
2021-03-23 8:33 [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting Horatiu Vultur
@ 2021-03-23 8:33 ` Horatiu Vultur
2021-03-23 8:33 ` [PATCH net-next 2/2] net: ocelot: Simplify MRP deletion Horatiu Vultur
2021-03-24 19:40 ` [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Horatiu Vultur @ 2021-03-23 8:33 UTC (permalink / raw)
To: davem, kuba, roopa, nikolay, vladimir.oltean, claudiu.manoil,
alexandre.belloni
Cc: UNGLinuxDriver, netdev, linux-kernel, bridge, Horatiu Vultur
When an MRP instance was created, the driver was notified that the
instance is created and then in a different callback about role of the
instance. But when the instance was deleted the driver was notified only
that the MRP instance is deleted and not also that the role is disabled.
This patch make sure that the driver is notified that the role is
changed to disabled before the MRP instance is deleted to have similar
callbacks with the creating of the instance. In this way it would
simplify the logic in the drivers.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
net/bridge/br_mrp.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index 12487f6fe9b4..cd2b1e424e54 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -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 */
--
2.30.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] net: ocelot: Simplify MRP deletion
2021-03-23 8:33 [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting Horatiu Vultur
2021-03-23 8:33 ` [PATCH net-next 1/2] bridge: mrp: Disable roles before deleting the MRP instance Horatiu Vultur
@ 2021-03-23 8:33 ` Horatiu Vultur
2021-03-24 19:40 ` [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Horatiu Vultur @ 2021-03-23 8:33 UTC (permalink / raw)
To: davem, kuba, roopa, nikolay, vladimir.oltean, claudiu.manoil,
alexandre.belloni
Cc: UNGLinuxDriver, netdev, linux-kernel, bridge, Horatiu Vultur
Now that the driver will always be notified that the role is deleted
before the ring is deleted, then we don't need to duplicate the logic of
cleaning the resources also in the delete function.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
drivers/net/ethernet/mscc/ocelot_mrp.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/net/ethernet/mscc/ocelot_mrp.c b/drivers/net/ethernet/mscc/ocelot_mrp.c
index c3cbcaf64bb2..08b481a93460 100644
--- a/drivers/net/ethernet/mscc/ocelot_mrp.c
+++ b/drivers/net/ethernet/mscc/ocelot_mrp.c
@@ -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);
--
2.30.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting
2021-03-23 8:33 [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting Horatiu Vultur
2021-03-23 8:33 ` [PATCH net-next 1/2] bridge: mrp: Disable roles before deleting the MRP instance Horatiu Vultur
2021-03-23 8:33 ` [PATCH net-next 2/2] net: ocelot: Simplify MRP deletion Horatiu Vultur
@ 2021-03-24 19:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-24 19:40 UTC (permalink / raw)
To: Horatiu Vultur
Cc: davem, kuba, roopa, nikolay, vladimir.oltean, claudiu.manoil,
alexandre.belloni, UNGLinuxDriver, netdev, linux-kernel, bridge
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Tue, 23 Mar 2021 09:33:45 +0100 you wrote:
> 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.
>
> Horatiu Vultur (2):
> bridge: mrp: Disable roles before deleting the MRP instance
> net: ocelot: Simplify MRP deletion
>
> [...]
Here is the summary with links:
- [net-next,1/2] bridge: mrp: Disable roles before deleting the MRP instance
https://git.kernel.org/netdev/net-next/c/b3cb91b97c04
- [net-next,2/2] net: ocelot: Simplify MRP deletion
https://git.kernel.org/netdev/net-next/c/5b7c0c32c904
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-24 19:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-23 8:33 [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting Horatiu Vultur
2021-03-23 8:33 ` [PATCH net-next 1/2] bridge: mrp: Disable roles before deleting the MRP instance Horatiu Vultur
2021-03-23 8:33 ` [PATCH net-next 2/2] net: ocelot: Simplify MRP deletion Horatiu Vultur
2021-03-24 19:40 ` [PATCH net-next 0/2] bridge: mrp: Disable roles before deleting patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).