Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3807179pxu; Mon, 12 Oct 2020 01:23:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVCMkQ423xIGX0ApZTQo/GqEqEWE2DMJOMSM33o8Ck3VoUYOlSPyBYSurI3oaFbUdXSEbe X-Received: by 2002:a05:6402:d3:: with SMTP id i19mr13067711edu.320.1602490994263; Mon, 12 Oct 2020 01:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602490994; cv=none; d=google.com; s=arc-20160816; b=fludxW+NACPKdtvi02GKIgqsZ2D813JxvMZhGVEhE8PruQLKm4oH9gP5QS5V+LB9Mh 8fynxOTQXyNvXkjUpvTfRCSY4yTsY9Ji+3zoCqaA4+OX5ADl2noUwvgK3AikvDQzx21b YwwiSSSKd6eMFzLWWzd5HEuApUlASqU4op3BN2zXQmcdUabvYNMTkREE/s9O71pAMJj6 uZxdmBkvkEI+B8C0VMOsNpIg9mdal/vkHL6fUFKa0oOTJ2tBkPi0DX80niLyN0ZTTy25 AM7xEhjtSdjbJpLqv7eysyvpNuPQXY0eLksCI2F1YvIl3rHifXP3gmIirVgSxV8qt5cA oGUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=QgEFAZvIGUs9d79dSBvM16GKW6VzPnxLl+Fxh+U3V5E=; b=D8EbpbgqhVL3C2MxxIeyyDLPuJog/DzNbFD2mcrpAwgv6kGYO9FjJFLGv8d+VQIYWj yywNMkKbUki6nYi5/IMhEGsk6RKHG9v+BLyKeREUOJ8uqFaZX1w4OLCT2fqVKoFteJS/ 108yMYN6steIEkYFDiX188N0yWEX5O2xWLx2YkuDUzzzy8dLvlNi/mFcH8dnHY79I8fr lRuydCD1vLGT4NHNNqIr0vg6gXy7k93I+gZxdJcenzcMzO1T4j6276TgybAx64Wc+Ls7 gUUoAfyuNh/V5M5zC+YAMyN1lr9DiWDWGy8tCKYMASu34f5UppgGnKeoJMyd6Z146L0L ESbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=smMjqkLU; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 b19si12057417edw.132.2020.10.12.01.22.50; Mon, 12 Oct 2020 01:23:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=smMjqkLU; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S1727879AbgJLIWC (ORCPT + 99 others); Mon, 12 Oct 2020 04:22:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727350AbgJLIVv (ORCPT ); Mon, 12 Oct 2020 04:21:51 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2914EC0613D0; Mon, 12 Oct 2020 01:21:51 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id p15so21971920ejm.7; Mon, 12 Oct 2020 01:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=QgEFAZvIGUs9d79dSBvM16GKW6VzPnxLl+Fxh+U3V5E=; b=smMjqkLUc83TdlNXcDcI3M3/ULwnTf55iu2dvwq3DZB3ijaghGEg1QucVM48Q59Xei PhCJRKNkGb6mEr/MRzSqyVNV4fflsAxkglH2EZ7WsMPP0qYCAMMKkJfrlb0Te3v932Kj u04qGb9yhQ1k2CE2QwduucTZPxyUTXc6f7vZLCvLmEUzn/FDxBGxmAIpH705hS2LrQ/+ +SOYOqNpqZrunAzwqopXYlPOD0/GDk4BgwqEYxQYMykZ+qxKMd/llLUBmr2yahu1s5mQ T/ll3jwrsNZlgaP76L6IGirBg7GpdPamcuyboxa4oE4J03+nQ3j2KUDK6SR2oN8ZurC5 kFvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QgEFAZvIGUs9d79dSBvM16GKW6VzPnxLl+Fxh+U3V5E=; b=jvsQO+bCRycEugMQ7gPDYNqZXlnjLP1T1TMwhWDwxWtKcTresq5f86KiL7BEjKijo8 LKmkiiQp903+aF08ZRqqWU435vsmqO3HEWBcminolpODrImgacWDz0qoDJi2ADMUSfrR rd8PKjd+TkTMMrGm6W1SUOpLw69/8aIq9ThmvsxcrmtQdRFlE9XPMAZe/2NH5cZGgCa3 TJvCZrHsK8Op1z2kunkRG7yVG1dfF21j5MdrrI7GUDQWzON1gTDrA6KOOzHpdYPWp9mn HVXFq4EaJtZBXuArXY0+MYYlgeAwHBlzuPgdXUyfcDY+otUQrrEZ471foCoqm6wJEQYE er7w== X-Gm-Message-State: AOAM532/ALYxLVzAqhDtbErsXOcYNX4OJy4mrqHCbQd2fyJ3TyNvUw7n gJw05run25BZA4l8bBB67lk= X-Received: by 2002:a17:906:82d7:: with SMTP id a23mr27024407ejy.66.1602490909845; Mon, 12 Oct 2020 01:21:49 -0700 (PDT) Received: from ?IPv6:2003:ea:8f00:6a00:f90c:2907:849f:701c? (p200300ea8f006a00f90c2907849f701c.dip0.t-ipconnect.de. [2003:ea:8f00:6a00:f90c:2907:849f:701c]) by smtp.googlemail.com with ESMTPSA id v6sm10439545ejj.112.2020.10.12.01.21.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Oct 2020 01:21:49 -0700 (PDT) Subject: [PATCH net-next v2 06/12] qtnfmac: use new function dev_fetch_sw_netstats From: Heiner Kallweit To: David Miller , Jakub Kicinski , =?UTF-8?Q?Bj=c3=b8rn_Mork?= , Oliver Neukum , Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Roopa Prabhu , Nikolay Aleksandrov , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Alexey Kuznetsov , Hideaki YOSHIFUJI , Johannes Berg , Pravin B Shelar , Steffen Klassert , Herbert Xu Cc: "netdev@vger.kernel.org" , linux-rdma@vger.kernel.org, Linux USB Mailing List , linux-wireless , bridge@lists.linux-foundation.org References: Message-ID: <166259f2-084c-45d7-e610-2de2a0bdae06@gmail.com> Date: Mon, 12 Oct 2020 10:14:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit Acked-by: Kalle Valo --- drivers/net/wireless/quantenna/qtnfmac/core.c | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 374074dc7..bf6dbeb61 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -139,34 +139,13 @@ static void qtnf_netdev_get_stats64(struct net_device *ndev, struct rtnl_link_stats64 *stats) { struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); - unsigned int start; - int cpu; netdev_stats_to_stats64(stats, &ndev->stats); if (!vif->stats64) return; - for_each_possible_cpu(cpu) { - struct pcpu_sw_netstats *stats64; - u64 rx_packets, rx_bytes; - u64 tx_packets, tx_bytes; - - stats64 = per_cpu_ptr(vif->stats64, cpu); - - do { - start = u64_stats_fetch_begin_irq(&stats64->syncp); - rx_packets = stats64->rx_packets; - rx_bytes = stats64->rx_bytes; - tx_packets = stats64->tx_packets; - tx_bytes = stats64->tx_bytes; - } while (u64_stats_fetch_retry_irq(&stats64->syncp, start)); - - stats->rx_packets += rx_packets; - stats->rx_bytes += rx_bytes; - stats->tx_packets += tx_packets; - stats->tx_bytes += tx_bytes; - } + dev_fetch_sw_netstats(stats, vif->stats64); } /* Netdev handler for transmission timeout. -- 2.28.0