nvmet-rdma: allocate RW ctxs according to mdts
authorMax Gurtovoy <maxg@mellanox.com>
Sun, 8 Mar 2020 10:55:05 +0000 (12:55 +0200)
committerKeith Busch <kbusch@kernel.org>
Wed, 25 Mar 2020 19:51:55 +0000 (04:51 +0900)
commitc363f249e7e6576587d8982d9087406fe98beb99
tree6a99da74470924745fa38dd7797179708b9e135b
parentec6d20e16c2d2bef8df2d82d63dcee51caa4ac27
nvmet-rdma: allocate RW ctxs according to mdts

Current nvmet-rdma code allocates MR pool budget based on queue size,
assuming both host and target use the same "max_pages_per_mr" count.
After limiting the mdts value for RDMA controllers, we know the factor
of maximum MR's per IO operation. Thus, make sure MR pool will be
sufficient for the required IO depth and IO size.

That is, say host's SQ size is 100, then the MR pool budget allocated
currently at target will also be 100 MRs. But 100 IO WRITE Requests
with 256 sg_count(IO size above 1MB) require 200 MRs when target's
"max_pages_per_mr" is 128.

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