From: Andrew Lunn <andrew@lunn.ch>
To: George McCollister <george.mccollister@gmail.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
netdev@vger.kernel.org, open list <linux-kernel@vger.kernel.org>,
linux-mips@vger.kernel.org
Subject: Re: [PATCH v4 net-next 2/2] net: dsa: qca: ar9331: export stats64
Date: Fri, 4 Dec 2020 23:12:57 +0100 [thread overview]
Message-ID: <20201204221257.GH2400258@lunn.ch> (raw)
In-Reply-To: <CAFSKS=Pq9=mNXGeTbcTOL-=rp8wWCS2qtHF38eD1HiN=EK0DOQ@mail.gmail.com>
> > +struct ar9331_sw_stats {
> > + u64 rxbroad;
> > + u64 rxpause;
> > + u64 rxmulti;
> > +};
7> > +struct ar9331_sw_port {
> > + int idx;
> > + struct ar9331_sw_priv *priv;
> > + struct delayed_work mib_read;
> > + struct ar9331_sw_stats stats;
> > +static void ar9331_stats_update(struct ar9331_sw_port *port,
> > + struct rtnl_link_stats64 *stats)
> > +{
> > + struct ar9331_sw_stats *s = &port->stats;
> > +
> > + stats->rx_packets = s->rxbroad + s->rxmulti + s->rx64byte +
> > + s->rx128byte + s->rx256byte + s->rx512byte + s->rx1024byte +
> > + s->rx1518byte + s->rxmaxbyte;
>
> Are all of these port->stats accesses always atomic? I'll need to do
> something similar in my xrs700x driver and want to make sure there
> doesn't need to be a lock between here and where they're updated in
> the delayed work.
Since these are u64, they are not atomic on 32 bit systems.
Take a look at
include/linux/u64_stats_sync.h
Andrewu
next prev parent reply other threads:[~2020-12-04 22:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-04 14:56 [PATCH v4 net-next 0/2] net: dsa: add stats64 support Oleksij Rempel
2020-12-04 14:56 ` [PATCH v4 net-next 1/2] net: dsa: add optional " Oleksij Rempel
2020-12-04 21:42 ` Florian Fainelli
2020-12-05 14:34 ` Andrew Lunn
2020-12-07 17:21 ` George McCollister
2020-12-04 14:56 ` [PATCH v4 net-next 2/2] net: dsa: qca: ar9331: export stats64 Oleksij Rempel
2020-12-04 21:40 ` George McCollister
2020-12-04 22:12 ` Andrew Lunn [this message]
2020-12-04 22:04 ` George McCollister
2020-12-09 14:06 ` Oleksij Rempel
2020-12-05 14:40 ` Andrew Lunn
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=20201204221257.GH2400258@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=george.mccollister@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.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;
as well as URLs for NNTP newsgroup(s).