Skip to contentSkip to conversation

RDMA/ipoib: print a message if only child interface is UP

PATCH Applied Jack Wang 3 participants 4 messages Apr 8, 2021 – Apr 13, 2021 InfiniBand

lore
Share & tools
lore

Jack Wang

author
#0 lore raw

PATCH v3 1/1 RDMA/ipoib: print a message if only child interface is UP

When "enhanced IPoIB" enabled for CX-5 devices, it requires the parent device to be UP, otherwise the child devices won't work.

This add a debug message to give admin a hint, if only child interface is UP, but parent interface is not.

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +6 -1
index e16b40c09f82..df6329abac1d 100644
@@ -164,8 +164,13 @@ int ipoib_open(struct net_device *dev)
 			dev_change_flags(cpriv->dev, flags | IFF_UP, NULL);
 		}
 		up_read(&priv->vlan_rwsem);
-	}
+	} else if (priv->parent) {
+		struct ipoib_dev_priv *ppriv = ipoib_priv(priv->parent);
 
+		if (!test_bit(IPOIB_FLAG_ADMIN_UP, &ppriv->flags))
+			ipoib_dbg(priv, "parent device %s is not up, so child device may be not functioning.\n",
+				  ppriv->dev->name);
+	}
 	netif_start_queue(dev);
 
 	return 0;
Signature · 1 line
2.25.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 17 lines · Jack Wang

When "enhanced IPoIB" enabled for CX-5 devices, it requires the parent device to be UP, otherwise the child devices won't work.

This add a debug message to give admin a hint, if only child interface is UP, but parent interface is not.

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +0 -0
index e16b40c09f82..df6329abac1d 100644

drivers/infiniband/ulp/ipoib/ipoib_main.c int ipoib_open(struct net_device *dev) · line 172

Quoted 10 lines
drivers/infiniband/ulp/ipoib/ipoib_main.c +5 -1
@@ -164,8 +164,13 @@ int ipoib_open(struct net_device *dev)
 			dev_change_flags(cpriv->dev, flags | IFF_UP, NULL);
 		}
 		up_read(&priv->vlan_rwsem);
-	}
+	} else if (priv->parent) {
+		struct ipoib_dev_priv *ppriv = ipoib_priv(priv->parent);
 
+		if (!test_bit(IPOIB_FLAG_ADMIN_UP, &ppriv->flags))
+			ipoib_dbg(priv, "parent device %s is not up, so child device may be not functioning.\n",
+				  ppriv->dev->name);

I personally would use stronger language than that.

Thanks

Quoted 7 lines
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -0
+	}
 	netif_start_queue(dev);
 
 	return 0;
Signature · 1 line
2.25.1
author
#2 lore raw
Quoted 26 lines · Leon Romanovsky
Quoted 24 lines · Jack Wang

When "enhanced IPoIB" enabled for CX-5 devices, it requires the parent device to be UP, otherwise the child devices won't work.

This add a debug message to give admin a hint, if only child interface is UP, but parent interface is not.

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +2 -1
index e16b40c09f82..df6329abac1d 100644
@@ -164,8 +164,13 @@ int ipoib_open(struct net_device *dev)
                      dev_change_flags(cpriv->dev, flags | IFF_UP, NULL);
              }
              up_read(&priv->vlan_rwsem);
-     }
+     } else if (priv->parent) {
+             struct ipoib_dev_priv *ppriv = ipoib_priv(priv->parent);
 
Quoted 6 lines

drivers/infiniband/ulp/ipoib/ipoib_main.c int ipoib_open(struct net_device *dev) · line 172

Quoted 3 lines
drivers/infiniband/ulp/ipoib/ipoib_main.c +3 -0
+             if (!test_bit(IPOIB_FLAG_ADMIN_UP, &ppriv->flags))
+                     ipoib_dbg(priv, "parent device %s is not up, so child device may be not functioning.\n",
+                               ppriv->dev->name);

I personally would use stronger language than that.

As there is configuration like on old CX-2/CX-3 HCA, it works fine, so I use such language.

Quoted 3 lines

Thanks

Thanks for the review!

Quoted 8 lines
Quoted 8 lines
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -1
+     }
      netif_start_queue(dev);
 
      return 0;
--

2.25.1

maintainer Applied
#3 lore raw
In reply to Jack Wang
Quoted 4 lines · Jack Wang

When "enhanced IPoIB" enabled for CX-5 devices, it requires the parent device to be UP, otherwise the child devices won't work.

Quoted 8 lines

This add a debug message to give admin a hint, if only child interface is UP, but parent interface is not.

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Applied to for-next, thanks

Jason