Page MenuHomeFreeBSD

Revert r332735 and fix MSI-X to properly fail allocations when full.
ClosedPublic

Authored by jhb on Nov 13 2018, 6:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 30 2024, 2:51 PM
Unknown Object (File)
Nov 30 2024, 2:48 PM
Unknown Object (File)
Nov 17 2024, 7:51 AM
Unknown Object (File)
Nov 16 2024, 1:35 PM
Unknown Object (File)
Nov 5 2024, 4:34 AM
Unknown Object (File)
Sep 30 2024, 11:27 PM
Unknown Object (File)
Sep 24 2024, 2:40 PM
Unknown Object (File)
Sep 17 2024, 8:58 PM
Subscribers

Details

Summary

The off-by-one errors in 332735 weren't actual errors and were
preventing the last MSI interrupt source from being used. Instead,
the issue is that when all MSI interrupt sources were allocated, the
loop in msix_alloc() would terminate with 'msi' still set to non-null.
The only check for 'i' overflowing was in the 'msi' == NULL case, so
msix_alloc() would try to reuse the last MSI interrupt source instead
of failing.

Fix by moving the check for all sources being in use to just after the
loop.

Test Plan
  • booted a bhyve VM with 2 virtio devices and hpet. hpet used 8 MSI IRQs, virtio_pci0 (vtnet) used 3, virtio_pci1 (vtblk) used 2. Tested with NUM_MSI_INTS set to 11 and with the fix, hpet gets 8, vtnet gets 3, and vtblk uses INT#. Without the fix, vtnet was only getting 2.

Diff Detail

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