linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] nvme-rdma: support devices with queue size < 32
@ 2017-03-23  9:04 Marta Rybczynska
  2017-03-23  9:24 ` Marta Rybczynska
  2017-03-23 14:00 ` Christoph Hellwig
  0 siblings, 2 replies; 22+ messages in thread
From: Marta Rybczynska @ 2017-03-23  9:04 UTC (permalink / raw)


In the case of small NVMe-oF queue size (<32) we may enter
a deadlock caused by the fact that the IB completions aren't sent
waiting for 32 and the send queue will fill up.

The error is seen as (using mlx5):
[ 2048.693355] mlx5_0:mlx5_ib_post_send:3765:(pid 7273):
[ 2048.693360] nvme nvme1: nvme_rdma_post_send failed with error code -12

The patch doesn't change the behaviour for remote devices with
larger queues.

Signed-off-by: Marta Rybczynska <marta.rybczynska at kalray.eu>
Signed-off-by: Samuel Jones <sjones at kalray.eu>
---
 drivers/nvme/host/rdma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 779f516..8ea4cba 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1023,6 +1023,7 @@ static int nvme_rdma_post_send(struct nvme_rdma_queue *queue,
 {
        struct ib_send_wr wr, *bad_wr;
        int ret;
+       int sig_limit;
 
        sge->addr   = qe->dma;
        sge->length = sizeof(struct nvme_command),
@@ -1054,7 +1055,8 @@ static int nvme_rdma_post_send(struct nvme_rdma_queue *queue,
         * embedded in request's payload, is not freed when __ib_process_cq()
         * calls wr_cqe->done().
         */
-       if ((++queue->sig_count % 32) == 0 || flush)
+       sig_limit = min(queue->queue_size, 32);
+       if ((++queue->sig_count % sig_limit) == 0 || flush)
                wr.send_flags |= IB_SEND_SIGNALED;
 
        if (first)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-04-10 11:29 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-23  9:04 [PATCH RFC] nvme-rdma: support devices with queue size < 32 Marta Rybczynska
2017-03-23  9:24 ` Marta Rybczynska
2017-03-23 14:00 ` Christoph Hellwig
2017-03-23 14:36   ` Marta Rybczynska
2017-03-28 11:09     ` Sagi Grimberg
2017-03-28 11:20       ` Marta Rybczynska
2017-03-28 11:30         ` Sagi Grimberg
2017-03-29  9:36           ` Marta Rybczynska
2017-03-29 13:29           ` Jason Gunthorpe
2017-03-29 15:47             ` Sagi Grimberg
2017-03-29 16:27               ` Jason Gunthorpe
2017-03-29 16:39                 ` Sagi Grimberg
2017-03-29 16:44                   ` Doug Ledford
2017-03-29 16:47                     ` Doug Ledford
2017-03-29 16:59                       ` Sagi Grimberg
2017-03-29 22:19                         ` Jason Gunthorpe
2017-03-30 14:23                         ` Marta Rybczynska
2017-04-06 12:29                           ` Marta Rybczynska
2017-04-06 13:02                             ` Leon Romanovsky
2017-04-07 13:31                               ` Marta Rybczynska
2017-04-09 12:31                                 ` Sagi Grimberg
2017-04-10 11:29                                   ` Marta Rybczynska

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