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 C5331A04A2; Tue, 5 Nov 2019 15:33:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E5941BEDC; Tue, 5 Nov 2019 15:33:30 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 99CA01BED7 for ; Tue, 5 Nov 2019 15:33:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572964408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kYYPKq7G0TvaXNFIU2VKZQi+cVHlcxpR80ca3YaYKMY=; b=FAFAwzmxxe7XxyHJejEVMWL+195McqdNAKRaBfAvwnQMRgrJXLBNaDND4aRz8pJwb2XV2D 3HarIQNqc/re/cNddobYVKhxIOOP3vaqSFkq3K5W2cWEEf4L3n/kryD+vsztBcSLug5eTm 0lrv9lYYbL5RXboLcbGQvavbrXNMGOk= Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-106-dL1ErdfgPrihfgWb0Wg6_Q-1; Tue, 05 Nov 2019 09:33:24 -0500 Received: by mail-ua1-f71.google.com with SMTP id i7so3405294uak.7 for ; Tue, 05 Nov 2019 06:33:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Vl2BGeD5FwgNPisuxVRWdJ1ztG+9zKHXF6x0N60J1oA=; b=rpYC9zOFu12Iw7Ph5ikZ9GJ1fe3OPV1Uy4OZfzzGfP2XSn62BwkXoULDB600vjHs1D k0AJ8wkW8wUA49qxT4Eu1fwsMsssgaUtf23Eikpyb4GyBObBf5gWtVivzjIZYOCnKti0 kf84w9USXoQpOLPOLctsoHo/t4BFOSbJorB2XEn1KZyMe6NldvEOkKc+3hJmfU13kCjN OuOoxnTEmloRlhV1kJKrJbRar/b0epapCACgXVwB27CZIwQ+kZtZVCQw0cUj/EMG/BDj RZn4pmPtv1b27ywTN3PXZ1tEFtZb76XX9pCfhW1hYcZy3fTmfT9YB4LcMbmWDBojDv/5 EgKw== X-Gm-Message-State: APjAAAXgejesnM8QHrmdoH2Mvgyua+v3VvgL/AbrgThOZQui34YBbmE7 xyEThGocjfnu0+uzZibFfOZ3/mG4lLigKeAooCP0gOulxiDt5r4vkIvyJ+hqG5R15xdGXlVKdH1 eVd4vw00w9YYBy5ZgPMY= X-Received: by 2002:a67:fa99:: with SMTP id f25mr4039169vsq.141.1572964404220; Tue, 05 Nov 2019 06:33:24 -0800 (PST) X-Google-Smtp-Source: APXvYqz4Ilot5skN7qH+GG0QkVQs/hxm6oyN0Nm1clLhmANv8uUXVKD+if4HFaHwGgnsWjtgFcSBd4AbH9Nmrxd0ggI= X-Received: by 2002:a67:fa99:: with SMTP id f25mr4039138vsq.141.1572964403825; Tue, 05 Nov 2019 06:33:23 -0800 (PST) MIME-Version: 1.0 References: <78A93308629D474AA53B84C5879E84D24B102602@DGGEMM533-MBX.china.huawei.com> In-Reply-To: <78A93308629D474AA53B84C5879E84D24B102602@DGGEMM533-MBX.china.huawei.com> From: David Marchand Date: Tue, 5 Nov 2019 15:33:12 +0100 Message-ID: To: "Wangyu (Turing Solution Development Dep)" Cc: "dev@dpdk.org" , "ferruh.yigit@intel.com" , Linuxarm , "humin (Q)" , "Liyuan (Larry)" , dengxiaofeng X-MC-Unique: dL1ErdfgPrihfgWb0Wg6_Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [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" On Tue, Nov 5, 2019 at 8:27 AM Wangyu (Turing Solution Development Dep) 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 > 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 in= dex 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 --=20 David Marchand