From: netdev-bot+sashiko@kernel.org
To: gongfan1@huawei.com
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
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 [thread overview]
Message-ID: <179644427505.3146.7330788653597759385@kernel.org> (raw)
In-Reply-To: <e843d3064c2599b4d16156d0e69a4eac0589f017.1796348433.git.gongfan1@huawei.com>
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
next prev parent reply other threads:[~2026-12-05 4:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 4:08 [PATCH net-next v19 0/4] net: hinic3: Support ethtool ops Fan Gong
2026-12-04 4:08 ` [PATCH net-next v19 1/4] hinic3: Add ethtool statistic ops part(1/2) Fan Gong
2026-12-05 4:17 ` netdev-bot+sashiko
2026-12-04 4:08 ` [PATCH net-next v19 2/4] hinic3: Add ethtool statistic ops part(2/2) Fan Gong
2026-12-05 4:17 ` netdev-bot+sashiko [this message]
2026-12-04 4:08 ` [PATCH net-next v19 3/4] hinic3: Add per-queue netdev-genl stats Fan Gong
2026-12-05 4:17 ` netdev-bot+sashiko
2026-12-04 4:08 ` [PATCH net-next v19 4/4] hinic3: Add ethtool pause param ops Fan Gong
2026-12-05 4:17 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179644427505.3146.7330788653597759385@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dimitri.daskalakis1@gmail.com \
--cc=edumazet@google.com \
--cc=gongfan1@huawei.com \
--cc=horms@kernel.org \
--cc=hramamurthy@google.com \
--cc=ioana.ciornei@nxp.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tengpeisen@huawei.com \
--cc=vadim.fedorenko@linux.dev \
--cc=wudi234@huawei.com \
--cc=wulike1@huawei.com \
--cc=zhoushuai28@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox