From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BC08FA0C4B; Fri, 15 Oct 2021 11:58:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96C99411FE; Fri, 15 Oct 2021 11:58:53 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id 5E829411F6 for ; Fri, 15 Oct 2021 11:58:51 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by mxs.oss.nvidia.com (10.13.234.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Fri, 15 Oct 2021 02:58:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SzKEiB5aGk8d9QjCqAGqDfJk267P50F+Hoby1qHcdmJJoFQYMG+A2+B4aWJsDIH6iIntaJkm5x/g0WlIWHu7s+V+D+jbaLdH989Xa5/VPeGtVr/jIGqiYEOBGLigdjMDbGiWXfsvNFLX0LkYNXJbNjQiStjt55z4Ono6pYJ2m/jpTyq5I9Le7SkO0Qq4JOd8hP3lqnTLNg5idSdBfeP+LTDL7wOqS7OHSCblWAzMpKATJ0U9qBsuPjWr9x8+K+LCfptBhIbhq1fNHo94ND8zd/SczGk5lwa54z7yelkm0FLD8FBn5OtisE7UJQfOrZ+5IvqaP3w2r9NivtIIPJ4eKg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e8HH1dRCnPbzpKwefpVhfyoXyuYa6SZVIf/83w5eGng=; b=hGGI4hg7985Hnu6+9taCvCSha20EoEzpDjVcuEa0e2vgGI9r/ccDofstvy55XAlb+H+VGQD2YuiUaL8F/wj5tlFQ8zRgRGJ0Vulbr2kbaYIh3NDN7NpxPkIF46fcpb3fBix1v/lIAUG6A56inOzim/VehCcoCJhMC0KkVekgpfRIghgHVcyObNaoI2o0La4fHRGaE++HPemjXZ5TwDTysXMpr88LlCtBqZxgFP06kRaadRXMkrU9N2ug4bPfXjoMXe4kgJKEWqA0j7DJtjWo770libk5MiWDcAL4/HCj27Qj1AfSZiyPGUfWRvnXmH35FWLoglrRGM1YSGeyQnbqkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e8HH1dRCnPbzpKwefpVhfyoXyuYa6SZVIf/83w5eGng=; b=pLtFm+TZFVno4IzePoOlDiE/ZmSk5EczKRmQjaIfMZ/LwCMEEPZ1Wdixk56Ka1oE35XCjZhB7K9Gw/wC0OmHhYR+1ODYls1xOi+l28m6tDZNulU5K/Kac/awHPHVhGXehEJufQVjljRw4MXOQqnLEp2rvJGI6GbHXNK8ocG3c4ISB+pDHLNJP9X6t1h63pCBhlFzzEf6mRZFGwIBOd1OjPHUNp0tWm5dImiXJfrqb8hyiumUoQI9Fs81S0650nZxz3523Ha1syLJ2Ix75yUOWLH3iEYYjCE8JoZTQsrOfRQVDjrQmgl7w47C1C4vxcy9wdDX668Wr1bbS5BngeITMg== Received: from CH0PR12MB5091.namprd12.prod.outlook.com (2603:10b6:610:be::10) by CH0PR12MB5316.namprd12.prod.outlook.com (2603:10b6:610:d7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Fri, 15 Oct 2021 09:58:49 +0000 Received: from CH0PR12MB5091.namprd12.prod.outlook.com ([fe80::59bf:640f:7140:ab97]) by CH0PR12MB5091.namprd12.prod.outlook.com ([fe80::59bf:640f:7140:ab97%9]) with mapi id 15.20.4587.032; Fri, 15 Oct 2021 09:58:49 +0000 From: Dmitry Kozlyuk To: Olivier Matz , Andrew Rybchenko CC: "dev@dpdk.org" , Matan Azrad Thread-Topic: [PATCH v4 2/4] mempool: add non-IO flag Thread-Index: AQHXwaNR7C9Q7+ksk02/c1PTh/aNi6vTxspwgAAFXoCAAALAAIAAAWDQ Date: Fri, 15 Oct 2021 09:58:49 +0000 Message-ID: References: <20211012000409.2751908-1-dkozlyuk@nvidia.com> <20211013110131.2909604-1-dkozlyuk@nvidia.com> <20211013110131.2909604-3-dkozlyuk@nvidia.com> <7fe50e1d-e4d8-8c92-56fd-13d5b5e413f8@oktetlabs.ru> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9ef06630-7bb5-49f7-70f8-08d98fc262d6 x-ms-traffictypediagnostic: CH0PR12MB5316: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Bt+wvQ4TQQXLvUZIq1vjz2g8Tyb7NFFOP7OmBkdYOnOtKumUzPrw+gaBYl9D3+vDgDkuh0IUhZ4Uwp2bqtrU3kzFvttYZIwBkyKEzHLpK/dhKx4Qe+0d6xCTSZLcU7ssHqQPU3WLdKqCFtaOit/4mCQHuDDj3SXSDTMajzJt2Y9HPdlOnPa/j9lq26w2rGiKCHkmuAgBLl4v9una91hGw4Z12WqJ2itGIM8XALX6X8pCjvtp4c4gUlahLIKWV8a8GJ9/Xi74fexn/KQZxLPJ0LnWFkhkU2E4V8vJxRKHSTbnKuQQdIQ/opkcEUYP38kZ9Cmqjzb3L7iSeC+TAIjHCWgHRjmONsNWeOm5FXZaeJFH5r5TG8kLEyb6QjiHiJN3DchnZ9W3MB/nSKPHphjeIvPpHSIkxtee7kiZ2Mf2B/GO3r/yw/NXobve5utNXaG3zHJPFkLQ646ZJWJPjJMCUuFdKWgiAmE1DREwwObH00maNpmkVz8CovMY4KynvNU9S+k57Bjl+Hp3HwamRPwlt58/UndqF/LPxJLR3ql0HH6mGatvaRBC+RP6QI+SRDb9WdoxYD+BBs6nAh2zHN7PZ7vUNYAYJvSrsImhTgXvHOE1OwPLFQGAPlTtAoVJLDwOqOBCiZFSeN1XcCg/rQKgCqxAr+rW/Ukg1Bc9LGnjZEwXR4qWWY7u0YMbRbVuRksC3XHVlyEm86IF+qTMH87jjg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR12MB5091.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(2906002)(66946007)(4326008)(86362001)(83380400001)(38100700002)(54906003)(55016002)(7696005)(9686003)(38070700005)(316002)(122000001)(52536014)(66556008)(508600001)(8936002)(64756008)(33656002)(110136005)(6506007)(71200400001)(53546011)(8676002)(66476007)(76116006)(66446008)(107886003)(186003)(26005)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?koi8-r?Q?tPNLiIkxmcYLEkVsJj/dDxZua7e6sftSbOgd+eVVHOFwZKCZgRV9VnR2YZPHJQ?= =?koi8-r?Q?+ES3FCYb/SUy9h0dFdWYemUzxFVFJxTCT3nuFB4+PuqRoYawUXyOEMGo+Gcl+6?= =?koi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qszmY3ptSwJvAviAG7dEHTQZItj+8Oh9HN0d1kU+MW7uqU6L13m?= =?koi8-r?Q?CEyAtFRsNX1K84Th/RBgr19qCSoNdjWCRmsOzD9+1qrEU145Ab/RiwWG3GQABV?= =?koi8-r?Q?J2bOHqN0sU2eekeukN60LSpjfUE/JI08/3gK7eV2a/8dYcQtMG4XFBmwT42ugb?= =?koi8-r?Q?28yQJIfQRpr2mgfynB+eZU0yZFm9fSrs7XYytCWdzIuG/1UnQ31HpdjDGL63CP?= =?koi8-r?Q?ydqbjEWg5vTDKeczZFYwBgf6fM1YMsPcq1+DFsepdhCRW4gLp3NFLEBVOM9X3Q?= =?koi8-r?Q?IiM43xt34EMW4IJA+IKE4=3D?= Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR12MB5091.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ef06630-7bb5-49f7-70f8-08d98fc262d6 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2021 09:58:49.3168 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nnVyGTV2US4DqhChT2Zyyu9bYkCBF/6gAxd2ceLjEWEMxYR21yDtkOozzQejCB25nKGY2jhy0QKqWcWuiQ1F1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5316 Subject: Re: [dpdk-dev] [PATCH v4 2/4] mempool: add non-IO flag X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Olivier Matz > Sent: 15 =CF=CB=D4=D1=C2=D2=D1 2021 =C7. 12:43 > To: Andrew Rybchenko > Cc: Dmitry Kozlyuk ; dev@dpdk.org; Matan Azrad > > Subject: Re: [PATCH v4 2/4] mempool: add non-IO flag >=20 > External email: Use caution opening links or attachments >=20 >=20 > On Fri, Oct 15, 2021 at 12:33:31PM +0300, Andrew Rybchenko wrote: > > On 10/15/21 12:18 PM, Dmitry Kozlyuk wrote: > > >> -----Original Message----- > > >> From: Andrew Rybchenko [...] > > >>> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c > > >>> index 51c0ba2931..2204f140b3 100644 > > >>> --- a/lib/mempool/rte_mempool.c > > >>> +++ b/lib/mempool/rte_mempool.c > > >>> @@ -371,6 +371,8 @@ rte_mempool_populate_iova(struct rte_mempool > > >>> *mp, char *vaddr, > > >>> > > >>> STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next); > > >>> mp->nb_mem_chunks++; > > >>> + if (iova =3D=3D RTE_BAD_IOVA) > > >>> + mp->flags |=3D MEMPOOL_F_NON_IO; > > >> > > >> As I understand rte_mempool_populate_iova() may be called few times > > >> for one mempool. The flag must be set if all invocations are done > > >> with RTE_BAD_IOVA. So, it should be set by default and just removed > > >> when iova !=3D RTE_BAD_IOVA happens. > > > > > > I don't agree at all. If any object of the pool is unsuitable for > > > IO, the pool cannot be considered suitable for IO. So if there's a > > > single invocation with RTE_BAD_IOVA, the flag must be set forever. > > > > If so, some objects may be used for IO, some cannot be used. > > What should happen if an application allocates an object which is > > suitable for IO and try to use it this way? >=20 > If the application can predict if the allocated object is usable for IO > before allocating it, I would be surprised to have it used for IO. I agre= e > with Dmitry here. The flag hints to components, PMDs before all, that objects from this mempool will never be used for IO, so that the component can save some memory mapping or DMA configuration. If the flag is set when even a single object may be used for IO, the consumer of the flag will not be ready for that. Whatever a corner case it is, Andrew is correct. There is a subtle difference between "pool is not usable" (as described now) and "objects from this mempool will never be used" (as stated above), I'll highlight it in the flag description.