Skip to content

Commit

Permalink
xfrm: 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>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
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 5711eb0 commit c852162
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions net/xfrm/xfrm_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ static void xfrmi_scrub_packet(struct sk_buff *skb, bool xnet)
static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
{
const struct xfrm_mode *inner_mode;
struct pcpu_sw_netstats *tstats;
struct net_device *dev;
struct xfrm_state *x;
struct xfrm_if *xi;
Expand Down Expand Up @@ -255,13 +254,7 @@ static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
}

xfrmi_scrub_packet(skb, xnet);

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 c852162

Please sign in to comment.