From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C9B976882 for ; Thu, 5 Jun 2014 16:39:34 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 05 Jun 2014 07:39:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,981,1392192000"; d="scan'208";a="542939372" Received: from sie-lab-212-143.ir.intel.com (HELO silpixa00385294.ir.intel.com) ([10.237.212.143]) by fmsmga001.fm.intel.com with ESMTP; 05 Jun 2014 07:39:40 -0700 From: Alan Carew To: dev@dpdk.org Date: Thu, 5 Jun 2014 15:39:19 +0100 Message-Id: <1401979159-14576-5-git-send-email-alan.carew@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1401979159-14576-1-git-send-email-alan.carew@intel.com> References: <1401979159-14576-1-git-send-email-alan.carew@intel.com> Subject: [dpdk-dev] [PATCH 4/4] [PATCH 4/4] virtio: Fixes the VIRTIO_PCI_CONFIG macro to use the correct offset to the Virtio header X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 14:39:35 -0000 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