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 13875A0C4E; Fri, 15 Oct 2021 15:28:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95C3C411CB; Fri, 15 Oct 2021 15:28:03 +0200 (CEST) Received: from AZHDRRW-EX01.nvidia.com (azhdrrw-ex01.nvidia.com [20.51.104.162]) by mails.dpdk.org (Postfix) with ESMTP id BCAB6410F1 for ; Fri, 15 Oct 2021 15:28:01 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) by mxs.oss.nvidia.com (10.13.234.36) 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 06:28:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qisisoqg200y+5uW3uHSkP5THaIDPpNGzKQzHdYRKAtvlJUmHQ3M21ccnNrGwiHFUT8DWD+IDVLcNv9ZDA8z8B0T0TMkMjTUnfiRSiS8i9BO0AcWoid6A1M+v6LklikjuemAuXuj6VBvb+CcwV8HUtGThsqAcd30PI1Mzw/Za87HzokeG7SrgZMxzBFQ3ayPDjAX3p4P1x30mRN6lYcTf8V1PPS6TOqwdRLRkW6Q3WuRpUD3jTbluQ4IKh5lggjxrSJZ5KbcFoXXvMoTi1kxOc9YoQV85yexh36YjN1goixEU9ZZDe5kACZszCLeUeAt1bc01q1DBJdIaLdmt7ZKpw== 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=3Vbkr/xJJMXM4Ee5Adgnlb/1AYuVKTB1zQcgZtONbOI=; b=D6LNvG/3+bVBdM9Waenrv1KVMfrvktELxESADYZCgeM7JxdiQXiF6rYmJubPNdxQcUxEjY7Lr8XMNSUH1BHDjocNq0OpwJPsr+bUSXirmuggOPZTabGV9mD46A+IlgBsB7vV03GHse8XX5z+yvWvSBfWFEfuG9+BkhCuhxZRs8gUdLp8PfCauB/0MgpaO5h29DmP0pQCbZ0p/eMjt+pLNGjVHEbWcI5eQnQe+LKtyzGFEqxaWWTP90KQYxbsyIEv8F4xgtrPgmxPDE+viZcSBZaqdApWqtUffbO2giDQhv1dNA32IJNWUqjep0uhlfIPImxaMVvPrPcxPPK5i+7ruA== 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=3Vbkr/xJJMXM4Ee5Adgnlb/1AYuVKTB1zQcgZtONbOI=; b=K6s1m17epAahAgoy7XSe3ySXV9R2r8gB3Q4jlX/NXQloFI5CNxQCv+fERQfLE1CPIVMEGPRaVcbzFnTU00p6srrLsTz+766Rjqd3PcgjAT7cx3drCg9Ipe+qM8eMQc5+o/9ltRaqdqE7NKr3dbysCHgrJUPgyxxmmShyT5XD2NTm4i/zs4ZqeXxX4TjLIDMgh/JluxDbJ7s7G8Q+fEZIcxv5gJzRqrXzHg9kypp5i2cuiwuM+zzCGZgg00haSbgP0DMV2iEmzHrMbLqzIZTVqsDSJP0C/kFQs5MOytkp8y7NWDI4bjhtNrAkbvGAVJXocRuzW2Z1wC3grBKcOrqVbA== Received: from CH0PR12MB5091.namprd12.prod.outlook.com (2603:10b6:610:be::10) by CH0PR12MB5121.namprd12.prod.outlook.com (2603:10b6:610:bc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Fri, 15 Oct 2021 13:27:59 +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.017; Fri, 15 Oct 2021 13:27:59 +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: AQHXwcdLPZEGUUkTr0660MPAApPKfavUC6rg Date: Fri, 15 Oct 2021 13:27:59 +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: 339f97f1-7c48-488c-c269-08d98fdf9b04 x-ms-traffictypediagnostic: CH0PR12MB5121: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2fs/PKu80PzWVJ0crga2HcXMTVHlmxaTOEEAs/dK2n3aKurrCw5hEAuvjHubuLTfuc8AAP0tv3V1JmkvvoErF+Jubwp1qkZ2pvS4s/mm7Cw42G5tqbkzr2kRnKXPtzle4pHJRSlM/bhu3Oar4oO0FV31EFD9Y1ef5gnuNKcIRUi1Qjl8tunpTLscgXAbqsU9lVRZh5i+IXYDAxa6qoOpYHs69hCjYuAL0UNW/vq0H4CgsVVVid4q36Q2iDgyb0xU3LbVqKnEO5W/qkeR486SmE6SHuf6ZjbnDPRUR0e+TT6s/xcXh9H1wjD1MgDEZwWMTnjEz5BlTulmc5gas/uygvokLIu1X+ul/GLX8Yyge5cyIrzmdzbM/6emfxMkvcbSdUSeS6YLrnq+oiAztpIDAgS+wUnHwbSUo+yK5a4SdbSznApUZUGRMhEBCFETPzQOMMUXaWL1xxxurJDx55sttLnPXN5n1dTs/D9MHgAilEuGmmJ4Gzj0s7fWF/HV8xC+pik9STYd6ZosjHLiyPgN7Ghso9GNbSE5eF52N3RBe+/dC9oDwd35QC+NfFDSQ6+rOV6e6ifyp0i0S9yMDDPmc3w5FjGBAh8cZZRsftiRmn/yicYxVYM1ARfCeN6+Z7zrpgEu2kTN+TbddXHwLdv7BYtVqfoeOWv+brJCvmeeT9uP8MQ6CpvCcePOk9AdHTJLxSGCYhr/Ef4UHhWEzqsJ5Q== 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)(71200400001)(9686003)(66476007)(66946007)(64756008)(66446008)(186003)(66556008)(52536014)(8936002)(508600001)(8676002)(38070700005)(76116006)(107886003)(2906002)(5660300002)(7696005)(122000001)(83380400001)(6506007)(4326008)(38100700002)(33656002)(6862004)(316002)(54906003)(26005)(86362001)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FthcufCVa2/biQ9Ex8ugI5B049GfbLP3Jin5/nUCcwtt3mGN9TBth+g3V9ef?= =?us-ascii?Q?0e/AdjWKKs7IGLpInHGf7kbs9ezBs63tobXN/dZyBKxPGo9fRSMT+qSC5sZL?= =?us-ascii?Q?N2OJIV+m94/PHv1s/gTUqSSXjBJPL+t5izc8iSyYAzNO93Jux6aLPsjeBK6Z?= =?us-ascii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rEzpDwS4HK9lgFwQMuIBQ?= =?us-ascii?Q?aQ3sautQwxKF/JG5JZr0oaRGyKH2OiEQe1EAUY5qEesO++1RsQvgtm/bF+QL?= =?us-ascii?Q?KuTF2TAL2+gORE+VXJpSiYKGqwR1oZOwLAfYC5AXQ9RyHlMr2ZGb3eyjCzv/?= =?us-ascii?Q?giHQyx19OnBxFYCRlt2sL08vQmk1TFuJal7qlRWFXYVGfIYQ9nZZ9CXGeBku?= =?us-ascii?Q?82fQEZrKcm/PWZx0dwU5DKagpaUEN4F1GWemkaQXdCmOf4uCEgZnzLAv6EW+?= =?us-ascii?Q?hkLwuZVP9fnGrcDvzV5ppo4c?= Content-Type: text/plain; charset="us-ascii" 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: 339f97f1-7c48-488c-c269-08d98fdf9b04 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2021 13:27:59.0616 (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: /B3COrj8JortcezIxdJ+yBmCejt7bQqWGGI9s2rJ709OeY+T5VRXDxEPqXfAyu5ikWC7B85cPZt8i2E5eDN3wQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5121 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" > [...] > > +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 is > set"); > > + rte_mempool_free(mp); > > + return 0; > > +} >=20 > 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. >=20 > 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, ...) >=20 > 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.