Skip to contentSkip to conversation

xfrm: use dev_sw_netstats_rx_add()

PATCH In review Fabian Frederick 2 participants 2 messages Oct 5, 2020

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

PATCH 7/9 xfrm: use dev_sw_netstats_rx_add()

use new helper for netstats settings

---
 net/xfrm/xfrm_interface.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
net/xfrm/xfrm_interface.c +1 -8
index eb8181987620d..8f8631eafe784 100644
@@ -210,7 +210,6 @@ static void xfrmi_scrub_packet(struct sk_buff *skb, bool xnet)
 static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
 {
 	const struct xfrm_mode *inner_mode;
-	struct pcpu_sw_netstats *tstats;
 	struct net_device *dev;
 	struct xfrm_state *x;
 	struct xfrm_if *xi;
@@ -255,13 +254,7 @@ static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
 	}
 
 	xfrmi_scrub_packet(skb, xnet);
-
-	tstats = this_cpu_ptr(dev->tstats);
-
-	u64_stats_update_begin(&tstats->syncp);
-	tstats->rx_packets++;
-	tstats->rx_bytes += skb->len;
-	u64_stats_update_end(&tstats->syncp);
+	dev_sw_netstats_rx_add(dev, skb->len);
 
 	return 0;
 }
Signature · 1 line
2.28.0