diff --git a/lib/event/subsystems/nvmf/nvmf_rpc.c b/lib/event/subsystems/nvmf/nvmf_rpc.c index 1c144bda00..2a02eb9ec6 100644 --- a/lib/event/subsystems/nvmf/nvmf_rpc.c +++ b/lib/event/subsystems/nvmf/nvmf_rpc.c @@ -1454,6 +1454,10 @@ static const struct spdk_json_object_decoder nvmf_rpc_create_transport_decoder[] "num_shared_buffers", offsetof(struct nvmf_rpc_create_transport_ctx, opts.num_shared_buffers), spdk_json_decode_uint32, true }, + { + "buf_cache_size", offsetof(struct nvmf_rpc_create_transport_ctx, opts.buf_cache_size), + spdk_json_decode_uint32, true + }, }; static void diff --git a/scripts/rpc.py b/scripts/rpc.py index 540058edf4..d78eb2496b 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1280,7 +1280,8 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse max_io_size=args.max_io_size, io_unit_size=args.io_unit_size, max_aq_depth=args.max_aq_depth, - num_shared_buffers=args.num_shared_buffers) + num_shared_buffers=args.num_shared_buffers, + buf_cache_size=args.buf_cache_size) 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) @@ -1291,6 +1292,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse p.add_argument('-u', '--io-unit-size', help='I/O unit size (bytes)', type=int) p.add_argument('-a', '--max-aq-depth', help='Max number of admin cmds per AQ', type=int) p.add_argument('-n', '--num-shared-buffers', help='The number of pooled data buffers available to the transport', type=int) + p.add_argument('-b', '--buf-cache-size', help='The number of shared buffers to cache per poll group', type=int) p.set_defaults(func=nvmf_create_transport) def get_nvmf_transports(args): diff --git a/scripts/rpc/nvmf.py b/scripts/rpc/nvmf.py index b479b6320e..848ac075c6 100644 --- a/scripts/rpc/nvmf.py +++ b/scripts/rpc/nvmf.py @@ -82,7 +82,8 @@ def nvmf_create_transport(client, max_io_size=None, io_unit_size=None, max_aq_depth=None, - num_shared_buffers=None): + num_shared_buffers=None, + buf_cache_size=None): """NVMf Transport Create options. Args: @@ -94,6 +95,7 @@ def nvmf_create_transport(client, io_unit_size: I/O unit size in bytes (optional) max_aq_depth: Max size admin quque per controller (optional) num_shared_buffers: The number of pooled data buffers available to the transport (optional) + buf_cache_size: The number of shared buffers to cache per poll group (optional) Returns: True or False @@ -115,6 +117,8 @@ 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: + params['buf_cache_size'] = buf_cache_size return client.call('nvmf_create_transport', params)