From patchwork Mon Oct 5 20:35:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 288970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC834C4363A for ; Mon, 5 Oct 2020 20:36:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2E0E21548 for ; Mon, 5 Oct 2020 20:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729126AbgJEUgM (ORCPT ); Mon, 5 Oct 2020 16:36:12 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:49467 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgJEUgM (ORCPT ); Mon, 5 Oct 2020 16:36:12 -0400 IronPort-SDR: iyoHWhF0CvKnOQjjHNp6VQqthifw0gpxVK6tEJ5Iwp4D0TcgwJmU4yOkhhiVkKVEejjG0FfAjF pYEflkJdiyF0k7bUBJJXQxBZtGCH7vSG4G1T263Wrppuu+tscmDhF9k1qRmPIHBQSgPcwKOTh2 zBy7uht0P9k88k4Yk3dvNmgEO4yDmHMZw6xT7FX9l9A2Y8ysBhxX424gNe/a1uwO3OrRMtsPlp +Z0lYDEC1val80y85LD8VNrlLokE1QlfEUdovlIry5WTxTvlPfcTQYNO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cq/eXjjXwnll8He6mmw58XZGq/HvR8LEWTeWDsjcsZEWcWogo+S/TniFucXj5Penm9Qbw86yolCIKpE4jDXJqhgL+f0yehGJ1ZeGRGBkqLEXfyeIWOQ+0MZz6KIs99jjwEUqCsS5c72h61sA/6zKFqLuzK9S0Eu5Lj1dx15/HNmhEo7zB0CN6d026VRWFugmwIXyM23Lx4oUFlzleMy6Z4g/tCFdxc+fxESQg6NZjBz+x/DNDyXAHBfsyTRFahWNWmDik7TsgtzN8Wf0Z9B9KigwjN3yWwGLAVmaeGBIc38qPc2Xj+Odp9x2zd26Y/3BEaRZ5DPHOrg4Zz/hbeAorOnVnfkau2MewfwSTE3GSO12yDuAdfSgE0GaPIQXwSeGPIotnjoEDPVbmjDfIgKAQS59SFL/5kY9fohFMOau3uNNnEYmmy0zO+DByG7qiPfYznZyMX0XOOWwA/jwkP8CPeZkAFDSC7rjeGAQ== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DgAgDggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUiBHoJRX40/klaKWYctCwEBAQEBAQEBATUBAgQBAYRKgjsmOBMCAwEBAQMCBQEBBgEBAQEBAQUEAYYPRYI3IoNHCwEjI4E/EoMmglgpqhczhBCBRINHgUKBOIgyhRqBQT+EX4o0BLdNgnGDE4RrklQPIqEfLZJnoimBek0gGIMkUBkNnGhCMDcCBgoBAQMJVwE9AY0yAQE X-IPAS-Result: A2DgAgDggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUiBHoJRX40/klaKWYctCwEBAQEBAQEBATUBAgQBAYRKgjsmOBMCAwEBAQMCBQEBBgEBAQEBAQUEAYYPRYI3IoNHCwEjI4E/EoMmglgpqhczhBCBRINHgUKBOIgyhRqBQT+EX4o0BLdNgnGDE4RrklQPIqEfLZJnoimBek0gGIMkUBkNnGhCMDcCBgoBAQMJVwE9AY0yAQE Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 05 Oct 2020 22:36:10 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: pablo@netfilter.org, laforge@gnumonks.org, Fabian Frederick Subject: [PATCH 5/9 net-next] gtp: use dev_sw_netstats_rx_add() Date: Mon, 5 Oct 2020 22:35:46 +0200 Message-Id: <20201005203546.55332-1-fabf@skynet.be> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org use new helper for netstats settings Signed-off-by: Fabian Frederick Acked-by: Harald Welte --- drivers/net/gtp.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index c09fe18c6c52d..030a1a5afe05a 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -182,8 +182,6 @@ static bool gtp_check_ms(struct sk_buff *skb, struct pdp_ctx *pctx, static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb, unsigned int hdrlen, unsigned int role) { - struct pcpu_sw_netstats *stats; - if (!gtp_check_ms(skb, pctx, hdrlen, role)) { netdev_dbg(pctx->dev, "No PDP ctx for this MS\n"); return 1; @@ -204,11 +202,7 @@ static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb, skb->dev = pctx->dev; - stats = this_cpu_ptr(pctx->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += skb->len; - u64_stats_update_end(&stats->syncp); + dev_sw_netstats_rx_add(pctx->dev, skb->len); netif_rx(skb); return 0;