Commit 1f8dda1d authored by Fabian Frederick's avatar Fabian Frederick Committed by David S. Miller

vxlan: 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 451b05f4
...@@ -1826,7 +1826,6 @@ static bool vxlan_ecn_decapsulate(struct vxlan_sock *vs, void *oiph, ...@@ -1826,7 +1826,6 @@ static bool vxlan_ecn_decapsulate(struct vxlan_sock *vs, void *oiph,
/* Callback from net/ipv4/udp.c to receive packets */ /* Callback from net/ipv4/udp.c to receive packets */
static int vxlan_rcv(struct sock *sk, struct sk_buff *skb) static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
{ {
struct pcpu_sw_netstats *stats;
struct vxlan_dev *vxlan; struct vxlan_dev *vxlan;
struct vxlan_sock *vs; struct vxlan_sock *vs;
struct vxlanhdr unparsed; struct vxlanhdr unparsed;
...@@ -1940,12 +1939,7 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb) ...@@ -1940,12 +1939,7 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
goto drop; goto drop;
} }
stats = this_cpu_ptr(vxlan->dev->tstats); dev_sw_netstats_rx_add(vxlan->dev, skb->len);
u64_stats_update_begin(&stats->syncp);
stats->rx_packets++;
stats->rx_bytes += skb->len;
u64_stats_update_end(&stats->syncp);
gro_cells_receive(&vxlan->gro_cells, skb); gro_cells_receive(&vxlan->gro_cells, skb);
rcu_read_unlock(); rcu_read_unlock();
......
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