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 6D695A00BE; Tue, 29 Oct 2019 10:02:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7114F1BED1; Tue, 29 Oct 2019 10:02:36 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 05D261BEC8 for ; Tue, 29 Oct 2019 10:02:34 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9T90fUI014941; Tue, 29 Oct 2019 02:02:33 -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=q9DkxgL7km3Yow5ahBFC1ZPbu7DcBJ3QrO0/tPYNvh0=; b=U5pcrtjROYjrh/uXhEKiHe33+U0wt8n2JlCtFLdEa1axaPLWxMzCVVBacExwD7lFSTbx aX5Aib5/R4++YGE8sFmm30trDawnyoXP6qnECxn8lSdVmPyWdDqRg9O62W65Ai1GDP/N 9ilEdHhBP7XK7bRul+U8TYn7cc1/8OWPCGiylK9Lyjo+ko7LGVioctUAv6VuiSs4TK06 y3msImFf5S+PnZoUh7tUrIbVasV/6Kvp02G/haSNfG2GGVb/TSMVclQXyeGzkyKhxYHC 5wTF0lhoc0RD/EmkfZOa/OV2RaeJlMbVq+fLqtaCtYC/Zj40wAb5bj/0kd9OXJc8mfcd eg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2vvnnp0ra2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2019 02:02:33 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 29 Oct 2019 02:02:32 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (104.47.32.57) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 29 Oct 2019 02:02:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M0r1a3EFiv+xrg2IBgEtUaFHoqLMD424Mij03Xc6+2IOJbNiTbUzoQ2hj3knFt/TjS5cVafwwDwcrXjBGWXQRiU6Lsu1/7ZxDhHsCgpp+n1iKxS2X5ni1FEFKS7PQ4xaWOXrlzZNHYK252pmX+aYrSKewV59zM9VrdBE3My4zyr2NpGH87Je3eqtPysBub1pFU1jjAs5+JUETzDBRq5zP5ZwGosxQw0Y+e8j2ADWaRHzSck79sI1fS3WRbhika7O6JMFukckjK+EHjO6kemmVoFIWjbvqgYWZVfgLdsjJP6cqCDAJ1sJwupqUmbnmXxdFpM3DkMZHoFcC0kCFIxBEg== 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=q9DkxgL7km3Yow5ahBFC1ZPbu7DcBJ3QrO0/tPYNvh0=; b=KJ6s9Nz9GshkS2Dv8OWek0ZHVp1mHXOt8zo62+y205WYupnu0PamV81QsNtLHUpzWRZ/795iXBveKGLQk7t5INdhFFeyb7G6+SeRQQEiM+/QpcVxMI6TWoz8WEtakrauMFbR1c9jCxtxqfS9rlb7vbhN51wTjInZ4ExeOpKeGlEXMWFePvxF9f+7Z3p40SowGIHjg8cuTC7ysflyEfvDnZARovS8dB1A8dTHPDYsjXlTUF6ZFbD8Y9ucU3/BZiXi4Aoa5bOuK9315uQg2OoDh0LXCN1BxsNavJECRtBontMCn5D7L/0b8NXL2CPbiGQN653ep80uiazAVMR58rfzAg== 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=q9DkxgL7km3Yow5ahBFC1ZPbu7DcBJ3QrO0/tPYNvh0=; b=i57U0mfnalQlEVzzbAWcsTaJAiT5kreccUNhkh2ErCM3ThrgJ4Lmv+/9kB19IIeUh/WJH5hHPZpcGtJT0cdQN9M8W37tD+LraxMRPUmJ7U6MKrEIheV5hQf3jv2nwApc86Rb8IxhnXL6fHGeeCtHIikFUySTP5iLTUEkErXvpNU= Received: from MWHPR18MB1645.namprd18.prod.outlook.com (10.173.241.137) by MWHPR18MB1088.namprd18.prod.outlook.com (10.173.123.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.23; Tue, 29 Oct 2019 09:02:26 +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:02:26 +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+sw Date: Tue, 29 Oct 2019 09:02:26 +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> In-Reply-To: <20191028140122.9592-2-olivier.matz@6wind.com> 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: 9ef1ae63-ebec-4718-2246-08d75c4eb875 x-ms-traffictypediagnostic: MWHPR18MB1088: 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)(39860400002)(366004)(376002)(396003)(136003)(13464003)(189003)(199004)(71200400001)(26005)(71190400001)(25786009)(316002)(186003)(55016002)(74316002)(9686003)(33656002)(6436002)(6246003)(99286004)(54906003)(52536014)(6916009)(102836004)(14444005)(256004)(14454004)(7696005)(86362001)(229853002)(2906002)(8936002)(6116002)(66556008)(66476007)(476003)(3846002)(66946007)(76116006)(66066001)(478600001)(7736002)(64756008)(11346002)(446003)(66446008)(305945005)(5660300002)(6506007)(81156014)(81166006)(55236004)(76176011)(486006)(4326008)(53546011)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR18MB1088; H:MWHPR18MB1645.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:3; A:3; 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: oaEZzmjsXPrUh5sZe54TN1r7bYS/TGga8fL3DWVtBOqAQjTIhFoN4X0Lp7VtpMWxDKPn3rUE3RDSb3UyWtSUQuPa+bw8yVnMwSFqHpqnzqCRx0TcLtWrnN0BchvN9CBH2QjHDAfycgvBheOOi0sjLqxuhJRypUJHTn3qvXynWjO3Mu4FpKsJCZ2os3YX18O8TTKP9zCKV4X+msUwu2HDzqqjzBR5S84qEpju8U9wfpp4QPTGfYQO8/PmPuCt8Rts6t9dwarOXx05UvEKVPvi832p1tEAJR1Fi0XpN+Aah7hfpYDvImf5aRqH7hqd+KfaCp/NLXWsoBh+4EnEG4CTlpMtYjwjSAiNNlx0np3F0tuGmcEdZv68LHIFi5xNffS+zWC+IDeh7lKTn41gGTrVA9vzXftpSLggRC2fqanNC6broUvh/vLmEGU4DIHO73lg Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9ef1ae63-ebec-4718-2246-08d75c4eb875 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 09:02:26.6673 (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: O62I2bTTEYOISbq3D10h1AMV6rR2XXPJc99hU/3A9YSBTClVoKadKp8oL6JKv0+n64RZGWXRVlIXEvr/RqmsBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR18MB1088 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, Thanks for patch set, able run the tests with 512MB page size with this pat= ch 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 th= e malformed mbufs. Can you confirm if the patch set was verified on any pla= tform with different page sizes. Meanwhile I will also debug this issue. 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 >=20 > External Email >=20 > ---------------------------------------------------------------------- > rte_mempool_populate_virt() currently requires that both addr and length = are > page-aligned. >=20 > Remove this uneeded constraint which can be annoying with big hugepages (= ex: > 1GB). >=20 > 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(-) >=20 > 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; >=20 > - /* 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); >=20 > - for (off =3D 0; off + pg_sz <=3D len && > + for (off =3D 0; off < len && > mp->populated_size < mp->size; off +=3D phys_len) { >=20 > iova =3D rte_mem_virt2iova(addr + off); @@ -389,7 +383,10 @@ > rte_mempool_populate_virt(struct rte_mempool *mp, char *addr, > } >=20 > /* 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; >=20 > 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 objects. > - * 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