fix MSI-X support in virtio driver
driver - device drivers
- There is an obvious size mismatch for allocation and deallocation of
countare not necessarily equal.
- Rather obviously, there is a missing return statement in
virtio_register_msifor the success case. Currently the control flow just proceeds to the error handling code where
- It seems that
virtio_enable_msimisses the interrupt teardown code for the case where
ddi_intr_block_enableare successful, but there is a later error.
- My understanding of the VirtIO specification is that the 24-byte offset for PCI configuration accesses should be used only when MSI-X mode is enabled for a device.
That is, only when the enable bit is set in the control register of the MSI-X capabilities. But currently the code sets
I believe that MSI-X is not actually activated until
- It seems that there is a little bit of confusion in the code between MSI and MSI-X handling.
I believe that the 20-byte offset should be used if MSI but not MSI-X happens to be supported (even if otherwise MSI is much more similar to MSI-X than to the legacy interrupts mode).
At least, the VirtIO specification explicitly talks about the 24-byte offset only for MSI-X mode.
Updated by Electric Monk about 7 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 17ad7f9fd28ceea21aea94421cb8ada963285765 Author: Andriy Gapon <avg@FreeBSD.org> Date: 2015-10-20T04:30:06.000Z 6166 fix MSI-X support in virtio driver Reviewed by: Daniel Kimmel <firstname.lastname@example.org> Reviewed by: Josef 'Jeff' Sipek <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>