diff options
author | jimharris <jimharris@FreeBSD.org> | 2013-03-26 19:50:46 +0000 |
---|---|---|
committer | jimharris <jimharris@FreeBSD.org> | 2013-03-26 19:50:46 +0000 |
commit | 93fd264895a68a10d395cb75c7f67339f8811d4a (patch) | |
tree | 82359dedd1ed281aa3fd524aef64c2d6bb5a5a28 /sys/dev/nvme/nvme_private.h | |
parent | bd33256583e92ae27c4215f57aa7bbdee3d50799 (diff) | |
download | FreeBSD-src-93fd264895a68a10d395cb75c7f67339f8811d4a.zip FreeBSD-src-93fd264895a68a10d395cb75c7f67339f8811d4a.tar.gz |
Add controller reset capability to nvme(4) and ability to explicitly
invoke it from nvmecontrol(8).
Controller reset will be performed in cases where I/O are repeatedly
timing out, the controller reports an unrecoverable condition, or
when explicitly requested via IOCTL or an nvme consumer. Since the
controller may be in such a state where it cannot even process queue
deletion requests, we will perform a controller reset without trying
to clean up anything on the controller first.
Sponsored by: Intel
Reviewed by: carl
Diffstat (limited to 'sys/dev/nvme/nvme_private.h')
-rw-r--r-- | sys/dev/nvme/nvme_private.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 4876bd5..695ce5e 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -180,6 +180,8 @@ struct nvme_qpair { struct nvme_tracker **act_tr; + boolean_t is_enabled; + struct mtx lock __aligned(CACHE_LINE_SIZE); } __aligned(CACHE_LINE_SIZE); @@ -233,6 +235,7 @@ struct nvme_controller { struct intr_config_hook config_hook; uint32_t ns_identified; uint32_t queues_created; + uint32_t num_start_attempts; /* For shared legacy interrupt. */ int rid; @@ -361,7 +364,8 @@ void nvme_payload_map_uio(void *arg, bus_dma_segment_t *seg, int nseg, int nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev); void nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev); -int nvme_ctrlr_reset(struct nvme_controller *ctrlr); +int nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr); +void nvme_ctrlr_reset(struct nvme_controller *ctrlr); /* ctrlr defined as void * to allow use with config_intrhook. */ void nvme_ctrlr_start(void *ctrlr_arg); void nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr, @@ -373,21 +377,23 @@ void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, uint32_t num_trackers, uint32_t max_xfer_size, struct nvme_controller *ctrlr); -void nvme_qpair_submit_cmd(struct nvme_qpair *qpair, - struct nvme_tracker *tr); +void nvme_qpair_submit_tracker(struct nvme_qpair *qpair, + struct nvme_tracker *tr); 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_enable(struct nvme_qpair *qpair); +void nvme_admin_qpair_disable(struct nvme_qpair *qpair); void nvme_admin_qpair_destroy(struct nvme_qpair *qpair); +void nvme_io_qpair_enable(struct nvme_qpair *qpair); +void nvme_io_qpair_disable(struct nvme_qpair *qpair); void nvme_io_qpair_destroy(struct nvme_qpair *qpair); int nvme_ns_construct(struct nvme_namespace *ns, uint16_t id, struct nvme_controller *ctrlr); +void nvme_ns_destruct(struct nvme_namespace *ns); int nvme_ns_physio(struct cdev *dev, struct uio *uio, int ioflag); |