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 6F6B8A00C2; Thu, 20 Oct 2022 10:23:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17E6F42C7C; Thu, 20 Oct 2022 10:23:34 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id D6B17427F5; Thu, 20 Oct 2022 10:23:32 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7D6605C01ED; Thu, 20 Oct 2022 04:23:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 20 Oct 2022 04:23:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1666254210; x= 1666340610; bh=pddpnnDBWDebuaNHkVNa2mmC1QAQUqDnd++9re2xWGU=; b=v EIA/PEj1U80FTzSFuHYlT4ODXRnK8iRyskpm5SB7QQDJ4ONNyED5vF6ylPiCIEGY ZA+IcPNHuMbfAh2y1lxOJU+u3Hdh9xbTHelo+gMP7g0SggbC9LfMZ/Y3p/iF691x d3uiIY1QAM3DU80th5twG8k+/VjJBs9Rgff6vv6ng2hsdykKbMk8lbOsf15lvyzS L3Ag/Le2bc/1/VFJj0j8zhW/EwdZ034zyvRICuGed//cnYXUQR2PnlVDApZcZYZo +zPzS6xtm7vAhk/wm2dPvaMFUWULHFSjPt7PRbCeTT7lNFQJomqKvDdF3zSR/XTJ ZmwH4biPZjy5DyMPQ2pVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1666254210; x= 1666340610; bh=pddpnnDBWDebuaNHkVNa2mmC1QAQUqDnd++9re2xWGU=; b=K vn/3aHY69nc0JAI2arf8iArj7H86JOKywwdVaD/OtY7Hz4KK1GiVCwE6bJ/3y38W j6QtLK+X7ZUYuDSRaewQ31gvYQ9M2Qw03ZiaxlRh5O3RaZK4vgqPx8pNjrjPkTas OHGJ8BITDB22VWiXBWOrT3q/wkWQZyD2Xd77StgC0AGUw394Fng3Z2yGOQiAkHJm g6rtsNtfxM+CR2LH9GbefDRJ2n6IFvONcVmfbk/SsSic4WYc1F0P8gqp7azhYzNi PAOju3smUnj6zYGu08e5nqbQPiwjg+UkAk7w90X2EEVKZc8FerxhmrgYIlgr4nVz YIyAkTalpVkeBCOl3BKfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeliedgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Oct 2022 04:23:29 -0400 (EDT) From: Thomas Monjalon To: Bruce Richardson Cc: dev@dpdk.org, ferruh.yigit@amd.com, techboard@dpdk.org Subject: Re: [PATCH] bus/vdev: automatically add eth alias for net drivers Date: Thu, 20 Oct 2022 10:23:27 +0200 Message-ID: <5565666.Sgy9Pd6rRy@thomas> In-Reply-To: References: <20220921133451.4164506-1-ferruh.yigit@amd.com> <20221019131118.32394-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 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?