nvmf/rdma: Round up in_capsule_data_size to support msdbd=16

SPDK RDMA target reports msdbd=16, these addtitional
SGL descriptors are located in capsule. The user can
set ICD size lower than required for msdbd=16. This
patch verifies that ICD can hold all additional SGLs.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I875d40e14e6506c39169d084e56df7ca5d761209
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10686
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
This commit is contained in:
Alexey Marchuk 2021-12-15 18:04:47 +03:00 committed by Jim Harris
parent 741b0839ef
commit ed1a6c7d64
2 changed files with 16 additions and 1 deletions

View File

@ -2206,6 +2206,7 @@ nvmf_rdma_create(struct spdk_nvmf_transport_opts *opts)
int flag;
uint32_t sge_count;
uint32_t min_shared_buffers;
uint32_t min_in_capsule_data_size;
int max_device_sge = SPDK_NVMF_MAX_SGL_ENTRIES;
pthread_mutexattr_t attr;
@ -2311,6 +2312,13 @@ nvmf_rdma_create(struct spdk_nvmf_transport_opts *opts)
return NULL;
}
min_in_capsule_data_size = sizeof(struct spdk_nvme_sgl_descriptor) * SPDK_NVMF_MAX_SGL_ENTRIES;
if (min_in_capsule_data_size < opts->in_capsule_data_size) {
SPDK_WARNLOG("In capsule data size is set to %u, this is minimum size required to support msdbd=16\n",
min_in_capsule_data_size);
opts->in_capsule_data_size = min_in_capsule_data_size;
}
rtransport->event_channel = rdma_create_event_channel();
if (rtransport->event_channel == NULL) {
SPDK_ERRLOG("rdma_create_event_channel() failed, %s\n", spdk_strerror(errno));

View File

@ -30,7 +30,13 @@ if [ -n "$local_nvme_trid" ]; then
bdevs="$bdevs Nvme0n1"
fi
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS
if [ "$TEST_TRANSPORT" == "rdma" ]; then
# set in_capsule_data_size to 0 value to verify that target correctly handles multi SGL payload.
# Specify io_unit_size in perf tool to force multi SGL payload.
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -c 0
else
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS
fi
$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
for bdev in $bdevs; do
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 $bdev
@ -44,6 +50,7 @@ fi
$SPDK_EXAMPLE_DIR/perf -q 1 -o 4096 -w randrw -M 50 -t 1 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
$SPDK_EXAMPLE_DIR/perf -q 32 -o 4096 -w randrw -M 50 -t 1 -HI -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
$SPDK_EXAMPLE_DIR/perf -q 128 -o 262144 -O 16384 -w randrw -M 50 -t 2 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
$SPDK_EXAMPLE_DIR/perf -q 128 -o 262144 -w randrw -M 50 -t 2 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" --transport-stat
sync
$rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode1