Skip to contentSkip to conversation

vxlan: use dev_sw_netstats_rx_add()

PATCH In review Fabian Frederick 1 participant 1 message Oct 5, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/9 vxlan: use dev_sw_netstats_rx_add()

use new helper for netstats settings

---
 drivers/net/vxlan.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/net/vxlan.c +1 -7
index be3bf233a809e..1a557aeba32b4 100644
@@ -1826,7 +1826,6 @@ static bool vxlan_ecn_decapsulate(struct vxlan_sock *vs, void *oiph,
 /* Callback from net/ipv4/udp.c to receive packets */
 static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
 {
-	struct pcpu_sw_netstats *stats;
 	struct vxlan_dev *vxlan;
 	struct vxlan_sock *vs;
 	struct vxlanhdr unparsed;
@@ -1940,12 +1939,7 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
 		goto drop;
 	}
 
-	stats = this_cpu_ptr(vxlan->dev->tstats);
-	u64_stats_update_begin(&stats->syncp);
-	stats->rx_packets++;
-	stats->rx_bytes += skb->len;
-	u64_stats_update_end(&stats->syncp);
-
+	dev_sw_netstats_rx_add(vxlan->dev, skb->len);
 	gro_cells_receive(&vxlan->gro_cells, skb);
 
 	rcu_read_unlock();
Signature · 1 line
2.28.0