From: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
To: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] IB: new common API for draining a queue pair
Date: Sat, 6 Feb 2016 19:08:38 +0200 [thread overview]
Message-ID: <20160206170838.GC8584@leon.nu> (raw)
In-Reply-To: <2da1db58d642789e8df154e34d622a37295d1ba3.1454709317.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
On Fri, Feb 05, 2016 at 01:13:16PM -0800, Steve Wise wrote:
> From: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+p6NamaJ0bNTAL8bYrjMMd8@public.gmane.org>
>
> Add provider-specific drain_qp function for providers needing special
> drain logic.
>
> Add static function __ib_drain_qp() which posts noop WRs to the RQ and
> SQ and blocks until their completions are processed. This ensures the
> applications completions have all been processed.
>
> Add API function ib_drain_qp() which calls the provider-specific drain
> if it exists or __ib_drain_qp().
>
> Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> ---
> drivers/infiniband/core/verbs.c | 72 +++++++++++++++++++++++++++++++++++++++++
> include/rdma/ib_verbs.h | 2 ++
> 2 files changed, 74 insertions(+)
>
...
> + ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
> + if (ret) {
> + WARN_ONCE(ret, "failed to drain QP: %d\n", ret);
> + return;
> + }
> +
> + ret = ib_post_recv(qp, &rwr, &bad_rwr);
> + if (ret) {
> + WARN_ONCE(ret, "failed to drain recv queue: %d\n", ret);
> + return;
> + }
> +
> + ret = ib_post_send(qp, &swr, &bad_swr);
> + if (ret) {
> + WARN_ONCE(ret, "failed to drain send queue: %d\n", ret);
> + return;
You are returning here despite the fact that recv queue drained
successfully and you can wait for completion of rdrain safely.
Is it done on purpose?
> + }
> +
> + wait_for_completion(&rdrain.done);
> + wait_for_completion(&sdrain.done);
> +}
> +
--
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:[~2016-02-06 17:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-05 21:55 [PATCH 0/3] new ib_drain_qp() API Steve Wise
[not found] ` <cover.1454709317.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-01-14 18:24 ` [PATCH 2/3] iw_cxgb4: add drain_qp function Steve Wise
2016-01-27 20:09 ` [PATCH 3/3] IB/srp: use ib_drain_qp() Steve Wise
2016-02-05 21:13 ` [PATCH 1/3] IB: new common API for draining a queue pair Steve Wise
[not found] ` <2da1db58d642789e8df154e34d622a37295d1ba3.1454709317.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-05 21:49 ` Chuck Lever
[not found] ` <3AB519EB-3BFE-4A02-A825-F74EECD2CE19-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-02-05 21:53 ` Steve Wise
2016-02-05 22:00 ` Chuck Lever
[not found] ` <53AAECEE-AC46-4E28-9FC0-DB1E567A2A50-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-02-05 22:20 ` Chuck Lever
2016-02-08 15:23 ` Steve Wise
2016-02-06 16:10 ` Devesh Sharma
[not found] ` <CANjDDBjFY+u=8UXVCkKkK0LKSWiRcfZYnP9035m5owAYZnfn6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-07 11:53 ` Sagi Grimberg
[not found] ` <56B73049.5040901-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-02-08 10:37 ` Devesh Sharma
[not found] ` <CANjDDBiGVxmMn7H-__z48hS93mHoqejiZgsry0DmLwJKxZ=MqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-08 15:53 ` Steve Wise
2016-02-08 15:34 ` Steve Wise
2016-02-06 17:08 ` Leon Romanovsky [this message]
[not found] ` <20160206170838.GC8584-2ukJVAZIZ/Y@public.gmane.org>
2016-02-07 11:51 ` Sagi Grimberg
[not found] ` <56B72FD4.3060407-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-02-08 15:24 ` Steve Wise
-- strict thread matches above, loose matches on Subject: below --
2016-02-08 22:14 [PATCH v2 0/3] new ib_drain_qp() API Steve Wise
[not found] ` <cover.1454969695.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-05 21:13 ` [PATCH 1/3] IB: new common API for draining a queue pair Steve Wise
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=20160206170838.GC8584@leon.nu \
--to=leon-2ukjvaziz/y@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@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;
as well as URLs for NNTP newsgroup(s).