]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-rdma: don't complete requests before a send work request has completed
authorSagi Grimberg <sagi@grimberg.me>
Thu, 23 Nov 2017 15:35:22 +0000 (17:35 +0200)
committerChristoph Hellwig <hch@lst.de>
Sun, 26 Nov 2017 14:33:32 +0000 (15:33 +0100)
commitadf62f3a9fca47a98c48490e780766ba3b9af7dc
tree49ab3f97188e32b101fd008db4205024ff8109fd
parente4e34d5fc17eb9d2c2f9bee9bbf92741d52d4c70
nvme-rdma: don't complete requests before a send work request has completed

In order to guarantee that the HCA will never get an access violation
(either from invalidated rkey or from iommu) when retrying a send
operation we must complete a request only when both send completion and
the nvme cqe has arrived. We need to set the send/recv completions flags
atomically because we might have more than a single context accessing the
request concurrently (one is cq irq-poll context and the other is
user-polling used in IOCB_HIPRI).

Only then we are safe to invalidate the rkey (if needed), unmap the host
buffers, and complete the IO.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c