Commit 8fdfffd0 authored by Fabian Frederick's avatar Fabian Frederick Committed by David S. Miller

bareudp: use dev_sw_netstats_rx_add()

use new helper for netstats settings
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1e84527b
...@@ -54,7 +54,6 @@ struct bareudp_dev { ...@@ -54,7 +54,6 @@ struct bareudp_dev {
static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
{ {
struct metadata_dst *tun_dst = NULL; struct metadata_dst *tun_dst = NULL;
struct pcpu_sw_netstats *stats;
struct bareudp_dev *bareudp; struct bareudp_dev *bareudp;
unsigned short family; unsigned short family;
unsigned int len; unsigned int len;
...@@ -160,13 +159,9 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) ...@@ -160,13 +159,9 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
len = skb->len; len = skb->len;
err = gro_cells_receive(&bareudp->gro_cells, skb); err = gro_cells_receive(&bareudp->gro_cells, skb);
if (likely(err == NET_RX_SUCCESS)) { if (likely(err == NET_RX_SUCCESS))
stats = this_cpu_ptr(bareudp->dev->tstats); dev_sw_netstats_rx_add(bareudp->dev, len);
u64_stats_update_begin(&stats->syncp);
stats->rx_packets++;
stats->rx_bytes += len;
u64_stats_update_end(&stats->syncp);
}
return 0; return 0;
drop: drop:
/* Consume bad packet */ /* Consume bad packet */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment