Commit d3fd65484c781 ("net: core: add dev_sw_netstats_tx_add") has added
function "dev_sw_netstats_tx_add()" to update net device per-cpu TX
stats.

Use this function instead of own code.

Signed-off-by: Lev Stipakov <l...@openvpn.net>
---
 net/xfrm/xfrm_interface.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index 9b8e292a7c6a..43ee4c5a6fa9 100644
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -319,12 +319,7 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, 
struct flowi *fl)
 
        err = dst_output(xi->net, skb->sk, skb);
        if (net_xmit_eval(err) == 0) {
-               struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
-
-               u64_stats_update_begin(&tstats->syncp);
-               tstats->tx_bytes += length;
-               tstats->tx_packets++;
-               u64_stats_update_end(&tstats->syncp);
+               dev_sw_netstats_tx_add(dev, 1, length);
        } else {
                stats->tx_errors++;
                stats->tx_aborted_errors++;
-- 
2.25.1

Reply via email to