From: Alan Carew <alan.carew@intel.com>
To: dev@dpdk.org
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
Date: Thu, 5 Jun 2014 15:39:19 +0100 [thread overview]
Message-ID: <1401979159-14576-5-git-send-email-alan.carew@intel.com> (raw)
In-Reply-To: <1401979159-14576-1-git-send-email-alan.carew@intel.com>
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 <alan.carew@intel.com>
---
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 <rte_ethdev.h>
+#include <rte_pci_dev_feature_defs.h>
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
next prev parent reply other threads:[~2014-06-05 14:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 14:39 [dpdk-dev] [PATCH 0/4] librte_pmd_virtio :Fix: virtio_pci.h non-existent virtio feature bit-flag tested Alan Carew
2014-06-05 14:39 ` [dpdk-dev] [PATCH 1/4] [PATCH 1/4] igb_uio: Add interrupt_mode sysfs entry for igb_uio devices Alan Carew
2014-06-05 17:20 ` Stephen Hemminger
2014-06-05 14:39 ` [dpdk-dev] [PATCH 2/4] [PATCH 2/4] eal_pci: Add interrupt mode to rte_pci_device and parsing to eal_pci Alan Carew
2014-06-05 14:39 ` [dpdk-dev] [PATCH 3/4] [PATCH 3/4] FreeBSD: Adds the equivalent interrupt mode setting and parsing Alan Carew
2014-06-05 14:39 ` Alan Carew [this message]
2014-06-05 15:22 ` [dpdk-dev] [PATCH 0/4] librte_pmd_virtio :Fix: virtio_pci.h non-existent virtio feature bit-flag tested Stephen Hemminger
2014-06-05 17:06 ` Stephen Hemminger
2014-06-16 10:19 ` Carew, Alan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1401979159-14576-5-git-send-email-alan.carew@intel.com \
--to=alan.carew@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).