From: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: "Hefty, Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"dotanb-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org"
<dotanb-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
Subject: Re: Questions regarding CMA
Date: Sun, 17 Jul 2011 10:08:53 +0300 [thread overview]
Message-ID: <201107171008.53552.jackm@dev.mellanox.co.il> (raw)
In-Reply-To: <1828884A29C6694DAF28B7E6B8A8237302E14C-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
On Thursday 14 July 2011 20:46, Hefty, Sean wrote:
> Although it's a minor performance gain, I'm leaning towards keeping id_priv->cm_id.ib = NULL on failure, either by resetting it or using a local variable. cma_has_cm_dev() can then be replaced by checking id_priv->cm_id.ib for non-NULL, and checks for IS_ERR(id_priv->cm_id.ib) are removed.
>
> > Please consider the patch below as a starting point (I did not touch the iwarp
> > code).
> > Please let me know (ASAP) what you think.
> > (I still leave a window here where id_priv->cm_id.ib is ERR. Is this a
> > problem?
> > Would it be better to use a local variable instead of id_priv->cm_id.ib, and
> > only assign to id_priv->cm_id.ib when all the error checks have passed?
> > This would leave a window where a successful cm_id creation is not
> > immediately assigned
> > to the CMA object -- would this be a problem?).
>
> Without adding more synchronization, we need to ensure that id_priv->cm_id.ib is set before a user can receive any callbacks.
> This restricts our use of a local variable to the create_cm_id calls only.
> See cma_connect_iw() for an example of using this approach.
>
Agreed. That way we never have to test for IS_ERR. I'll send a patch.
-Jack
--
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
next prev parent reply other threads:[~2011-07-17 7:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 7:58 Questions regarding CMA Jack Morgenstein
[not found] ` <201107141058.29879.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-07-14 17:46 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237302E14C-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-07-17 7:08 ` Jack Morgenstein [this message]
2011-07-17 10:46 ` [PATCH] rdma_cm: avoid assigning an IS_ERR value to cm id pointer in CMA id object Jack Morgenstein
[not found] ` <201107171346.48065.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-07-18 16:35 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237302E6B9-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-07-18 16:39 ` Roland Dreier
[not found] ` <CAL1RGDWn_wqK3-0NM4NG1=wHw9_Q-2TT2goB_H_3RtyPEdS7aQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-19 6:45 ` Jack Morgenstein
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=201107171008.53552.jackm@dev.mellanox.co.il \
--to=jackm-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
--cc=dotanb-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox