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

nvmf/rdma: Allow incorrect responder_resources



Initiator must not set intiator_depth since
accordig to the NVMf spec it can't issue RDMA
operations. But some drivers set it to incorrect
value. We can allow such connections, just
print a warning when admin qpair is connected

Fixes issue #3115

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@gmail.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
parent deea9d10
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1329,10 +1329,15 @@ nvmf_rdma_connect(struct spdk_nvmf_transport *transport, struct rdma_cm_event *e
	 * The responder_resources field must match the initiator depth specified by the remote node when running
	 * the rdma_connect and rdma_accept functions. */
	if (rdma_param->responder_resources != 0) {
		SPDK_ERRLOG("Host (Initiator) is not allowed to use RDMA operations (responder_resources %u)\n",
		if (private_data->qid) {
			SPDK_DEBUGLOG(rdma, "Host (Initiator) is not allowed to use RDMA operations,"
				      " responder_resources must be 0 but set to %u\n",
				      rdma_param->responder_resources);
		nvmf_rdma_event_reject(event->id, SPDK_NVMF_RDMA_ERROR_INVALID_ORD);
		return -1;
		} else {
			SPDK_WARNLOG("Host (Initiator) is not allowed to use RDMA operations,"
				     " responder_resources must be 0 but set to %u\n",
				     rdma_param->responder_resources);
		}
	}
	/* from man3 rdma_get_cm_event
	 * initiator_depth - Specifies the maximum number of outstanding RDMA read operations that the recipient holds.