From: Antoine Tenart <atenart@kernel.org>
To: bjorn@mork.no, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Andrew Lunn <andrew@lunn.ch>, David Miller <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Igor Mitsyanko <imitsyanko@quantenna.com>,
Jakub Kicinski <kuba@kernel.org>,
Johannes Berg <johannes@sipsolutions.net>,
Kalle Valo <kvalo@codeaurora.org>,
Nikolay Aleksandrov <nikolay@nvidia.com>,
Oliver Neukum <oneukum@suse.com>,
Pravin B Shelar <pshelar@ovn.org>,
Roopa Prabhu <roopa@nvidia.com>,
Sergey Matyukevich <geomatsi@gmail.com>,
Steffen Klassert <steffen.klassert@secunet.com>,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>
Cc: linux-rdma@vger.kernel.org,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Linux USB Mailing List <linux-usb@vger.kernel.org>,
linux-wireless <linux-wireless@vger.kernel.org>,
bridge@lists.linux-foundation.org
Subject: Re: [Bridge] [PATCH net-next v2 03/12] net: macsec: use new function dev_fetch_sw_netstats
Date: Mon, 12 Oct 2020 15:37:34 +0200 [thread overview]
Message-ID: <160250985474.6233.14282398170315752864@surface> (raw)
In-Reply-To: <0d81e0f7-7784-42df-8e10-d0b77ca5b7ee@gmail.com>
Hello,
Quoting Heiner Kallweit (2020-10-12 10:04:11)
> Simplify the code by using new function dev_fetch_sw_netstats().
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Antoine Tenart <atenart@kernel.org>
Thanks!
Antoine
> ---
> drivers/net/macsec.c | 22 +---------------------
> 1 file changed, 1 insertion(+), 21 deletions(-)
>
> diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
> index 2b0c8f01d..11ca5fa90 100644
> --- a/drivers/net/macsec.c
> +++ b/drivers/net/macsec.c
> @@ -3647,30 +3647,10 @@ static int macsec_change_mtu(struct net_device *dev, int new_mtu)
> static void macsec_get_stats64(struct net_device *dev,
> struct rtnl_link_stats64 *s)
> {
> - int cpu;
> -
> if (!dev->tstats)
> return;
>
> - for_each_possible_cpu(cpu) {
> - struct pcpu_sw_netstats *stats;
> - struct pcpu_sw_netstats tmp;
> - int start;
> -
> - stats = per_cpu_ptr(dev->tstats, cpu);
> - do {
> - start = u64_stats_fetch_begin_irq(&stats->syncp);
> - tmp.rx_packets = stats->rx_packets;
> - tmp.rx_bytes = stats->rx_bytes;
> - tmp.tx_packets = stats->tx_packets;
> - tmp.tx_bytes = stats->tx_bytes;
> - } while (u64_stats_fetch_retry_irq(&stats->syncp, start));
> -
> - s->rx_packets += tmp.rx_packets;
> - s->rx_bytes += tmp.rx_bytes;
> - s->tx_packets += tmp.tx_packets;
> - s->tx_bytes += tmp.tx_bytes;
> - }
> + dev_fetch_sw_netstats(s, dev->tstats);
>
> s->rx_dropped = dev->stats.rx_dropped;
> s->tx_dropped = dev->stats.tx_dropped;
> --
> 2.28.0
>
>
next prev parent reply other threads:[~2020-10-12 13:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 8:00 [Bridge] [PATCH net-next v2 00/12] net: add and use function dev_fetch_sw_netstats for fetching pcpu_sw_netstats Heiner Kallweit
2020-10-12 8:01 ` [Bridge] [PATCH net-next v2 01/12] net: add " Heiner Kallweit
2020-10-12 8:03 ` [Bridge] [PATCH net-next v2 02/12] IB/hfi1: use new function dev_fetch_sw_netstats Heiner Kallweit
2020-10-12 8:04 ` [Bridge] [PATCH net-next v2 03/12] net: macsec: " Heiner Kallweit
2020-10-12 13:37 ` Antoine Tenart [this message]
2020-10-12 8:06 ` [Bridge] [PATCH net-next v2 04/12] net: usb: qmi_wwan: " Heiner Kallweit
2020-10-12 8:07 ` [Bridge] [PATCH net-next v2 05/12] net: usbnet: " Heiner Kallweit
2020-10-12 8:14 ` [Bridge] [PATCH net-next v2 06/12] qtnfmac: " Heiner Kallweit
2020-10-12 8:15 ` [Bridge] [PATCH net-next v2 07/12] net: bridge: " Heiner Kallweit
2020-10-12 8:16 ` [Bridge] [PATCH net-next v2 08/12] net: dsa: " Heiner Kallweit
2020-10-12 8:17 ` [Bridge] [PATCH net-next v2 09/12] iptunnel: " Heiner Kallweit
2020-10-12 8:18 ` [Bridge] [PATCH net-next v2 10/12] mac80211: " Heiner Kallweit
2020-10-12 8:19 ` [Bridge] [PATCH net-next v2 11/12] net: openvswitch: " Heiner Kallweit
2020-10-12 8:19 ` [Bridge] [PATCH net-next v2 12/12] xfrm: " Heiner Kallweit
2020-10-14 0:39 ` [Bridge] [PATCH net-next v2 00/12] net: add and use function dev_fetch_sw_netstats for fetching pcpu_sw_netstats Jakub Kicinski
2020-10-14 5:42 ` Leon Romanovsky
2020-10-14 6:13 ` Heiner Kallweit
2020-10-14 7:53 ` Leon Romanovsky
2020-10-14 7:59 ` Heiner Kallweit
2020-10-14 8:01 ` Johannes Berg
2020-10-14 8:33 ` Leon Romanovsky
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=160250985474.6233.14282398170315752864@surface \
--to=atenart@kernel.org \
--cc=andrew@lunn.ch \
--cc=bjorn@mork.no \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=geomatsi@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=hkallweit1@gmail.com \
--cc=imitsyanko@quantenna.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=kvalo@codeaurora.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@nvidia.com \
--cc=olteanv@gmail.com \
--cc=oneukum@suse.com \
--cc=pshelar@ovn.org \
--cc=roopa@nvidia.com \
--cc=steffen.klassert@secunet.com \
--cc=vivien.didelot@gmail.com \
--cc=yoshfuji@linux-ipv6.org \
/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