[dpdk-dev] [PATCH v2 2/7] pci: build on Windows

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Wed Apr 29 01:52:17 CEST 2020


This patch misses two things:

1. Documentation on pci_map_resource() mentions MAP_FAILED,
   while rte_mem_map() returns NULL on failure.

2. Code in drivers/bus/pci/linux passes MAP_FIXED to pci_map_resource(),
   which should be changed to corresponding RTE_MAP_FORCE_ADDRESS flag
   (it is renamed in v4 of MM patch series).

On 2020-04-28 12:11 GMT+0300 talshn at mellanox.com wrote:
[snip]
> +	if (mapaddr == NULL) {
>  		RTE_LOG(ERR, EAL,
>  			"%s(): cannot mmap(%d, %p, 0x%zx, 0x%llx): %s (%p)\n",
>  			__func__, fd, requested_addr, size,
> @@ -160,7 +160,7 @@ pci_unmap_resource(void *requested_addr, size_t size)
>  		return;
>  
>  	/* Unmap the PCI memory resource of device */
> -	if (munmap(requested_addr, size)) {
> +	if (rte_mem_unmap(requested_addr, size)) {
>  		RTE_LOG(ERR, EAL, "%s(): cannot munmap(%p, %#zx): %s\n",
>  			__func__, requested_addr, size,
>  			strerror(errno));

Logging can be removed here if ERR level is not a requirement: rte_mem_map()
and rte_mem_unmap() already log OS errors on debug level.

-- 
Dmitry Kozlyuk


More information about the dev mailing list