On 11.10.2020 21:54, Stephen Hemminger wrote:
> On Sun, 11 Oct 2020 21:36:43 +0200
> Heiner Kallweit wrote:
>
>> +void dev_fetch_sw_netstats(struct rtnl_link_stats64 *s,
>> + struct pcpu_sw_netstats __percpu *netstats)
>
> netstats is unmodified, should it be const?
>
>>
In several places the same code is used to populate rtnl_link_stats64
fields with data from pcpu_sw_netstats. Therefore factor out this code
to a new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit
---
include/linux/netdevice.h | 2 ++
net/core/dev.c| 36
On Sun, 11 Oct 2020 21:36:43 +0200 Heiner Kallweit wrote:
> In several places the same code is used to populate rtnl_link_stats64
> fields with data from pcpu_sw_netstats. Therefore factor out this code
> to a new function dev_fetch_sw_netstats().
>
> Signed-off-by: Heiner Kallweit
> +/**
> + *
On Sun, 11 Oct 2020 21:36:43 +0200
Heiner Kallweit wrote:
> +void dev_fetch_sw_netstats(struct rtnl_link_stats64 *s,
> +struct pcpu_sw_netstats __percpu *netstats)
netstats is unmodified, should it be const?
> +{
> + int cpu;
> +
> + if