From 3709db7383c837cd071819b7a7d2182d72541095 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Mon, 7 Jan 2019 14:27:26 -0700 Subject: [PATCH] nvmf: add buf_cache_size to conf and rpc functions Change-Id: I11514dc5981e9750d693202ff86af22b2064ae72 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/439434 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker --- etc/spdk/nvmf.conf.in | 3 +++ lib/event/subsystems/nvmf/conf.c | 5 +++++ lib/event/subsystems/nvmf/nvmf_rpc.c | 1 + 3 files changed, 9 insertions(+) diff --git a/etc/spdk/nvmf.conf.in b/etc/spdk/nvmf.conf.in index 3ccb436ef..c57524a08 100644 --- a/etc/spdk/nvmf.conf.in +++ b/etc/spdk/nvmf.conf.in @@ -94,6 +94,9 @@ # It is used to provide the read/write data buffers for the qpairs on this transport. #NumSharedBuffers 512 + # Set the number of shared buffers to be cached per poll group + #BufCacheSize 32 + [Nvme] # NVMe Device Whitelist # Users may specify which NVMe devices to claim by their transport id. diff --git a/lib/event/subsystems/nvmf/conf.c b/lib/event/subsystems/nvmf/conf.c index 1830b0746..a605371c7 100644 --- a/lib/event/subsystems/nvmf/conf.c +++ b/lib/event/subsystems/nvmf/conf.c @@ -524,6 +524,11 @@ spdk_nvmf_parse_transport(struct spdk_nvmf_parse_transport_ctx *ctx) if (val >= 0) { opts.num_shared_buffers = val; } + val = spdk_conf_section_get_intval(ctx->sp, "BufCacheSize"); + if (val >= 0) { + opts.buf_cache_size = val; + } + transport = spdk_nvmf_transport_create(trtype, &opts); if (transport) { diff --git a/lib/event/subsystems/nvmf/nvmf_rpc.c b/lib/event/subsystems/nvmf/nvmf_rpc.c index 2a02eb9ec..8e6e6e0ca 100644 --- a/lib/event/subsystems/nvmf/nvmf_rpc.c +++ b/lib/event/subsystems/nvmf/nvmf_rpc.c @@ -1590,6 +1590,7 @@ dump_nvmf_transport(struct spdk_json_write_ctx *w, struct spdk_nvmf_transport *t spdk_json_write_named_uint32(w, "io_unit_size", opts->io_unit_size); spdk_json_write_named_uint32(w, "max_aq_depth", opts->max_aq_depth); spdk_json_write_named_uint32(w, "num_shared_buffers", opts->num_shared_buffers); + spdk_json_write_named_uint32(w, "buf_cache_size", opts->buf_cache_size); spdk_json_write_object_end(w); }