From: Stephen Hemminger Subject: Re: [PATCH 0/4] librte_pmd_virtio :Fix: virtio_pci.h non-existent virtio feature bit-flag tested Date: Thu, 5 Jun 2014 10:06:33 -0700 Message-ID: <20140605100633.6a6047bd@nehalam.linuxnetplumber.net> References: <1401979159-14576-1-git-send-email-alan.carew@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Alan Carew Return-path: In-Reply-To: <1401979159-14576-1-git-send-email-alan.carew-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Thu, 5 Jun 2014 15:39:15 +0100 Alan Carew 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.