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 5FBE4A00BE; Tue, 29 Oct 2019 10:19:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 71E4A1BED4; Tue, 29 Oct 2019 10:19:03 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 254881BED2 for ; Tue, 29 Oct 2019 10:19:01 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9T9AtJ3022034; Tue, 29 Oct 2019 02:19:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=GVTl5tZ8rPdDDOosASkW2ZtdAjv8F2A0ZDgh142lRR0=; b=UsF1GDB4HvvXKfsHj8kXzotLL/6Szed+oS8VzXVW7EMg2P7mGoQm/Ttf9KKfTEBLYmWi Njc9KpOrUI4vijE2hnCKuRijrgx4mkO5GfJE9UYjI7dXkNrWiPFQbfkn+R8LEPEP8uEs zaJJmKiAiRqYI0WnILZgi4r5mJ1gVQauxkwQF7Eroamut4qHktaJYgKqD29M3YPRBKBL BQzyrjl0QvsjFCbbWDsvub55xtQgOuh7aKc0KeUxXNlQF+U5XhM/flxq69K4tP6ODjg/ vaymwowmOfZEYAL8Rw+Acr+h5gwyGaLED/5BEKRAvNB8rskPOpysxRcVL+9IcTxqMEcI Pg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2vvkgq9en0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2019 02:19:00 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 29 Oct 2019 02:18:59 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (104.47.48.56) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 29 Oct 2019 02:18:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NV1Rsq2QS9uBXEJCIkez6XKYZRMGtBW0B+oyBPu6ZtsNLBw5PJ63DzjEcLoJ86eOCvT8rG8x1c31kf+VdWCECEGNetnRhJmByUZ0rFFMiRyCuDxWrKXJq68He5YJnXdwJP9uyDsriqMYloCOiMIwzYTqWPwsCe8FNV6Yw74wTx6eHHvpbIj2hEFfWBS9yelaZsVkL7LEh8r01puMz2ayZUboMuHtqfVWGl7xsmhJZbshRlX/Jn3sPRWJfLZc8oSr9gJp1sKNnod8yVFJGkxcr2/nkcVt209iNiKE7w+wOsOFvim30taZ5jmjylsrkEMoavI9Jn3nWzgqMxO6iHlX6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GVTl5tZ8rPdDDOosASkW2ZtdAjv8F2A0ZDgh142lRR0=; b=VWZip7yCaJOyg5mcukZ5cKOD9M/B+tgy/r4gIQ8tf/CgeFyEkc17hT6t8AMjwfMMeK84cFZMztVbUJGQRd8Fe/vfjRIrsqhn23CmGUNWtRSpdDSG368gulWjH2Jnblw+ERVKOOi0OKka3hmYV5Nxqm6NIQnC+NUAdiIEwArWDr2+1hW5ZujzrgwtZlmZz4A/P/gfW4YPBkko64FLwPYmCIHA5G7P6lCiPU7PH1pH0M+VP3+cGjO/oZ1DXTwkUiPFvyWerCVjRWr6DoRIzO0GDnJ4qYhuOPF7GNsS/62bEZa7x1iZNZ2HCu65odST+mNdpsWE1vyZ9K+6cnSvxASygw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GVTl5tZ8rPdDDOosASkW2ZtdAjv8F2A0ZDgh142lRR0=; b=dQruEceBDKmePRHcEcpkx9hELvBA3yLsIkWK2/N6WOkG5YoikWcXssEmRkaAH5O9WbDJIbqYM+qy2l7QM9CnEAr89YEiraMvSjzcGQlPuzfq3o//ao1dSf6YovselFXuZi/j9ENWlG/KR3bQWG7xkNAHvlrA1k3hQs4QQ2xaPqs= Received: from MWHPR18MB1645.namprd18.prod.outlook.com (10.173.241.137) by MWHPR18MB0989.namprd18.prod.outlook.com (10.173.125.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.24; Tue, 29 Oct 2019 09:18:57 +0000 Received: from MWHPR18MB1645.namprd18.prod.outlook.com ([fe80::b4fd:71ce:2bc4:7afb]) by MWHPR18MB1645.namprd18.prod.outlook.com ([fe80::b4fd:71ce:2bc4:7afb%3]) with mapi id 15.20.2387.027; Tue, 29 Oct 2019 09:18:57 +0000 From: Vamsi Krishna Attunuru To: Olivier Matz CC: Anatoly Burakov , Andrew Rybchenko , Ferruh Yigit , "Giridharan, Ganesan" , Jerin Jacob Kollanukkaran , Kiran Kumar Kokkilagadda , Stephen Hemminger , Thomas Monjalon , "dev@dpdk.org" Thread-Topic: [EXT] [PATCH 1/5] mempool: allow unaligned addr/len in populate virt Thread-Index: AQHVjZhFmI/E3uKQOECUV7iw/kPwM6dxT+swgAAHJACAAABxUA== Date: Tue, 29 Oct 2019 09:18:56 +0000 Message-ID: References: <20190719133845.32432-1-olivier.matz@6wind.com> <20191028140122.9592-1-olivier.matz@6wind.com> <20191028140122.9592-2-olivier.matz@6wind.com> <20191029091328.jciu3zijml5xupjo@platinum> In-Reply-To: <20191029091328.jciu3zijml5xupjo@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.140.231.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a0021a42-4275-4602-b4e7-08d75c5106c2 x-ms-traffictypediagnostic: MWHPR18MB0989: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(136003)(39860400002)(376002)(396003)(189003)(199004)(13464003)(8676002)(6436002)(81166006)(74316002)(316002)(5660300002)(71190400001)(86362001)(71200400001)(8936002)(229853002)(305945005)(7736002)(33656002)(6246003)(81156014)(76116006)(9686003)(55016002)(66946007)(66476007)(66556008)(66446008)(64756008)(478600001)(2906002)(26005)(66066001)(256004)(186003)(446003)(25786009)(11346002)(76176011)(53546011)(102836004)(14454004)(7696005)(55236004)(3846002)(99286004)(6506007)(6116002)(54906003)(486006)(476003)(14444005)(4326008)(52536014)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR18MB0989; H:MWHPR18MB1645.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9vsrUKu+qq1UqnU7PV3p0XaJLrl4D+jCby+x3g8Jx+lTvPU7kXfnJjQ8N4ZGv6MGJN/jaebVLSk+z3krufeB19A2rLlVbSOgkAGg/WZy+1vDinsrzSacjgf6hiA8+1WdappVzN72GnT6l8UsS/YGO75kgOPkSa6EZaLV2MwQR1TDOpANDS1sTBBASQdfbf093sDzV23Vh925jv99DpJjxw9O8leSv5YBcAAF/bKdM83X6obTK6gv8ZJVe2Oa0EAgrVunCABK5ha2pSSWmuw4+Yo1dq1W5smCP3wQkyHBOZsLO6BfceiXSSBpOjdwUoa8MNO3rO87m5xJ0XqEwJDZqe75TOQVSFcjtPBdQqinicJ5Tz2B1dfPb1Bdr7q/93jLK0ek6UEUcCiLThvYdRTENlepWWkzotumPgbJSPyd1iwS4QGDKgE/wj9tkQwHh2UL Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a0021a42-4275-4602-b4e7-08d75c5106c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 09:18:57.0195 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: C8EE4wbjSdz4Ojfu1AyGDyaiAF9NFB7HTFDpa6VMklJMhTUNUk/TUzwwTrOibgsECKQl8IJLNouPnlEDNTzHyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR18MB0989 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-29_03:2019-10-28,2019-10-29 signatures=0 Subject: Re: [dpdk-dev] [EXT] [PATCH 1/5] mempool: allow unaligned addr/len in populate virt 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" Hi Olivier, > -----Original Message----- > From: Olivier Matz > Sent: Tuesday, October 29, 2019 2:43 PM > To: Vamsi Krishna Attunuru > Cc: Anatoly Burakov ; Andrew Rybchenko > ; Ferruh Yigit ; > Giridharan, Ganesan ; Jerin Jacob Kollanukkaran > ; Kiran Kumar Kokkilagadda ; > Stephen Hemminger ; Thomas Monjalon > ; dev@dpdk.org > Subject: Re: [EXT] [PATCH 1/5] mempool: allow unaligned addr/len in popul= ate > virt >=20 > Hi Vamsi, >=20 > On Tue, Oct 29, 2019 at 09:02:26AM +0000, Vamsi Krishna Attunuru wrote: > > Hi Olivier, > > > > Thanks for patch set, able run the tests with 512MB page size with > > this patch set on Octeontx2 platform, somehow mbuf is holding null > > fields when pool is created with 2MB page size, tests like l3fwd, kni > > are failing due to the malformed mbufs. Can you confirm if the patch > > set was verified on any platform with different page sizes. Meanwhile I= will > also debug this issue. >=20 > Thank you for testing. > I tested the patch locally on x86 with 2MB huge pages, and using travis-c= i. >=20 > Maybe it is related to the octeontx2 mempool driver? There is a specific > condition to align the object start address to a multiple of total_elt_sz= . >=20 > Is it this specific patch that breaks your test? Or is it the full patchs= et? No, I am testing full patchset. I will check with specific patches to narro= w down the non-working case. >=20 > Thanks, > Olivier >=20 >=20 >=20 > > > > Regards > > A Vamsi > > > > > -----Original Message----- > > > From: Olivier Matz > > > Sent: Monday, October 28, 2019 7:31 PM > > > To: dev@dpdk.org > > > Cc: Anatoly Burakov ; Andrew Rybchenko > > > ; Ferruh Yigit > > > ; Giridharan, Ganesan > > > ; Jerin Jacob Kollanukkaran > > > ; Kiran Kumar Kokkilagadda > > > ; Stephen Hemminger > > > ; Thomas Monjalon ; > > > Vamsi Krishna Attunuru > > > Subject: [EXT] [PATCH 1/5] mempool: allow unaligned addr/len in > > > populate virt > > > > > > External Email > > > > > > -------------------------------------------------------------------- > > > -- > > > rte_mempool_populate_virt() currently requires that both addr and > > > length are page-aligned. > > > > > > Remove this uneeded constraint which can be annoying with big hugepag= es > (ex: > > > 1GB). > > > > > > Signed-off-by: Olivier Matz > > > --- > > > lib/librte_mempool/rte_mempool.c | 18 +++++++----------- > > > lib/librte_mempool/rte_mempool.h | 3 +-- > > > 2 files changed, 8 insertions(+), 13 deletions(-) > > > > > > diff --git a/lib/librte_mempool/rte_mempool.c > > > b/lib/librte_mempool/rte_mempool.c > > > index 0f29e8712..76cbacdf3 100644 > > > --- a/lib/librte_mempool/rte_mempool.c > > > +++ b/lib/librte_mempool/rte_mempool.c > > > @@ -368,17 +368,11 @@ rte_mempool_populate_virt(struct rte_mempool > > > *mp, char *addr, > > > size_t off, phys_len; > > > int ret, cnt =3D 0; > > > > > > - /* address and len must be page-aligned */ > > > - if (RTE_PTR_ALIGN_CEIL(addr, pg_sz) !=3D addr) > > > - return -EINVAL; > > > - if (RTE_ALIGN_CEIL(len, pg_sz) !=3D len) > > > - return -EINVAL; > > > - > > > if (mp->flags & MEMPOOL_F_NO_IOVA_CONTIG) > > > return rte_mempool_populate_iova(mp, addr, RTE_BAD_IOVA, > > > len, free_cb, opaque); > > > > > > - for (off =3D 0; off + pg_sz <=3D len && > > > + for (off =3D 0; off < len && > > > mp->populated_size < mp->size; off +=3D phys_len) { > > > > > > iova =3D rte_mem_virt2iova(addr + off); @@ -389,7 +383,10 @@ > > > rte_mempool_populate_virt(struct rte_mempool *mp, char *addr, > > > } > > > > > > /* populate with the largest group of contiguous pages */ > > > - for (phys_len =3D pg_sz; off + phys_len < len; phys_len +=3D pg_sz= ) { > > > + for (phys_len =3D RTE_PTR_ALIGN_CEIL(addr + off + 1, pg_sz) - > > > + (addr + off); > > > + off + phys_len < len; > > > + phys_len =3D RTE_MIN(phys_len + pg_sz, len - off)) { > > > rte_iova_t iova_tmp; > > > > > > iova_tmp =3D rte_mem_virt2iova(addr + off + phys_len); > @@ -575,8 > > > +572,7 @@ rte_mempool_populate_default(struct rte_mempool > > > *mp) > > > * have > > > */ > > > mz =3D rte_memzone_reserve_aligned(mz_name, 0, > > > - mp->socket_id, flags, > > > - RTE_MAX(pg_sz, align)); > > > + mp->socket_id, flags, align); > > > } > > > if (mz =3D=3D NULL) { > > > ret =3D -rte_errno; > > > @@ -601,7 +597,7 @@ rte_mempool_populate_default(struct > rte_mempool > > > *mp) > > > (void *)(uintptr_t)mz); > > > else > > > ret =3D rte_mempool_populate_virt(mp, mz->addr, > > > - RTE_ALIGN_FLOOR(mz->len, pg_sz), pg_sz, > > > + mz->len, pg_sz, > > > rte_mempool_memchunk_mz_free, > > > (void *)(uintptr_t)mz); > > > if (ret < 0) { > > > diff --git a/lib/librte_mempool/rte_mempool.h > > > b/lib/librte_mempool/rte_mempool.h > > > index 8053f7a04..0fe8aa7b8 100644 > > > --- a/lib/librte_mempool/rte_mempool.h > > > +++ b/lib/librte_mempool/rte_mempool.h > > > @@ -1042,9 +1042,8 @@ int rte_mempool_populate_iova(struct > > > rte_mempool *mp, char *vaddr, > > > * A pointer to the mempool structure. > > > * @param addr > > > * The virtual address of memory that should be used to store obje= cts. > > > - * Must be page-aligned. > > > * @param len > > > - * The length of memory in bytes. Must be page-aligned. > > > + * The length of memory in bytes. > > > * @param pg_sz > > > * The size of memory pages in this virtual area. > > > * @param free_cb > > > -- > > > 2.20.1 > >