[dpdk-dev] 答复: [PATCH v2] bus/pci: resolve multiple NICs address conflicts

Wangyu (Eric) seven.wangyu at huawei.com
Thu Nov 7 04:17:32 CET 2019


Hi, Anatoly

We map BAR's with arbitrary addresses, so i don't think we can do much here - if mmap() returns page-unaligned addresses on platforms with 64K sizes, it's not our fault.

    	Maybe we have some misunderstanding here. mmap() returns page-aligned on my system, but the man page of mmap() ,we found this " offset must be a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE) ".
	So the mmap() must apply of one or more page size, in 64K system, it's bigger than 16K. When calculate second NIC address(first NIC address + 16K), the problem arise. I prefer to say that it is a matching problem between software and system.

		We are using Centos 7.6.1810 (AltArch) on arm server, the default page size is 64K, so we can't do much here.


Best Regards,
Xiaofeng Deng

Turing Business Unit, HiSilicon, HUAWEI
Mobile: (+86)18219206880
Email: dengxiaofeng at huawei.com

-----邮件原件-----
发件人: Burakov, Anatoly [mailto:anatoly.burakov at intel.com] 
发送时间: 2019年11月6日 18:35
收件人: David Marchand <david.marchand at redhat.com>; Wangyu (Eric) <seven.wangyu at huawei.com>
抄送: dengxiaofeng <dengxiaofeng at huawei.com>; dev at dpdk.org; ferruh.yigit at intel.com; Linuxarm <linuxarm at huawei.com>; humin (Q) <humin29 at huawei.com>; Liyuan (Larry) <Larry.T at huawei.com>
主题: Re: [dpdk-dev] [PATCH v2] bus/pci: resolve multiple NICs address conflicts

On 06-Nov-19 7:37 AM, David Marchand wrote:
> On Wed, Nov 6, 2019 at 7:16 AM Wangyu (Eric) <seven.wangyu at huawei.com> wrote:
>>
>>
>> In 64K pagesize system, DPDK will read the size NIC need in uio/uio1/maps/map1/size,  when the size small than pagesize(e.g.,82599 is 16K), dev->mem_resource[i].len will be 16K, but the mmap function applies for at least 1 page size, which is 64K.
>> Then second NIC mmap, start address is first NIC address + 16K, which already used by first NIC.
> 
> Do you see this issue with vfio?
> 
> 
>> So if change the size to first NIC address + 64K, problem solved.
> 
> You are hacking a description of the device resources to workaround a problem.
> This patch is a no go for me.
> 
> Maybe there is something to do with the hint passed to mmap in uio case.
> Adding Anatoly to the loop.
> 







More information about the dev mailing list