Thread (9 messages) 9 messages, 2 authors, 2020-03-06

Re: [PATCH V2 3/3] nvmet-rdma: allocate RW ctxs according to mdts

From: Max Gurtovoy <hidden>
Date: 2020-03-05 22:59:41

On 3/5/2020 10:49 PM, Sagi Grimberg wrote:
quoted
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index d12ef0d..daab656 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -976,7 +976,7 @@ static int nvmet_rdma_create_queue_ib(struct 
nvmet_rdma_queue *queue)
  {
      struct ib_qp_init_attr qp_attr;
      struct nvmet_rdma_device *ndev = queue->dev;
-    int comp_vector, nr_cqe, ret, i;
+    int comp_vector, nr_cqe, ret, i, factor;
        /*
       * Spread the io queues across completion vectors,
@@ -1009,7 +1009,9 @@ static int nvmet_rdma_create_queue_ib(struct 
nvmet_rdma_queue *queue)
      qp_attr.qp_type = IB_QPT_RC;
      /* +1 for drain */
      qp_attr.cap.max_send_wr = queue->send_queue_size + 1;
-    qp_attr.cap.max_rdma_ctxs = queue->send_queue_size;
+    factor = rdma_rw_mr_factor(ndev->device, queue->cm_id->port_num,
+                   1 << NVMET_RDMA_MAX_MDTS);
Maybe I'm missing something, but aren't you missing the mpsmin
multiplier? your maxpages is not (1 << 8) but rather (1 << 20) isn't it?
why ?

we support 256 pages with 4KB size each to get 1MB "mdts".

The factor is in units of RW api context (that might limit the size of 
the MRs according to some logic).



_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help