linux/drivers/infiniband/ulp
Alex Estrin 3158f228fc Revert "IB/ipoib: Update broadcast object if PKey value was changed in index 0"
commit 612601d001 upstream.

commit 9a9b811269 will cause core to fail UD QP from being destroyed
on ipoib unload, therefore cause resources leakage.
On pkey change event above patch modifies mgid before calling underlying
driver to detach it from QP. Drivers' detach_mcast() will fail to find
modified mgid it was never given to attach in a first place.
Core qp->usecnt will never go down, so ib_destroy_qp() will fail.

IPoIB driver actually does take care of new broadcast mgid based on new
pkey by destroying an old mcast object in ipoib_mcast_dev_flush())
....
	if (priv->broadcast) {
		rb_erase(&priv->broadcast->rb_node, &priv->multicast_tree);
		list_add_tail(&priv->broadcast->list, &remove_list);
		priv->broadcast = NULL;
	}
...

then in restarted ipoib_macst_join_task() creating a new broadcast mcast
object, sending join request and on completion tells the driver to attach
to reinitialized QP:
...
if (!priv->broadcast) {
...
	broadcast = ipoib_mcast_alloc(dev, 0);
...
	memcpy(broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4,
	       sizeof (union ib_gid));
	priv->broadcast = broadcast;
...

Fixes: 9a9b811269 ("IB/ipoib: Update broadcast object if PKey value was changed in index 0")
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Alex Estrin <alex.estrin@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-10-05 09:47:30 +02:00
..
ipoib Revert "IB/ipoib: Update broadcast object if PKey value was changed in index 0" 2017-10-05 09:47:30 +02:00
iser RDMA/iser: don't send an rkey if all data is written as immadiate-data 2017-07-20 11:20:50 -04:00
isert iser-target: Avoid isert_conn->cm_id dereference in isert_login_recv_done 2017-07-06 23:11:35 -07:00
opa_vnic Fixes #3 for 4.12-rc 2017-07-06 11:45:08 -07:00
srp RDMA/SA: Fix kernel panic in CMA request handler flow 2017-06-01 17:20:14 -04:00
srpt IB/srpt: Make a debug statement in srpt_abort_cmd() more informative 2017-07-06 22:58:01 -07:00
Makefile IB/opa-vnic: Virtual Network Interface Controller (VNIC) netdev 2017-04-20 12:01:38 -04:00