diff options
| author | Heiner Kallweit <[email protected]> | 2020-11-07 20:49:46 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2020-11-10 01:50:27 +0000 |
| commit | 6a9006287959ef69556d612dcbde9e68bf16a42b (patch) | |
| tree | 58305ba2e578f5fe75ca11902465002b5f29749a /net/dsa/dsa.c | |
| parent | net: core: add dev_get_tstats64 as a ndo_get_stats64 implementation (diff) | |
| download | kernel-6a9006287959ef69556d612dcbde9e68bf16a42b.tar.gz kernel-6a9006287959ef69556d612dcbde9e68bf16a42b.zip | |
net: dsa: use net core stats64 handling
Use netdev->tstats instead of a member of dsa_slave_priv for storing
a pointer to the per-cpu counters. This allows us to use core
functionality for statistics handling.
Reviewed-by: Florian Fainelli <[email protected]>
Tested-by: Vladimir Oltean <[email protected]>
Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/dsa/dsa.c')
| -rw-r--r-- | net/dsa/dsa.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 2131bf2b3a67..a1b1dc8a4d87 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -201,7 +201,6 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev, { struct dsa_port *cpu_dp = dev->dsa_ptr; struct sk_buff *nskb = NULL; - struct pcpu_sw_netstats *s; struct dsa_slave_priv *p; if (unlikely(!cpu_dp)) { @@ -234,11 +233,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev, skb = nskb; } - s = this_cpu_ptr(p->stats64); - u64_stats_update_begin(&s->syncp); - s->rx_packets++; - s->rx_bytes += skb->len; - u64_stats_update_end(&s->syncp); + dev_sw_netstats_rx_add(skb->dev, skb->len); if (dsa_skb_defer_rx_timestamp(p, skb)) return 0; |
