Skip to content

Commit 29c5542

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Bound the inline threshold values
Currently the sysctls that allow setting the inline threshold allow any value to be set. Small values only make the transport run slower. The default 1KB setting is as low as is reasonable. And the logic that decides how to divide a Send buffer between RPC-over-RDMA header and RPC message assumes (but does not check) that the lower bound is not crazy (say, 57 bytes). Send and receive buffers share a page with some control information. Values larger than about 3KB can't be supported, currently. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Tested-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 6b26cc8 commit 29c5542

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

include/linux/sunrpc/xprtrdma.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
#define RPCRDMA_DEF_SLOT_TABLE (128U)
5353
#define RPCRDMA_MAX_SLOT_TABLE (256U)
5454

55-
#define RPCRDMA_DEF_INLINE (1024) /* default inline max */
55+
#define RPCRDMA_MIN_INLINE (1024) /* min inline thresh */
56+
#define RPCRDMA_DEF_INLINE (1024) /* default inline thresh */
57+
#define RPCRDMA_MAX_INLINE (3068) /* max inline thresh */
5658

5759
/* Memory registration strategies, by number.
5860
* This is part of a kernel / user space API. Do not remove. */

net/sunrpc/xprtrdma/transport.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ static unsigned int xprt_rdma_memreg_strategy = RPCRDMA_FRMR;
7373

7474
static unsigned int min_slot_table_size = RPCRDMA_MIN_SLOT_TABLE;
7575
static unsigned int max_slot_table_size = RPCRDMA_MAX_SLOT_TABLE;
76+
static unsigned int min_inline_size = RPCRDMA_MIN_INLINE;
77+
static unsigned int max_inline_size = RPCRDMA_MAX_INLINE;
7678
static unsigned int zero;
7779
static unsigned int max_padding = PAGE_SIZE;
7880
static unsigned int min_memreg = RPCRDMA_BOUNCEBUFFERS;
@@ -96,13 +98,17 @@ static struct ctl_table xr_tunables_table[] = {
9698
.maxlen = sizeof(unsigned int),
9799
.mode = 0644,
98100
.proc_handler = proc_dointvec,
101+
.extra1 = &min_inline_size,
102+
.extra2 = &max_inline_size,
99103
},
100104
{
101105
.procname = "rdma_max_inline_write",
102106
.data = &xprt_rdma_max_inline_write,
103107
.maxlen = sizeof(unsigned int),
104108
.mode = 0644,
105109
.proc_handler = proc_dointvec,
110+
.extra1 = &min_inline_size,
111+
.extra2 = &max_inline_size,
106112
},
107113
{
108114
.procname = "rdma_inline_write_padding",

0 commit comments

Comments
 (0)