# Re: \[PATCH net-next 2/4\] gen\_stats: Add instead Set the value in \_\_gnet\_stats\_copy\_basic().

- From: Cong Wang \<hidden\>
- Date: 2021-10-13 16:34:17 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/10/11213331
- Thread: https://ratatoskr.run/netdev/2021/10/11212910/t.md

```text
On Thu, Oct 7, 2021 at 10:51 AM Sebastian Andrzej Siewior
[ref] wrote:
>
> Since day one __gnet_stats_copy_basic() always assigned the value to the
> bstats argument overwriting the previous value.
>
> Based on review there are five users of that function as of today:
> - est_fetch_counters(), ___gnet_stats_copy_basic()
>   memsets() bstats to zero, single invocation.
>
> - mq_dump(), mqprio_dump(), mqprio_dump_class_stats()
>   memsets() bstats to zero, multiple invocation but does not use the
>   function due to !qdisc_is_percpu_stats().
>
> It will probably simplify in percpu stats case if the value would be
> added and not just stored

You at least need to rename it before doing so, otherwise "copy"
would be too confusing.
```
