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 B8C1F45B0C; Fri, 11 Oct 2024 04:36:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 800CC402E1; Fri, 11 Oct 2024 04:36:47 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2100.outbound.protection.outlook.com [40.107.244.100]) by mails.dpdk.org (Postfix) with ESMTP id 8C12B402E0 for ; Fri, 11 Oct 2024 04:36:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pSqqEGP859TAejti2tfQha6t8+MQ9y04VKf+etDBGw0opIwCMCWCW4r+uNkr0POnEbGt9sCECruC2zTwUhUlvi2flFEXteS2t143zZTbjfmgnadVO8zRFoTNUD3d8xEJzwpUOcK/EoqsbD7W5sTO3rbLAM4jMtkDFrVrYQclOC95DyU2SeCO7EltzdhBa33w72/qheub793Lnb7e+XTbKUT8Z19tVubjFia+5ADG58tR4CmuH46QGdh49sTWejgXHbdXryNV7DzTRIr/SKiL2LQDdcWe/NYTh+41yIuhta060SJ++WkoVdawznQmolmaaxz2yiWZQbkBQ93Ru1hzMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ga9IjwgIoQm1uHPSz2pifISaR9vucROGgkmtfYKJWPc=; b=w2E5a1fxnHtHYZU629tNzKRli+Rvtt2z858WAw9ZCjkBh8lhHkeYa9bVjKUDz8U18VUNKa+bfXZhfFiIUl8PMKbmNarIBYEo/S2dC2xUd2sRTJV6SZfrauQge1arp3uBLbWYXBeRywDcb9lR3aRByibUXqlpIbEjhPe5ifWZTBkO37qbZBhELh20JdeP1MxCoBbSDuUgEae7Tv9v8Ca1NMBKIcdCwRXlQBDKNQGVITnzf2fKe0A2X2jQJ9DdSIyNchzcivODw62ImeePE0+GNydeU4kGxehM6kHsTI54T/PtuWTg8QnqcLl/isxjzffV9gJFQAj1/tQxzRsjN6fxIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ga9IjwgIoQm1uHPSz2pifISaR9vucROGgkmtfYKJWPc=; b=hfmLKt5OqQB5o/KswhTlqtydEMndcv4FYCt1l83j8EM63UatEuC3OqFjESbUXc/nhVGT9eTGuuRvd57KAGN+BFcj35PjX9Tsky8CvLSfgdzYBX2scwH7u0apjw2j1/XYT02eDea3NyR7HKKfuhicZlA/Hm0ML9zZSPEfiGcVkFc= Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by BY5PR13MB3731.namprd13.prod.outlook.com (2603:10b6:a03:219::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Fri, 11 Oct 2024 02:36:44 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Fri, 11 Oct 2024 02:36:44 +0000 From: Chaoyong He To: Stephen Hemminger CC: "dev@dpdk.org" , oss-drivers , Long Wu , Nole Zhang Subject: RE: [PATCH 04/10] net/nfp: improve the logic readability Thread-Topic: [PATCH 04/10] net/nfp: improve the logic readability Thread-Index: AQHbGvVE6+T1xtJqe0OgHHVG8V0VKbKAFz0AgAC+hrA= Date: Fri, 11 Oct 2024 02:36:44 +0000 Message-ID: References: <20241010091716.3631747-1-chaoyong.he@corigine.com> <20241010091716.3631747-5-chaoyong.he@corigine.com> <20241010081044.2acd3bd9@hermes.local> In-Reply-To: <20241010081044.2acd3bd9@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR13MB5545:EE_|BY5PR13MB3731:EE_ x-ms-office365-filtering-correlation-id: a01d7c61-f2f5-45d3-7e93-08dce99d8bb7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?/Ti0COHr8Qh2kIozPedzebbqvYnPJQsf5x4z+ZnBrEpQhfhGpUlqWA+iq5qx?= =?us-ascii?Q?bsTwIXwbo1QA7eYcuXD7DrErSD6pI/KJAW/xzPGD8m39GIPabk31/Fb8MXwa?= =?us-ascii?Q?xRl3aBo4fcmJVrWCeRvuIiD+XocI+FSYBQV8Nfhc19gUxKq/pthO1z9wDf3j?= =?us-ascii?Q?mMQ3j9cssUkpddjYd+PGTIgyC0efT9EQu9YIMjAr7w0YTXDSA0zz9BMD717O?= =?us-ascii?Q?cJIsPFsxDC13MSQIiC6XB6JvFdgoYaklZcjHedsADHL4kyHMsiH45igodQBJ?= =?us-ascii?Q?pyAMrDEhxpSPH53XZ6LgXSU9Zwng8L/b8RY3rUrYBORFpffEs5332VtJo+An?= =?us-ascii?Q?Rj+Qr9IB+x4aBoXppFEMbw5azDMh+LINsZdHL6UJi56WVD9E0wMzFQMuaTrz?= =?us-ascii?Q?Hdip+Au8zORB1t20IbzBvFq28YmbbIel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ecjegY6F792I1sSshiqp7dzqhFSSbdhg4/4o6OQgco+dbQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LsDkqd1+tW/KD7+BobkxzR4Ygg29CluoOghfeN4BNjC6GOfuxywx6P0mpJKn?= =?us-ascii?Q?fViLgnc7Ff25nL5qFek0tZ0uWnfv4pN1LS8iiAY7GOwF3OWuETZiH5DNPlek?= =?us-ascii?Q?xy3KXQbY6j8oBZSByAovOvEzQj3i4yBuOhJ3HvI3p3lOXvbJYIvQAPSgJ4/M?= =?us-ascii?Q?Eq37dV6eUS/wZgQieHA6v3XyP3SkhcI+684Tt1OP109YOGeoPYrBXfJx7ZVV?= =?us-ascii?Q?9E9hbUQqOt1QgyIS9KO5QJuNDtjyvYJtN8EmcEkXCArmjBJecKAEytzU3nNB?= =?us-ascii?Q?bdYN8tHtUtz5jyBCz4qKaEWwn4YknYYEPjgWnhNbRPJVxxDjLTusV6GKeYm4?= =?us-ascii?Q?0bWs/PnfUSVin3LgptC4KssGcwOKfDW6Bf3y/dOzDuzkaVg8qUQS8d9MxSlN?= =?us-ascii?Q?uqaPelwgO6MjtYtd91RUm66d7vtzc8SFAP2aNE/f5dXd58rZA+ZDeP0xrt/d?= =?us-ascii?Q?qRFleukw3u8y3KVxq6xGApiG4rn0ZWZVVGNGYxn4dncpjK39F1BHNVwgif+L?= =?us-ascii?Q?gyOjIXPkCYNGO/SSODUiwQU9xbxmCL2r7Vu2rOJKbvnOw6YwSAYZQ0MOX4vC?= =?us-ascii?Q?t66bLFtg+WIlR0EgzRT0HPSloWfe/zDSTEU9dPZFxCBdK0VZZi8m9zZtrTpD?= =?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DvUWlDlvOqdZU1BEc86F6W0+mWfRP2Q+6?= =?us-ascii?Q?o5T51veGP167o1QaMh2o8yC3uQOk7cOAOnPVLGUK?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a01d7c61-f2f5-45d3-7e93-08dce99d8bb7 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2024 02:36:44.2869 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +8BzhpMozwIleZtmi0X8x1OWITB1lFXRbqKEjVJ/LTCtqBCTOCIYfdxe6TG7Viz0lBmDm4UQZjgH7P3pVYJTt1w0OMVIydbBIIbILnWc5nI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR13MB3731 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 > On Thu, 10 Oct 2024 17:17:10 +0800 > Chaoyong He wrote: >=20 > > + > > +port_cleanup: > > + for (uint32_t j =3D 0; j < i; j++) { > > + struct rte_eth_dev *eth_dev; > > + > > + nfp_port_name_generate(port_name, sizeof(port_name), j, > pf_dev); > > + eth_dev =3D rte_eth_dev_get_by_name(port_name); > > + if (eth_dev !=3D NULL) > > + rte_eth_dev_destroy(eth_dev, NULL); > > + } > > + >=20 > You could skip the lookup if you kept an array of eth_dev's that were cre= ated? Yes, it does make sense and sounds a good idea. Maybe we can do it in a future patch rather than in this one? Anyway, thanks for your review.