diff options
author | jimharris <jimharris@FreeBSD.org> | 2012-10-18 00:44:39 +0000 |
---|---|---|
committer | jimharris <jimharris@FreeBSD.org> | 2012-10-18 00:44:39 +0000 |
commit | a5279c222fba5a40054c2b884024700c8f22a6f7 (patch) | |
tree | 0025fbe683191b1597b5b4914d3977f0c0a525df /sys/dev/nvme/nvme_private.h | |
parent | bca33a6688fc34f33afa47494cf922c6d21b99d3 (diff) | |
download | FreeBSD-src-a5279c222fba5a40054c2b884024700c8f22a6f7.zip FreeBSD-src-a5279c222fba5a40054c2b884024700c8f22a6f7.tar.gz |
Preallocate a limited number of nvme_tracker objects per qpair, rather
than dynamically creating them at runtime.
Sponsored by: Intel
Diffstat (limited to 'sys/dev/nvme/nvme_private.h')
-rw-r--r-- | sys/dev/nvme/nvme_private.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 9554725..0797b53 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -68,14 +68,25 @@ MALLOC_DECLARE(M_NVME); */ #define NVME_MAX_XFER_SIZE NVME_MAX_PRP_LIST_ENTRIES * PAGE_SIZE +#define NVME_ADMIN_TRACKERS (16) #define NVME_ADMIN_ENTRIES (128) /* min and max are defined in admin queue attributes section of spec */ #define NVME_MIN_ADMIN_ENTRIES (2) #define NVME_MAX_ADMIN_ENTRIES (4096) -#define NVME_IO_ENTRIES (1024) -/* min is a reasonable value picked for the nvme(4) driver */ -#define NVME_MIN_IO_ENTRIES (128) +/* + * NVME_IO_ENTRIES defines the size of an I/O qpair's submission and completion + * queues, while NVME_IO_TRACKERS defines the maximum number of I/O that we + * will allow outstanding on an I/O qpair at any time. The only advantage in + * having IO_ENTRIES > IO_TRACKERS is for debugging purposes - when dumping + * the contents of the submission and completion queues, it will show a longer + * history of data. + */ +#define NVME_IO_ENTRIES (256) +#define NVME_IO_TRACKERS (128) +#define NVME_MIN_IO_TRACKERS (16) +#define NVME_MAX_IO_TRACKERS (1024) + /* * NVME_MAX_IO_ENTRIES is not defined, since it is specified in CC.MQES * for each controller. @@ -134,6 +145,7 @@ struct nvme_qpair { uint32_t max_xfer_size; uint32_t num_entries; + uint32_t num_trackers; uint32_t sq_tdbl_off; uint32_t cq_hdbl_off; @@ -155,8 +167,6 @@ struct nvme_qpair { bus_dmamap_t cpl_dma_map; uint64_t cpl_bus_addr; - uint32_t num_tr; - SLIST_HEAD(, nvme_tracker) free_tr; struct nvme_tracker **act_tr; @@ -348,12 +358,11 @@ void nvme_ctrlr_submit_io_request(struct nvme_controller *ctrlr, void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, - uint32_t max_xfer_size, + 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_process_completions(struct nvme_qpair *qpair); -struct nvme_tracker * nvme_qpair_allocate_tracker(struct nvme_qpair *qpair); void nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req); |