HomeFreeBSD

Fix two off-by-one errors when allocating MSI and MSI-X interrupts.

Description

Fix two off-by-one errors when allocating MSI and MSI-X interrupts.

x86 enforces an (arbitray) limit on the number of available MSI and
MSI-X interrupts to simplify code (in particular, interrupt_source[]
is statically sized). This means that an attempt to allocate an MSI
vector needs to fail if it would go beyond the limit, but the checks
for exceeding the limit had an off-by-one error. In the case of MSI-X
which allocates interrupts one at a time this meant that IRQ 768 kept
getting handed out multiple times for msix_alloc() instead of failing
because all MSI IRQs were in use.

Tested by: lidl
MFC after: 1 week

Details

Provenance
jhbAuthored on
Parents
rS332734: MFC r332388:
Branches
Unknown
Tags
Unknown