Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178221593
D62311.1796274820.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D62311.1796274820.diff
View Options
diff --git a/sys/dev/ufshci/ufshci_pci.c b/sys/dev/ufshci/ufshci_pci.c
--- a/sys/dev/ufshci/ufshci_pci.c
+++ b/sys/dev/ufshci/ufshci_pci.c
@@ -190,7 +190,6 @@
device_t dev = ctrlr->dev;
int force_intx = 0;
int num_io_queues, per_cpu_io_queues, min_cpus_per_ioq;
- int num_vectors_requested;
TUNABLE_INT_FETCH("hw.ufshci.force_intx", &force_intx);
if (force_intx)
@@ -199,12 +198,6 @@
if (pci_msix_count(dev) == 0)
goto msi;
- /*
- * Try to allocate one MSI-X per core for I/O queues, plus one
- * for admin queue, but accept single shared MSI-X if have to.
- * Fall back to MSI if can't get any MSI-X.
- */
-
/*
* TODO: Need to implement MCQ(Multi Circular Queue)
* Example: num_io_queues = mp_ncpus;
@@ -229,40 +222,29 @@
num_io_queues = min(num_io_queues, max(1, pci_msix_count(dev) - 1));
-again:
if (num_io_queues > vm_ndomains)
num_io_queues -= num_io_queues % vm_ndomains;
- num_vectors_requested = min(num_io_queues + 1, pci_msix_count(dev));
- ctrlr->msi_count = num_vectors_requested;
+
+ /*
+ * The driver has a single interrupt handler that serves every
+ * queue. Allocate one MSI-X vector and route it there. Ask for
+ * more vectors once per-queue handlers exist.
+ */
+ ctrlr->msi_count = 1;
if (pci_alloc_msix(dev, &ctrlr->msi_count) != 0) {
ufshci_printf(ctrlr, "unable to allocate MSI-X\n");
ctrlr->msi_count = 0;
goto msi;
}
- if (ctrlr->msi_count == 1)
- return (ufshci_pci_setup_shared(ctrlr, 1));
- if (ctrlr->msi_count != num_vectors_requested) {
- pci_release_msi(dev);
- num_io_queues = ctrlr->msi_count - 1;
- goto again;
- }
-
- ctrlr->num_io_queues = num_io_queues;
- return (0);
+ return (ufshci_pci_setup_shared(ctrlr, 1));
msi:
- /*
- * Try to allocate 2 MSIs (admin and I/O queues), but accept single
- * shared if have to. Fall back to INTx if can't get any MSI.
- */
- ctrlr->msi_count = min(pci_msi_count(dev), 2);
+ /* Try a single MSI. Fall back to INTx if that fails. */
+ ctrlr->msi_count = min(pci_msi_count(dev), 1);
if (ctrlr->msi_count > 0) {
if (pci_alloc_msi(dev, &ctrlr->msi_count) != 0) {
ufshci_printf(ctrlr, "unable to allocate MSI\n");
ctrlr->msi_count = 0;
- } else if (ctrlr->msi_count == 2) {
- ctrlr->num_io_queues = 1;
- return (0);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 3, 5:13 AM (23 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42164850
Default Alt Text
D62311.1796274820.diff (2 KB)
Attached To
Mode
D62311: ufshci: use one interrupt vector on PCI
Attached
Detach File
Event Timeline