From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BE36AA0352; Tue, 5 Nov 2019 08:26:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E0052C12; Tue, 5 Nov 2019 08:26:45 +0100 (CET) Received: from huawei.com (szxga02-in.huawei.com [45.249.212.188]) by dpdk.org (Postfix) with ESMTP id E3A782B96 for ; Tue, 5 Nov 2019 08:26:41 +0100 (CET) Received: from DGGEMM403-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id 69E5AC41B975954CD708 for ; Tue, 5 Nov 2019 15:26:19 +0800 (CST) Received: from DGGEMM422-HUB.china.huawei.com (10.1.198.39) by DGGEMM403-HUB.china.huawei.com (10.3.20.211) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 5 Nov 2019 15:26:18 +0800 Received: from DGGEMM533-MBX.china.huawei.com ([169.254.5.114]) by dggemm422-hub.china.huawei.com ([10.1.198.39]) with mapi id 14.03.0439.000; Tue, 5 Nov 2019 15:26:13 +0800 From: "Wangyu (Turing Solution Development Dep)" To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Linuxarm , "humin (Q)" , "Liyuan (Larry)" , dengxiaofeng Thread-Topic: [PATCH v2] bus/pci: resolve multiple NICs address conflicts Thread-Index: AdWTqbUcVGrMoqfPRo+oZbLD03ZZLQ== Date: Tue, 5 Nov 2019 07:26:13 +0000 Message-ID: <78A93308629D474AA53B84C5879E84D24B102602@DGGEMM533-MBX.china.huawei.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.57.112.122] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2] bus/pci: resolve multiple NICs address conflicts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. Signed-off-by: Beard-627 Signed-off-by: Eric wang Acked-by: Wei Hu Acked-by: Min Hu --- 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 inde= x 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 =3D phys_addr; dev->mem_resource[i].len =3D end_addr - phys_addr + 1; + if (dev->mem_resource[i].len < + (unsigned int)getpagesize()) + + dev->mem_resource[i].len =3D + (unsigned int)getpagesize(); /* not mapped for now */ dev->mem_resource[i].addr =3D NULL; } -- 1.8.3.1