[dpdk-dev] [PATCH v2] bus/pci: resolve multiple NICs address conflicts
David Marchand
david.marchand at redhat.com
Tue Nov 5 15:33:12 CET 2019
On Tue, Nov 5, 2019 at 8:27 AM Wangyu (Turing Solution Development
Dep) <seven.wangyu at huawei.com> wrote:
>
>
> NIC address conflicts on 64K pagesize when using multiple NICs,
> as system will mmap 64K pagesize for NIC,
> but dev->mem_resource[i].len is 16K.
Please, can you describe the problem you want to fix?
Is this a problem specific to a pci device you are using?
Thanks.
>
> Signed-off-by: Beard-627 <dengxiaofeng at huawei.com>
> Signed-off-by: Eric wang <seven.wangyu at huawei.com>
> Acked-by: Wei Hu <xavier.huwei at huawei.com>
> Acked-by: Min Hu <humin29 at huawei.com>
> ---
> drivers/bus/pci/linux/pci.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index 43debaa..afaa68d 100644
> --- a/drivers/bus/pci/linux/pci.c
> +++ b/drivers/bus/pci/linux/pci.c
> @@ -201,6 +201,11 @@
> if (flags & IORESOURCE_MEM) {
> dev->mem_resource[i].phys_addr = phys_addr;
> dev->mem_resource[i].len = end_addr - phys_addr + 1;
> + if (dev->mem_resource[i].len <
> + (unsigned int)getpagesize())
> +
> + dev->mem_resource[i].len =
> + (unsigned int)getpagesize();
> /* not mapped for now */
> dev->mem_resource[i].addr = NULL;
> }
> --
> 1.8.3.1
--
David Marchand
More information about the dev
mailing list