summaryrefslogtreecommitdiff
path: root/drivers/net/gtp.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2020-10-05 23:35:46 +0300
committerDavid S. Miller <davem@davemloft.net>2020-10-06 16:23:21 +0300
commit36a6f5667925f7621afdcd482eb3bdda1bd5f9b6 (patch)
tree0c5976079c5861ae9a0d17c8bcedf946fdeb3ee3 /drivers/net/gtp.c
parent8fdfffd0b97a0f1e46618afad7e24ebf889952c4 (diff)
downloadlinux-36a6f5667925f7621afdcd482eb3bdda1bd5f9b6.tar.xz
gtp: use dev_sw_netstats_rx_add()
use new helper for netstats settings Signed-off-by: Fabian Frederick <fabf@skynet.be> Acked-by: Harald Welte <laforge@gnumonks.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gtp.c')
-rw-r--r--drivers/net/gtp.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index c09fe18c6c52..030a1a5afe05 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -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;