[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201018173649.GF456889@lunn.ch>
Date: Sun, 18 Oct 2020 19:36:49 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Vladimir Oltean <vladimir.oltean@....com>, netdev@...r.kernel.org,
f.fainelli@...il.com, vivien.didelot@...il.com,
Christian Eggers <ceggers@...i.de>,
Kurt Kanzenbach <kurt@...utronix.de>
Subject: Re: [RFC PATCH 01/13] net: dsa: add plumbing for custom netdev
statistics
On Sun, Oct 18, 2020 at 09:49:51AM -0700, Jakub Kicinski wrote:
> > + struct u64_stats_sync syncp;
> > +} __aligned(1 * sizeof(u64));
>
> Why aligned to u64? Compiler should pick a reasonable alignment here
> by itself.
Hi Jakub
I wondered that as well. But:
struct gnet_stats_basic_cpu {
struct gnet_stats_basic_packed bstats;
struct u64_stats_sync syncp;
} __aligned(2 * sizeof(u64));
/* often modified stats are per-CPU, other are shared (netdev->stats) */
struct pcpu_sw_netstats {
u64 rx_packets;
u64 rx_bytes;
u64 tx_packets;
u64 tx_bytes;
struct u64_stats_sync syncp;
} __aligned(4 * sizeof(u64));
struct pcpu_lstats {
u64_stats_t packets;
u64_stats_t bytes;
struct u64_stats_sync syncp;
} __aligned(2 * sizeof(u64));
Cargo cult or is there a real need?
Andrew
Powered by blists - more mailing lists