mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Limit AHCI to only one MSI if more is not needed.
My AMD Ryzen system has 4 AHCI controllers, each supporting 16 MSI vectors. Since two of the controllers have only one SATA port, limit to single MSI saves system 30 interrupt vectors for free. It may be possible to also limit number of MSI vectors to 4 and 8 for the other two controllers, but according to the AHCI specification after that controllers may revert to only one vector, that would be a bigger loss to risk. MFC after: 2 weeks
This commit is contained in:
parent
52488b5148
commit
abab2155ed
1 changed files with 5 additions and 1 deletions
|
|
@ -470,6 +470,7 @@ ahci_pci_attach(device_t dev)
|
|||
uint8_t revid = pci_get_revid(dev);
|
||||
int msi_count, msix_count;
|
||||
uint8_t table_bar = 0, pba_bar = 0;
|
||||
uint32_t caps, pi;
|
||||
|
||||
msi_count = pci_msi_count(dev);
|
||||
msix_count = pci_msix_count(dev);
|
||||
|
|
@ -604,9 +605,12 @@ ahci_pci_attach(device_t dev)
|
|||
|
||||
/* Setup MSI register parameters */
|
||||
/* Process hints. */
|
||||
caps = ATA_INL(ctlr->r_mem, AHCI_CAP);
|
||||
pi = ATA_INL(ctlr->r_mem, AHCI_PI);
|
||||
if (ctlr->quirks & AHCI_Q_NOMSI)
|
||||
ctlr->msi = 0;
|
||||
else if (ctlr->quirks & AHCI_Q_1MSI)
|
||||
else if ((ctlr->quirks & AHCI_Q_1MSI) ||
|
||||
((caps & (AHCI_CAP_NPMASK | AHCI_CAP_CCCS)) == 0 && pi == 1))
|
||||
ctlr->msi = 1;
|
||||
else
|
||||
ctlr->msi = 2;
|
||||
|
|
|
|||
Loading…
Reference in a new issue