Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1947690imm; Sat, 18 Aug 2018 07:45:47 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz8CT8N8UIkjvdWVkqgmS0cWbPiRAliXvtl8yg+VMMQOGELYwq5dQiY0wvnnpwz6U+jknpj X-Received: by 2002:a63:cf4a:: with SMTP id b10-v6mr37143904pgj.235.1534603547350; Sat, 18 Aug 2018 07:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534603547; cv=none; d=google.com; s=arc-20160816; b=sXFuSi71E0f+WQfd/hZjLRa/ImJEio8zH9W9RKVV76pnM1r6+4BksNaftbHgR37AT3 dbiInbQ6RE593XB+21MCK7qoKyma2e6/Us5nE+DbkF+cmnKhZqTBuYrrgFPWdD3AVvRb UJlqSirtV9sAGH4LyXpaMbfQ2RCqXwYpqc+WwKuvntmWoLsbythi8+bsZvgBn8ZZ3m17 zpfkCdvl3D3UDEgdVH/VE/0E7VnC8fRoF2iOaSPrBqse6bnKB5HDgeZKbaowYq1PSktL VzKeN3WQAxiceRVa80HaXjOTkpTYpULU8hkzw/16y1dLH/NdFOilaYGZob4RhqxSL9a5 J6tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6WG1P/2fEsxGeOWGWWEveEFRqW/51yVmmYy4YMjHkjQ=; b=pUJmvxZCR+KigWUTcdSoSCK/97Y8zqOkIF7dTiOS4snI012yRsSHLs48mGZfLQtB+j ISQWOr5NtULYGeVVEW6m9KRn7ZW2mYf65RbvHHbDaEsX3lpE7XvLhNFpxuf0NpGE1iAn b41sPpqJ/rhyNJr7c1BHQvdr1zzmNop3ITYN04O4FM66CxQAKL0KuRG8yvEiiF2YemXm ToEM+3/0OoAM9tm3x5WI6ccDLcMCIkZLNu/qPS6B3aQv7Tqssa/UOVVmrJbGs4Rm2GLP ms5wsgX/wPoDH7UGCV7KyUab7Hi0fouXMvgA31yPhLWdrmrEJoWbnBh2ZOZ32MjIZOC3 kX6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b39-v6si5072537plb.484.2018.08.18.07.45.29; Sat, 18 Aug 2018 07:45:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726456AbeHRRwM (ORCPT + 99 others); Sat, 18 Aug 2018 13:52:12 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:10417 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbeHRRwM (ORCPT ); Sat, 18 Aug 2018 13:52:12 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.7]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec5b7830b1c1a-4c506; Sat, 18 Aug 2018 22:44:05 +0800 (CST) X-RM-TRANSID: 2eec5b7830b1c1a-4c506 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.240]) by rmsmtp-syy-appsvr04-12004 (RichMail) with SMTP id 2ee45b7830b4741-b6e71; Sat, 18 Aug 2018 22:44:05 +0800 (CST) X-RM-TRANSID: 2ee45b7830b4741-b6e71 From: Haishuang Yan To: Steffen Klassert , "David S. Miller" , Alexey Kuznetsov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH] ip6_vti: simplify stats handling in vti6_xmit Date: Sat, 18 Aug 2018 22:43:48 +0800 Message-Id: <1534603428-30425-1-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Same as ip_vti, use iptunnel_xmit_stats to updates stats in tunnel xmit code path. Signed-off-by: Haishuang Yan --- net/ipv6/ip6_vti.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index c72ae3a..65d4a80 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c @@ -503,17 +503,9 @@ static bool vti6_state_check(const struct xfrm_state *x, skb->dev = skb_dst(skb)->dev; err = dst_output(t->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 += pkt_len; - tstats->tx_packets++; - u64_stats_update_end(&tstats->syncp); - } else { - stats->tx_errors++; - stats->tx_aborted_errors++; - } + if (net_xmit_eval(err) == 0) + err = pkt_len; + iptunnel_xmit_stats(dev, err); return 0; tx_err_link_failure: -- 1.8.3.1