Skip to contentSkip to conversation

gtp: use dev_sw_netstats_rx_add()

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

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

PATCH 5/9 gtp: use dev_sw_netstats_rx_add()

use new helper for netstats settings

---
 drivers/net/gtp.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/net/gtp.c +1 -7
index c09fe18c6c52d..030a1a5afe05a 100644
@@ -182,8 +182,6 @@ static bool gtp_check_ms(struct sk_buff *skb, struct pdp_ctx *pctx,
 static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb,
 			unsigned int hdrlen, unsigned int role)
 {
-	struct pcpu_sw_netstats *stats;
-
 	if (!gtp_check_ms(skb, pctx, hdrlen, role)) {
 		netdev_dbg(pctx->dev, "No PDP ctx for this MS\n");
 		return 1;
@@ -204,11 +202,7 @@ static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb,
 
 	skb->dev = pctx->dev;
 
-	stats = this_cpu_ptr(pctx->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(pctx->dev, skb->len);
 
 	netif_rx(skb);
 	return 0;
Signature · 1 line
2.28.0
maintainer Acked-by on v1 5/9
#1 lore raw
Quoted 1 line · Fabian Frederick

use new helper for netstats settings

Signature · 4 lines
- Harald Welte <[email protected]>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)