summaryrefslogtreecommitdiff
path: root/drivers/block/rnbd/rnbd-clt.c
diff options
context:
space:
mode:
authorJack Wang <jinpu.wang@cloud.ionos.com>2021-06-21 07:53:40 +0200
committerJason Gunthorpe <jgg@nvidia.com>2021-06-21 21:02:21 -0300
commit7404bddeb43902725c6b65421032f090ccea496b (patch)
treee5216510daa01295fd40545e135a2e0d4f3a1c7e /drivers/block/rnbd/rnbd-clt.c
parent6fc45596506b7a6d8c734d3f1b435318c7e7f678 (diff)
downloadlwn-7404bddeb43902725c6b65421032f090ccea496b.tar.gz
lwn-7404bddeb43902725c6b65421032f090ccea496b.zip
rnbd/rtrs-clt: Query and use max_segments from rtrs-clt.
With fast memory registration on write request, rnbd-clt can do bigger IO without split. rnbd-clt now can query rtrs-clt to get the max_segments, instead of using BMAX_SEGMENTS. BMAX_SEGMENTS is not longer needed, so remove it. Link: https://lore.kernel.org/r/20210621055340.11789-6-jinpu.wang@ionos.com Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com> Reviewed-by: Md Haris Iqbal <haris.iqbal@cloud.ionos.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/block/rnbd/rnbd-clt.c')
-rw-r--r--drivers/block/rnbd/rnbd-clt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
index c604a402cd5c..d6f12e6c91f7 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -92,7 +92,7 @@ static int rnbd_clt_set_dev_attr(struct rnbd_clt_dev *dev,
dev->fua = !!(rsp->cache_policy & RNBD_FUA);
dev->max_hw_sectors = sess->max_io_size / SECTOR_SIZE;
- dev->max_segments = BMAX_SEGMENTS;
+ dev->max_segments = sess->max_segments;
return 0;
}
@@ -1292,7 +1292,7 @@ find_and_get_or_create_sess(const char *sessname,
sess->rtrs = rtrs_clt_open(&rtrs_ops, sessname,
paths, path_cnt, port_nr,
0, /* Do not use pdu of rtrs */
- RECONNECT_DELAY, BMAX_SEGMENTS,
+ RECONNECT_DELAY,
MAX_RECONNECTS, nr_poll_queues);
if (IS_ERR(sess->rtrs)) {
err = PTR_ERR(sess->rtrs);
@@ -1306,6 +1306,7 @@ find_and_get_or_create_sess(const char *sessname,
sess->max_io_size = attrs.max_io_size;
sess->queue_depth = attrs.queue_depth;
sess->nr_poll_queues = nr_poll_queues;
+ sess->max_segments = attrs.max_segments;
err = setup_mq_tags(sess);
if (err)