public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH/libmlx4] Return failure if asked to resize CQ to fewer than outstanding entries
Date: Sun, 04 Sep 2016 12:15:39 -0700	[thread overview]
Message-ID: <87wpirxyqs.fsf@digitalvampire.org> (raw)

From: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>

Don't silently return 0 (success) but not resize the CQ when the number of
outstanding entries is smaller than the size requested.  Instead return
EINVAL so the consumer knows the CQ wasn't resized.

This is one of the fixes in kernel commit 8ab9406a41c8 ("IB/mlx4: Bug fixes
in mlx4_ib_resize_cq") from Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>.

Signed-off-by: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
---
 src/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/verbs.c b/src/verbs.c
index 43853c0c6532..5cc82cf38763 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -392,7 +392,7 @@ int mlx4_resize_cq(struct ibv_cq *ibcq, int cqe)
 	/* Can't be smaller then the number of outstanding CQEs */
 	outst_cqe = mlx4_get_outstanding_cqes(cq);
 	if (cqe < outst_cqe + 1) {
-		ret = 0;
+		ret = EINVAL;
 		goto out;
 	}
 
-- 
2.9.3

--
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

             reply	other threads:[~2016-09-04 19:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04 19:15 Roland Dreier [this message]
     [not found] ` <87wpirxyqs.fsf-ukP65eMp1S23Y08NHXK2NB2eb7JE58TQ@public.gmane.org>
2016-09-06 14:00   ` [PATCH/libmlx4] Return failure if asked to resize CQ to fewer than outstanding entries Yishai Hadas

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=87wpirxyqs.fsf@digitalvampire.org \
    --to=roland-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@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