diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2021-03-23 11:33:46 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-24 22:14:08 +0300 |
commit | b3cb91b97c04e29feee8888ad08426d8904be63f (patch) | |
tree | 1fd3e30f6d166f15b98250f9688d7d76b36a967f /net/bridge | |
parent | 45b85e47cdd79740b858593f040431f66bf0f032 (diff) | |
download | linux-b3cb91b97c04e29feee8888ad08426d8904be63f.tar.xz |
bridge: mrp: Disable roles before deleting the MRP instance
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_mrp.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 */ |