summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvme/nvme_private.h
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2013-03-26 18:37:36 +0000
committerjimharris <jimharris@FreeBSD.org>2013-03-26 18:37:36 +0000
commit68cbcde2c3b19f1e130a75ba8e3a6adbbda96ccf (patch)
tree98474bb830b74da96c2c16660823e20f34796f75 /sys/dev/nvme/nvme_private.h
parent7ad47d8780dbe3e2ff0febe22184fb77639c69e9 (diff)
downloadFreeBSD-src-68cbcde2c3b19f1e130a75ba8e3a6adbbda96ccf.zip
FreeBSD-src-68cbcde2c3b19f1e130a75ba8e3a6adbbda96ccf.tar.gz
Enable asynchronous event requests on non-Chatham devices.
Also add logic to clean up all outstanding asynchronous event requests when resetting or shutting down the controller, since these requests will not be explicitly completed by the controller itself. Sponsored by: Intel
Diffstat (limited to 'sys/dev/nvme/nvme_private.h')
-rw-r--r--sys/dev/nvme/nvme_private.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
index 4ea3a06..6874449 100644
--- a/sys/dev/nvme/nvme_private.h
+++ b/sys/dev/nvme/nvme_private.h
@@ -97,7 +97,7 @@ MALLOC_DECLARE(M_NVME);
#define NVME_MAX_NAMESPACES (16)
#define NVME_MAX_CONSUMERS (2)
-#define NVME_MAX_ASYNC_EVENTS (4)
+#define NVME_MAX_ASYNC_EVENTS (8)
#define NVME_TIMEOUT_IN_SEC (30)
@@ -119,6 +119,12 @@ struct nvme_request {
STAILQ_ENTRY(nvme_request) stailq;
};
+struct nvme_async_event_request {
+
+ struct nvme_controller *ctrlr;
+ struct nvme_request *req;
+};
+
struct nvme_tracker {
SLIST_ENTRY(nvme_tracker) slist;
@@ -255,6 +261,9 @@ struct nvme_controller {
boolean_t is_started;
+ uint32_t num_aers;
+ struct nvme_async_event_request aer[NVME_MAX_ASYNC_EVENTS];
+
#ifdef CHATHAM2
uint64_t chatham_size;
uint64_t chatham_lbas;
@@ -343,12 +352,9 @@ void nvme_ctrlr_cmd_delete_io_sq(struct nvme_controller *ctrlr,
void nvme_ctrlr_cmd_set_num_queues(struct nvme_controller *ctrlr,
uint32_t num_queues, nvme_cb_fn_t cb_fn,
void *cb_arg);
-void nvme_ctrlr_cmd_set_asynchronous_event_config(struct nvme_controller *ctrlr,
- union nvme_critical_warning_state state,
- nvme_cb_fn_t cb_fn, void *cb_arg);
-void nvme_ctrlr_cmd_asynchronous_event_request(struct nvme_controller *ctrlr,
- nvme_cb_fn_t cb_fn,
- void *cb_arg);
+void nvme_ctrlr_cmd_set_async_event_config(struct nvme_controller *ctrlr,
+ union nvme_critical_warning_state state,
+ nvme_cb_fn_t cb_fn, void *cb_arg);
void nvme_ctrlr_cmd_abort(struct nvme_controller *ctrlr, uint16_t cid,
uint16_t sqid, nvme_cb_fn_t cb_fn, void *cb_arg);
@@ -376,6 +382,9 @@ void nvme_qpair_submit_cmd(struct nvme_qpair *qpair,
void nvme_qpair_process_completions(struct nvme_qpair *qpair);
void nvme_qpair_submit_request(struct nvme_qpair *qpair,
struct nvme_request *req);
+void nvme_qpair_manual_abort_request(struct nvme_qpair *qpair,
+ struct nvme_request *req, uint32_t sct,
+ uint32_t sc, boolean_t print_on_error);
void nvme_admin_qpair_destroy(struct nvme_qpair *qpair);
OpenPOWER on IntegriCloud