nvme/tcp: detect cq errors.
We should alert the upper layer when the qpair becomes unusable due to qpair errors. Change-Id: Icdee3b55a14441a60111f3bd7a44dceef93bbb09 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474095 Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
ac03d9206f
commit
f6646fd9fa
@ -235,6 +235,7 @@ nvme_tcp_qpair_disconnect(struct spdk_nvme_qpair *qpair)
|
|||||||
struct nvme_tcp_qpair *tqpair = nvme_tcp_qpair(qpair);
|
struct nvme_tcp_qpair *tqpair = nvme_tcp_qpair(qpair);
|
||||||
struct nvme_tcp_pdu *pdu;
|
struct nvme_tcp_pdu *pdu;
|
||||||
|
|
||||||
|
qpair->transport_qp_is_failed = true;
|
||||||
spdk_sock_close(&tqpair->sock);
|
spdk_sock_close(&tqpair->sock);
|
||||||
|
|
||||||
/* clear the send_queue */
|
/* clear the send_queue */
|
||||||
@ -1490,7 +1491,7 @@ nvme_tcp_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_c
|
|||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_NVME, "Error polling CQ! (%d): %s\n",
|
SPDK_DEBUGLOG(SPDK_LOG_NVME, "Error polling CQ! (%d): %s\n",
|
||||||
errno, spdk_strerror(errno));
|
errno, spdk_strerror(errno));
|
||||||
return -1;
|
goto fail;
|
||||||
} else if (rc == 0) {
|
} else if (rc == 0) {
|
||||||
/* Partial PDU is read */
|
/* Partial PDU is read */
|
||||||
break;
|
break;
|
||||||
@ -1503,6 +1504,19 @@ nvme_tcp_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_c
|
|||||||
}
|
}
|
||||||
|
|
||||||
return reaped;
|
return reaped;
|
||||||
|
fail:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Since admin queues take the ctrlr_lock before entering this function,
|
||||||
|
* we can call nvme_tcp_qpair_disconnect. For other qpairs we need
|
||||||
|
* to call the generic function which will take the lock for us.
|
||||||
|
*/
|
||||||
|
if (nvme_qpair_is_admin_queue(qpair)) {
|
||||||
|
nvme_tcp_qpair_disconnect(qpair);
|
||||||
|
} else {
|
||||||
|
nvme_ctrlr_disconnect_qpair(qpair);
|
||||||
|
}
|
||||||
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -1610,8 +1624,10 @@ nvme_tcp_qpair_connect(struct nvme_tcp_qpair *tqpair)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tqpair->qpair.transport_qp_is_failed = false;
|
||||||
rc = nvme_fabric_qpair_connect(&tqpair->qpair, tqpair->num_entries);
|
rc = nvme_fabric_qpair_connect(&tqpair->qpair, tqpair->num_entries);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
tqpair->qpair.transport_qp_is_failed = true;
|
||||||
SPDK_ERRLOG("Failed to send an NVMe-oF Fabric CONNECT command\n");
|
SPDK_ERRLOG("Failed to send an NVMe-oF Fabric CONNECT command\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -51,10 +51,7 @@ run_test suite test/nvmf/host/perf.sh $TEST_ARGS
|
|||||||
#run_test test/nvmf/host/identify_kernel_nvmf.sh $TEST_ARGS
|
#run_test test/nvmf/host/identify_kernel_nvmf.sh $TEST_ARGS
|
||||||
run_test suite test/nvmf/host/aer.sh $TEST_ARGS
|
run_test suite test/nvmf/host/aer.sh $TEST_ARGS
|
||||||
run_test suite test/nvmf/host/fio.sh $TEST_ARGS
|
run_test suite test/nvmf/host/fio.sh $TEST_ARGS
|
||||||
# The automated reconnect we do in this test currently only works for RDMA.
|
run_test suite test/nvmf/host/target_disconnect.sh $TEST_ARGS
|
||||||
if [ $TEST_TRANSPORT == "rdma" ]; then
|
|
||||||
run_test suite test/nvmf/host/target_disconnect.sh $TEST_ARGS
|
|
||||||
fi
|
|
||||||
|
|
||||||
timing_exit host
|
timing_exit host
|
||||||
|
|
||||||
|
@ -51,6 +51,8 @@ DEFINE_STUB(nvme_qpair_submit_request,
|
|||||||
DEFINE_STUB(spdk_nvme_ctrlr_get_current_process, struct spdk_nvme_ctrlr_process *,
|
DEFINE_STUB(spdk_nvme_ctrlr_get_current_process, struct spdk_nvme_ctrlr_process *,
|
||||||
(struct spdk_nvme_ctrlr *ctrlr), (struct spdk_nvme_ctrlr_process *)(uintptr_t)0x1);
|
(struct spdk_nvme_ctrlr *ctrlr), (struct spdk_nvme_ctrlr_process *)(uintptr_t)0x1);
|
||||||
|
|
||||||
|
DEFINE_STUB_V(nvme_ctrlr_disconnect_qpair, (struct spdk_nvme_qpair *qpair));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_nvme_tcp_pdu_set_data_buf(void)
|
test_nvme_tcp_pdu_set_data_buf(void)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user