[dpdk-dev] [PATCH 0/4] librte_pmd_virtio :Fix: virtio_pci.h non-existent virtio feature bit-flag tested

Stephen Hemminger stephen at networkplumber.org
Thu Jun 5 19:06:33 CEST 2014


On Thu,  5 Jun 2014 15:39:15 +0100
Alan Carew <alan.carew at intel.com> wrote:

> This series addresses an issue with librte_pmd_virtio where the offset to the
> virtio device specific header may be incorrect depending on whether MSI-X has
> been enabled or not.
> 
> If MSI-X is configured the device specific header is placed at byte offset 24
> relative to the IO base address. 
> If MSI-X is not configured the device specific header is placed at
> byte offset 20. 
> 
> The following macro defined in virtio_pci.h is used to test the
> presence of the MSI-X header and determine the correct offset: 
> #define VIRTIO_PCI_CONFIG(hw) (((hw)->guest_features & VIRTIO_PCI_FLAG_MSIX) ? 24 : 20) 
> 
> However, VIRTIO_PCI_FLAG_MSIX is not a guest_feature nor is it part of the
> Virtio Specification and resolves to the VIRTIO_NET_F_MAC feature as both
> are #defined as 0x20. 
> 
> VIRTIO_PCI_FLAG_MSIX or similar flag should instead be set by the kernel
> driver allocating resources and passed to user space for testing. 
> i.e. 
> #define VIRTIO_PCI_CONFIG(hw) (((hw)->intr_mode & IGBUIO_MSIX_INTR_MODE) ? 24 : 20)
> 
> To enable this testing of interrupt mode, this series allows for the kernel
> driver(igb_uio) to place the configured interrupt mode into a sysfs entry.
> sysfs is then parsed by eal_pci to determine the configured mode, which
> allows all user space devices to correctly determine the interrupt mode,
> including virtio_ethdev.

Why not scan for the IRQ in /proc/interrupts rather than changing the kernel driver.
I ask because my goal is to get rid of igb_uio and it's quirks and use
uio_pci_generic instead.


More information about the dev mailing list