On Thu, Sep 24, 2015 at 8:00 PM, Christoph Lameter <cl@xxxxxxxxx> wrote: > Ok here is the fixed up and tested V2 of the patch. Can this go in with > Doug's patch? Repeating myself... do you find some over complexity in Erez's implementation? what's the rational for not using his patch and yes using yours? Erez and Co were very busy with some internal deadlines and he's now OOO (it's a high Holiday season now) - will be able to review your patch once he's back (Oct 6, I believe). It seems that the patch does the job, but there are locking/contexts and such to consider here, so I can't just ack it, have you passed it through testing? Or. > Subject: ipoib: Expire sendonly multicast joins on neighbor expiration V2 > > Add mcast_leave functionality to __ipoib_reap_neighbor. > > Signed-off-by: Christoph Lameter <cl@xxxxxxxxx> > > Index: linux/drivers/infiniband/ulp/ipoib/ipoib_main.c > =================================================================== > --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c 2015-09-23 09:51:19.259274231 -0500 > +++ linux/drivers/infiniband/ulp/ipoib/ipoib_main.c 2015-09-23 09:59:59.803289023 -0500 > @@ -1149,6 +1149,9 @@ > unsigned long dt; > unsigned long flags; > int i; > + LIST_HEAD(remove_list); > + struct ipoib_mcast *mcast, *tmcast; > + struct net_device *dev = priv->dev; > > if (test_bit(IPOIB_STOP_NEIGH_GC, &priv->flags)) > return; > @@ -1176,6 +1179,19 @@ > lockdep_is_held(&priv->lock))) != NULL) { > /* was the neigh idle for two GC periods */ > if (time_after(neigh_obsolete, neigh->alive)) { > + u8 *mgid = neigh->daddr + 4; > + > + /* Is this multicast ? */ > + if (*mgid == 0xff) { > + mcast = __ipoib_mcast_find(dev, mgid); > + > + if (mcast && test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) { > + list_del(&mcast->list); > + rb_erase(&mcast->rb_node, &priv->multicast_tree); > + list_add_tail(&mcast->list, &remove_list); > + } > + } > + > rcu_assign_pointer(*np, > rcu_dereference_protected(neigh->hnext, > lockdep_is_held(&priv->lock))); > @@ -1191,6 +1207,8 @@ > > out_unlock: > spin_unlock_irqrestore(&priv->lock, flags); > + list_for_each_entry_safe(mcast, tmcast, &remove_list, list) > + ipoib_mcast_leave(dev, mcast); > } > > static void ipoib_reap_neigh(struct work_struct *work) > Index: linux/drivers/infiniband/ulp/ipoib/ipoib.h > =================================================================== > --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib.h 2015-09-23 09:51:19.259274231 -0500 > +++ linux/drivers/infiniband/ulp/ipoib/ipoib.h 2015-09-23 09:51:19.255274231 -0500 > @@ -548,6 +548,8 @@ > > int ipoib_mcast_attach(struct net_device *dev, u16 mlid, > union ib_gid *mgid, int set_qkey); > +int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast); > +struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid); > > int ipoib_init_qp(struct net_device *dev); > int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca); > Index: linux/drivers/infiniband/ulp/ipoib/ipoib_multicast.c > =================================================================== > --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 2015-09-23 09:51:19.259274231 -0500 > +++ linux/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 2015-09-23 09:51:19.255274231 -0500 > @@ -158,7 +158,7 @@ > return mcast; > } > > -static struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid) > +struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid) > { > struct ipoib_dev_priv *priv = netdev_priv(dev); > struct rb_node *n = priv->multicast_tree.rb_node; > @@ -705,7 +705,7 @@ > return 0; > } > > -static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast) > +int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast) > { > struct ipoib_dev_priv *priv = netdev_priv(dev); > int ret = 0; -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html