Page MenuHomeFreeBSD

Assorted fixes to MSI-X/MSI/INTx setup iflib(9)
ClosedPublic

Authored by marius on Jun 10 2018, 3:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 6, 10:51 AM
Unknown Object (File)
Wed, May 1, 3:27 PM
Unknown Object (File)
Thu, Apr 25, 8:23 PM
Unknown Object (File)
Feb 4 2024, 9:08 PM
Unknown Object (File)
Dec 24 2023, 4:14 PM
Unknown Object (File)
Dec 22 2023, 11:25 PM
Unknown Object (File)
Oct 3 2023, 10:54 AM
Unknown Object (File)
Sep 1 2023, 11:04 AM
Subscribers

Details

Summary
  • In iflib_msix_init(), VMMs with broken MSI-X activation are trying to be worked around by manually enabling PCIM_MSIXCTRL_MSIX_ENABLE before calling pci_alloc_msix(9). Apart from constituting a layering violation, this has the problem of leaving PCIM_MSIXCTRL_MSIX_ENABLE enabled when falling back to MSI or INTx when e. g. MSI-X is black- listed and initially also when disabled via hw.pci.enable_msix. The later in turn was incorrectly worked around in r325166. Since r310806, pci(4) itself has code to deal with broken MSI-X handling of VMMs, so all of these workarounds in iflib(9) can go, fixing non-working interrupts when falling back to MSI/INTx. In any case, possibly further adjustments to broken MSI-X activation of VMMs like enabling r310806 by default in VM environments need to be placed into pci(4), not iflib(9). [1]
  • Also remove the pci_enable_busmaster(9) call from iflib_msix_init(), which is already more properly invoked from iflib_device_attach().
  • When falling back to MSI/INTx, release the MSI-X BAR resource again.
  • When falling back to INTx, ensure scctx->isc_vectors is set to 1 and not to something higher from a device with more than one MSI message supported.
  • Make the nearby ring_state(s) stuff (static) const.

Discussed with: jhb@ at BSDCan 2018 [1]

Test Plan

Successfully verified that one now ends up with a working MSI for em(4) on systems where MSI-X is black-listed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks good to my eye as far as I can tell...

This revision is now accepted and ready to land.Jun 10 2018, 5:18 AM

Thanks. You probably want Matt to review this as well though.

Can you provide a diff with context so I can see where you're adding the resource release without having to go directly to the sources?

This revision now requires review to proceed.Jun 13 2018, 9:54 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 17 2018, 8:33 PM
This revision was automatically updated to reflect the committed changes.