Skip to contentSkip to conversation

IB/ipoib: Warn when one port fails to initialize

PATCH Applied Yuval Shaia 3 participants 3 messages Nov 29, 2017 – Dec 13, 2017 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/ipoib: Warn when one port fails to initialize

If one port fails to initialize an error message should indicate the reason and driver should continue serving the working port(s) and other HCA(s).

Fixes e4b2d06892c7 ("IB/ipoib: Remove device when one port fails to

init").

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +4 -3
index 12b7f911f0e5..0c95101c45c8 100644
@@ -2196,8 +2196,10 @@ static struct net_device *ipoib_add_port(const char *format,
 	int result = -ENOMEM;
 
 	priv = ipoib_intf_alloc(hca, port, format);
-	if (!priv)
+	if (!priv) {
+		pr_warn("%s, %d: ipoib_intf_alloc failed\n", hca->name, port);
 		goto alloc_mem_failed;
+	}
 
 	SET_NETDEV_DEV(priv->dev, hca->dev.parent);
 	priv->dev->dev_id = port - 1;
@@ -2326,8 +2328,7 @@ static void ipoib_add_one(struct ib_device *device)
 	}
 
 	if (!count) {
-		pr_err("Failed to init port, removing it\n");
-		ipoib_remove_one(device, dev_list);
+		kfree(dev_list);
 		return;
 	}
 
Signature · 6 lines
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive
Quoted 29 lines · Yuval Shaia

If one port fails to initialize an error message should indicate the reason and driver should continue serving the working port(s) and other HCA(s).

Fixes e4b2d06892c7 ("IB/ipoib: Remove device when one port fails to

init").

---
  drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +3 -1
index 12b7f911f0e5..0c95101c45c8 100644
@@ -2196,8 +2196,10 @@ static struct net_device *ipoib_add_port(const char *format,
  	int result = -ENOMEM;
 
  	priv = ipoib_intf_alloc(hca, port, format);
-	if (!priv)
+	if (!priv) {
+		pr_warn("%s, %d: ipoib_intf_alloc failed\n", hca->name, port);
  		goto alloc_mem_failed;
+	}
 
  	SET_NETDEV_DEV(priv->dev, hca->dev.parent);
  	priv->dev->dev_id = port - 1;

drivers/infiniband/ulp/ipoib/ipoib_main.c static void ipoib_add_one(struct ib_device *device) · line 2334

Quoted 9 lines
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -2
@@ -2326,8 +2328,7 @@ static void ipoib_add_one(struct ib_device *device)
  	}
 
  	if (!count) {
-		pr_err("Failed to init port, removing it\n");
-		ipoib_remove_one(device, dev_list);
+		kfree(dev_list);
  		return;
  	}
 

Looks like this will solve the issue, thanks for fixing.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to a message not in the archive
Quoted 10 lines · Yuval Shaia

If one port fails to initialize an error message should indicate the reason and driver should continue serving the working port(s) and other HCA(s).

Fixes e4b2d06892c7 ("IB/ipoib: Remove device when one port fails to

init").

 drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Thanks, applied to -next

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html