diff options
| author | Eric Dumazet <[email protected]> | 2022-03-11 05:14:20 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2022-03-12 07:17:24 +0000 |
| commit | 625788b5844511cf4c30cffa7fa0bc3a69cebc82 (patch) | |
| tree | 1b1b091212352474f56d6c4497017bc206c7c785 /drivers/net/eql.c | |
| parent | Merge branch 'nfp-preliminary-support-for-nfp-3800' (diff) | |
| download | kernel-625788b5844511cf4c30cffa7fa0bc3a69cebc82.tar.gz kernel-625788b5844511cf4c30cffa7fa0bc3a69cebc82.zip | |
net: add per-cpu storage and net->core_stats
Before adding yet another possibly contended atomic_long_t,
it is time to add per-cpu storage for existing ones:
dev->tx_dropped, dev->rx_dropped, and dev->rx_nohandler
Because many devices do not have to increment such counters,
allocate the per-cpu storage on demand, so that dev_get_stats()
does not have to spend considerable time folding zero counters.
Note that some drivers have abused these counters which
were supposed to be only used by core networking stack.
v4: should use per_cpu_ptr() in dev_get_stats() (Jakub)
v3: added a READ_ONCE() in netdev_core_stats_alloc() (Paolo)
v2: add a missing include (reported by kernel test robot <[email protected]>)
Change in netdev_core_stats_alloc() (Jakub)
Signed-off-by: Eric Dumazet <[email protected]>
Cc: jeffreyji <[email protected]>
Reviewed-by: Brian Vazquez <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Acked-by: Paolo Abeni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/eql.c')
0 files changed, 0 insertions, 0 deletions
