|
@@ -601,6 +601,10 @@ int ipoib_mcast_start_thread(struct net_device *dev)
|
|
queue_work(ipoib_workqueue, &priv->mcast_task);
|
|
queue_work(ipoib_workqueue, &priv->mcast_task);
|
|
mutex_unlock(&mcast_mutex);
|
|
mutex_unlock(&mcast_mutex);
|
|
|
|
|
|
|
|
+ spin_lock_irq(&priv->lock);
|
|
|
|
+ set_bit(IPOIB_MCAST_STARTED, &priv->flags);
|
|
|
|
+ spin_unlock_irq(&priv->lock);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -611,6 +615,10 @@ int ipoib_mcast_stop_thread(struct net_device *dev, int flush)
|
|
|
|
|
|
ipoib_dbg_mcast(priv, "stopping multicast thread\n");
|
|
ipoib_dbg_mcast(priv, "stopping multicast thread\n");
|
|
|
|
|
|
|
|
+ spin_lock_irq(&priv->lock);
|
|
|
|
+ clear_bit(IPOIB_MCAST_STARTED, &priv->flags);
|
|
|
|
+ spin_unlock_irq(&priv->lock);
|
|
|
|
+
|
|
mutex_lock(&mcast_mutex);
|
|
mutex_lock(&mcast_mutex);
|
|
clear_bit(IPOIB_MCAST_RUN, &priv->flags);
|
|
clear_bit(IPOIB_MCAST_RUN, &priv->flags);
|
|
cancel_delayed_work(&priv->mcast_task);
|
|
cancel_delayed_work(&priv->mcast_task);
|
|
@@ -693,6 +701,12 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid,
|
|
*/
|
|
*/
|
|
spin_lock(&priv->lock);
|
|
spin_lock(&priv->lock);
|
|
|
|
|
|
|
|
+ if (!test_bit(IPOIB_MCAST_STARTED, &priv->flags)) {
|
|
|
|
+ ++priv->stats.tx_dropped;
|
|
|
|
+ dev_kfree_skb_any(skb);
|
|
|
|
+ goto unlock;
|
|
|
|
+ }
|
|
|
|
+
|
|
mcast = __ipoib_mcast_find(dev, mgid);
|
|
mcast = __ipoib_mcast_find(dev, mgid);
|
|
if (!mcast) {
|
|
if (!mcast) {
|
|
/* Let's create a new send only group now */
|
|
/* Let's create a new send only group now */
|
|
@@ -754,6 +768,7 @@ out:
|
|
ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN);
|
|
ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+unlock:
|
|
spin_unlock(&priv->lock);
|
|
spin_unlock(&priv->lock);
|
|
}
|
|
}
|
|
|
|
|