๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27243

Re: [PATCH net-next v19 2/4] hinic3: Add ethtool statistic ops part(2/2)

#27243
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 04:17
99 lines
12222 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message does not mention a structural and behavioural
  change.

--

hinic3: Add ethtool statistic ops part(2/2)

This commit adds five standard ethtool statistics callbacks to hinic3
(eth-phy, eth-mac, eth-ctrl, rmon and pause). Each one reads the physical
port counters from firmware with hinic3_get_phy_port_stats(). The commit
also adds a separate VF ethtool_ops table and selects between the PF and
VF tables in hinic3_set_ethtool_ops().

> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_ethtool.c b/drivers/net/ethernet/huawei/hinic3/hinic3_ethtool.c
> index 0ec5d7f21e098..1a62668a65f77 100644
> --- a/drivers/net/ethernet/huawei/hinic3/hinic3_ethtool.c
> +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_ethtool.c

[ ... ]

> @@ -674,9 +867,32 @@ static const struct ethtool_ops hinic3_ethtool_ops = {
>  	.get_strings                    = hinic3_get_strings,
>  	.get_sset_count                 = hinic3_get_sset_count,
>  	.get_ethtool_stats              = hinic3_get_ethtool_stats,
> +	.get_eth_phy_stats              = hinic3_get_eth_phy_stats,
> +	.get_eth_mac_stats              = hinic3_get_eth_mac_stats,
> +	.get_eth_ctrl_stats             = hinic3_get_eth_ctrl_stats,
> +	.get_rmon_stats                 = hinic3_get_rmon_stats,
> +	.get_pause_stats                = hinic3_get_pause_stats,
> +};
> +
> +static const struct ethtool_ops hinic3vf_ethtool_ops = {
> +	.supported_coalesce_params      = ETHTOOL_COALESCE_USECS |
> +					  ETHTOOL_COALESCE_PKT_RATE_RX_USECS,
> +	.get_link_ksettings             = hinic3_get_link_ksettings,
> +	.get_drvinfo                    = hinic3_get_drvinfo,
> +	.get_msglevel                   = hinic3_get_msglevel,
> +	.set_msglevel                   = hinic3_set_msglevel,
> +	.get_link                       = ethtool_op_get_link,
> +	.get_strings                    = hinic3_get_strings,
> +	.get_sset_count                 = hinic3_get_sset_count,
> +	.get_ethtool_stats              = hinic3_get_ethtool_stats,
>  };
>  
>  void hinic3_set_ethtool_ops(struct net_device *netdev)
>  {
> -	netdev->ethtool_ops = &hinic3_ethtool_ops;
> +	struct hinic3_nic_dev *nic_dev = netdev_priv(netdev);
> +
> +	if (!HINIC3_IS_VF(nic_dev->hwdev))
> +		netdev->ethtool_ops = &hinic3_ethtool_ops;
> +	else
> +		netdev->ethtool_ops = &hinic3vf_ethtool_ops;
>  }

[Severity: Low]
This isn't a bug, but could the commit message describe the PF/VF split?

The commit message only says:

    This commit adds five standard ethtool statistics callbacks to the hinic3
    driver: get_eth_phy_stats, get_eth_mac_stats, get_eth_ctrl_stats,
    get_rmon_stats and get_pause_stats. Each callback reads the physical port
    counters from firmware via hinic3_get_phy_port_stats() and copies them
    into the standard ethtool structures.

The patch also does two other things:

- It adds hinic3vf_ethtool_ops, which is mostly a copy of
  hinic3_ethtool_ops.

- hinic3_set_ethtool_ops() now chooses between the two tables based on
  HINIC3_IS_VF().

So VF netdevs get none of the new eth-phy, eth-mac, eth-ctrl, rmon or
pause stats groups.

The exclusion looks intentional. It matches the !HINIC3_IS_VF() check
around the port stats in hinic3_get_ethtool_stats(), presumably because
VFs cannot query the physical port counters.

The driver now keeps two ops tables that have to stay in sync. Any op
added only to hinic3_ethtool_ops will be missing on VFs without warning.
The later patch in this series, "hinic3: Add ethtool pause param ops",
adds get/set_pauseparam only to the PF table. That commit message does
not explain the split either.

Would it help to say in the commit message that VFs are excluded on
purpose, and why?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1796348433.git.gongfan1%40huawei.com
Technical Details
Message-ID: <179644427505.3146.7330788653597759385@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377827-linux-kernel-netdev=dewy.ru
References: <e843d3064c2599b4d16156d0e69a4eac0589f017.1796348433.git.gongfan1@huawei.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377827-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v19 2/4] hinic3: Add ethtool statistic ops part(2/2)
Date: Sat, 05 Dec 2026 04:17:55 +0000
Organization: Usenet Network
Message-ID: <179644427505.3146.7330788653597759385@kernel.org>
References: <e843d3064c2599b4d16156d0e69a4eac0589f017.1796348433.git.gongfan1@huawei.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2951522"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CBmVN5gnpeNwiaKUm1W3FwFV1k0= sha256:xDShezY/efv+VShB7i4E5+dPxjCuB/NPS5/MAa7/tO4=
	sha1:16Ov103dxxAZzYUhnJbQEUCWmyA= sha256:6OUMcLlN7AaS6+j25iFe4z3wtuhSN3LdHEVvtgGA3Ao=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 0C14D117D65; Sat,  5 Dec 2026 07:18:37 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.542
X-Spam-Status: No, score=-3.542 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id vT-7gSMU8kdb;
	Sat,  5 Dec 2026 07:18:34 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377827-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 0B7CC117D66; Sat,  5 Dec 2026 07:18:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 3CF853E280; Sat,  5 Dec 2026 04:18:08 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796444282;
	b=WFxlR+MUsTF+RpjzAr4hFoRBhE+CPy71EqAOjONRuMe8wDf5zVsUrwix+XD6WWDke7MT
	 7wBrFn/qdZtuWyxbiuRy5MtX1s4tUr8hpbzH88WUxG/ZrOzUrICR5x8yPQJCPWi+B8ya5
	 VnPFbWcrWkrWioDyqAyjYoYwHBeHEInuP7YVTt7jcAkpd2O+HNNtc5eq50QcGQaYDCBeK
	 8hss5zxX1n97DUUu1wkJzq8zA09NweaKu7kP/col0PoJTkX6w0N+eujojWmDzCGbatldK
	 cJhzehOvy9cMsO0rJMftMKjL+InXUTfcbZfXSm8uWE2+7RIW34NweokEpy7aKcLRcIw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796444282;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=Agj9TynkHbKI5/wyxdxEc9cmUN7l7JwqrfjKunLKnUk=;
	b=wl2mFJL/6xi+50b/NQSGBI9O82WGijHt7iZftdA3pItUfvX02wDK5M+tUcS8jdvYKy6l
	 oXm2w/jvhivUkjQpoZDqQnnqZpOZO5ACydRwSUutiTLmLrRD/qh15/3VGdJt3HfeQmlEK
	 Oh6WODN37z1aXQ711NC/vA++gqRos4gFDe/YtrMHK1gjqLdKfsRTJHJH6cctj6t2LHLrr
	 bqfLwXPyLcqRwn8BwVriP3isTWmbGXnf8x6yF9iO6F8RmQ/FIrxpYkJuD2WLIJhVbdzGI
	 3wcJ1YLqdXiDqQnHd5a9D14s+c3LStrxaCQuj12p5ySsS/3ZKGDhhmNIJV2VrfcT3Yw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Wpe/pf7X";
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B3D760A2608;
	Sat,  5 Dec 2026 04:18:02 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Wpe/pf7X
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796444276;
	b=ilmIVpFI11b5MTAfM3ydsWbUUp4T1UElDq0zTnMSffS9sRgPV6bF8cBUlbJxJ/FWMyyB
	 RYyDgfRSiQzlFjaE4X+vXME639M9rSRhFE1/hgJFbM1XjF9F2zelqdb8KKVBW37kNh6BT
	 p27HSQQta0A6TFO9fjZo22KaAXZQvLpLCrACIWFfWfBcsRCWfSZPee+q1CSqO0RiW0mw/
	 H//E4Q/XC5Lhv7jSuB9BucJDBA1FrcRdI23mdUMF16x0wvEmBE+tfb/gTRgnubDZVR7/v
	 RnWyazwCstZVdlnxBiRCrKiS2f1+piqXGjyCWuRPDFWaKGUlJYGcLuTp9g/mEUT3kIg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796444276;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=Agj9TynkHbKI5/wyxdxEc9cmUN7l7JwqrfjKunLKnUk=;
	b=g8LzeIm6dFjTWXY8Y4vB1aoJfQcX4Vx7I26B4jU4uatu26pd9ZkCFlYF9rKr6XSER8ky
	 TefYhPqG8K5xGwDiTRuvcX9QGsOqUAygB4n6326szbm2fqciVxOUeJJQHdP1gcS4DxVVB
	 CYr7Zqn+Fh40bJVehivmsc3K0/v+pNAd65y4ISBZz3L3Eqx3zJ0BOr37EbAekKXfFEyTm
	 gtL1EZyWHxUUhdgrwy6h8CxN2XVTiE7OaIy0Io0kGC+8P788HAkPOgk2hRSmj/h3UtImS
	 QaNzjX1sg8nC2l5vAtxVv5vH5JifsHjaPfDgG9DDJl+HAx61P+GpdB2vW3LyZcSFo/g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Wpe/pf7X";
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAE91606A338;
	Sat,  5 Dec 2026 04:17:56 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C83C1F00A07;
	Sat,  5 Dec 2026 04:17:55 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796444276;
	bh=Agj9TynkHbKI5/wyxdxEc9cmUN7l7JwqrfjKunLKnUk=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Wpe/pf7Xt31g/qq3aMXdapvJfkTpuZvK23LqhIcUf2SOaXBmlhxtNI4EmPbvYMHlm
	 pOOnqm/UMnhyqkktItsv+3we9iwuhkh6a6JiNgmdODkA8bglGbDOWH4o7TNU1abhBd
	 ggovkPX4vtKNZw+BBW3SsTMyDjVgMLkTPv1ImFhY6Qdqi6eKhVn4ynXfdckVniklqD
	 ivMWyqFvW1/OTuM6pDkZcHWqw1kCGja834DJO2RC1mvmgpbc2RdRFDWbQrQm99YOrN
	 wyOHKFZ0tLfZZ4SYIbJO+lqLJDph/KqWR1m8BQ1YaeNNkGnEPUtfEtlK4++myEgJU8
	 jc9MR15k1tQUA==
X-Cc: wudi234@huawei.com, tengpeisen@huawei.com, netdev@vger.kernel.org,
 davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
 horms@kernel.org, andrew+netdev@lunn.ch, ioana.ciornei@nxp.com,
 maxime.chevallier@bootlin.com, mohsin.bashr@gmail.com,
 dimitri.daskalakis1@gmail.com, hramamurthy@google.com,
 larysa.zaremba@intel.com, vadim.fedorenko@linux.dev,
 linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
 zhoushuai28@huawei.com, wulike1@huawei.com
X-In-Reply-To: <e843d3064c2599b4d16156d0e69a4eac0589f017.1796348433.git.gongfan1@huawei.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list