All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] iw_cm: Call provider listen_destroy function before changing state.
Date: Wed, 22 Feb 2012 14:43:22 -0600	[thread overview]
Message-ID: <4F45536A.3050501@opengridcomputing.com> (raw)
In-Reply-To: <CAG4TOxMXTzLDynza4KOaccx2C+Nn0485Xk_hXgg_bG0CiCTSEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 02/22/2012 02:32 PM, Roland Dreier wrote:
> On Wed, Feb 22, 2012 at 11:43 AM, Steve Wise
> <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>  wrote:
>>       spin_lock_irqsave(&cm_id_priv->lock, flags);
>>         switch (cm_id_priv->state) {
>>         case IW_CM_STATE_LISTEN:
>> -               cm_id_priv->state = IW_CM_STATE_DESTROYING;
>>                 spin_unlock_irqrestore(&cm_id_priv->lock, flags);
>>                 /* destroy the listening endpoint */
>>                 ret = cm_id->device->iwcm->destroy_listen(cm_id);
>>                 spin_lock_irqsave(&cm_id_priv->lock, flags);
>> +               cm_id_priv->state = IW_CM_STATE_DESTROYING;
>>                 break;
>>         case IW_CM_STATE_ESTABLISHED:
>>                 cm_id_priv->state = IW_CM_STATE_DESTROYING;
> This seems a bit wonky to me... with the old code, we set the state to
> DESTROYING inside the lock, so we know all previous connections
> were either done with their locked region or saw the new state.
>
> Now we have a window where are done with destroy_listen() but
> the state is still not DESTROYING.
>
> Is it possible to have the provider reject requests instead of silently
> dropping them?  Would that be a better fix?
>

Perhaps.   Or the connect request event handler could return a status indicating whether or not it queued the request 
and will subsequently accept or reject it.



>   - R.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-02-22 20:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 19:43 [PATCH] iw_cm: Call provider listen_destroy function before changing state Steve Wise
     [not found] ` <20120222194337.21025.30754.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
2012-02-22 19:50   ` Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A82373374F1119-P5GAC/sN6hlcIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-02-22 20:02       ` Steve Wise
     [not found]         ` <4F4549E9.3090102-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2012-02-22 20:20           ` Steve Wise
2012-02-22 20:32   ` Roland Dreier
     [not found]     ` <CAG4TOxMXTzLDynza4KOaccx2C+Nn0485Xk_hXgg_bG0CiCTSEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-22 20:43       ` Steve Wise [this message]
     [not found]         ` <4F45536A.3050501-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2012-02-22 21:01           ` Steve Wise

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=4F45536A.3050501@opengridcomputing.com \
    --to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sean.hefty-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.