eal: fix memory mapping on 32-bit target
authorLance Richardson <lance.richardson@broadcom.com>
Sat, 8 May 2021 14:27:53 +0000 (10:27 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 11 May 2021 21:01:06 +0000 (23:01 +0200)
commit6beb2d294743aad1488234109a3ad95a8d5a273f
tree717ee2233437cc583d5b4c57f3354bb71227f6d7
parent86ff0663639417f9d25907d09343a5c231e32a51
eal: fix memory mapping on 32-bit target

For 32-bit targets, size_t is normally a 32-bit type and
does not have sufficient range to represent 64-bit offsets
that are needed when mapping PCI addresses.
Use uint64_t instead.

Found when attempting to run 32-bit Linux dpdk-testpmd
using VFIO driver:

    EAL: pci_map_resource(): cannot map resource(63, 0xc0010000, \
    0x200000, 0x20000000000): Invalid argument ((nil))

Fixes: c4b89ecb64ea ("eal: introduce memory management wrappers")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/eal/include/rte_eal_paging.h
lib/eal/unix/eal_unix_memory.c
lib/eal/windows/eal_memory.c