From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1134-235.mail.aliyun.com (out1134-235.mail.aliyun.com [42.120.134.235]) by dpdk.org (Postfix) with ESMTP id 0A70D4A6E for ; Fri, 7 Nov 2014 10:47:44 +0100 (CET) X-Alimail-AntiSpam: AC=CONTINUE; BC=0.02354928|-1; FP=0|0|0|0|0|-1|-1|-1; HT=r41g03042; MF=liang.xu@cinfotech.cn; PH=DW; RN=4; RT=4; SR=0; Received: from WS-web (liang.xu@cinfotech.cn[203.110.175.218]) by r41g06016.xy2.aliyun.com at Fri, 07 Nov 2014 17:57:07 +0800 Date: Fri, 07 Nov 2014 17:57:07 +0800 From: "XU Liang" To: "=?UTF-8?B?QnVyYWtvdiwgQW5hdG9seQ==?=" , "dev@dpdk.org" Message-ID: <2c2ad9a4-1c04-4641-9667-249617ae2c56@cinfotech.cn> X-Mailer: Alimail-Mailagent revision 2667797 MIME-Version: 1.0 References: <1415193919-17361-1-git-send-email-liang.xu@cinfotech.cn> <1415347284-15468-1-git-send-email-liang.xu@cinfotech.cn>, C6ECDF3AB251BE4894318F4E4512369780C07822@IRSMSX109.ger.corp.intel.com In-Reply-To: C6ECDF3AB251BE4894318F4E4512369780C07822@IRSMSX109.ger.corp.intel.com x-aliyun-mail-creator: Webmail4_2670074_M3LTW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTBfMSkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzM4LjAuMjEyNS4xMTEgU2FmYXJpLzUzNy4zNg==vN Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] =?utf-8?q?=5BPATCH_v6=5D_eal=3A_map_uio_resources_afte?= =?utf-8?q?r_hugepages_when_the_base=5Fvirtaddr_is_configured=2E?= X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: XU Liang List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 09:47:46 -0000 How to find the=C2=A0maximum end virtual address ?=C2=A0I'm not the DPDK exper= t, but I will try to do my best.=0A If the segments isn't overlap, "if(seg->ad= dr > last->addr)=C2=A0last =3D seg;" already find the segment with=C2=A0maximu= m end virtual address.=0A-----------------------------------------------------= -------------From:Burakov, Anatoly Time:2014 Nov 7 = (Fri) 17 : 47To:=E5=BE=90=E4=BA=AE , dev@dpdk.org Cc:thomas.monjalon@6wind.com , De Lara Gua= rch, Pablo Subject:RE: [PATCH v6] eal: map uio= resources after hugepages when the base_virtaddr is configured.=0AThe commit = message looks fine to me, but VFIO code needs to be adjusted the same way.=0A=0A= Also, now that I think of it, you can't simply assume that whatever last memse= g you have has the latest virtual address. When IVSHMEM is initialized, it too= reserves some space in the virtual memory, which can be higher than the last = hugepage, but not be the last hugepage (because IVSHMEM memory is first to be = reserved, before the main memory).=0A=0AMy advice would be to rewrite the func= tion to return the maximum end virtual address (instead of a last segment) and= move it to eal_pci.c (and include declaration for it in include/eal_pci_init.= h).=0A=0AMy apologies for not thinking about any of this during the first 6 it= erations of the patch :(=0A=0AThanks,=0AAnatoly=0A=0A-----Original Message----= -=0AFrom: lxu [mailto:liang.xu@cinfotech.cn] =0ASent: Friday, November 7, 2014= 8:01 AM=0ATo: dev@dpdk.org=0ACc: Burakov, Anatoly; thomas.monjalon@6wind.com;= De Lara Guarch, Pablo=0ASubject: [PATCH v6] eal: map uio resources after huge= pages when the base_virtaddr is configured.=0A=0AA multiple process DPDK appli= cation must mmap hugepages and pci resource into same virtual addresses. By de= fault the virtual addresses chosen by the primary process automatically when c= alling the mmap. But sometime the virtual addresses chosen by the primary proc= ess isn't usable at secondary process. Such as the secondary process linked wi= th more libraries than primary process. The library has been mapped into this = virtual address. The command line parameter 'base-virtaddr' has been added for= this situation. If it's configured, the hugepages will be mapped into this ba= se address. But the virtual address of uio resource mapped still does not refe= r to the parameter. In that case it would still fail.=0A=0AThis patch try to m= ap uio resources after hugepages when the base_virtaddr is configured. So the = error of "EAL: pci_map_resource(): cannot mmap" can be resolved by set base-vi= rtaddr into free virtual address space.=0A=0ASigned-off-by: lxu =0A---=0A lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 29 ++++++++++++= ++++++++++++++++-=0A 1 file changed, 28 insertions(+), 1 deletion(-)=0A=0Adiff= --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/e= al/eal_pci_uio.c=0Aindex 7e62266..a2c9ab6 100644=0A--- a/lib/librte_eal/linuxa= pp/eal/eal_pci_uio.c=0A+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c=0A@@ -2= 73,6 +273,24 @@ pci_get_uio_dev(struct rte_pci_device *dev, char *dstbuf,=0A = return uio_num;=0A }=0A =0A+static inline const struct rte_memseg *=0A+get_phy= smem_last(void)=0A+{=0A+ const struct rte_memseg * seg =3D rte_eal_get_physmem= _layout();=0A+ const struct rte_memseg * last =3D seg;=0A+ unsigned i =3D 0;=0A= +=0A+ for (i=3D0; iaddr =3D=3D NU= LL)=0A+ break;=0A+=0A+ if(seg->addr > last->addr)=0A+ last =3D seg;=0A+=0A= + }=0A+ return last;=0A+}=0A+=0A /* map the PCI resource of a PCI device in vi= rtual memory */ int pci_uio_map_resource(struct rte_pci_device *dev) @@ -290= ,6 +308,13 @@ pci_uio_map_resource(struct rte_pci_device *dev)=0A struct mapp= ed_pci_resource *uio_res;=0A struct pci_map *maps;=0A =0A+ /* map uio resourc= e into user required virtual address */=0A+ static void * requested_addr;=0A+ = if (internal_config.base_virtaddr && NULL =3D=3D requested_addr) {=0A+ const = struct rte_memseg * last =3D get_physmem_last();=0A+ requested_addr =3D RTE_P= TR_ADD(last->addr, last->len);=0A+ }=0A+=0A dev->intr_handle.fd =3D -1;=0A d= ev->intr_handle.type =3D RTE_INTR_HANDLE_UNKNOWN;=0A =0A@@ -371,10 +396,12 @@ = pci_uio_map_resource(struct rte_pci_device *dev)=0A if (maps[j].addr !=3D N= ULL)=0A fail =3D 1;=0A else {=0A- mapaddr =3D pci_map_resource(NULL,= fd, (off_t)offset,=0A+ mapaddr =3D pci_map_resource(requested_addr, fd, (o= ff_t)offset,=0A (size_t)maps[j].size);=0A if (mapaddr =3D=3D NULL)=0A= fail =3D 1;=0A+ else if (NULL !=3D requested_addr)=0A+ requested_= addr =3D RTE_PTR_ADD(mapaddr, maps[j].size);=0A }=0A =0A if (fail) {=0A-= -=0A1.9.1 >From anatoly.burakov@intel.com Fri Nov 7 10:53:50 2014 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2EF227EC4 for ; Fri, 7 Nov 2014 10:53:45 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 07 Nov 2014 02:02:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,331,1413270000"; d="scan'208,217";a="628228403" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga002.fm.intel.com with ESMTP; 07 Nov 2014 02:02:40 -0800 Received: from irsmsx107.ger.corp.intel.com (163.33.3.99) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 7 Nov 2014 10:00:58 +0000 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.101]) by IRSMSX107.ger.corp.intel.com ([169.254.10.154]) with mapi id 14.03.0195.001; Fri, 7 Nov 2014 10:00:57 +0000 From: "Burakov, Anatoly" To: XU Liang , "dev@dpdk.org" Thread-Topic: [PATCH v6] eal: map uio resources after hugepages when the base_virtaddr is configured. Thread-Index: AQHP+mEdCoJJM6uhEkSpotX1GZcOhJxU7g3YgAAALIA= Date: Fri, 7 Nov 2014 10:00:57 +0000 Message-ID: References: <1415193919-17361-1-git-send-email-liang.xu@cinfotech.cn> <1415347284-15468-1-git-send-email-liang.xu@cinfotech.cn>, C6ECDF3AB251BE4894318F4E4512369780C07822@IRSMSX109.ger.corp.intel.com <2c2ad9a4-1c04-4641-9667-249617ae2c56@cinfotech.cn> In-Reply-To: <2c2ad9a4-1c04-4641-9667-249617ae2c56@cinfotech.cn> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v6] eal: map uio resources after hugepages when the base_virtaddr is configured. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 09:53:50 -0000 QWgsIHllcywgc29ycnkgYWJvdXQgdGhhdCwgaGF2ZW7igJl0IHF1aXRlIHdva2UgdXAgeWV0IOKY uSBZb3XigJlyZSByaWdodC4gU28gaXTigJlzIHJlbW92aW5nIHRoZSBkZXBlbmRlbmN5IG9uIC0t YmFzZS12aXJ0YWRkciwgbW92aW5nIHRoZSBmdW5jdGlvbiB0byBlYWxfcGNpLmMgIGFuZCBhZGRp bmcgc2ltaWxhciBWRklPIGNvZGUgdGhhdOKAmXMgbGVmdCB0aGVuLg0KDQpUaGFua3MsDQpBbmF0 b2x5DQoNCkZyb206IFhVIExpYW5nIFttYWlsdG86bGlhbmcueHVAY2luZm90ZWNoLmNuXQ0KU2Vu dDogRnJpZGF5LCBOb3ZlbWJlciA3LCAyMDE0IDk6NTcgQU0NClRvOiBCdXJha292LCBBbmF0b2x5 OyBkZXZAZHBkay5vcmcNCkNjOiB0aG9tYXMubW9uamFsb25ANndpbmQuY29tOyBEZSBMYXJhIEd1 YXJjaCwgUGFibG8NClN1Ympl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