Page MenuHomeFreeBSD

D61625.1794930467.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D61625.1794930467.diff

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
@@ -142,6 +142,8 @@
#define NVME_ABORT_SENT 1 /* Abort submitted, not yet completed */
#define NVME_ABORT_FAILED 2 /* Abort did not abort the command */
+#define NVME_MAX_ABORTS_PER_PASS 16
+
struct nvme_tracker {
TAILQ_ENTRY(nvme_tracker) tailq;
struct nvme_request *req;
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
@@ -836,11 +836,13 @@
struct nvme_qpair *qpair = arg;
struct nvme_controller *ctrlr = qpair->ctrlr;
struct nvme_tracker *tr;
+ struct nvme_tracker *abort_tr[NVME_MAX_ABORTS_PER_PASS];
sbintime_t now;
bool idle = true;
bool is_admin = qpair == &ctrlr->adminq;
bool fast;
uint32_t csts;
+ u_int i, naborts;
uint8_t cfs;
mtx_assert(&qpair->recovery, MA_OWNED);
@@ -954,6 +956,7 @@
*/
mtx_lock(&qpair->lock);
idle = true;
+ naborts = 0;
TAILQ_FOREACH(tr, &qpair->outstanding_tr, tailq) {
/*
* Skip async commands, they are posted to the card for
@@ -979,23 +982,14 @@
if (ctrlr->enable_aborts &&
tr->abort_state == NVME_ABORT_NONE &&
tr->req->cb_fn != nvme_abort_complete) {
- if (atomic_fetchadd_int(
- &ctrlr->outstanding_aborts, 1) >
- (int)ctrlr->cdata.acl) {
- atomic_subtract_int(
- &ctrlr->outstanding_aborts, 1);
- continue;
- }
/*
* This isn't an abort command, ask for a
* hardware abort. This goes to the admin
* queue which will reset the card if it
* times out.
*/
- tr->abort_state = NVME_ABORT_SENT;
- nvme_ctrlr_cmd_abort(ctrlr,
- qpair->cid_base + tr->cid, qpair->id,
- nvme_abort_complete, tr);
+ if (naborts < nitems(abort_tr))
+ abort_tr[naborts++] = tr;
} else if (ctrlr->enable_aborts &&
tr->abort_state == NVME_ABORT_SENT) {
continue;
@@ -1009,7 +1003,22 @@
goto do_reset;
}
}
+ for (i = 0; i < naborts; i++) {
+ if (atomic_fetchadd_int(&ctrlr->outstanding_aborts,
+ 1) > (int)ctrlr->cdata.acl) {
+ atomic_subtract_int(
+ &ctrlr->outstanding_aborts, 1);
+ break;
+ }
+ abort_tr[i]->abort_state = NVME_ABORT_SENT;
+ }
+ naborts = i;
mtx_unlock(&qpair->lock);
+
+ for (i = 0; i < naborts; i++)
+ nvme_ctrlr_cmd_abort(ctrlr,
+ qpair->cid_base + abort_tr[i]->cid, qpair->id,
+ nvme_abort_complete, abort_tr[i]);
break;
case RECOVERY_WAITING:

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 17, 3:47 PM (18 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41802427
Default Alt Text
D61625.1794930467.diff (2 KB)

Event Timeline