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 6207DA0C41; Tue, 19 Oct 2021 15:08:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2F1E4119C; Tue, 19 Oct 2021 15:08:20 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id 6B08A4119B for ; Tue, 19 Oct 2021 15:08:19 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.43) 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; Tue, 19 Oct 2021 06:08:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DdmDbYLikkFsNsWml8pda9FdU0WcQiIosOjarQs2AmBc55iI3MKnp4Xh/Cn9U7MlK0W4y/X1DGtgMYCfFC08JkO4JcEs+9B529fEiEidhPbS63911vUfqgLehPEBMKgK+m9JvrZI3HUnHvlt9g7085Ohrr5qvl4OQ+x7Lukt7fKAQWQf9Uyud6xbLU7/EGJ+ZfC7pSpgYfrv8jS4dVDj0E2lY5xumNXiZmJIvVOE1hPLndG7Tl0hiA77T5h9e3QegOJPvWVDqNBFa5Ct3D6fPpFGBc61onJJsc2Mk4L62MhBb17nVIEVNK214bZROjZ6JKOUWBuqJiRMBnJjBEvc3A== 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=VFNkc1jwPFQzVDertOO35JNgpu2Z+diYmqh+NxPmAGY=; b=TpU1KgGUnu9nKNEFzEcGvr0LI256wbZRRe9iD89Ca9UlP40BficP6aWi/aV2bpUrrKn8OE63Wq++ce+fXdHlB68I7JanKAA0lUnfAIzsQ2W/9uDg4+Q7VyU8elvskTVasY3E+nnnRsNrMak4meYXBKsrA6CCdlpmTedhLL9htYmjWw8AvF+pQrfrVlVx4LoVp+46ANjoZQIpP93rlGrFI0Npt0yDZl5QbAkEowsZU6w6zMPi6UMRmr83glhbbaq4YCcOYRBrP7sWJj+ue0xM3qK2vS1Ix1woWkJxy4twncLttub5FGXW9Slvof4BbMYfjqtbMFq7xAV7zZe7OTInyA== 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=VFNkc1jwPFQzVDertOO35JNgpu2Z+diYmqh+NxPmAGY=; b=H0aTYshYmeKjD+N1aSFtShTL4vJBwug/3QcP2Dv7fCYzNqUeWNWfQ6zo6z8eX2jZuduDvwSw9hUHZ52Agx0RGkut5TtIYHx9cXJVViRIAVvBHfbd7JaJQ7GHdqik35NqQ6HIilTc0paM9vPQjzDLadCsMhsCQ6iliJ1u5HzT7dXI7+YJgopcjtRB+3+egQUFOFnHq6QjRA1E2KwdAZrn9kAb6OJLO/njfm//ei60WESYb2N4Yp2yuFGiafH0WQgk3UJRK+zzkemLGMuJI7Ricj3atb3/r3BJmtzDnJwbD/jqflTDR5h1DVbrSW0Rc1H6yKeO+PQWcurX9eHaLntEGw== Received: from CH0PR12MB5091.namprd12.prod.outlook.com (2603:10b6:610:be::10) by CH0PR12MB5297.namprd12.prod.outlook.com (2603:10b6:610:d4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Tue, 19 Oct 2021 13:08:17 +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.4608.018; Tue, 19 Oct 2021 13:08:17 +0000 From: Dmitry Kozlyuk To: Olivier Matz CC: "dev@dpdk.org" , Andrew Rybchenko , Matan Azrad Thread-Topic: [PATCH v4 2/4] mempool: add non-IO flag Thread-Index: AQHXwcdLPZEGUUkTr0660MPAApPKfavUC6rggAAF8QCABeUOEA== Date: Tue, 19 Oct 2021 13:08:17 +0000 Message-ID: References: <20211012000409.2751908-1-dkozlyuk@nvidia.com> <20211013110131.2909604-1-dkozlyuk@nvidia.com> <20211013110131.2909604-3-dkozlyuk@nvidia.com> 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: 24685623-5fbc-474b-90d8-08d993018436 x-ms-traffictypediagnostic: CH0PR12MB5297: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rRgcoJIchy5OuOH6faGhYpWT2/UW5SmjESvWbuALTEBkNHCy7jKYoOfFR23BV6HvZkDudxcCxSpDN+lJNBHyaw1D5o60mbtNkohYmNbGTQcLDNsyH/gw2hzMElkC1LWp3ZqNzuVIiAPBsht0qVEY6EWj4efjm7pDV6haL7jgxDX6Wmq2NqMOt4+r6hqxGkZmwTgsPhHINeKrbZp4NkoiZKwRNjRPKe4kjcZGN44gt6KYCL9+5WokdoGRvgRGb3HYyr3sJHtZ2uM7NCB2l+t3YJKruZ2aq7d1PiTz6MnwPfMOieJ+jdu32XJCnTPLG+95s7GsxXn9GhYbGn2N0I3m2mOUSWbfsNhxckUaZR0s1AwKNb6o48ZqgJh57BvqO2U9XQuvzNeh6RfXAx6Z1kABee/hGP7aG8CQAGxiK3ed7w92JqFdCnC50YrRd2iLVd3QW4EiPvp/O3uGq2EFAcbxBjuIG3wKkCUhR2jlO1Rrtnc+/R9vzxXM0QKy8wTt7hWQgetLfpfZMXB9gxtjorL6TD6BvoThp6ztzpKJsUFBaqRPyFdEZZSScNicwPMQTtLoU56D43C9ivbQJUT4ZIYFnV+zcRQ0fkBTM+BOt7lKd/jf6/JgbqRDL7x49n7cC7hvoZBAZbsV+cZ6BkjqKVtsWyvlktOnXpzJnM8JPn98nQoLqaSsWlqGtk0IaE7YA29P8TUiBORjdSIftDOHT1tSUQ== 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)(64756008)(66476007)(66556008)(54906003)(66446008)(66946007)(86362001)(76116006)(9686003)(6506007)(2906002)(508600001)(8676002)(33656002)(7696005)(71200400001)(52536014)(83380400001)(5660300002)(6862004)(122000001)(38100700002)(316002)(38070700005)(107886003)(26005)(8936002)(53546011)(4326008)(186003)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?koi8-r?Q?YCj0cf5Tf1ljzGmxQB2ICHfiM/ho2ZtFPC1bh4YnbHLjIsxWbP6J1jLUeYTh59?= =?koi8-r?Q?1PrH+lX5JgmIxGFM1SvWb9ldgTsrdldx6/CukFscD3PKRkCbWCIqy5tnibFjRr?= =?koi8-r?Q?/lqv6nc9X4/XxyozkREPMUO47EAzPMwfCx0r7Qik0SCbu6WU4QRD1WKnrGOEjB?= =?koi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q83Bob2uCTJeBlahh+gTVndpRBEZk8dxl+fOUSeZMANF4NrwT?= =?koi8-r?Q?megRaH5PZgQlgT6WHMraq0PON2lt3JSG8/ai3QMMdRLdusPteZ9hE3L3rPUVJk?= =?koi8-r?Q?KMGwYoy47hASM+uNK4AbE1+XsiKDFwQ8JSMSOXISMXi8UwKm+4YvwNiFNSTzID?= =?koi8-r?Q?mWhI1yZnbMo9V70cGM36DeyIgXfzMt6c6uU0Pc7KAuhHUG77wm4SZ4npgPGLfW?= =?koi8-r?Q?U3nQ4C6sRcFx2r3SM7B/Q=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: 24685623-5fbc-474b-90d8-08d993018436 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2021 13:08:17.1497 (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: dkozlyuk@nvidia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5297 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. 16:43 > To: Dmitry Kozlyuk > Cc: dev@dpdk.org; Andrew Rybchenko ; 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 01:27:59PM +0000, Dmitry Kozlyuk wrote: > > > [...] > > > > +static int > > > > +test_mempool_flag_non_io_set_when_no_iova_contig_set(void) > > > > +{ > > > > + struct rte_mempool *mp; > > > > + int ret; > > > > + > > > > + mp =3D rte_mempool_create_empty("empty", MEMPOOL_SIZE, > > > > + MEMPOOL_ELT_SIZE, 0, 0, > > > > + SOCKET_ID_ANY, > > > MEMPOOL_F_NO_IOVA_CONTIG); > > > > + RTE_TEST_ASSERT_NOT_NULL(mp, "Cannot create mempool: %s", > > > > + rte_strerror(rte_errno)); > > > > + rte_mempool_set_ops_byname(mp, rte_mbuf_best_mempool_ops(), > NULL); > > > > + ret =3D rte_mempool_populate_default(mp); > > > > + RTE_TEST_ASSERT(ret > 0, "Failed to populate mempool: %s", > > > > + rte_strerror(rte_errno)); > > > > + RTE_TEST_ASSERT(mp->flags & MEMPOOL_F_NON_IO, > > > > + "NON_IO flag is not set when NO_IOVA_CONTIG i= s > > > set"); > > > > + rte_mempool_free(mp); > > > > + return 0; > > > > +} > > > > > > One comment that also applies to the previous patch. Using > > > RTE_TEST_ASSERT_*() is convenient to test a condition, display an > error > > > message and return on error in one operation. But here it can cause a > > > leak on test failure. > > > > > > I don't know what is the best approach to solve the issue. Having > > > equivalent test macros that do "goto fail" instead of "return -1" > would > > > help here. I mean something like: > > > RTE_TEST_ASSERT_GOTO_*(cond, label, fmt, ...) > > > > > > What do you think? > > > > This can work with existing macros: > > > > #define TEST_TRACE_FAILURE(...) goto fail > > > > Because of "trace" in the name it looks a bit like a hijacking. > > Probably the macro should be named TEST_HANDLE_FAILURE > > to suggest broader usages than just tracing, > > but for now it looks the most neat way. >=20 > That would work for me. Did so in v9. > What about introducing another macro for this usage, that would > be "return -1" by default and that can be overridden? I like this suggestion by itself. While implementing the solution with RTE_TEST_TRACE_FAILURE() I didn't like the hustle with #ifdef/#pragma push/pop_macro. At least some of them could be hidden, need to play with macros before suggesting something clean.