rpc/nvmf.py: pass zero values to SPDK when allowed

in_capsule_data_size/buf_cache_size/sock_priority/max_namespaces can be 0,
which should be passed in nvmf_create_transport/nvmf_create_subsystem commands.

Signed-off-by: Allen Zhu <allenz@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: Ib557cf9f20f7ec2c0b3c31156cd79dbd670ce7e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3815
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Allen Zhu 2020-08-04 10:24:41 +03:00 committed by Tomasz Zawadzki
parent f600ca4c3c
commit 96ab62802c

View File

@ -148,7 +148,7 @@ def nvmf_create_transport(client,
params['max_qpairs_per_ctrlr'] = max_qpairs_per_ctrlr
if max_io_qpairs_per_ctrlr:
params['max_io_qpairs_per_ctrlr'] = max_io_qpairs_per_ctrlr
if in_capsule_data_size:
if in_capsule_data_size is not None:
params['in_capsule_data_size'] = in_capsule_data_size
if max_io_size:
params['max_io_size'] = max_io_size
@ -158,7 +158,7 @@ def nvmf_create_transport(client,
params['max_aq_depth'] = max_aq_depth
if num_shared_buffers:
params['num_shared_buffers'] = num_shared_buffers
if buf_cache_size:
if buf_cache_size is not None:
params['buf_cache_size'] = buf_cache_size
if max_srq_depth:
params['max_srq_depth'] = max_srq_depth
@ -168,7 +168,7 @@ def nvmf_create_transport(client,
params['c2h_success'] = c2h_success
if dif_insert_or_strip:
params['dif_insert_or_strip'] = dif_insert_or_strip
if sock_priority:
if sock_priority is not None:
params['sock_priority'] = sock_priority
if acceptor_backlog is not None:
params['acceptor_backlog'] = acceptor_backlog
@ -258,7 +258,7 @@ def nvmf_create_subsystem(client,
if allow_any_host:
params['allow_any_host'] = True
if max_namespaces:
if max_namespaces is not None:
params['max_namespaces'] = max_namespaces
if tgt_name: