summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvme/nvme_private.h
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2013-03-26 20:02:35 +0000
committerjimharris <jimharris@FreeBSD.org>2013-03-26 20:02:35 +0000
commit83032bc2394df6e15ddb874995f794f0c8c660b1 (patch)
tree5ebc789383fbca5abbead81ca4e0081cc57c742d /sys/dev/nvme/nvme_private.h
parent711dabaf432762eec4942b5f5f7611e7df825260 (diff)
downloadFreeBSD-src-83032bc2394df6e15ddb874995f794f0c8c660b1.zip
FreeBSD-src-83032bc2394df6e15ddb874995f794f0c8c660b1.tar.gz
Add a tunable for the I/O timeout interval. Default is still 30 seconds,
but can be adjusted between a min/max of 5 and 120 seconds. Sponsored by: Intel Reviewed by: carl
Diffstat (limited to 'sys/dev/nvme/nvme_private.h')
-rw-r--r--sys/dev/nvme/nvme_private.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
index 2fde631..8921710 100644
--- a/sys/dev/nvme/nvme_private.h
+++ b/sys/dev/nvme/nvme_private.h
@@ -100,7 +100,9 @@ MALLOC_DECLARE(M_NVME);
#define NVME_MAX_CONSUMERS (2)
#define NVME_MAX_ASYNC_EVENTS (8)
-#define NVME_TIMEOUT_IN_SEC (30)
+#define NVME_DEFAULT_TIMEOUT_PERIOD (30) /* in seconds */
+#define NVME_MIN_TIMEOUT_PERIOD (5)
+#define NVME_MAX_TIMEOUT_PERIOD (120)
#ifndef CACHE_LINE_SIZE
#define CACHE_LINE_SIZE (64)
@@ -113,7 +115,7 @@ struct nvme_request {
struct nvme_command cmd;
void *payload;
uint32_t payload_size;
- uint32_t timeout;
+ boolean_t timeout;
struct uio *uio;
nvme_cb_fn_t cb_fn;
void *cb_arg;
@@ -257,6 +259,9 @@ struct nvme_controller {
/** interrupt coalescing threshold */
uint32_t int_coal_threshold;
+ /** timeout period in seconds */
+ uint32_t timeout_period;
+
struct nvme_qpair adminq;
struct nvme_qpair *ioq;
@@ -427,7 +432,7 @@ nvme_allocate_request(void *payload, uint32_t payload_size, nvme_cb_fn_t cb_fn,
req->payload_size = payload_size;
req->cb_fn = cb_fn;
req->cb_arg = cb_arg;
- req->timeout = NVME_TIMEOUT_IN_SEC;
+ req->timeout = TRUE;
return (req);
}
@@ -444,7 +449,7 @@ nvme_allocate_request_uio(struct uio *uio, nvme_cb_fn_t cb_fn, void *cb_arg)
req->uio = uio;
req->cb_fn = cb_fn;
req->cb_arg = cb_arg;
- req->timeout = NVME_TIMEOUT_IN_SEC;
+ req->timeout = TRUE;
return (req);
}
OpenPOWER on IntegriCloud