Commit 242201d2 authored by Maciej Szwed's avatar Maciej Szwed Committed by Jim Harris
Browse files

nvmf: update the IBV state only for QP related events



qp_context is only available for QP related events.
For other events we should not update ibv state as we try
to access null object data field.

Signed-off-by: default avatarMaciej Szwed <maciej.szwed@intel.com>
Change-Id: Id8d2fee090d9a40c7e00c866914c2eb164e7587c

Reviewed-on: https://review.gerrithub.io/422941


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 6abdfcd2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2107,15 +2107,15 @@ spdk_nvmf_process_ib_event(struct spdk_nvmf_rdma_device *device)

	rqpair = event.element.qp->qp_context;

	/* This call is thread-safe. Immediately update the IBV state on error notification. */
	spdk_nvmf_rdma_update_ibv_state(rqpair);

	switch (event.event_type) {
	case IBV_EVENT_QP_FATAL:
	case IBV_EVENT_QP_LAST_WQE_REACHED:
		/* This call is thread-safe. Immediately update the IBV state on error notification. */
		spdk_nvmf_rdma_update_ibv_state(rqpair);

		spdk_thread_send_msg(rqpair->qpair.group->thread, _spdk_nvmf_rdma_qp_error, rqpair);
		break;
	case IBV_EVENT_SQ_DRAINED: {
	case IBV_EVENT_SQ_DRAINED:
		/* This event occurs frequently in both error and non-error states.
		 * Check if the qpair is in an error state before sending a message.
		 * Note that we're not on the correct thread to access the qpair, but
@@ -2126,14 +2126,14 @@ spdk_nvmf_process_ib_event(struct spdk_nvmf_rdma_device *device)
			spdk_thread_send_msg(rqpair->qpair.group->thread, _spdk_nvmf_rdma_qp_error, rqpair);
		}
		break;

	}
	case IBV_EVENT_CQ_ERR:
	case IBV_EVENT_QP_REQ_ERR:
	case IBV_EVENT_QP_ACCESS_ERR:
	case IBV_EVENT_COMM_EST:
	case IBV_EVENT_PATH_MIG:
	case IBV_EVENT_PATH_MIG_ERR:
		spdk_nvmf_rdma_update_ibv_state(rqpair);
		break;
	case IBV_EVENT_CQ_ERR:
	case IBV_EVENT_DEVICE_FATAL:
	case IBV_EVENT_PORT_ACTIVE:
	case IBV_EVENT_PORT_ERR: