Page MenuHomeFreeBSD

D42454.diff
No OneTemporary

D42454.diff

diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -1405,6 +1405,12 @@
to = NVME_CAP_LO_TO(cap_lo) + 1;
ctrlr->ready_timeout_in_ms = to * 500;
+ timeout_period = NVME_ADMIN_TIMEOUT_PERIOD;
+ TUNABLE_INT_FETCH("hw.nvme.admin_timeout_period", &timeout_period);
+ timeout_period = min(timeout_period, NVME_MAX_TIMEOUT_PERIOD);
+ timeout_period = max(timeout_period, NVME_MIN_TIMEOUT_PERIOD);
+ ctrlr->admin_timeout_period = timeout_period;
+
timeout_period = NVME_DEFAULT_TIMEOUT_PERIOD;
TUNABLE_INT_FETCH("hw.nvme.timeout_period", &timeout_period);
timeout_period = min(timeout_period, NVME_MAX_TIMEOUT_PERIOD);
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
--- a/sys/dev/nvme/nvme_private.h
+++ b/sys/dev/nvme/nvme_private.h
@@ -86,6 +86,7 @@
#define NVME_MAX_CONSUMERS (2)
#define NVME_MAX_ASYNC_EVENTS (8)
+#define NVME_ADMIN_TIMEOUT_PERIOD (60) /* in seconds */
#define NVME_DEFAULT_TIMEOUT_PERIOD (30) /* in seconds */
#define NVME_MIN_TIMEOUT_PERIOD (5)
#define NVME_MAX_TIMEOUT_PERIOD (120)
@@ -279,6 +280,7 @@
uint32_t int_coal_threshold;
/** timeout period in seconds */
+ uint32_t admin_timeout_period;
uint32_t timeout_period;
/** doorbell stride */
diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c
--- a/sys/dev/nvme/nvme_qpair.c
+++ b/sys/dev/nvme/nvme_qpair.c
@@ -1181,6 +1181,8 @@
if (req->timeout) {
if (req->cb_fn == nvme_completion_poll_cb)
timeout = 1;
+ else if (qpair->id == 0)
+ timeout = ctrlr->admin_timeout_period;
else
timeout = ctrlr->timeout_period;
tr->deadline = getsbinuptime() + timeout * SBT_1S;
diff --git a/sys/dev/nvme/nvme_sysctl.c b/sys/dev/nvme/nvme_sysctl.c
--- a/sys/dev/nvme/nvme_sysctl.c
+++ b/sys/dev/nvme/nvme_sysctl.c
@@ -132,8 +132,8 @@
static int
nvme_sysctl_timeout_period(SYSCTL_HANDLER_ARGS)
{
- struct nvme_controller *ctrlr = arg1;
- uint32_t newval = ctrlr->timeout_period;
+ uint32_t *ptr = arg1;
+ uint32_t newval = *ptr;
int error = sysctl_handle_int(oidp, &newval, 0, req);
if (error || (req->newptr == NULL))
@@ -143,7 +143,7 @@
newval < NVME_MIN_TIMEOUT_PERIOD) {
return (EINVAL);
} else {
- ctrlr->timeout_period = newval;
+ *ptr = newval;
}
return (0);
@@ -352,10 +352,15 @@
nvme_sysctl_int_coal_threshold, "IU",
"Interrupt coalescing threshold");
+ SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO,
+ "admin_timeout_period", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE,
+ &ctrlr->admin_timeout_period, 0, nvme_sysctl_timeout_period, "IU",
+ "Timeout period for Admin queue (in seconds)");
+
SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO,
"timeout_period", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE,
- ctrlr, 0, nvme_sysctl_timeout_period, "IU",
- "Timeout period (in seconds)");
+ &ctrlr->timeout_period, 0, nvme_sysctl_timeout_period, "IU",
+ "Timeout period for I/O queues (in seconds)");
SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO,
"num_cmds", CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 7, 7:39 AM (22 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14506967
Default Alt Text
D42454.diff (3 KB)

Event Timeline