diff mbox series

[3/3] RDMA/core: Add default IP when a bonded slave is unlinked

Message ID 1732736619-19941-4-git-send-email-longli@linuxonhyperv.com (mailing list archive)
State Not Applicable
Headers show
Series [1/3] RDMA/core: Do not use netdev if it is a bonded slave | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Long Li Nov. 27, 2024, 7:43 p.m. UTC
From: Long Li <longli@microsoft.com>

When a bonded slave is unlikned, the current code doesn't add a default
GID for the new unlinked netdev.

Add a default GID for the netdev.

Signed-off-by: Long Li <longli@microsoft.com>
---
 drivers/infiniband/core/roce_gid_mgmt.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c
index 827a50dbd308..3fa2740fa0d2 100644
--- a/drivers/infiniband/core/roce_gid_mgmt.c
+++ b/drivers/infiniband/core/roce_gid_mgmt.c
@@ -692,6 +692,11 @@  static const struct netdev_event_work_cmd add_cmd_upper_ips = {
 	.filter = upper_device_filter
 };
 
+static const struct netdev_event_work_cmd add_default_gid_cmd = {
+	.cb	= add_default_gids,
+	.filter	= is_ndev_for_default_gid_filter,
+};
+
 static void
 ndev_event_unlink(struct netdev_notifier_changeupper_info *changeupper_info,
 		  struct netdev_event_work_cmd *cmds)
@@ -704,7 +709,8 @@  ndev_event_unlink(struct netdev_notifier_changeupper_info *changeupper_info,
 
 	cmds[0] = upper_ips_del_cmd;
 	cmds[0].ndev = changeupper_info->upper_dev;
-	cmds[1] = add_cmd;
+	cmds[1] = add_default_gid_cmd;
+	cmds[2] = add_cmd;
 }
 
 static const struct netdev_event_work_cmd bonding_default_add_cmd = {
@@ -751,11 +757,6 @@  static void netdevice_event_changeupper(struct net_device *event_ndev,
 		ndev_event_unlink(changeupper_info, cmds);
 }
 
-static const struct netdev_event_work_cmd add_default_gid_cmd = {
-	.cb	= add_default_gids,
-	.filter	= is_ndev_for_default_gid_filter,
-};
-
 static int netdevice_event(struct notifier_block *this, unsigned long event,
 			   void *ptr)
 {