Skip to content

Commit 94232d9

Browse files
Erez Shitritrolandd
authored andcommitted
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 <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent a39c52a commit 94232d9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/infiniband/ulp/ipoib/ipoib_multicast.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,18 @@ void ipoib_mcast_join_task(struct work_struct *work)
518518
struct ipoib_dev_priv *priv =
519519
container_of(work, struct ipoib_dev_priv, mcast_task.work);
520520
struct net_device *dev = priv->dev;
521+
struct ib_port_attr port_attr;
521522

522523
if (!test_bit(IPOIB_MCAST_RUN, &priv->flags))
523524
return;
524525

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+
525533
if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid))
526534
ipoib_warn(priv, "ib_query_gid() failed\n");
527535
else

0 commit comments

Comments
 (0)