summaryrefslogtreecommitdiff
path: root/drivers/net/virtio/virtio_pci.c
diff options
context:
space:
mode:
authorYuanhan Liu <yuanhan.liu@linux.intel.com>2016-03-10 15:01:20 +0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-03-14 23:16:15 +0100
commit36ea36efb471146ead95b4d1fc0c5642682bca77 (patch)
treec886e4351ca00bc2cb1beeaff8b7887c70ee413c /drivers/net/virtio/virtio_pci.c
parent6b5a857fb0b9985024f2523aa4572d7ce0c28779 (diff)
downloaddpdk-next-eventdev-36ea36efb471146ead95b4d1fc0c5642682bca77.zip
dpdk-next-eventdev-36ea36efb471146ead95b4d1fc0c5642682bca77.tar.gz
dpdk-next-eventdev-36ea36efb471146ead95b4d1fc0c5642682bca77.tar.xz
virtio: fix query of legacy features
Declare dst as type uint32_t instead of uint64_t, otherwise, we will get a random upper 32 bit feature bits, as the following io port read reads lower 32 bit only. It could lead a feature bits that include VIRTIO_F_VERSION_1 (the 32th bit) for legacy virtio, which is obviously wrong. Fixes: b8f04520ad71 ("virtio: use PCI ioport API") Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com> Reviewed-by: David Marchand <david.marchand@6wind.com>
Diffstat (limited to 'drivers/net/virtio/virtio_pci.c')
-rw-r--r--drivers/net/virtio/virtio_pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index 98fc370..c007959 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -74,7 +74,7 @@ legacy_write_dev_config(struct virtio_hw *hw, size_t offset,
static uint64_t
legacy_get_features(struct virtio_hw *hw)
{
- uint64_t dst;
+ uint32_t dst;
rte_eal_pci_ioport_read(&hw->io, &dst, 4, VIRTIO_PCI_HOST_FEATURES);
return dst;