numam-dpdk/drivers/bus/pci
Thomas Monjalon 9d2b245937 pci: keep API compatibility with mmap values
The function pci_map_resource() returns MAP_FAILED in case of error.
When replacing the call to mmap() by rte_mem_map(),
the error code became NULL, breaking the API.
This function is probably not used outside of DPDK,
but it is still a problem for two reasons:
	- the deprecation process was not followed
	- the Linux function pci_vfio_mmap_bar() is broken for i40e

The error code is reverted to the Unix value MAP_FAILED.
Windows needs to define this special value (-1 as in Unix).
After proper deprecation process, the API could be changed again
if really needed.

Because of the switch from mmap() to rte_mem_map(),
another part of the API was changed: "int additional_flags"
are defined as "additional flags for the mapping range"
without mentioning it was directly used in mmap().
Currently it is directly used in rte_mem_map(),
that's why the values rte_map_flags must be mapped (sic) on the mmap ones
in case of Unix OS.

These are side effects of a badly defined API using Unix values.

Bugzilla ID: 503
Fixes: 2fd3567e54 ("pci: use OS generic memory mapping functions")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Lihong Ma <lihongx.ma@intel.com>
2020-07-11 11:48:13 +02:00
..
bsd pci: keep API compatibility with mmap values 2020-07-11 11:48:13 +02:00
linux pci: keep API compatibility with mmap values 2020-07-11 11:48:13 +02:00
windows bus/pci: support Windows with bifurcated drivers 2020-06-30 00:02:54 +02:00
Makefile build: disable experimental API check internally 2020-04-14 16:22:34 +02:00
meson.build bus/pci: introduce Windows support with stubs 2020-06-30 00:02:54 +02:00
pci_common_uio.c pci: keep API compatibility with mmap values 2020-07-11 11:48:13 +02:00
pci_common.c bus/pci: introduce Windows support with stubs 2020-06-30 00:02:54 +02:00
pci_params.c devargs: rename enum items with singular form 2018-10-11 13:57:29 +02:00
private.h bus/pci: optimise scanning with whitelist/blacklist 2020-05-11 16:59:58 +02:00
rte_bus_pci_version.map build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
rte_bus_pci.h bus/pci: change IOVA as VA flag name 2019-07-22 17:46:32 +02:00