Skip to contentSkip to conversation

IB/ipoib: Do not turn on carrier to a non active port

PATCH In review Moni Shoua 2 participants 2 messages Sep 21, 2009 – Sep 24, 2009 1 message not in the archive InfiniBand

lore
Share & tools
lore

Moni Shoua

author
#0 lore raw

PATCH v2 1/1 IB/ipoib: Do not turn on carrier to a non active port

This patch fixes https://bugs.openfabrics.org/show_bug.cgi?id=1726
Multicast join can succeed even if IB port is down. This happens when OpenSM runs on the same port with the requesting port. IPoIB on the other hand, calls netif_carrier_on() when join succeeded without caring about the state of the IB port. The result is an IPoIB interface in RUNNING state but without active IB port to support it. If a bonding interface uses this IPoIB interface as a slave it might not detect that this slave is almost useless and failover functionality will be damaged.
The fix checks the state of the IB port in the carrier_task before calling netif_carrier_on().

---
 drivers/infiniband/ulp/ipoib/ipoib_multicast.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/infiniband/ulp/ipoib/ipoib_multicast.c +7 -0
index 25874fc..9ace51d 100644
@@ -362,12 +362,19 @@ void ipoib_mcast_carrier_on_task(struct work_struct *work)
 {
 	struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv,
 						   carrier_on_task);
+	struct ib_port_attr attr;
 
 	/*
 	 * Take rtnl_lock to avoid racing with ipoib_stop() and
 	 * turning the carrier back on while a device is being
 	 * removed.
 	 */
+
+	if (ib_query_port(priv->ca, priv->port, &attr) ||
+		attr.state != IB_PORT_ACTIVE) {
+		ipoib_dbg(priv, "wait with carrier until IB port is active\n");
+		return;
+	}
 	rtnl_lock();
 	netif_carrier_on(priv->dev);
 	rtnl_unlock();

--
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

A message that is not in the archive (sent off-list or not yet received): 4AB74A78.2080108-hKgKHo2Ms0F+cjeuK/[email protected]