Skip to content

Commit c852162

Browse files
Fabian Frederickdavem330
authored andcommitted
xfrm: use dev_sw_netstats_rx_add()
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>
1 parent 5711eb0 commit c852162

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎net/xfrm/xfrm_interface.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ static void xfrmi_scrub_packet(struct sk_buff *skb, bool xnet)
210210
static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
211211
{
212212
const struct xfrm_mode *inner_mode;
213-
struct pcpu_sw_netstats *tstats;
214213
struct net_device *dev;
215214
struct xfrm_state *x;
216215
struct xfrm_if *xi;
@@ -255,13 +254,7 @@ static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
255254
}
256255

257256
xfrmi_scrub_packet(skb, xnet);
258-
259-
tstats = this_cpu_ptr(dev->tstats);
260-
261-
u64_stats_update_begin(&tstats->syncp);
262-
tstats->rx_packets++;
263-
tstats->rx_bytes += skb->len;
264-
u64_stats_update_end(&tstats->syncp);
257+
dev_sw_netstats_rx_add(dev, skb->len);
265258

266259
return 0;
267260
}

0 commit comments

Comments
 (0)