public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Dennis Dalessandro
	<dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mike Marciniszyn
	<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Alex Estrin <alex.estrin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Feras Daoud <ferasda-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH for-rc 5/7] Revert "IB/ipoib: Update broadcast object if PKey value was changed in index 0"
Date: Tue, 26 Sep 2017 19:27:29 +0300	[thread overview]
Message-ID: <20170926162729.GG6816@mtr-leonro.local> (raw)
In-Reply-To: <20170926130620.31476.82301.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2789 bytes --]

On Tue, Sep 26, 2017 at 06:06:22AM -0700, Dennis Dalessandro wrote:
> From: Alex Estrin <alex.estrin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> commit 9a9b8112699d 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: 9a9b8112699d ("IB/ipoib: Update broadcast object if PKey value was changed in index 0")
> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Alex Estrin <alex.estrin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/infiniband/ulp/ipoib/ipoib_ib.c |   13 -------------
>  1 files changed, 0 insertions(+), 13 deletions(-)
>

I consulted with Feras about it and it is his reply.

From Feras:
After applying the patch in question, the following scenario may happens:

    PKEY change event occurs, it calls update_parent_pkey (which updates the device and the priv broadcast)
    and then brings the device down. The flow of taking the device down flushes the multicast groups and
    the broadcast group. Since the patch changes the broadcast address, the flow fails to detach from the
    unattached group causing syndrome.

Mistakenly we thought that that patch will fix other issue with VM migrations when pkey change in index 0,
in this case the interface state was down so we did not hit this issue.

Anyway, your revert is correct.

Thanks,
Reviewed-by: Feras Daoud <ferasda-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-09-26 16:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26 13:05 [PATCH for-rc 0/7] IB/hfi1: Fixes for RC Dennis Dalessandro
2017-09-26 13:06 ` [PATCH for-rc 5/7] Revert "IB/ipoib: Update broadcast object if PKey value was changed in index 0" Dennis Dalessandro
     [not found]   ` <20170926130620.31476.82301.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-09-26 16:27     ` Leon Romanovsky [this message]
     [not found] ` <20170926130434.31476.81826.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-09-26 13:05   ` [PATCH for-rc 1/7] IB/hfi1: Turn off AOC TX after offline substates Dennis Dalessandro
2017-09-26 13:06   ` [PATCH for-rc 2/7] IB/hfi1: Only reset QSFP after link up and turn off AOC TX Dennis Dalessandro
2017-09-26 13:06   ` [PATCH for-rc 3/7] IB/hfi1: Check eeprom config partition validity Dennis Dalessandro
2017-09-26 13:06   ` [PATCH for-rc 4/7] IB/hfi1: Return correct value in general interrupt handler Dennis Dalessandro
2017-09-26 13:06   ` [PATCH for-rc 6/7] IB/hfi1: On error, fix use after free during user context setup Dennis Dalessandro
2017-09-26 13:06   ` [PATCH for-rc 7/7] IB/hfi1: Unsuccessful PCIe caps tuning should not fail driver load Dennis Dalessandro
2017-09-27 15:15   ` [PATCH for-rc 0/7] IB/hfi1: Fixes for RC Doug Ledford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170926162729.GG6816@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=alex.estrin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=ferasda-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox