Skip to content

Commit 5711eb0

Browse files
Fabian Frederickdavem330
authored andcommitted
ipv6: use dev_sw_netstats_rx_add()
use new helper for netstats settings Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 36a6f56 commit 5711eb0

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

‎net/ipv6/ip6_vti.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err)
347347
{
348348
unsigned short family;
349349
struct net_device *dev;
350-
struct pcpu_sw_netstats *tstats;
351350
struct xfrm_state *x;
352351
const struct xfrm_mode *inner_mode;
353352
struct ip6_tnl *t = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6;
@@ -390,12 +389,7 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err)
390389

391390
skb_scrub_packet(skb, !net_eq(t->net, dev_net(skb->dev)));
392391
skb->dev = dev;
393-
394-
tstats = this_cpu_ptr(dev->tstats);
395-
u64_stats_update_begin(&tstats->syncp);
396-
tstats->rx_packets++;
397-
tstats->rx_bytes += skb->len;
398-
u64_stats_update_end(&tstats->syncp);
392+
dev_sw_netstats_rx_add(dev, skb->len);
399393

400394
return 0;
401395
}

0 commit comments

Comments
 (0)