Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp263318pxb; Thu, 12 Nov 2020 03:16:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUBwMDTsaxEB+he5hIbVVqPA4zO0hamClvI6mYRmXdYG7lBAnzyqHbOMI3zjHSvQ3aCvNc X-Received: by 2002:a17:906:cd0f:: with SMTP id oz15mr30233574ejb.228.1605179811117; Thu, 12 Nov 2020 03:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605179811; cv=none; d=google.com; s=arc-20160816; b=SuWNBfBqhnCkYSH1N9/KQfcBCJpOr6FO/jtGI4SRyxeVwP4iraWbr6FrZRDkc2Bt0H nw4YQu2Az+RfAe9KkPM1VCV4Jdj2wtwx7BWbg/zXPxKo9ZTVDEBOuyKh735NkOlfK6WL T8R/SvnFPzXc3MT4rK/h2/fdBUKOa337964+/Smx1XpCuu8FxyQmXHkTril0cPNW+jHN tfE59k1dhNyQ3KArKFk2aa/MLSdkUnUOg9YTByEdxiIvSHiSG6vUJbcfGAmFBrEcdcSq H/JMgAzqIr4Dps/bKQdWRQmTmsaQCObS/mePevYULUjmf8B5vg4Ay8dc8G5WxS9AmjwL HHGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=BdT6UiNPeuKqH8weoNwVCRBG/yR7CRLpN9ozhwUo2p4=; b=BG114bXa8jpIh0UjC16+pkqum1RpDITs0cfAmZv9VtJsV64aimuCQN93vsjmE5IwR1 7+Ed/gshnHi3G4l/W9b8vdnfZp7Qd45+TKzsIS8nz2fkexBjjZZfWwWLXUQj7/IupxrC rj+hCfIvmrDAUiiaeeplHfcKTBin04EsCppcjslsN3eMrW6qExWzkduvr35rVDGyRrkH mIzSUVKXGauo/C10jwy475j/4x+bGGT7Dmi4Ajk5n9dFUH/p8hU83fSjn1Sjp9Vq9LZV NYgREFNycUpWhLCQwYbn6y9oz71dEmBmqbZdY9QUsgVhI3/TFkObAiVygcGlh2059j10 5Img== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="CWvGy/v/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si3346923eji.106.2020.11.12.03.16.28; Thu, 12 Nov 2020 03:16:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="CWvGy/v/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727916AbgKLLPB (ORCPT + 99 others); Thu, 12 Nov 2020 06:15:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725902AbgKLLO7 (ORCPT ); Thu, 12 Nov 2020 06:14:59 -0500 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98FA9C0613D1; Thu, 12 Nov 2020 03:14:59 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id o15so5574391wru.6; Thu, 12 Nov 2020 03:14:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BdT6UiNPeuKqH8weoNwVCRBG/yR7CRLpN9ozhwUo2p4=; b=CWvGy/v/GU7OHushkVvX56H3IaS6FKG8pyx/X+YqcOp9oaaezrCjjLasjjH1D35+9m MilQAHvGkyk8HKcOaqWHs3wpfXrSWwyIu/jGGx4wTfYBYMuyII5yyjZpljpe/ro2xM/u W/2M5nxFK/XE38eaU4xPIbHM6IKHJomulVEG94/yKSozBrTUzA1ehI3hrQ3KFs2nnMfk NOcqeqDlX5t41Q9Pso0a+oVTv8b9yrG3SgW7w3XPkI7cy/wD8eGFRhuZKTuGjkbfR37b hhO8WM5LBXDvYV8D0w6hDfxndE9/B+Ct70PGgciubZmT/vi4lSEP+uMIgYj3CZk7tVTG Yt3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BdT6UiNPeuKqH8weoNwVCRBG/yR7CRLpN9ozhwUo2p4=; b=sfD5rtBCY597MEO5PgJKwZU/sSe3Yjpj0xePrYhD6N/gd1f4HLSEm5p1ySS1N3UCyz AuJnbxmS/FLTVCp9CCq41Fx2Et5+oNtidTgPxEsaN3SapryrD1nUKp88ubd3ia4ahi0q sLdIQHJJZVZhN346qxxYM1CHvKHb3X8Yr4AxbWM3gGXsWfe/eBu7Ip76Uxlw9rzOjBNR F/Arc+XzLf7NglDxKiWDGwvkxV3KT66H8pdRM8A1cKhuLa0uS19zaB5ewFYhQKUkUpcA i3ZBB7DlTKjHNqd7yAAqJyOTX55GX6jI6CTTuSEqaiT5pR779/TRIoGaRbny5AZjgG52 mnzw== X-Gm-Message-State: AOAM5309A0CaelQF8ESQU81HIV/9ktXlAFZHTyrNHVv5YFwlqqgipo0J N02HR6dHYPyDjwuEU7gz3iU= X-Received: by 2002:adf:fec5:: with SMTP id q5mr22107443wrs.245.1605179698195; Thu, 12 Nov 2020 03:14:58 -0800 (PST) Received: from ubux1.panoulu.local ([2a00:1d50:3:0:1cd1:d2e:7b13:dc30]) by smtp.gmail.com with ESMTPSA id t13sm6563447wru.67.2020.11.12.03.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 03:14:57 -0800 (PST) From: Lev Stipakov X-Google-Original-From: Lev Stipakov To: Steffen Klassert , Herbert Xu , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lev Stipakov Subject: [PATCH 3/3] net: xfrm: use core API for updating TX stats Date: Thu, 12 Nov 2020 13:13:45 +0200 Message-Id: <20201112111345.34625-1-lev@openvpn.net> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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