From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@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] iw_cxgb4: refactor sq/rq drain logic
Date: Tue, 10 Jan 2017 14:03:00 -0500 [thread overview]
Message-ID: <1484074980.2149.25.camel@redhat.com> (raw)
In-Reply-To: <68eb584a0cf57442ca6b2be97f915ab03c9b4293.1482442436.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2052 bytes --]
On Thu, 2016-12-22 at 07:04 -0800, Steve Wise wrote:
> With the addition of the IB/Core drain API, iw_cxgb4 supported drain
> by watching the CQs when the QP was out of RTS and signalling "drain
> complete" when the last CQE is polled. This, however, doesn't fully
> support the drain semantics. Namely, the drain logic is supposed to
> signal
> "drain complete" only when the application has _processed_ the last
> CQE,
> not just removed them from the CQ. Thus a small timing hole exists
> that
> can cause touch after free type bugs in applications using the drain
> API
> (nvmf, iSER, for example). So iw_cxgb4 needs a better solution.
>
> The iWARP Verbs spec mandates that "_at some point_ after the QP is
> moved to ERROR", the iWARP driver MUST synchronously fail post_send
> and
> post_recv calls. iw_cxgb4 was currently not allowing any posts once
> the
> QP is in ERROR. This was in part due to the fact that the HW queues
> for
> the QP in ERROR state are disabled at this point, so there wasn't
> much
> else to do but fail the post operation synchronously. This
> restriction
> is what drove the first drain implementation in iw_cxgb4 that has the
> above mentioned flaw.
>
> This patch changes iw_cxgb4 to allow post_send and post_recv WRs
> after
> the QP is moved to ERROR state for kernel mode users, thus still
> adhering
> to the Verbs spec for user mode users, but allowing flush WRs for
> kernel
> users. Since the HW queues are disabled, we just synthesize a CQE
> for
> this post, queue it to the SW CQ, and then call the CQ event handler.
> This enables proper drain operations for the various storage
> applications.
>
> Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Hi Steve,
I've pulled these three patches for 4.10-rc. Thanks.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2017-01-10 19:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-22 15:04 [PATCH 1/3] iw_cxgb4: refactor sq/rq drain logic Steve Wise
[not found] ` <68eb584a0cf57442ca6b2be97f915ab03c9b4293.1482442436.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-12-22 15:40 ` [PATCH 2/3] iw_cxgb4: free EQ queue memory on last deref Steve Wise
2016-12-22 15:40 ` [PATCH 3/3] iw_cxgb4: do not send RX_DATA_ACK CPLs after close/abort Steve Wise
2017-01-10 19:03 ` Doug Ledford [this message]
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=1484074980.2149.25.camel@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.