aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErez Shitrit <erezsh@mellanox.com>2013-10-16 10:37:53 -0400
committerRoland Dreier <roland@purestorage.com>2013-11-08 17:42:49 -0500
commit94232d9ce81755c4b0c1536648442383442b27e0 (patch)
tree665e0c5214e0a3ee33e9fe60d9f93471546b8b80
parenta39c52ab887fdcefae1d7f467fb0621f30833c84 (diff)
IPoIB: Start multicast join process only on active ports
The driver starts the mcast_join task whenever the netdev interface is UP without relation to the underlying IB port state. Until the port state is ACTIVE all the join requests are irrelevant, and the IB core returns -EINVAL. So the user will see errors such as: "multicast join failed for ff12:401b:... , status -22". Instead, have ipoib_mcast_join_task() return when the port is not active. It will be called again when the port state is changed and the low-level driver triggers the IB_EVENT_PORT_ACTIVE event or the IB_EVENT_CLIENT_REREGISTER event. Signed-off-by: Erez Shitrit <erezsh@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 780a2a0df41f..d4e005720d01 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -518,10 +518,18 @@ void ipoib_mcast_join_task(struct work_struct *work)
518 struct ipoib_dev_priv *priv = 518 struct ipoib_dev_priv *priv =
519 container_of(work, struct ipoib_dev_priv, mcast_task.work); 519 container_of(work, struct ipoib_dev_priv, mcast_task.work);
520 struct net_device *dev = priv->dev; 520 struct net_device *dev = priv->dev;
521 struct ib_port_attr port_attr;
521 522
522 if (!test_bit(IPOIB_MCAST_RUN, &priv->flags)) 523 if (!test_bit(IPOIB_MCAST_RUN, &priv->flags))
523 return; 524 return;
524 525
526 if (ib_query_port(priv->ca, priv->port, &port_attr) ||
527 port_attr.state != IB_PORT_ACTIVE) {
528 ipoib_dbg(priv, "port state is not ACTIVE (state = %d) suspending join task\n",
529 port_attr.state);
530 return;
531 }
532
525 if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid)) 533 if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid))
526 ipoib_warn(priv, "ib_query_gid() failed\n"); 534 ipoib_warn(priv, "ib_query_gid() failed\n");
527 else 535 else