From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, 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>,
Lukas Bulwahn <lukas.bulwahn@redhat.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Vivian Wang <wangruikang@iscas.ac.cn>,
Troy Mitchell <troy.mitchell@linux.spacemit.com>,
Dust Li <dust.li@linux.alibaba.com>
Subject: Re: [PATCH net-next v3] eea: Add basic driver framework for Alibaba Elastic Ethernet Adaptor
Date: Thu, 25 Sep 2025 15:00:17 +0800 [thread overview]
Message-ID: <1758783617.5882711-3-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <03aa2085-bc5a-486f-ae61-3c66179d6823@lunn.ch>
On Fri, 19 Sep 2025 18:40:47 +0200, Andrew Lunn <andrew@lunn.ch> wrote:
> > +void eea_stats(struct net_device *netdev, struct rtnl_link_stats64 *tot)
> > +{
> > + 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 enet_rx *rx = enet->rx[i];
> > +
> > + 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) {
>
> Why would enet->rx and/or enet->tx not be set?
We allocate enet->rx, tx only when the driver is open.
>
> > + for (i = 0; i < enet->cfg.tx_ring_num; i++) {
> > + struct enet_tx *tx = &enet->tx[i];
>
> What prevents them from going away while in this loop?
rtnl_lock
Thanks.
>
> Andrew
next prev parent reply other threads:[~2025-09-25 7:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 1:48 [PATCH net-next v3] eea: Add basic driver framework for Alibaba Elastic Ethernet Adaptor Xuan Zhuo
2025-09-19 1:53 ` Troy Mitchell
2025-09-19 5:42 ` Xuan Zhuo
2025-09-19 13:00 ` Przemek Kitszel
2025-09-25 6:42 ` Xuan Zhuo
2025-09-25 14:11 ` Andrew Lunn
2025-09-26 1:21 ` Xuan Zhuo
2025-09-25 7:36 ` Xuan Zhuo
2025-09-19 16:35 ` Andrew Lunn
2025-09-25 6:55 ` Xuan Zhuo
2025-09-19 16:40 ` Andrew Lunn
2025-09-25 7:00 ` Xuan Zhuo [this message]
2025-09-25 8:06 ` Kalesh Anakkur Purayil
2025-09-26 1:46 ` Xuan Zhuo
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=1758783617.5882711-3-xuanzhuo@linux.alibaba.com \
--to=xuanzhuo@linux.alibaba.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dust.li@linux.alibaba.com \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=guwen@linux.alibaba.com \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=lukas.bulwahn@redhat.com \
--cc=lulie@linux.alibaba.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=troy.mitchell@linux.spacemit.com \
--cc=vadim.fedorenko@linux.dev \
--cc=wangruikang@iscas.ac.cn \
/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