Re: [PATCH 1/3] iw_cxgb4: refactor sq/rq drain logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Hi Steve,

I've pulled these three patches for 4.10-rc.  Thanks.

-- 
Doug Ledford <dledford@xxxxxxxxxx>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux