Commit 3f3d0eab authored by Gioh Kim's avatar Gioh Kim Committed by Jason Gunthorpe

RDMA/rtrs: Define MIN_CHUNK_SIZE

Define MIN_CHUNK_SIZE to replace the hard-coding number.
We need 4k for metadata, so MIN_CHUNK_SIZE should be at least 8k.

Link: https://lore.kernel.org/r/20210528113018.52290-7-jinpu.wang@ionos.comSigned-off-by: default avatarGioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 3a98ea70
...@@ -56,6 +56,7 @@ enum { ...@@ -56,6 +56,7 @@ enum {
* somewhere between 1 and 65536 and it depends on the system. * somewhere between 1 and 65536 and it depends on the system.
*/ */
MAX_SESS_QUEUE_DEPTH = 65536, MAX_SESS_QUEUE_DEPTH = 65536,
MIN_CHUNK_SIZE = 8192,
RTRS_HB_INTERVAL_MS = 5000, RTRS_HB_INTERVAL_MS = 5000,
RTRS_HB_MISSED_MAX = 5, RTRS_HB_MISSED_MAX = 5,
......
...@@ -2165,9 +2165,9 @@ static int check_module_params(void) ...@@ -2165,9 +2165,9 @@ static int check_module_params(void)
sess_queue_depth, 1, MAX_SESS_QUEUE_DEPTH); sess_queue_depth, 1, MAX_SESS_QUEUE_DEPTH);
return -EINVAL; return -EINVAL;
} }
if (max_chunk_size < 4096 || !is_power_of_2(max_chunk_size)) { if (max_chunk_size < MIN_CHUNK_SIZE || !is_power_of_2(max_chunk_size)) {
pr_err("Invalid max_chunk_size value %d, has to be >= %d and should be power of two.\n", pr_err("Invalid max_chunk_size value %d, has to be >= %d and should be power of two.\n",
max_chunk_size, 4096); max_chunk_size, MIN_CHUNK_SIZE);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment