From: Sean Hefty <mshefty@ichips.intel.com>
To: Steve Wise <swise@opengridcomputing.com>
Cc: rdreier@cisco.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, openib-general@openib.org
Subject: Re: [PATCH 1/2] iWARP Connection Manager.
Date: Thu, 01 Jun 2006 14:09:12 -0700 [thread overview]
Message-ID: <447F5778.6010202@ichips.intel.com> (raw)
In-Reply-To: <1149181233.31610.34.camel@stevo-desktop>
Steve Wise wrote:
>>>+int iw_cm_disconnect(struct iw_cm_id *cm_id, int abrupt)
>>>+{
>>>+ struct iwcm_id_private *cm_id_priv;
>>>+ unsigned long flags;
>>>+ int ret = 0;
>>>+
>>>+ cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
>>>+ /* Wait if we're currently in a connect or accept downcall */
>>>+ wait_event(cm_id_priv->connect_wait,
>>>+ !test_bit(IWCM_F_CONNECT_WAIT, &cm_id_priv->flags));
>>
>>Am I understanding this check correctly? You're checking to see if the user has
>>called iw_cm_disconnect() at the same time that they called iw_cm_connect() or
>>iw_cm_accept(). Are connect / accept blocking, or are you just waiting for an
>>event?
>
>
> The CM must wait for the low level provider to finish a connect() or
> accept() operation before telling the low level provider to disconnect
> via modifying the iwarp QP. Regardless of whether they block, this
> disconnect can happen concurrently with the connect/accept so we need to
> hold the disconnect until the connect/accept completes.
>
>
>>>+EXPORT_SYMBOL(iw_cm_disconnect);
>>>+static void destroy_cm_id(struct iw_cm_id *cm_id)
>>>+{
>>>+ struct iwcm_id_private *cm_id_priv;
>>>+ unsigned long flags;
>>>+ int ret;
>>>+
>>>+ cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
>>>+ /* Wait if we're currently in a connect or accept downcall. A
>>>+ * listening endpoint should never block here. */
>>>+ wait_event(cm_id_priv->connect_wait,
>>>+ !test_bit(IWCM_F_CONNECT_WAIT, &cm_id_priv->flags));
>>
>>Same question/comment as above.
>>
>
>
> Same answer.
There's a difference between trying to handle the user calling
disconnect/destroy at the same time a call to accept/connect is active, versus
the user calling disconnect/destroy after accept/connect have returned. In the
latter case, I think you're fine. In the first case, this is allowing a user to
call destroy at the same time that they're calling accept/connect.
Additionally, there's no guarantee that the F_CONNECT_WAIT flag has been set by
accept/connect by the time disconnect/destroy tests it.
- Sean
next prev parent reply other threads:[~2006-06-01 21:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-31 18:26 [PATCH 0/2][RFC] iWARP Core Support Steve Wise
2006-05-31 18:26 ` [PATCH 1/2] iWARP Connection Manager Steve Wise
2006-05-31 18:40 ` Stephen Hemminger
2006-05-31 19:24 ` Roland Dreier
2006-05-31 20:47 ` Muli Ben-Yehuda
2006-05-31 20:58 ` Steve Wise
2006-05-31 21:01 ` Stephen Hemminger
2006-05-31 21:54 ` Roland Dreier
2006-05-31 22:22 ` Steve Wise
2006-05-31 22:22 ` Sean Hefty
2006-06-01 17:00 ` Steve Wise
2006-06-01 21:09 ` Sean Hefty [this message]
2006-06-01 22:21 ` [openib-general] " Tom Tucker
2006-06-01 17:11 ` Tom Tucker
2006-05-31 18:26 ` [PATCH 2/2] iWARP Core Changes Steve Wise
2006-05-31 18:36 ` Stephen Hemminger
2006-05-31 19:17 ` Roland Dreier
2006-05-31 20:30 ` Steve Wise
2006-05-31 20:32 ` Roland Dreier
2006-05-31 21:26 ` Sean Hefty
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=447F5778.6010202@ichips.intel.com \
--to=mshefty@ichips.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=openib-general@openib.org \
--cc=rdreier@cisco.com \
--cc=swise@opengridcomputing.com \
/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.