Skip to content

Commit

Permalink
rpc: fix nvmf_create_transport c2h_success option.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461737
Reviewed-by: Shuhei Matsumoto <[email protected]>
Reviewed-by: Changpeng Liu <[email protected]>
Tested-by: SPDK CI Jenkins <[email protected]>
  • Loading branch information
Seth5141 authored and Changpeng Liu committed Jul 16, 2019
1 parent dc53a9d commit e2c0d9a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/jsonrpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion scripts/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ def nvmf_create_transport(args):
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)

Expand Down
4 changes: 2 additions & 2 deletions scripts/rpc/nvmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e2c0d9a

Please sign in to comment.