Commit 94966468 authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

nvme/rdma: Introduce transport_ack_timeout



Add transport_ack_timeout parameter to nvme controller opts.
This parameter allows to configure RDMA ACK timeout according
to the formula 4.096 * 2^(transport_ack_timeout) usec.
The parameter should be in range 0..31 where 0 means use
driver-specific default value.

Change-Id: I0c8a5a636aa9d816bda5c1ba58f56a00a585b060
Signed-off-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/502


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent ebe4bfc2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -156,6 +156,9 @@ the target expects the initiator to send both the compare command and write comm
SPDK initiator currently respects this requirement, but this note is included as a flag for other initiators attempting
compatibility with this version of SPDK.

The `spdk_nvme_ctrlr_opts` struct has been extended with new field `transport_ack_timeout` which allows
to configure transport ACK timeout. Applicable for RDMA transport only.

### rpc

A new RPC, `bdev_zone_block_create`, enables creating an emulated zoned bdev on top of a standard block device.
+1 −0
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ CONFIG_FIO_SOURCE_DIR=/usr/src/fio
# Requires ibverbs development libraries.
CONFIG_RDMA=n
CONFIG_RDMA_SEND_WITH_INVAL=n
CONFIG_RDMA_SET_ACK_TIMEOUT=n

# Enable NVMe Character Devices.
CONFIG_NVME_CUSE=n
+10 −0
Original line number Diff line number Diff line
@@ -569,6 +569,16 @@ of libibverbs, so Linux kernel NVMe-oF initiators based on kernels greater
than or equal to 4.14 will see significantly reduced performance.
*******************************************************************************"
	fi

	if echo -e '#include <rdma/rdma_cma.h>\n' \
		'int main(void) { return !!RDMA_OPTION_ID_ACK_TIMEOUT; }\n' \
		| ${BUILD_CMD[@]} -c - 2>/dev/null; then
		CONFIG[RDMA_SET_ACK_TIMEOUT]="y"
	else
		CONFIG[RDMA_SET_ACK_TIMEOUT]="n"
		echo "RDMA_OPTION_ID_ACK_TIMEOUT is not supported"
	fi

fi

if [[ "${CONFIG[FC]}" = "y" ]]; then
+15 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 *   BSD LICENSE
 *
 *   Copyright (c) Intel Corporation. All rights reserved.
 *   Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
 *   Copyright (c) 2019, 2020 Mellanox Technologies LTD. All rights reserved.
 *
 *   Redistribution and use in source and binary forms, with or without
 *   modification, are permitted provided that the following conditions
@@ -220,6 +220,20 @@ struct spdk_nvme_ctrlr_opts {
	 * Defaults to 'false' (errors are logged).
	 */
	bool disable_error_logging;

	/**
	 * It is used for RDMA transport
	 * Specify the transport ACK timeout. The value should be in range 0-31 where 0 means
	 * use driver-specific default value. The value is applied to each RDMA qpair
	 * and affects the time that qpair waits for transport layer acknowledgement
	 * until it retransmits a packet. The value should be chosen empirically
	 * to meet the needs of a particular application. A low value means less time
	 * the qpair waits for ACK which can increase the number of retransmissions.
	 * A large value can increase the time the connection is closed.
	 * The value of ACK timeout is calculated according to the formula
	 * 4.096 * 2^(transport_ack_timeout) usec.
	 */
	uint8_t transport_ack_timeout;
};

/**
+4 −0
Original line number Diff line number Diff line
@@ -174,6 +174,10 @@ spdk_nvme_ctrlr_get_default_ctrlr_opts(struct spdk_nvme_ctrlr_opts *opts, size_t
	if (FIELD_OK(disable_error_logging)) {
		opts->disable_error_logging = false;
	}

	if (FIELD_OK(transport_ack_timeout)) {
		opts->transport_ack_timeout = SPDK_NVME_DEFAULT_TRANSPORT_ACK_TIMEOUT;
	}
#undef FIELD_OK
}

Loading