Commit bd3840a7 authored by Ivan Betsis's avatar Ivan Betsis Committed by Jim Harris
Browse files

nvmf/rdma: Add RPC to set new RDMA batching option



Add option to enable/disable work requests batching (RDMA only).

Signed-off-by: default avatarIvan Betsis <c_ivanb@mellanox.com>
Signed-off-by: default avatarEvgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: default avatarSasha Kotchubievsky <sashakot@mellanox.com>
Change-Id: I84ca599711cdc2713606444e7ec501c36671e796
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/925


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
parent c818233b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ RPC.
A new RPC `bdev_examine_bdev` was added to allow users to examine a bdev explicitly.
It can be used only if bdev_auto_examine is set to false by the RPC `bdev_set_options`.

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

### Miscellaneous

The contents of the log_rpc library have been moved to the event library. The log_rpc
+1 −0
Original line number Diff line number Diff line
@@ -4714,6 +4714,7 @@ dif_insert_or_strip | Optional | boolean | Enable DIF insert for write I
sock_priority               | Optional | number  | The socket priority of the connection owned by this transport (TCP only)
acceptor_backlog            | Optional | number  | The number of pending connections allowed in backlog before failing new connection attempts (RDMA only)
abort_timeout_sec           | Optional | number  | Abort execution timeout value, in seconds
no_wr_batching              | Optional | boolean | Disable work requests batching (RDMA only)

### Example

+5 −0
Original line number Diff line number Diff line
@@ -510,6 +510,10 @@ static const struct spdk_json_object_decoder rdma_transport_opts_decoder[] = {
		"no_srq", offsetof(struct rdma_transport_opts, no_srq),
		spdk_json_decode_bool, true
	},
	{
		"no_wr_batching", offsetof(struct rdma_transport_opts, no_wr_batching),
		spdk_json_decode_bool, true
	},
	{
		"acceptor_backlog", offsetof(struct rdma_transport_opts, acceptor_backlog),
		spdk_json_decode_int32, true
@@ -2562,6 +2566,7 @@ nvmf_rdma_dump_opts(struct spdk_nvmf_transport *transport, struct spdk_json_writ
	spdk_json_write_named_uint32(w, "max_srq_depth", rtransport->rdma_opts.max_srq_depth);
	spdk_json_write_named_bool(w, "no_srq", rtransport->rdma_opts.no_srq);
	spdk_json_write_named_int32(w, "acceptor_backlog", rtransport->rdma_opts.acceptor_backlog);
	spdk_json_write_named_bool(w, "no_wr_batching", rtransport->rdma_opts.no_wr_batching);
}

static int
+3 −1
Original line number Diff line number Diff line
@@ -1805,7 +1805,8 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
                                       dif_insert_or_strip=args.dif_insert_or_strip,
                                       sock_priority=args.sock_priority,
                                       acceptor_backlog=args.acceptor_backlog,
                                       abort_timeout_sec=args.abort_timeout_sec)
                                       abort_timeout_sec=args.abort_timeout_sec,
                                       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)
@@ -1827,6 +1828,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
    p.add_argument('-y', '--sock-priority', help='The sock priority of the tcp connection. Relevant only for TCP transport', type=int)
    p.add_argument('-l', '--acceptor_backlog', help='Pending connections allowed at one time. Relevant only for RDMA transport', type=int)
    p.add_argument('-x', '--abort-timeout-sec', help='Abort execution timeout value, in seconds', type=int)
    p.add_argument('-w', '--no-wr-batching', action='store_true', help='Disable work requests batching. Relevant only for RDMA transport')
    p.set_defaults(func=nvmf_create_transport)

    def nvmf_get_transports(args):
+5 −2
Original line number Diff line number Diff line
@@ -109,7 +109,8 @@ def nvmf_create_transport(client,
                          dif_insert_or_strip=None,
                          sock_priority=None,
                          acceptor_backlog=None,
                          abort_timeout_sec=None):
                          abort_timeout_sec=None,
                          no_wr_batching=None):
    """NVMf Transport Create options.

    Args:
@@ -129,7 +130,7 @@ def nvmf_create_transport(client,
        dif_insert_or_strip: Boolean flag to enable DIF insert/strip for I/O - TCP specific (optional)
        acceptor_backlog: Pending connections allowed at one time - RDMA specific (optional)
        abort_timeout_sec: Abort execution timeout value, in seconds (optional)

        no_wr_batching: Boolean flag to disable work requests batching - RDMA specific (optional)
    Returns:
        True or False
    """
@@ -171,6 +172,8 @@ def nvmf_create_transport(client,
        params['acceptor_backlog'] = acceptor_backlog
    if abort_timeout_sec:
        params['abort_timeout_sec'] = abort_timeout_sec
    if no_wr_batching is not None:
        params['no_wr_batching'] = no_wr_batching
    return client.call('nvmf_create_transport', params)