Page MenuHomeFreeBSD

D31182.diff
No OneTemporary

D31182.diff

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
@@ -675,30 +675,6 @@
qpair->num_trackers = num_trackers;
qpair->ctrlr = ctrlr;
- if (ctrlr->msix_enabled) {
- /*
- * MSI-X vector resource IDs start at 1, so we add one to
- * the queue's vector to get the corresponding rid to use.
- */
- qpair->rid = qpair->vector + 1;
-
- qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ,
- &qpair->rid, RF_ACTIVE);
- if (bus_setup_intr(ctrlr->dev, qpair->res,
- INTR_TYPE_MISC | INTR_MPSAFE, NULL,
- nvme_qpair_msix_handler, qpair, &qpair->tag) != 0) {
- nvme_printf(ctrlr, "unable to setup intx handler\n");
- goto out;
- }
- if (qpair->id == 0) {
- bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag,
- "admin");
- } else {
- bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag,
- "io%d", qpair->id - 1);
- }
- }
-
mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF);
/* Note: NVMe PRP format is restricted to 4-byte alignment. */
@@ -818,6 +794,31 @@
qpair->act_tr = malloc_domainset(sizeof(struct nvme_tracker *) *
qpair->num_entries, M_NVME, DOMAINSET_PREF(qpair->domain),
M_ZERO | M_WAITOK);
+
+ if (ctrlr->msix_enabled) {
+ /*
+ * MSI-X vector resource IDs start at 1, so we add one to
+ * the queue's vector to get the corresponding rid to use.
+ */
+ qpair->rid = qpair->vector + 1;
+
+ qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ,
+ &qpair->rid, RF_ACTIVE);
+ if (bus_setup_intr(ctrlr->dev, qpair->res,
+ INTR_TYPE_MISC | INTR_MPSAFE, NULL,
+ nvme_qpair_msix_handler, qpair, &qpair->tag) != 0) {
+ nvme_printf(ctrlr, "unable to setup intx handler\n");
+ goto out;
+ }
+ if (qpair->id == 0) {
+ bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag,
+ "admin");
+ } else {
+ bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag,
+ "io%d", qpair->id - 1);
+ }
+ }
+
return (0);
out:

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 8, 7:27 PM (21 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14541309
Default Alt Text
D31182.diff (1 KB)

Event Timeline