From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: Xiao Yang <yangx.jy@cn.fujitsu.com>
Cc: <linux-rdma@vger.kernel.org>, <leon@kernel.org>
Subject: Re: [PATCH v2] librdmacm: Make some functions report proper errno
Date: Wed, 16 Dec 2020 17:51:46 +0800 [thread overview]
Message-ID: <5FD9D8B2.1020208@cn.fujitsu.com> (raw)
In-Reply-To: <20201216092252.155110-1-yangx.jy@cn.fujitsu.com>
Hi Leon,
Thanks for your quick reply. :-)
I have done the same change on three
functions(ucma_get_device,ucma_create_cqs, rdma_create_qp_ex).
On 2020/12/16 17:22, Xiao Yang wrote:
> Some functions reports fixed ENOMEM when getting any failure, so
> it's hard for user to know which actual error happens on them.
>
> Fixes(ucma_get_device):
> 2ffda7f29913 ("librdmacm: Only allocate verbs resources when needed")
> 191c9346f335 ("librdmacm: Reference count access to verbs context")
> Fixes(ucma_create_cqs):
> f8f1335ad8d8 ("librdmacm: make CQs optional for rdma_create_qp")
> 9e33488e8e50 ("librdmacm: fix all calls to set errno")
> Fixes(rdma_create_qp_ex):
> d2efdede11f7 ("r4019: Add support for userspace RDMA connection management abstraction (CMA)")
> 4e33a4109a62 ("librdmacm: returns errors from the library consistently")
> 995eb0c90c1a ("rdmacm: Add support for XRC QPs")
For every function, I am not sure which one is an exact commit so just
attach all related commits ids.
Best Regards,
Xiao Yang
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
> librdmacm/cma.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> index 8c820ccf..a2575156 100644
> --- a/librdmacm/cma.c
> +++ b/librdmacm/cma.c
> @@ -635,7 +635,7 @@ static int ucma_get_device(struct cma_id_private *id_priv, __be64 guid,
> if (!cma_dev->pd)
> cma_dev->pd = ibv_alloc_pd(cma_dev->verbs);
> if (!cma_dev->pd) {
> - ret = ERR(ENOMEM);
> + ret = -1;
> goto out;
> }
>
> @@ -1490,7 +1490,7 @@ static int ucma_create_cqs(struct rdma_cm_id *id, uint32_t send_size, uint32_t r
> return 0;
> err:
> ucma_destroy_cqs(id);
> - return ERR(ENOMEM);
> + return -1;
> }
>
> int rdma_create_srq_ex(struct rdma_cm_id *id, struct ibv_srq_init_attr_ex *attr)
> @@ -1662,7 +1662,7 @@ int rdma_create_qp_ex(struct rdma_cm_id *id,
> attr->srq = id->srq;
> qp = ibv_create_qp_ex(id->verbs, attr);
> if (!qp) {
> - ret = ERR(ENOMEM);
> + ret = -1;
> goto err1;
> }
>
next prev parent reply other threads:[~2020-12-16 9:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 9:22 [PATCH v2] librdmacm: Make some functions report proper errno Xiao Yang
2020-12-16 9:51 ` Xiao Yang [this message]
2020-12-16 9:55 ` Leon Romanovsky
2020-12-21 1:26 ` Xiao Yang
2020-12-21 11:42 ` Leon Romanovsky
2020-12-22 3:40 ` 答复: " Yang, Xiao
2020-12-22 8:33 ` Leon Romanovsky
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=5FD9D8B2.1020208@cn.fujitsu.com \
--to=yangx.jy@cn.fujitsu.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.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