Skip to contentSkip to conversation

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

PATCH Superseded Jack Wang 2 participants 3 messages Apr 8, 2021 InfiniBand

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jack Wang

author
#0 lore raw

PATCH 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.[1]

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

[1]https://lore.kernel.org/linux-rdma/CAMGffE=3YYxv9i7_qQr3-Uv-NGr-7VsnMk8DTjR0YbX1vJBzXQ@mail.gmail.com/T/#u

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +5 -1
index e16b40c09f82..782b792985b8 100644
@@ -164,8 +164,12 @@ 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 deivce %s is not up, so child may be not functioning.\n", ((struct ipoib_dev_priv *) ppriv)->dev->name);
+	}
 	netif_start_queue(dev);
 
 	return 0;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 18 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.[1]

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

[1]https://lore.kernel.org/linux-rdma/CAMGffE=3YYxv9i7_qQr3-Uv-NGr-7VsnMk8DTjR0YbX1vJBzXQ@mail.gmail.com/T/#u

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

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

Quoted 9 lines
drivers/infiniband/ulp/ipoib/ipoib_main.c +4 -1
@@ -164,8 +164,12 @@ 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 deivce %s is not up, so child may be not functioning.\n", ((struct ipoib_dev_priv *) ppriv)->dev->name);

Why do you need extra casting? "ppriv" is already "struct ipoib_dev_priv *".

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 27 lines · Leon Romanovsky
Quoted 25 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.[1]

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

[1]https://lore.kernel.org/linux-rdma/CAMGffE=3YYxv9i7_qQr3-Uv-NGr-7VsnMk8DTjR0YbX1vJBzXQ@mail.gmail.com/T/#u

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +2 -1
index e16b40c09f82..782b792985b8 100644
@@ -164,8 +164,12 @@ 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 4 lines

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

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

Why do you need extra casting? "ppriv" is already "struct ipoib_dev_priv *".

Indeed, will remove that.

Thanks

Quoted 10 lines

Thanks

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

2.25.1