From e2c0d9a294c5875e9f14c7d6af9ddbd46e30cc44 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Sun, 14 Jul 2019 19:58:55 -0700 Subject: [PATCH] rpc: fix nvmf_create_transport c2h_success option. This option was intended to enable the user to disable the c2h_option, but because of the way arguments filter down through the python script, it was actually impossible to disable the optimization. My understanding is that typically we will want to keep this optimization enabled on most systems, but the option should work like it says it does. Also, align the implementation of this function with the other ones on the RPC i.e. use the store_true, store_false paradigm. Change-Id: I59f0e9a573abf1d567e5539294c63c68899b35f1 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461737 Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu Tested-by: SPDK CI Jenkins --- CHANGELOG.md | 4 +++- doc/jsonrpc.md | 2 +- scripts/rpc.py | 2 +- scripts/rpc/nvmf.py | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 848d5e77a..2d827a354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,9 @@ This allows the user to specify which file to store the persistent reservation s that this is done per namespace. The c2h success optimization under which a command capsule response is not sent -for reads is turned on. A config knob was added to allow for enable/disable. +for reads is turned on by default. A config knob was added to allow disabling +the optimization. This will mostly be used for integration testing with 5.0.x kernels +while some compatibility fixes make their way down the pipeline for 5.1.x kernels. Shared receive queue can now be disabled even for NICs that support it using the `nvmf_create_transport` RPC method parameter `no_srq`. The actual use of a shared diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 1daa67df4..2a47b6ec4 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -3614,7 +3614,7 @@ num_shared_buffers | Optional | number | The number of pooled data buf buf_cache_size | Optional | number | The number of shared buffers to reserve for each poll group 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) +c2h_success | Optional | boolean | Disable 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: diff --git a/scripts/rpc.py b/scripts/rpc.py index 697e27986..11412839c 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1433,7 +1433,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse p.add_argument('-b', '--buf-cache-size', help='The number of shared buffers to reserve for each poll group', type=int) 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('-o', '--c2h-success', action='store_false', help='Disable C2H success optimization. Relevant only for TCP transport') 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) diff --git a/scripts/rpc/nvmf.py b/scripts/rpc/nvmf.py index bfd7c994f..76c56ace6 100644 --- a/scripts/rpc/nvmf.py +++ b/scripts/rpc/nvmf.py @@ -63,7 +63,7 @@ def nvmf_create_transport(client, buf_cache_size: The number of shared buffers to reserve for each poll group (optional) 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) + c2h_success: Boolean flag to 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: @@ -92,7 +92,7 @@ def nvmf_create_transport(client, params['max_srq_depth'] = max_srq_depth if no_srq: params['no_srq'] = no_srq - if c2h_success: + if c2h_success is not None: params['c2h_success'] = c2h_success if dif_insert_or_strip: params['dif_insert_or_strip'] = dif_insert_or_strip