===================================================================
@@ -548,6 +548,8 @@
int ipoib_mcast_attach(struct net_device *dev, u16 mlid,
union ib_gid *mgid, int set_qkey);
+void ipoib_mcast_remove_mc_list(struct net_device *dev, struct list_head *list);
+void ipoib_mcast_detach_sendonly(struct ipoib_dev_priv *priv, u8 *mgid, struct list_head *list);
int ipoib_init_qp(struct net_device *dev);
int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca);
===================================================================
@@ -1149,6 +1149,8 @@
unsigned long dt;
unsigned long flags;
int i;
+ LIST_HEAD(remove_list);
+ struct net_device *dev = priv->dev;
if (test_bit(IPOIB_STOP_NEIGH_GC, &priv->flags))
return;
@@ -1176,6 +1178,9 @@
lockdep_is_held(&priv->lock))) != NULL) {
/* was the neigh idle for two GC periods */
if (time_after(neigh_obsolete, neigh->alive)) {
+
+ ipoib_mcast_detach_sendonly(priv, neigh->daddr + 4, &remove_list);
+
rcu_assign_pointer(*np,
rcu_dereference_protected(neigh->hnext,
lockdep_is_held(&priv->lock)));
@@ -1191,6 +1196,7 @@
out_unlock:
spin_unlock_irqrestore(&priv->lock, flags);
+ ipoib_mcast_remove_mc_list(dev, &remove_list);
}
static void ipoib_reap_neigh(struct work_struct *work)
===================================================================
@@ -800,6 +800,23 @@
}
}
+/*
+ * Check if this is a sendonly multicast group. If so remove it from the list and put it
+ * onto the given list for final removal.
+ */
+void ipoib_mcast_detach_sendonly(struct ipoib_dev_priv *priv, u8 *mgid, struct list_head *remove_list)
+{
+ struct ipoib_mcast *mcast;
+
+ /* Is this multicast ? */
+ if (mcast_auto_create && *mgid == 0xff) {
+ mcast = __ipoib_mcast_find(priv->dev, mgid);
+
+ if (mcast && test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags))
+ ipoib_detach_mc_group(priv, mcast, remove_list);
+ }
+}
+
void ipoib_mcast_dev_flush(struct net_device *dev)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);