Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: <linux-rdma@vger.kernel.org>
Cc: <leon@kernel.org>, Xiao Yang <yangx.jy@cn.fujitsu.com>
Subject: [PATCH rdma-core] librdmacm: Make rdma_create_qp_ex() report proper errno
Date: Wed, 16 Dec 2020 09:54:59 +0800	[thread overview]
Message-ID: <20201216015459.78733-1-yangx.jy@cn.fujitsu.com> (raw)

Current rdma_create_qp_ex() reports fixed ENOMEM when calling
ibv_create_qp_ex() fails, so it's hard for user to know which
actual error happens on ibv_create_qp_ex().

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 librdmacm/cma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/librdmacm/cma.c b/librdmacm/cma.c
index 8c820ccf..20ee1e00 100644
--- a/librdmacm/cma.c
+++ b/librdmacm/cma.c
@@ -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;
 	}
 
-- 
2.25.1




             reply	other threads:[~2020-12-16  2:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  1:54 Xiao Yang [this message]
2020-12-16  8:21 ` [PATCH rdma-core] librdmacm: Make rdma_create_qp_ex() report proper errno 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=20201216015459.78733-1-yangx.jy@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