rpc: Add dif_insert_or_strip parameter to nvmf_create_transport RPC
Add an new optional parameter dif_insert_or_strip to nvmf_create_transport RPC. .INI config file will be deprecated and dif_insert_or_strip is not supported in .INI config file. Change-Id: Ibf38b599cff75eeb0056dd2125d6ec10d444f339 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458927 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
aa322721cb
commit
390cffb64e
@ -3574,6 +3574,7 @@ buf_cache_size | Optional | number | The number of shared buffers
|
||||
max_srq_depth | Optional | number | The number of elements in a per-thread shared receive queue (RDMA only)
|
||||
no_srq | Optional | boolean | Disable shared receive queue even for devices that support it. (RDMA only)
|
||||
c2h_success | Optional | boolean | Enable 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)
|
||||
|
||||
### Example:
|
||||
|
||||
|
@ -1462,6 +1462,10 @@ static const struct spdk_json_object_decoder nvmf_rpc_create_transport_decoder[]
|
||||
"c2h_success", offsetof(struct nvmf_rpc_create_transport_ctx, opts.c2h_success),
|
||||
spdk_json_decode_bool, true
|
||||
},
|
||||
{
|
||||
"dif_insert_or_strip", offsetof(struct nvmf_rpc_create_transport_ctx, opts.dif_insert_or_strip),
|
||||
spdk_json_decode_bool, true
|
||||
},
|
||||
};
|
||||
|
||||
static void
|
||||
@ -1600,6 +1604,7 @@ dump_nvmf_transport(struct spdk_json_write_ctx *w, struct spdk_nvmf_transport *t
|
||||
spdk_json_write_named_bool(w, "no_srq", opts->no_srq);
|
||||
} else if (type == SPDK_NVME_TRANSPORT_TCP) {
|
||||
spdk_json_write_named_bool(w, "c2h_success", opts->c2h_success);
|
||||
spdk_json_write_named_bool(w, "dif_insert_or_strip", opts->dif_insert_or_strip);
|
||||
}
|
||||
|
||||
spdk_json_write_object_end(w);
|
||||
|
@ -1418,7 +1418,8 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
buf_cache_size=args.buf_cache_size,
|
||||
max_srq_depth=args.max_srq_depth,
|
||||
no_srq=args.no_srq,
|
||||
c2h_success=args.c2h_success)
|
||||
c2h_success=args.c2h_success,
|
||||
dif_insert_or_strip=args.dif_insert_or_strip)
|
||||
|
||||
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)
|
||||
@ -1433,6 +1434,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
p.add_argument('-s', '--max-srq-depth', help='Max number of outstanding I/O per SRQ. Relevant only for RDMA transport', type=int)
|
||||
p.add_argument('-r', '--no-srq', action='store_true', help='Disable per-thread shared receive queue. Relevant only for RDMA transport')
|
||||
p.add_argument('-o', '--c2h-success', help='Enable C2H success optimization. Relevant only for TCP transport', type=bool)
|
||||
p.add_argument('-f', '--dif-insert-or-strip', action='store_true', help='Enable DIF insert/strip. Relevant only for TCP transport')
|
||||
p.set_defaults(func=nvmf_create_transport)
|
||||
|
||||
def get_nvmf_transports(args):
|
||||
|
@ -47,7 +47,8 @@ def nvmf_create_transport(client,
|
||||
buf_cache_size=None,
|
||||
max_srq_depth=None,
|
||||
no_srq=False,
|
||||
c2h_success=True):
|
||||
c2h_success=True,
|
||||
dif_insert_or_strip=None):
|
||||
"""NVMf Transport Create options.
|
||||
|
||||
Args:
|
||||
@ -63,6 +64,7 @@ def nvmf_create_transport(client,
|
||||
max_srq_depth: Max number of outstanding I/O per shared receive queue - RDMA specific (optional)
|
||||
no_srq: Boolean flag to disable SRQ even for devices that support it - RDMA specific (optional)
|
||||
c2h_success: Boolean flag to enable/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)
|
||||
|
||||
Returns:
|
||||
True or False
|
||||
@ -92,6 +94,8 @@ def nvmf_create_transport(client,
|
||||
params['no_srq'] = no_srq
|
||||
if c2h_success:
|
||||
params['c2h_success'] = c2h_success
|
||||
if dif_insert_or_strip:
|
||||
params['dif_insert_or_strip'] = dif_insert_or_strip
|
||||
return client.call('nvmf_create_transport', params)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user