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 AF8CFA055F; Thu, 20 Oct 2022 13:51:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6910242D67; Thu, 20 Oct 2022 13:51:55 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2079.outbound.protection.outlook.com [40.107.102.79]) by mails.dpdk.org (Postfix) with ESMTP id C937942D62; Thu, 20 Oct 2022 13:51:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QSE3AmPNXI0CZFmU4UpCD7ZsI1hflqxqdPkeRlRVZUOGZRWKFNM4tMoM3C/TDBVp2p3deV2Mubln9nDwOM2dDPXG+kP4t1zVAgKOK3NZ/UoFuzlT571n950FBcC4fuge4v1SI6UYax4M4yGlzx5WTdmEdwwgEWvjrovUqNY7XgzNsVhejgRQL5iO8LHFvzdktv+TOa0BpkSP6MPO7bZDWvKtlG7OJWdBOtrr5/5kt/dYbBh+XTZAecH14nC3SZiHf6MrPWw/iw9ri2j2gcUP4LawuwiJOkSS621Osv8xkVDvCIRGk2m2M1lNIqEqLcLarZYiwLHGyVqsBCABhSWOhQ== 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=pDPvmxlZQK5iqncpkGaX7ya8a6km1+RpQ3vqPHNx51M=; b=iBfcqEQYsdp3B78vw+MN50uoObyPHaIaQVTb6x4fXXJxjfMVLxvHA9TmQ5ZjKXGXdyPz2mtPYgDtXNU0rhiPlKn2/cGwv1C4RNtNc8pLbOL/7AQBeZleO7kPrEr4TKz245fZkKtmxBdek+T2f1pLEmxuX5hBZjED2Gr4wni+6Pvryg2I3fUYQWBfMepqPyOYBu8IfSWnRgoWHQEWh7Zf11iiTvVxNG+k9QTlfjt+vf8tdWAEyY4Eg3ZuHg4oI8umeZHzVGZaUJJJHBhFc1vRuOjJHOLac9FY0BaPblS8bWMacZXuad92adxWEfoppLHsWu2EHHwOiF0NDpOJJP36+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pDPvmxlZQK5iqncpkGaX7ya8a6km1+RpQ3vqPHNx51M=; b=alG055sJvC+XmK2/UByUsUOaSvNHJwfMWrqt23qyUKcDmKeNyPpOtYg7XKkzaa/P/EXuAfnbrDXZ85E9IqV2zTOA73BrsSSUoMP4q1yZgWPdM5Z0az7nCeZ1gELLZ5im7lYMrzvkYMXiepE5i4ZvOdmF9NW3zwqsAp3EThiCEdE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) by BN9PR12MB5353.namprd12.prod.outlook.com (2603:10b6:408:102::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Thu, 20 Oct 2022 11:51:51 +0000 Received: from DM6PR12MB4297.namprd12.prod.outlook.com ([fe80::b9fd:e732:4585:6b25]) by DM6PR12MB4297.namprd12.prod.outlook.com ([fe80::b9fd:e732:4585:6b25%7]) with mapi id 15.20.5723.033; Thu, 20 Oct 2022 11:51:51 +0000 Message-ID: Date: Thu, 20 Oct 2022 12:51:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH] bus/vdev: automatically add eth alias for net drivers Content-Language: en-US To: Bruce Richardson , Thomas Monjalon Cc: dev@dpdk.org, techboard@dpdk.org References: <20220921133451.4164506-1-ferruh.yigit@amd.com> <20221019131118.32394-1-bruce.richardson@intel.com> <5565666.Sgy9Pd6rRy@thomas> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0110.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::26) To DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4297:EE_|BN9PR12MB5353:EE_ X-MS-Office365-Filtering-Correlation-Id: fc8070d3-9d38-4f98-95c4-08dab2917a2c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s4/eyaDGI+cKkc8u2odgOzSeG6rk1n5N4cL+h+VypodJvneW8LrFrGx5Igol99kc8VlI+p5MkmOA0Sy6rNQNBfy2xpisP49Ys31hwJim/rxFTOQKl0ry7Q0Oo02tQ8y51b6vlU7R1k0sM3h05fvIzf2eXIdHgHx5fGUCTazlgVwKoQhGA6odoO8e8D2idjJAVTP/0FD9/8W1wukgBMdxnc/aygRsGMbZjpTLDz/VIi+0uz/NawMWYnBITNfrCbGElqy7MAF5LYlD21c+45CBOHuZfKE53qx8UL0pzne7XqF6eYhFZU81sGH/0YEqNgM7wtNj0usI/CgMqfqwatyvvbLDLQscPgh8zuz2mA+nystVTO27ndTk3VtKbtU1v8jdQ/kfmNNcGxNxCZnkffIGAYsZK0GiKMa19lpKIQXpI7ur6RlWhCpI50/ZqM7YZ206bZajlzDr87o92pSnZmXZucOsZipgOGSdp5TZl4fxHF7Dnm1gMEcM6stMMRlYWgslcY13xxsotRLbeR2K5A/WSH0xjiZoDFNgt0FA78Q+oPctUJ22bJ4uJyPicn9d4cLF9jfNjVc+fiZNkrTcYE7dm849ASH1xCRGx9SoTSIux7VZk55wevoO0kVlRoK7EqPSI0QS1IctX8anTOat3iWlpMlhOMVNAYLOTEeoZA9bCfpnLFWoZc8IlEuEgXFpQVLo+e8rqdJ//eAkBqDn7YIUFyBFaptlSWEZbtbeOPYbMPuCxA5E/9SZIH712iC/81XRLW7ieOyctILEuTHp1cZKDfKis+DS+kyRyPQ+urzHhqw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4297.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(39860400002)(376002)(366004)(396003)(451199015)(2616005)(110136005)(26005)(44832011)(8676002)(66946007)(4326008)(66556008)(66476007)(6506007)(83380400001)(41300700001)(6512007)(86362001)(36756003)(31696002)(5660300002)(53546011)(316002)(8936002)(38100700002)(6666004)(31686004)(6486002)(186003)(2906002)(478600001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T09RMlVUWXZQNmZKQ0R0NHJIK3RvajI5RW56N1RKVXh5UThXYW1HR0RXeE44?= =?utf-8?B?OEZMUTRsanpNb1VqYkpSbnhJMDF1Wk9aY1V3bHhTT0I0OUFtUER5S2dVckFR?= =?utf-8?B?bmczZVZ5SFQ0YVdHYzkvNnB3SlBrVENtVlVLM0pIbTkxQkY2cUh2Ynh4Nkdi?= =?utf-8?B?bHRENXJzQVdHdzRvWWpmM0Q5U0hVdENVeU82NngxdXZFWlJkc2JNdXlqUm9B?= =?utf-8?B?SC9MMUNqdXpIbWM5b0lQMjgxQkV2SHZUY0x2ZnJHWXo0SFVyQmhWcG02aUZ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jZkZXE5OTh3ZUVYNXdxa0F1VVdiY2pwaUR2eUVY?= =?utf-8?Q?/CMOSwfCLR5cD8SPdzfmsBAw7?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc8070d3-9d38-4f98-95c4-08dab2917a2c X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 11:51:51.7965 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lMfAmuAImcRrYSg0BU6bjRpVyYqFwAtECI3QKjUIO5WiBxedgcb8+G6NEichWmTx X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5353 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 10/20/2022 9:48 AM, Bruce Richardson wrote: > 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. In my perspective this is for cleanup, and new PMDs keep adding alias because they are copying from existing drivers. Except from above there is no harm to have alias.