Skip to content

Commit

Permalink
nvmf/rdma: Add RPC to set new option batch
Browse files Browse the repository at this point in the history
Add option for disable/enable work requests batching (only RDMA).

Signed-off-by: Ivan Betsis <[email protected]>
Signed-off-by: Evgeniy Kochetov <[email protected]>
Signed-off-by: Alexey Marchuk <[email protected]>
Signed-off-by: Sasha Kotchubievsky <[email protected]>
  • Loading branch information
Ivan Betsis committed Feb 16, 2020
1 parent 6788d57 commit c2a2cae
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## v20.04: (Upcoming Release)

### rpc

Add optional 'no_wr_batching' parameter to 'nvmf_create_transport' RPC method.

### nvmf

Add 'no_wr_batching' parameter in 'spdk_nvmf_transport_opts' for the ability disable WR batching RDMA.
Expand Down
1 change: 1 addition & 0 deletions doc/jsonrpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3844,6 +3844,7 @@ no_srq | Optional | boolean | Disable shared receive queue
c2h_success | Optional | boolean | Disable C2H success optimization (TCP only)
dif_insert_or_strip | Optional | boolean | Enable DIF insert for write I/O and DIF strip for read I/O DIF (TCP only)
sock_priority | Optional | number | The socket priority of the connection owned by this transport (TCP only)
no_wr_batching | Optional | boolean | Disable work requests batching (RDMA only)

### Example:

Expand Down
5 changes: 5 additions & 0 deletions lib/nvmf/nvmf_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,10 @@ static const struct spdk_json_object_decoder nvmf_rpc_create_transport_decoder[]
"tgt_name", offsetof(struct nvmf_rpc_create_transport_ctx, tgt_name),
spdk_json_decode_string, true
},
{
"no_wr_batching", offsetof(struct nvmf_rpc_create_transport_ctx, opts.no_wr_batching),
spdk_json_decode_bool, false
},
};

static void
Expand Down Expand Up @@ -1745,6 +1749,7 @@ dump_nvmf_transport(struct spdk_json_write_ctx *w, struct spdk_nvmf_transport *t
if (type == SPDK_NVME_TRANSPORT_RDMA) {
spdk_json_write_named_uint32(w, "max_srq_depth", opts->max_srq_depth);
spdk_json_write_named_bool(w, "no_srq", opts->no_srq);
spdk_json_write_named_bool(w, "no_wr_batching", opts->no_wr_batching);
} else if (type == SPDK_NVME_TRANSPORT_TCP) {
spdk_json_write_named_bool(w, "c2h_success", opts->c2h_success);
spdk_json_write_named_uint32(w, "sock_priority", opts->sock_priority);
Expand Down
4 changes: 3 additions & 1 deletion scripts/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,8 @@ def nvmf_create_transport(args):
no_srq=args.no_srq,
c2h_success=args.c2h_success,
dif_insert_or_strip=args.dif_insert_or_strip,
sock_priority=args.sock_priority)
sock_priority=args.sock_priority,
no_wr_batching=args.no_wr_batching)

p = subparsers.add_parser('nvmf_create_transport', help='Create NVMf transport')
p.add_argument('-t', '--trtype', help='Transport type (ex. RDMA)', type=str, required=True)
Expand All @@ -1702,6 +1703,7 @@ def nvmf_create_transport(args):
p.add_argument('-o', '--c2h-success', action='store_false', help='Disable C2H success optimization. Relevant only for TCP transport')
p.add_argument('-f', '--dif-insert-or-strip', action='store_true', help='Enable DIF insert/strip. Relevant only for TCP transport')
p.add_argument('-y', '--sock-priority', help='The sock priority of the tcp connection. Relevant only for TCP transport', type=int)
p.add_argument('-b', '--no-wr-batching', action='store_false', help='Disable work requests batching. Relevant only for RDMA transport', default=False)
p.set_defaults(func=nvmf_create_transport)

def nvmf_get_transports(args):
Expand Down
7 changes: 5 additions & 2 deletions scripts/rpc/nvmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def nvmf_create_transport(client,
no_srq=False,
c2h_success=True,
dif_insert_or_strip=None,
sock_priority=None):
sock_priority=None,
no_wr_batching=None):
"""NVMf Transport Create options.
Args:
Expand All @@ -123,7 +124,7 @@ def nvmf_create_transport(client,
no_srq: Boolean flag to disable SRQ even for devices that support it - RDMA specific (optional)
c2h_success: Boolean flag to disable the C2H success optimization - TCP specific (optional)
dif_insert_or_strip: Boolean flag to enable DIF insert/strip for I/O - TCP specific (optional)
no_wr_batching: Boolean flag to disable work requests batching - RDMA specific (optional)
Returns:
True or False
"""
Expand Down Expand Up @@ -158,6 +159,8 @@ def nvmf_create_transport(client,
params['dif_insert_or_strip'] = dif_insert_or_strip
if sock_priority:
params['sock_priority'] = sock_priority
if no_wr_batching is not None:
params['no_wr_batching'] = no_wr_batching
return client.call('nvmf_create_transport', params)


Expand Down

0 comments on commit c2a2cae

Please sign in to comment.