diff options
author | Fabian Frederick <fabf@skynet.be> | 2020-10-05 22:35:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-06 06:23:21 -0700 |
commit | 8fdfffd0b97a0f1e46618afad7e24ebf889952c4 (patch) | |
tree | dd744a5b029488877ebfefaf597f50be5c1f8a9e /drivers/net/bareudp.c | |
parent | 1e84527b7fa92496ac7fbee9f8c3557e7fe1ecb1 (diff) | |
download | linux-8fdfffd0b97a0f1e46618afad7e24ebf889952c4.tar.bz2 |
bareudp: use dev_sw_netstats_rx_add()
use new helper for netstats settings
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bareudp.c')
-rw-r--r-- | drivers/net/bareudp.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c index 841910f1db65..ff0bea1554f9 100644 --- a/drivers/net/bareudp.c +++ b/drivers/net/bareudp.c @@ -54,7 +54,6 @@ struct bareudp_dev { static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) { struct metadata_dst *tun_dst = NULL; - struct pcpu_sw_netstats *stats; struct bareudp_dev *bareudp; unsigned short family; unsigned int len; @@ -160,13 +159,9 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) len = skb->len; err = gro_cells_receive(&bareudp->gro_cells, skb); - if (likely(err == NET_RX_SUCCESS)) { - stats = this_cpu_ptr(bareudp->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += len; - u64_stats_update_end(&stats->syncp); - } + if (likely(err == NET_RX_SUCCESS)) + dev_sw_netstats_rx_add(bareudp->dev, len); + return 0; drop: /* Consume bad packet */ |