RDMA/rtrs-srv: Set minimal max_send_wr and max_recv_wr
authorJack Wang <jinpu.wang@cloud.ionos.com>
Mon, 14 Jun 2021 09:03:33 +0000 (11:03 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 18 Jun 2021 16:47:12 +0000 (13:47 -0300)
commit5e91eabf66c854f16ca2e954e5c68939bc81601e
tree3b036df87c63ff499125e8191e99bf8e732322c3
parent915e4af59f0b6a9e72dd9ef0fda853b87ae556c5
RDMA/rtrs-srv: Set minimal max_send_wr and max_recv_wr

Currently rtrs when create_qp use a coarse numbers (bigger in general),
which leads to hardware create more resources which only waste memory with
no benefits.

For max_send_wr, we don't really need alway max_qp_wr size when creating
qp, reduce it to cq_size.

For max_recv_wr,  cq_size is enough.

With the patch when sess_queue_depth=128, per session (2 paths) memory
consumption reduced from 188 MB to 65MB

When always_invalidate is enabled, we need send more wr, so treat it
special.

Fixes: 9cb837480424e ("RDMA/rtrs: server: main functionality")
Link: https://lore.kernel.org/r/20210614090337.29557-2-jinpu.wang@ionos.com
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Reviewed-by: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/ulp/rtrs/rtrs-srv.c