Linux Documentation
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Fan Gong <gongfan1@huawei.com>, Wu Di <wudi234@huawei.com>,
	Teng Peisen <tengpeisen@huawei.com>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	Mohsin Bashir <mohsin.bashr@gmail.com>,
	Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>,
	Harshitha Ramamurthy <hramamurthy@google.com>,
	Larysa Zaremba <larysa.zaremba@intel.com>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	Chen Anwen <chenanwen@huawei.com>,
	He Wei <august.hewei@huawei.com>, luosifu <luosifu@huawei.com>,
	Xin Guo <guoxin09@huawei.com>,
	Zhou Shuai <zhoushuai28@huawei.com>, Wu Like <wulike1@huawei.com>,
	Shi Jing <shijing34@huawei.com>,
	Zheng Jiezhen <zhengjiezhen@h-partners.com>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>
Subject: Re: [PATCH net-next v13 1/3] hinic3: Add ethtool statistic ops
Date: Mon, 17 Aug 2026 14:02:42 +0100	[thread overview]
Message-ID: <6f8c545d-bdd6-444d-a548-11901ba6dcbe@linux.dev> (raw)
In-Reply-To: <dfeeb94c9025b96a02078a0f87ec4d204460b8c3.1786774752.git.tengpeisen@huawei.com>

On 17/08/2026 03:04, Fan Gong wrote:

[...]

> +static void hinic3_get_drv_queue_stats(struct net_device *netdev, u64 *data)
> +{
> +	struct hinic3_nic_dev *nic_dev = netdev_priv(netdev);
> +	struct hinic3_txq_stats txq_stats = {};
> +	struct hinic3_rxq_stats rxq_stats = {};
> +	u16 i = 0, j, qid;
> +	char *p;
> +
> +	for (qid = 0; qid < nic_dev->q_params.num_qps; qid++) {
> +		if (!nic_dev->txqs)
> +			break;

how can this happen on registered netdev? And even if it's possible, why 
do you check it on every iteration of the loop?

> +
> +		hinic3_txq_get_stats(&nic_dev->txqs[qid], &txq_stats);
> +		for (j = 0; j < ARRAY_SIZE(hinic3_tx_queue_stats); j++, i++) {
> +			p = (char *)&txq_stats +
> +			    hinic3_tx_queue_stats[j].offset;
> +			data[i] = *(u64 *)p;
> +		}
> +	}
> +
> +	i = nic_dev->q_params.num_qps * ARRAY_SIZE(hinic3_tx_queue_stats);
> +	for (qid = 0; qid < nic_dev->q_params.num_qps; qid++) {
> +		if (!nic_dev->rxqs)
> +			break;

the very same question here

> +
> +		hinic3_rxq_get_stats(&nic_dev->rxqs[qid], &rxq_stats);
> +		for (j = 0; j < ARRAY_SIZE(hinic3_rx_queue_stats); j++, i++) {
> +			p = (char *)&rxq_stats +
> +			    hinic3_rx_queue_stats[j].offset;
> +			data[i] = *(u64 *)p;
> +		}
> +	}
> +}



  reply	other threads:[~2026-08-17 13:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  2:03 [PATCH net-next v13 0/3] net: hinic3: PF initialization Fan Gong
2026-08-17  2:04 ` [PATCH net-next v13 1/3] hinic3: Add ethtool statistic ops Fan Gong
2026-08-17 13:02   ` Vadim Fedorenko [this message]
2026-08-17  2:04 ` [PATCH net-next v13 2/3] hinic3: Add ethtool coalesce ops Fan Gong
2026-08-17  2:04 ` [PATCH net-next v13 3/3] hinic3: Remove unneeded coalesce parameters Fan Gong
2026-08-17 15:42 ` [PATCH net-next v13 0/3] net: hinic3: PF initialization Jakub Kicinski

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=6f8c545d-bdd6-444d-a548-11901ba6dcbe@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=august.hewei@huawei.com \
    --cc=chenanwen@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dimitri.daskalakis1@gmail.com \
    --cc=edumazet@google.com \
    --cc=gongfan1@huawei.com \
    --cc=guoxin09@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=luosifu@huawei.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mohsin.bashr@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shijing34@huawei.com \
    --cc=tengpeisen@huawei.com \
    --cc=wudi234@huawei.com \
    --cc=wulike1@huawei.com \
    --cc=zhengjiezhen@h-partners.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