Commit b6c72d7b authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf: move AER command handling to session.c



Change-Id: Ib2ffdc253df808547a43f7f8e52b8d4d53c09c96
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 6da9e179
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -176,10 +176,8 @@ nvmf_direct_ctrlr_process_admin_cmd(struct spdk_nvmf_request *req)
		}
		break;
	case SPDK_NVME_OPC_ASYNC_EVENT_REQUEST:
		SPDK_TRACELOG(SPDK_TRACE_NVMF, "Async Event Request\n");
		session->aer_req = req;
		return spdk_nvmf_session_async_event_request(req);

		return SPDK_NVMF_REQUEST_EXEC_STATUS_ASYNCHRONOUS;
	case SPDK_NVME_OPC_KEEP_ALIVE:
		SPDK_TRACELOG(SPDK_TRACE_NVMF, "Keep Alive\n");
		/*
+11 −0
Original line number Diff line number Diff line
@@ -763,3 +763,14 @@ spdk_nvmf_session_get_features_async_event_configuration(struct spdk_nvmf_reques
	rsp->cdw0 = session->async_event_config.raw;
	return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
}

int
spdk_nvmf_session_async_event_request(struct spdk_nvmf_request *req)
{
	struct spdk_nvmf_session *session = req->conn->sess;

	SPDK_TRACELOG(SPDK_TRACE_NVMF, "Async Event Request\n");

	session->aer_req = req;
	return SPDK_NVMF_REQUEST_EXEC_STATUS_ASYNCHRONOUS;
}
+2 −0
Original line number Diff line number Diff line
@@ -129,4 +129,6 @@ int spdk_nvmf_session_get_features_number_of_queues(struct spdk_nvmf_request *re
int spdk_nvmf_session_set_features_async_event_configuration(struct spdk_nvmf_request *req);
int spdk_nvmf_session_get_features_async_event_configuration(struct spdk_nvmf_request *req);

int spdk_nvmf_session_async_event_request(struct spdk_nvmf_request *req);

#endif
+1 −4
Original line number Diff line number Diff line
@@ -340,10 +340,7 @@ nvmf_virtual_ctrlr_process_admin_cmd(struct spdk_nvmf_request *req)
	case SPDK_NVME_OPC_SET_FEATURES:
		return nvmf_virtual_ctrlr_set_features(req);
	case SPDK_NVME_OPC_ASYNC_EVENT_REQUEST:
		SPDK_TRACELOG(SPDK_TRACE_NVMF, "Async Event Request\n");
		/* TODO: Just release the request as consumed. AER events will never
		 * be triggered. */
		return SPDK_NVMF_REQUEST_EXEC_STATUS_RELEASE;
		return spdk_nvmf_session_async_event_request(req);
	case SPDK_NVME_OPC_KEEP_ALIVE:
		SPDK_TRACELOG(SPDK_TRACE_NVMF, "Keep Alive\n");
		/*
+6 −0
Original line number Diff line number Diff line
@@ -174,6 +174,12 @@ spdk_nvmf_session_get_features_async_event_configuration(struct spdk_nvmf_reques
	return -1;
}

int
spdk_nvmf_session_async_event_request(struct spdk_nvmf_request *req)
{
	return -1;
}

/* test suite function */
static void
nvmf_test_nvmf_direct_ctrlr_admin_identify_nslist(void)
Loading