public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Amir Vadai <amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Eyal Perry <eyalpe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Or Gerlitz <gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH FIX for-3.19] IB/ipoib: Fix failed multicast joins/sends
Date: Wed, 14 Jan 2015 10:38:10 -0500	[thread overview]
Message-ID: <1421249890.43839.243.camel@redhat.com> (raw)
In-Reply-To: <54B63CE9.3080205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

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

On Wed, 2015-01-14 at 11:54 +0200, Or Gerlitz wrote:
> On 1/14/2015 8:38 AM, Doug Ledford wrote:
> > The usage of IPOIB_MCAST_RUN as a flag is inconsistent.  In some places
> > it is used to mean "our device is administratively allowed to send
> > multicast joins/leaves/packets" [...]
> what? please tell which of these upstream hits (prior to any fix) has 
> this semantics?

Actually, almost all of them.  I don't think they were originally
intended to be that way, but as a result of the mechanics of how
multicast joins are done, the net result is what it is.  But even more
importantly, this semantic is what we *want*.  For example, in
join_finish() where it tests IPOIB_MCAST_RUN before queueing delayed
work on a join failure, we *want* this to queue work whether the current
task thinks it is done or not as this is an async failure case and the
thread could have thought it was finished and cleared the flag before we
got our failure.  Treating this flag with the old semantic leaves this
situation with a dangling error condition that doesn't get retried until
something else restarts the mcast thread.  In fact, in almost all of the
places that this flag is checked, we really do want to run the thread
again unless we are in the middle of a mcast flush or we are downing the
dev.  In all other cases, we want to requeue the task.  So the semantic
I'm applying here, even if not what you or some other people had in
mind, is in fact closer to the truth of how the flag is used, and is
more in line with how we *want* the flag used.

> # git grep -n IPOIB_MCAST_RUN drivers/infiniband/ulp/ipoib
> drivers/infiniband/ulp/ipoib/ipoib.h:90: IPOIB_MCAST_RUN           = 6,
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:434: if 
> (test_bit(IPOIB_MCAST_RUN, &priv->flags))
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:466:     if (status && 
> test_bit(IPOIB_MCAST_RUN, &priv->flags))
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:536: if 
> (test_bit(IPOIB_MCAST_RUN, &priv->flags))
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:550:     if 
> (!test_bit(IPOIB_MCAST_RUN, &priv->flags))
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:576: if 
> (test_bit(IPOIB_MCAST_RUN, &priv->flags))
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:634: 
> clear_bit(IPOIB_MCAST_RUN, &priv->flags);
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:644:     if 
> (!test_and_set_bit(IPOIB_MCAST_RUN, &priv->flags))
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:658: 
> clear_bit(IPOIB_MCAST_RUN, &priv->flags);
> drivers/infiniband/ulp/ipoib/ipoib_multicast.c:728: if 
> (!test_and_set_bit(IPOIB_MCAST_RUN, &priv->flags))
> 


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-01-14 15:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14  6:38 [PATCH FIX for-3.19] IB/ipoib: Fix failed multicast joins/sends Doug Ledford
     [not found] ` <c903a4f1282f7d5852157c68bcc3f4324fd4300f.1421217352.git.dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-01-14  9:54   ` Or Gerlitz
     [not found]     ` <54B63CE9.3080205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-01-14 15:38       ` Doug Ledford [this message]
2015-01-14 16:02   ` Erez Shitrit
     [not found]     ` <54B692FB.1010904-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-01-14 16:09       ` Doug Ledford
     [not found]         ` <1421251762.43839.249.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-01-14 18:47           ` Erez Shitrit
     [not found]             ` <54B6B9CA.6090208-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-01-14 19:08               ` 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=1421249890.43839.243.camel@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=eyalpe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@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