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: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Id8d2fee090d9a40c7e00c866914c2eb164e7587c

Reviewed-on: https://review.gerrithub.io/422941
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Maciej Szwed 2018-08-21 10:02:26 +02:00 committed by Jim Harris
parent 6abdfcd23e
commit 242201d2c9

View File

@ -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: