From: Saeed Mahameed
Date: Mon, 5 Nov 2018 19:13:59 +
> On Sat, 2018-11-03 at 19:36 -0700, David Miller wrote:
>> From: Saeed Mahameed
>> Date: Fri, 2 Nov 2018 18:54:22 -0700
>>
>> > +static void mlx5e_fold_sw_stats(struct mlx5e_priv *priv, struct
>> > rtnl_link_stats64 *s)
>> > +{
>> > +
On Sat, 2018-11-03 at 19:36 -0700, David Miller wrote:
> From: Saeed Mahameed
> Date: Fri, 2 Nov 2018 18:54:22 -0700
>
> > +static void mlx5e_fold_sw_stats(struct mlx5e_priv *priv, struct
> > rtnl_link_stats64 *s)
> > +{
> > + int i;
> > +
> > + /* not required ? */
> > + memset(s, 0, size
From: Saeed Mahameed
Date: Fri, 2 Nov 2018 18:54:22 -0700
> +static void mlx5e_fold_sw_stats(struct mlx5e_priv *priv, struct
> rtnl_link_stats64 *s)
> +{
> + int i;
> +
> + /* not required ? */
> + memset(s, 0, sizeof(*s));
Why wouldn't this be required?
I can see that perhaps you
mlx5e_grp_sw_update_stats can be called from two threads,
1) ndo_get_stats64
2) get_ethtool_stats
For this reason and to minimize concurrency issue impact on 64bit machines
mlx5e_grp_sw_update_stats folds the software stats into a temporary sw
stats variable and at the end memcopy it to the global