Skip to content

Commit

Permalink
ipv6: use dev_sw_netstats_rx_add()
Browse files Browse the repository at this point in the history
use new helper for netstats settings

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Fabian Frederick authored and David S. Miller committed Oct 6, 2020
1 parent 36a6f56 commit 5711eb0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/ipv6/ip6_vti.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err)
{
unsigned short family;
struct net_device *dev;
struct pcpu_sw_netstats *tstats;
struct xfrm_state *x;
const struct xfrm_mode *inner_mode;
struct ip6_tnl *t = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6;
Expand Down Expand Up @@ -390,12 +389,7 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err)

skb_scrub_packet(skb, !net_eq(t->net, dev_net(skb->dev)));
skb->dev = dev;

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;
}
Expand Down

0 comments on commit 5711eb0

Please sign in to comment.