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 89D13A0551; Thu, 20 Oct 2022 10:48:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 308CC42C7C; Thu, 20 Oct 2022 10:48:20 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 54094427F5; Thu, 20 Oct 2022 10:48:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666255698; x=1697791698; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=M0m63eIKEgfM+H3XFiB/19IY2B1wshw7NnXBvMgV1fo=; b=mJS9+XGyk7wOVQIXQy5Pa77m2pJhQxz9ATzobwjQjBgDGwWxDvV1z0XX lLnLRf5YJuFp+CVLmp2Ev/QZCRxlhy9v/KMblE828zze8EBoFdYL1yndX SeFhyjwxjJMM+ws+16X1UswSNHIbJskruJaD/4Clf5C/NDu0I8ryhdcv6 c9n5spaUlbF1DnjdenF1qzi06qgf1ncT93nuug0mZ9K0PQP/sFdo3h7Oj dU9zv9lI2mUFCHcOmcKJUzvYGMg9N74jxC5S5B23QBVsIf8vWapKe+ll6 ANOjMS1wpSQ+XovOU8tuQtBPC6OCZnB8xFYxESyl96JEh5w7047mzdU0o g==; X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="304265988" X-IronPort-AV: E=Sophos;i="5.95,198,1661842800"; d="scan'208";a="304265988" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 01:48:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="660794835" X-IronPort-AV: E=Sophos;i="5.95,198,1661842800"; d="scan'208";a="660794835" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga008.jf.intel.com with ESMTP; 20 Oct 2022 01:48:17 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 20 Oct 2022 01:48:16 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 20 Oct 2022 01:48:16 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 20 Oct 2022 01:48:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F4YSNampGzFrDUW1l5Ymqzhr5O69bTN9E1z/gpxuZ5yePLgoXOm08i8l5eMR1FjyLckTAw1+5Jc+TeCVAVuYKVaoTHQNBL1LX4/Kcv0gbP3zULtMIJ5Aa1DZQwZlIbIrPy+cVhhg8ZhR0Ezlhf4qaOrJTTLSdNDFzW3yB36IJQCgAvFbvjYffKVDmVmS6LeSCKF67quf7jvlwabwiMLEsNopvwdXhLm8+jYijAPYG8P8X1xz1XOXalSjtiWdX9lU4GpabxsjVvyVwMmiIV+twW0XCpcRRIke7NZORT73AOh37jpL0Z7Eubluv4we9wO/+SIe//HCbLXL896XU+8sJw== 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=3TDrSc4nF3Vznum5G/DbUovt9yV8AR3eJoBG6Bc4oVM=; b=ddHy0F2XVjgK4Bj7Ah1ldoSJhmczQcS6jL7PNwCLaVFv1Rp//15fIxnLUE8hPSaWn5LuQAqTWN0DWK01oayPaS01P/B+mWzs6Th9g4xBu/e2dcAwAkxpCGYWfpDtze6jNc3odFSdvKqUAPITBQw1lP5pa/Ug1nJMLJRiDUSzjQx5W/IQK1eaVREEEoRMD4LoA2xY44Wx0HAmTfkPh91PxDwqKV/ZJdvi81+LsphCtjKakF2VrRB0krficUKs0yr2qieb6SJFgK5tEYpi3MiaL7tmGzT9cHqhzBYm9B9qOEF2bJ9/ExKoJ5zHL4dQ07a7WLl0eh6TVMH3HS1hk2wV3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BN6PR11MB1618.namprd11.prod.outlook.com (2603:10b6:405:d::13) by MW4PR11MB6861.namprd11.prod.outlook.com (2603:10b6:303:213::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Thu, 20 Oct 2022 08:48:10 +0000 Received: from BN6PR11MB1618.namprd11.prod.outlook.com ([fe80::91e5:73b1:1a4:739d]) by BN6PR11MB1618.namprd11.prod.outlook.com ([fe80::91e5:73b1:1a4:739d%10]) with mapi id 15.20.5723.034; Thu, 20 Oct 2022 08:48:09 +0000 Date: Thu, 20 Oct 2022 09:48:05 +0100 From: Bruce Richardson To: Thomas Monjalon CC: , , Subject: Re: [PATCH] bus/vdev: automatically add eth alias for net drivers Message-ID: References: <20220921133451.4164506-1-ferruh.yigit@amd.com> <20221019131118.32394-1-bruce.richardson@intel.com> <5565666.Sgy9Pd6rRy@thomas> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <5565666.Sgy9Pd6rRy@thomas> X-ClientProxiedBy: LO4P265CA0040.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::9) To BN6PR11MB1618.namprd11.prod.outlook.com (2603:10b6:405:d::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR11MB1618:EE_|MW4PR11MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: 85d9cf1e-0b70-4a1d-82ed-08dab277d068 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S2B6oRU6R74nx4mSz6h4AD9qBheWAY7UHQxW+2s4r0ooKWMuaZwD5KsWULmoH9S6ttjVEuULL25viXvyXsvNNZzSOo1f7/pS9a4pMOd2oiGjDzOe6+CoZNOQTN2GlED7LPX1hcvp35EWW+tAUS68XsrpeToKfZuQAZeH2Atai1zDw16/m3mKOwevqpOFUGxIwsmBNl/zEBnpkE19ttyydnFu9BPLFZbHesYvw2fTZl0VL+IsXqnELvLPtoME8rD9S5CsH+uZ0P48bvgsbaXGSul9DvYOde65msNzUt1L0Vz0JperU4uKlo6VtN/kCY4pjnKORLWsZZ+ERcRihO20cPbrr6o0QvaGjRWqFLtCZG50mF4tJJZcbgxW8azM4Rnm7xXDdEiu/TvOi0eHTqF+ptFxZmIRX3bPBjE2CsS7JOt/QQHf1jJaI9KCw+n6PzOSlf/OEUgnhByIJJwG8tZ9g6uhYXap4ps0pRLIV5lcpCutdmiZVDqRt/dpFCbPH5IjPdCs3xBWGZZHcAgwhpai2mQ7SFvMMAWhnKgOnpTeF607vf6Mml5IzA3uHtQZlrQQxTenub5dpRJ/xuUDwVV+J7IZtWh1YAd3240qM27mhbpL1dJ/UDTEmF6gua1qHk/qozy5SFpGP+0wwEe2l4QFEM0ErSuwEYkfg8y6gl+jsGVMEpAgwI1lXj1unwpl3Aif56KDG6UuNG4Zdmih1QmIHA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB1618.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(366004)(39860400002)(136003)(396003)(376002)(451199015)(83380400001)(6916009)(4326008)(38100700002)(41300700001)(6506007)(44832011)(8676002)(66476007)(66556008)(66946007)(6666004)(5660300002)(8936002)(316002)(6512007)(2906002)(186003)(82960400001)(26005)(478600001)(86362001)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cyMSNsRQV4a19M1Tpt0u/XhIFH2AwA7y5V1Dx7qxw4RaC2y6Aye3aVvjAxXL?= =?us-ascii?Q?gtzTiQ7ku83XlL84gMYXzk7FbhrIVLuP75t0PhhIEVlSPTEYtnySZAUoAOFQ?= =?us-ascii?Q?UuT3j2As2ZNdIqiM8Z5Wqcqhl5mBUlJqoifKJrREq8YNpkr/lYpIH9aUaM8w?= =?us-ascii?Q?99HjjwXH8LMxyy+0GUaV4WiMmvCoAuL0PmUOp5bJPMErIZKvRvT8apQnKmZ0?= =?us-ascii?Q?Qcy2hhONkjz4h8emE+PIk4PoYHTz5L8imINl8HgRCJNtDUfPRX1VD48ipg+G?= =?us-ascii?Q?JKT185Nlrdd+XO3rlTKrKLFKd1j9VtnSkD9VkzRsbULiWFyrAhlYby0BvuLm?= =?us-ascii?Q?Fzhtt/LwVIuZ/MNlXLmX23VKcpc3NBnISRlpgBXjHzMqWU7hI5J9Jxmon4hx?= =?us-ascii?Q?YRKPMiQ4kq8Igut+vJSggP5VcXfNTEW9xAq6KD38vIbdiOxHlGihWtygGiH5?= =?us-ascii?Q?6TVJZkaUDS5t5Qi0S/bHOMLQDvTQpr93Jv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MNKmk6PFvL0fZKE+GtjnTBOgvnKUFRMfqn8Ner84T8p2MX8uVcE/kYqaG8Ot?= =?us-ascii?Q?Jtrlk4Ub3vRzdprkQYMIy4PU/E/NUNFKK+s2UCg0saQU9BIKctJ3hrN6ykJ1?= =?us-ascii?Q?t5P0TpjviV3z0wY2qkw7vRfNb8tKU7kXj0I8/u2diw1hIRTeooRZXb2nWahk?= =?us-ascii?Q?UmOd5koQvkGGgtkcxVSl2RoLv4dadHR/r/+rX5LJjyEIjDNNiAB0r4ljIIsu?= =?us-ascii?Q?Rg=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 85d9cf1e-0b70-4a1d-82ed-08dab277d068 X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB1618.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 08:48:09.6208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TZJo59A5fYo1fb+ItXWm96x3jArKXKn7ATyU+8hTzlcSkbc/CPBK58MKjq7765FZ9OodhcQglvuFZ/F5bqQ821fsSmKWyVSmKNbV8Vn6QPc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB6861 X-OriginatorOrg: intel.com 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, Oct 20, 2022 at 10:23:27AM +0200, Thomas Monjalon wrote: > 19/10/2022 15:20, Bruce Richardson: > > On Wed, Oct 19, 2022 at 02:11:18PM +0100, Bruce Richardson wrote: > > > For historical reasons, a number of net vdev drivers also add a driver > > > alias using the "eth_" prefix. Since this is done on a per-driver basis, > > > the use of the alias in inconsistent and is spread across multiple > > > files. We can remove the per-driver aliases by just adding the alias > > > automatically at the vdev bus level. > > > > > > Signed-off-by: Bruce Richardson > > > --- > > > drivers/bus/vdev/vdev.c | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c > > > index f5b43f1930..bfd7ce60c1 100644 > > > --- a/drivers/bus/vdev/vdev.c > > > +++ b/drivers/bus/vdev/vdev.c > > > @@ -54,6 +54,12 @@ static rte_spinlock_t vdev_custom_scan_lock = RTE_SPINLOCK_INITIALIZER; > > > void > > > rte_vdev_register(struct rte_vdev_driver *driver) > > > { > > > + /* For net driver vdevs, add an automatic alias using "eth" prefix */ > > > + if (strncmp(driver->driver.name, "net_", 4) == 0 && driver->driver.alias == NULL) { > > > + char *alias = strdup(driver->driver.name); > > > + memcpy(alias, "eth_", 4); > > > + driver->driver.alias = alias; > > > + } > > > TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next); > > > } > > > > > > > As a self-review comment, I realise this solution has got an issue that it > > leaks memory if drivers are constantly being registered or unregistered. I > > find it hard to see situations where this can occur, but it is a potential > > issue. > > > > A second solution that does not have this problem is to move the aliasing > > to EAL, as below: > > Honestly I think the status quo is OK: > We have some aliases in some PMD for some historical reason > and everybody looks OK with that. Isn't it? > Well, the inconsistency bugs me a little, but if others feel the status quo is ok, I'm ok with that.