From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03AD4C4332F for ; Thu, 10 Nov 2022 16:59:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232800AbiKJQ7V (ORCPT ); Thu, 10 Nov 2022 11:59:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232764AbiKJQ7N (ORCPT ); Thu, 10 Nov 2022 11:59:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF2D121811 for ; Thu, 10 Nov 2022 08:59:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6FECCB82259 for ; Thu, 10 Nov 2022 16:59:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A526C433C1; Thu, 10 Nov 2022 16:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668099549; bh=hmxY1dF8hIO1nlDn+CtHi3Lp4HcLd6ksoBSOWMnmfeQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eBpRQG4/ZR5jZReLAZQIF3Y1xPswWeNztaHjDSPP/weggCEkwDo/RnFi/bCy127cl h+O2Tp4ZhYa7tE8mganwncZkftzGCcK4miiDUOlq9KOKyOHstZoPF5VgO3fE9zsN0G MVv9o5BWCKgn2OU94hoox7V9PQhUZPThZH6rFeSUog8TdgxjRpoMlInrbQpjB8zj6k lwO2oEtDdRm/noB3zo9daYi+lAhb/OWXK9i+8zNSCFKRDJb9J3Xvc+Qfw38PCvIDRI kqVpl5yM9E25+mvMjoFUSBAja3HEeV73nozqyYUDGWQVTSGZqg+ea1Soc1DKJsSjCQ gnh136MxGKxXw== Date: Thu, 10 Nov 2022 08:59:07 -0800 From: Jakub Kicinski To: Vincent MAILHOL Cc: Leon Romanovsky , netdev@vger.kernel.org, "David S . Miller" , Eric Dumazet , Paolo Abeni , Guangbin Huang , Sean Anderson , Tom Rix , Tonghao Zhang , Wolfram Sang , Marco Bonelli Subject: Re: [PATCH net-next v1] ethtool: ethtool_get_drvinfo: populate drvinfo fields even if callback exits Message-ID: <20221110085907.764e18cd@kernel.org> In-Reply-To: References: <20221108035754.2143-1-mailhol.vincent@wanadoo.fr> <20221109122641.781b30d9@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 10 Nov 2022 17:34:55 +0900 Vincent MAILHOL wrote: > > While I'm typing - I've used dev_driver_string() to get the driver > > name in the past. Perhaps something to consider? > > I am not sure of that one. If dev->dev.parent->driver is not set, it > defaults to dev_bus_name() which is .bus_info, isn't it? > https://elixir.bootlin.com/linux/latest/source/drivers/base/core.c#L2181 I don't think so? We put dev_name() into bus_info, which is usually the address of the device on the bus (e.g. (D)BDF for PCI, like 0000:00:14.3). The name of the bus is pci. dev_driver_string() will also fall back to printing class name. > For the end user, it might be better to display an empty driver name > in 'ethtool -i' rather than reporting the bus_info twice? > > I mean, if you ask me for my opinion, then my answer is "I am not > sure". If you have confidence that dev_driver_string() is better, then > I will send a v2 right away. Well, it doesn't matter. I asked because handful of popular drivers use dev_driver_string(). But.. these are drivers so parent->driver will be set and it ends up not making any difference.