diff mbox series

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

Message ID 20210408084859.16596-1-jinpu.wang@ionos.com (mailing list archive)
State Superseded
Headers show
Series [v2] RDMA/ipoib: print a message if only child interface is UP | expand

Commit Message

Jinpu Wang April 8, 2021, 8:48 a.m. UTC
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.

Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index e16b40c09f82..bae2a64f6991 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -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",
+				  ((struct ipoib_dev_priv *) ppriv)->dev->name);
+	}
 	netif_start_queue(dev);
 
 	return 0;