From: Jakub Kicinski <kuba@kernel.org>
To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Wen Gu <guwen@linux.alibaba.com>,
Philo Lu <lulie@linux.alibaba.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Dong Yibo <dong100@mucse.com>,
Lukas Bulwahn <lukas.bulwahn@redhat.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Vivian Wang <wangruikang@iscas.ac.cn>,
MD Danish Anwar <danishanwar@ti.com>,
Dust Li <dust.li@linux.alibaba.com>, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net-next v16 5/5] eea: introduce ethtool support
Date: Wed, 26 Nov 2025 16:55:10 -0800 [thread overview]
Message-ID: <20251126165510.34698f35@kernel.org> (raw)
In-Reply-To: <20251124014251.63761-6-xuanzhuo@linux.alibaba.com>
On Mon, 24 Nov 2025 09:42:51 +0800 Xuan Zhuo wrote:
> +void eea_stats(struct net_device *netdev, struct rtnl_link_stats64 *tot)
..ethtool.c is not a great place for an ndo, I missed this in previous
reviews
> + struct eea_net *enet = netdev_priv(netdev);
> + u64 packets, bytes;
> + u32 start;
> + int i;
> +
> + if (enet->rx) {
> + for (i = 0; i < enet->cfg.rx_ring_num; i++) {
> + struct eea_net_rx *rx = enet->rx[i];
Could you document here what prevents enet->rx from getting swapped /
going away half way thru the iteration? The implicit RCU sync in
netif_napi_del() ?
ndo get_stats runs under RCU and without rtnl_lock if read via profcs
(tools/testing/selftests/drivers/net/stats.py has a test case for it
FWIW)
> + do {
> + start = u64_stats_fetch_begin(&rx->stats.syncp);
> + packets = u64_stats_read(&rx->stats.packets);
> + bytes = u64_stats_read(&rx->stats.bytes);
> + } while (u64_stats_fetch_retry(&rx->stats.syncp,
> + start));
> +
> + tot->rx_packets += packets;
> + tot->rx_bytes += bytes;
> + }
> + }
> +
> + if (enet->tx) {
> + for (i = 0; i < enet->cfg.tx_ring_num; i++) {
> + struct eea_net_tx *tx = &enet->tx[i];
> +
> + do {
> + start = u64_stats_fetch_begin(&tx->stats.syncp);
> + packets = u64_stats_read(&tx->stats.packets);
> + bytes = u64_stats_read(&tx->stats.bytes);
> + } while (u64_stats_fetch_retry(&tx->stats.syncp,
> + start));
> +
> + tot->tx_packets += packets;
> + tot->tx_bytes += bytes;
> + }
> + }
> +}
prev parent reply other threads:[~2025-11-27 0:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 1:42 [PATCH net-next v16 0/5] eea: Add basic driver framework for Alibaba Elastic Ethernet Adaptor Xuan Zhuo
2025-11-24 1:42 ` [PATCH net-next v16 1/5] eea: introduce PCI framework Xuan Zhuo
2025-11-24 1:42 ` [PATCH net-next v16 2/5] eea: introduce ring and descriptor structures Xuan Zhuo
2025-11-24 1:42 ` [PATCH net-next v16 3/5] eea: probe the netdevice and create adminq Xuan Zhuo
2025-11-27 0:42 ` Jakub Kicinski
2025-11-24 1:42 ` [PATCH net-next v16 4/5] eea: create/destroy rx,tx queues for netdevice open and stop Xuan Zhuo
2025-11-27 0:49 ` Jakub Kicinski
2025-11-24 1:42 ` [PATCH net-next v16 5/5] eea: introduce ethtool support Xuan Zhuo
2025-11-27 0:55 ` Jakub Kicinski [this message]
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=20251126165510.34698f35@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=dong100@mucse.com \
--cc=dust.li@linux.alibaba.com \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=guwen@linux.alibaba.com \
--cc=lorenzo@kernel.org \
--cc=lukas.bulwahn@redhat.com \
--cc=lulie@linux.alibaba.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vadim.fedorenko@linux.dev \
--cc=wangruikang@iscas.ac.cn \
--cc=xuanzhuo@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.