From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Carew Subject: [PATCH 4/4] [PATCH 4/4] virtio: Fixes the VIRTIO_PCI_CONFIG macro to use the correct offset to the Virtio header Date: Thu, 5 Jun 2014 15:39:19 +0100 Message-ID: <1401979159-14576-5-git-send-email-alan.carew@intel.com> References: <1401979159-14576-1-git-send-email-alan.carew@intel.com> To: dev-VfR2kkLFssw@public.gmane.org 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" This final patch address the issue of not being able to determine the correct offet when MSI-X is disabled. Signed-off-by: Alan Carew --- lib/librte_pmd_virtio/virtio_ethdev.c | 1 + lib/librte_pmd_virtio/virtio_pci.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c index c2b4dfb..819e7d7 100644 --- a/lib/librte_pmd_virtio/virtio_ethdev.c +++ b/lib/librte_pmd_virtio/virtio_ethdev.c @@ -719,6 +719,7 @@ eth_virtio_dev_init(__rte_unused struct eth_driver *eth_drv, } #endif hw->io_base = (uint32_t)(uintptr_t)pci_dev->mem_resource[0].addr; + hw->intr_mode = pci_dev->intr_mode; /* Reset the device although not necessary at startup */ vtpci_reset(hw); diff --git a/lib/librte_pmd_virtio/virtio_pci.h b/lib/librte_pmd_virtio/virtio_pci.h index 96443c7..7b3d0ef 100644 --- a/lib/librte_pmd_virtio/virtio_pci.h +++ b/lib/librte_pmd_virtio/virtio_pci.h @@ -44,6 +44,7 @@ #endif #include +#include struct virtqueue; @@ -177,6 +178,7 @@ struct virtio_hw { uint16_t subsystem_device_id; uint16_t subsystem_vendor_id; uint8_t revision_id; + enum igbuio_intr_mode intr_mode; uint8_t mac_addr[ETHER_ADDR_LEN]; int adapter_stopped; struct rte_eth_stats eth_stats; @@ -201,7 +203,7 @@ struct virtio_net_config { * The remaining space is defined by each driver as the per-driver * configuration space. */ -#define VIRTIO_PCI_CONFIG(hw) (((hw)->guest_features & VIRTIO_PCI_FLAG_MSIX) ? 24 : 20) +#define VIRTIO_PCI_CONFIG(hw) (((hw)->intr_mode == IGBUIO_MSIX_INTR_MODE) ? 24 : 20) /* * How many bits to shift physical queue address written to QUEUE_PFN. -- 1.7.0.7