Actions
Bug #6166
closedfix MSI-X support in virtio driver
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
driver - device drivers
Start date:
2015-08-26
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
Description
- There is an obvious size mismatch for allocation and deallocation of
sc_intr_htable
invirtio_register_msi
ashandler_count
andcount
are not necessarily equal.
- Rather obviously, there is a missing return statement in
virtio_register_msi
for the success case. Currently the control flow just proceeds to the error handling code wheresc_intr_htable
is destroyed.
- It seems that
virtio_enable_msi
misses the interrupt teardown code for the case whereddi_intr_enable
/ddi_intr_block_enable
are 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 setssc_config_offset
toVIRTIO_CONFIG_DEVICE_CONFIG_MSI
invirtio_register_msi
.
I believe that MSI-X is not actually activated untilvirtio_enable_msi
successfully callsddi_intr_enable
orddi_intr_block_enable
.
- 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.
Related issues
Updated by Andriy Gapon almost 7 years ago
Review request: https://www.illumos.org/rb/r/86/
Updated by Josef Sipek over 6 years ago
- Blocks Bug #6341: virtio doesn't try hard enough to get MSI interrupts added
Updated by Josef Sipek over 6 years ago
- Blocks Bug #6340: virtio lies about falling back to INTx interrupts added
Updated by Electric Monk over 6 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 17ad7f9fd28ceea21aea94421cb8ada963285765
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 <dan.kimmel@delphix.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Approved by: Robert Mustacchi <rm@joyent.com>
Actions