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 0B52BA00C5; Sun, 5 Jul 2020 14:25:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DD49B1DC41; Sun, 5 Jul 2020 14:25:43 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70051.outbound.protection.outlook.com [40.107.7.51]) by dpdk.org (Postfix) with ESMTP id 65AB21DC3D for ; Sun, 5 Jul 2020 14:25:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V0X/7dYnT8hGOXLl1dC+k6Wjd0AyGFpyP51LCR8DDVKw+Rxk/xVV1DJFWTDmXCei54VSsiR9k9NtWugdV5UqmsjAo+ny46WENnINFouk5L3yqj76F9G20oXz61G73QODU1r5Up62C3KKxu1uhHdbKJyVMa94tr08GBFmNc0LqkttpWvm3UVR/B12DszI9ZW8shB6jDMJiKWVqr9HLNSt5SQzHfDm6F6071YYSBuPSebybNyhg+KvxCQuKnhgJN69alroSaNIbIB0ZuOqSTyXXpU246cTUu6oFZ6JVjPvcBhUoIqMBTRGus4PV3DBtXAYHVnRIOudAfNyXAd4pRTvdQ== 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=JRYkUBO3LSY5I+vziJmXk8qn279pqNQembGlLGIysGE=; b=llFidnaIAc2/jivKSAtHCn1sdGeba0oBgvzSlGhss63xZCwWQ1HbuntBO9pPVtXNTPlfpkNemyv4GUpLzRO97/iMlNFY8zglAVFQDXG7jQ5tcowHOq6gHbYu/2IsLlEJefX7RaBLX7jf2nGzgkr/FP6EgfzX2SZzHoP85qlUGPvg0PeDeSJnDR9Wbq9c13yCoWqa8jv8hCFQdvVn+zoE0lcthD6NKiFFyNrJZeIDoYqvgc25qCKDCd/AnOY9ZVzrpDe92prHYUbhBzd7ofP/c7dp3lDASrp7o7DEAhXM0OHUt0pt3e7mJxKJQsB3Cavb/iKKcA4Ry/hB+jxl4Vjduw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JRYkUBO3LSY5I+vziJmXk8qn279pqNQembGlLGIysGE=; b=cZs0r1NnM9YX1VlT7wTvOuZwu3VCmBT9A31ip0mcvffvGuJNueV6diz7EMLtWl7AWwDaKMxzFNoSfzhFQftGdPnPbx+H81e70CCBa0dImSEzV6GhWCtliBw54v2m0gJyTyVKGhKrge43jC8pchvIHDfB07hI+21QV4WzKAA6Q6A= Received: from VI1PR05MB5872.eurprd05.prod.outlook.com (2603:10a6:803:de::17) by VI1PR05MB4798.eurprd05.prod.outlook.com (2603:10a6:802:5b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23; Sun, 5 Jul 2020 12:25:41 +0000 Received: from VI1PR05MB5872.eurprd05.prod.outlook.com ([fe80::ec95:ae9e:77c8:63ae]) by VI1PR05MB5872.eurprd05.prod.outlook.com ([fe80::ec95:ae9e:77c8:63ae%6]) with mapi id 15.20.3153.029; Sun, 5 Jul 2020 12:25:41 +0000 From: Fady Bader To: Dmitry Kozlyuk CC: "dev@dpdk.org" , Thomas Monjalon , Tasnim Bashar , Tal Shnaiderman , Yohad Tor , "harini.ramakrishnan@microsoft.com" , "ocardona@microsoft.com" , "pallavi.kadam@intel.com" , "ranjit.menon@intel.com" , "olivier.matz@6wind.com" , "arybchenko@solarflare.com" , "mdr@ashroe.eu" , "nhorman@tuxdriver.com" Thread-Topic: [PATCH v5 2/3] mempool: use generic memory management Thread-Index: AQHWUsUAP5fNrjXj/0GC6jEXriNY3aj46Rtw Date: Sun, 5 Jul 2020 12:25:40 +0000 Message-ID: References: <20200702131409.17964-2-fady@mellanox.com> <20200705114629.2152-1-fady@mellanox.com> <20200705114629.2152-3-fady@mellanox.com> <20200705150826.30f0b143@sovereign> In-Reply-To: <20200705150826.30f0b143@sovereign> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [213.57.105.94] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 45775e68-c433-4470-a154-08d820de8814 x-ms-traffictypediagnostic: VI1PR05MB4798: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 045584D28C x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PiUURhwfzWqA8D0TvEoOWBmZxbn82fzh4QBd8+TYirOvNs0VSyxl7ir68yAm7PkMfhl6gIxl3U3SlixTa19qmg8PexgbIbcsDyRg3J2KCUfKsgxYYxpfHpC/wUVhLIC9jQvgXxqGHdYgbaA5Yre9fadL+5yGxJnFnx3EljBUHRZxPjJW1L5ywDRLr5MBns42DGx9YTDwHGNCxfpekm4UKvg7a7mlpb0xbwPvk54RMMXruhC/+KsvtK4E1XEhXYSXUk4EkZdlV54D10oZ6zzovwtPTKSjvqw1EkRP7fM/fgtCINZeQWwmTTVDDiiDYBzOep14LPHNSimoT4auKVrt4gajbDo6f7PTqykQGoQZUCt3DENCYFPrxJHB4edgENta x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5872.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(136003)(376002)(366004)(396003)(39860400002)(2906002)(6916009)(33656002)(86362001)(5660300002)(52536014)(26005)(71200400001)(55016002)(9686003)(6506007)(53546011)(186003)(54906003)(316002)(66556008)(66446008)(66476007)(64756008)(66946007)(478600001)(45080400002)(7696005)(7416002)(8936002)(76116006)(83380400001)(4326008)(8676002)(41533002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: YawTB6BCYw1Vx9Y+lIqECcjvN4k3ugM/CsSnQOkgL3aLA8igtGFMfIyPxSNSGsyzHS2QC+fuls3V5W5L2mmat9Kc3EoGF6d6Igg6nsdFrz0XmtGas2Pkh2FJB80p2V3Sg7fq9dsGikleVhVnlBpeeyE5JzyBhSp4KmoOYMkxikHAG6sxrt9zIP/ZmVbEaX7B3QNfRxBG10grP6soAR/Y4zAHB+96Fdpxyno4trdiInsTL/SxWl3rqzTuwOjqj7gDw7LCs1Oh8VHDoWl05ELVTVz0IKNfNgmsN88lSJBkGtnfi9uHCoupmRshQapDdFOZ7uOtP3oZx5gDoS7gJqm94EQ8Dbd+wr4reBx40UDosEgkl1MReW8MaZ4f5l8e2xBZLqy2tvjhozh7rL+V69CbpRrD1rdMqLxFDwQsVG4EzbHEE7XDgtqPH0BeR66+lI3+xSzSIaxaka/auYut1kVtSJaM7MtgkgGwxTlhYiWIGkM= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR05MB5872.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45775e68-c433-4470-a154-08d820de8814 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2020 12:25:40.8998 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Ru1Z2qwIBF2Sk/ZoLwVndBjE4FPDWVKJ7TnEnCOr6BRLc8m3Bv7Rk8dGUxKJRRsAXQyK3ryJWSwAi/2tGj9IFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4798 Subject: Re: [dpdk-dev] [PATCH v5 2/3] mempool: use generic memory management 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" > -----Original Message----- > From: Dmitry Kozlyuk > Sent: Sunday, July 5, 2020 3:08 PM > To: Fady Bader > Cc: dev@dpdk.org; Thomas Monjalon ; Tasnim Bashar > ; Tal Shnaiderman ; Yohad Tor > ; harini.ramakrishnan@microsoft.com; > ocardona@microsoft.com; pallavi.kadam@intel.com; ranjit.menon@intel.com; > olivier.matz@6wind.com; arybchenko@solarflare.com; mdr@ashroe.eu; > nhorman@tuxdriver.com > Subject: Re: [PATCH v5 2/3] mempool: use generic memory management >=20 > On Sun, 5 Jul 2020 14:46:28 +0300, Fady Bader wrote: > [snip] > > /* populate the mempool with an anonymous mapping */ @@ -740,20 > > +741,20 @@ rte_mempool_populate_anon(struct rte_mempool *mp) > > } > > > > /* get chunk of virtually continuous memory */ > > - addr =3D mmap(NULL, size, PROT_READ | PROT_WRITE, > > - MAP_SHARED | MAP_ANONYMOUS, -1, 0); > > - if (addr =3D=3D MAP_FAILED) { > > + addr =3D rte_mem_map(NULL, size, RTE_PROT_READ | RTE_PROT_WRITE, > > + RTE_MAP_SHARED | RTE_MAP_ANONYMOUS, -1, 0); > > + if (addr =3D=3D NULL) { > > rte_errno =3D errno; >=20 > rte_errno is set by rte_mem_map(), using errno here is incorrect on Windo= ws. Ok, I'll send a new version soon. >=20 > > return 0; > > } > > /* can't use MMAP_LOCKED, it does not exist on BSD */ > > - if (mlock(addr, size) < 0) { > > + if (rte_mem_lock(addr, size) < 0) { > > rte_errno =3D errno; >=20 > Ditto. >=20 > [snip] >=20 > -- > Dmitry Kozlyuk