[dpdk-dev] vfio-pci: Fixing type used to unsigned long

Message ID 1435243334-4566-1-git-send-email-alejandro.lucero@netronome.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Alejandro Lucero June 25, 2015, 2:42 p.m. UTC
  From: "Alejandro.Lucero" <alejandro.lucero@netronome.com>

VFIO kernel driver and mmap system call expect offset and size being 64 bits.

Due to this bug BAR index info given to the VFIO driver is always 0 when checking validity of resources mapping.
---
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index aea1fb1..29d8806 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -728,7 +728,7 @@  pci_vfio_map_resource(struct rte_pci_device *dev)
 		struct vfio_region_info reg = { .argsz = sizeof(reg) };
 		void *bar_addr;
 		struct memreg {
-			uint32_t offset, size;
+			unsigned long offset, size;
 		} memreg[2] = {};
 
 		reg.index = i;