Commit 36a6f566 authored by Fabian Frederick's avatar Fabian Frederick Committed by David S. Miller
Browse files

gtp: use dev_sw_netstats_rx_add()



use new helper for netstats settings

Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Acked-by: default avatarHarald Welte <laforge@gnumonks.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8fdfffd0
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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;