Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3807407pxu; Mon, 12 Oct 2020 01:23:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBVi4AoFPlZZJ/mOyfWscQmxJB2Q7Jby4wp1xVtflf834sEOBdH1dfV9PLboeXPYsSpMgF X-Received: by 2002:a05:6402:8:: with SMTP id d8mr12480826edu.15.1602491021777; Mon, 12 Oct 2020 01:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602491021; cv=none; d=google.com; s=arc-20160816; b=pmJq8jsI12Pw9pY3BzQH8aR1Dlf/yJJgxVhTOzQqb3oEoHfKcvvfzX3S85dDuh3fPN NLV4R7hBtaV+eRf/WPgGyBjpzJbjHMYdCO//Tc36kNdUJMFwp7aTfWlrn9zylXAe2j2e UulabuPVJAHVxdImmNe2q9W/szH8GvFhL2Ojpfmki74vSSzV3Q+YXb14Q4NfUmZMMSr0 AQKJm3eMsrtXJ3EBRG9FZCe6u2/qB8N/7Gj5H50wHIuokg26FiOoY7PkqBM3u753sGw5 1Dxhsd3DETAvvLZAhyh0guC+QzgRXoBNVtP4BFLXeqpzAddbJtBvNMyxfduCnXFrs9En 44dQ== 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=m4bUmyI+LcL2kRpVckxE5LM+etyYjhNnBeXZhGHIk4E=; b=GHaJNmVRRQUTXt9Czj3etSwLRuv+10ifxLG4FDLL2DeCoin1/V8HLQLgQzABwgjg+N Ds+I8C2lb8KXEH1WoYuw1paWpyhxAfbFxG80nueF0qKCRaGVPIymjWOGP7qCcDuxF5h5 Q9yF8I/CIq2kLwQwurilFBXsYxe5UrQNBlOGys+0/0VZ9qm/v+zKb4nCjNtKNjS+iJZy U0Vqx2uAXr/fJ+O3JcIwoGPUGpp1Pqa8I+H5q5L2bLNLNS7d2E4hcB/EjQZ5G2MD9Gw+ uaEZU4PXoIiTSFTnqgMqvHEVPoJ6lQLPI0qxn6KBOLloInvvQXBha21cIjLkosdJxU+m nuFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lDYtJfWe; 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 lt22si11633460ejb.30.2020.10.12.01.23.17; Mon, 12 Oct 2020 01:23:41 -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=lDYtJfWe; 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 S1728594AbgJLIWR (ORCPT + 99 others); Mon, 12 Oct 2020 04:22:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbgJLIV5 (ORCPT ); Mon, 12 Oct 2020 04:21:57 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8138AC0613D5; Mon, 12 Oct 2020 01:21:57 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id t21so15989107eds.6; Mon, 12 Oct 2020 01:21:57 -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=m4bUmyI+LcL2kRpVckxE5LM+etyYjhNnBeXZhGHIk4E=; b=lDYtJfWe8/DHmjC4qnf5MwRbdeN5hvaFN8hfqDPHJ+0ZfSsAgJJ/eXIwbH/bAiyviA aryMIMTmub/a4wvpBSrINDW0mgGtW14oQkcmg7cHioMBNYxSeFVJEVppU4CZN/z3pgYi yCFSGrnv7HyvCgvGS3/K6wNcJVNLfuuY8v8uzjSvqKU8yTWDfejU2Bd9+zFdG60zZczq jBuK8KZCwLWlL18mrCzoRXzYxMqfYb9GBbaRMEFJXupAYO/QmQVPMGU2VtefsbCISeUd mBdf8EcSNS2NDXdJN9FOMUgC0woGLf6i+BjyF8u1bEQoHHPT7PqN5ajYLcMBnPcAUc/e zu1A== 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=m4bUmyI+LcL2kRpVckxE5LM+etyYjhNnBeXZhGHIk4E=; b=UTRTkAomygHoW5iGH9Vkd4NTYLYV1V/qtn02REzoV94KyPuyPwGxMEl5F0HiKPhCK8 jB9icw74/Mmb8K9v7ppg/L0ZuGDFxxXhhK/PYOxpb8Bjp/jOvv91BbrTtiRVMmCc1cBU 65uWztXjlIYlbg4s7/m/qFG1THfv17kAfh0yrqjsGKVn5KGWozO/AP54w17rESIJR2jG Zz4eNvpW+MP5RoK5PP1ZpIjeusUbB6VW8lsA7v5nApV9kvyzT8LxJZBhi0+6ecxE+2EJ DUcIBTW6PSx9TIFZAfO8I8bxwBaGnIDFIavIMOeAxPy/4MxuQcwLvNMZytheD1MEKbab //pw== X-Gm-Message-State: AOAM530utoZPqvE81PtfuIH1o3svWQFjX77RNfbLmrMGTvLwJ9IrYMko hhgvlgZ+5SFe5qPwPAI7CBA= X-Received: by 2002:a50:c05b:: with SMTP id u27mr12607356edd.290.1602490916179; Mon, 12 Oct 2020 01:21:56 -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 j10sm10013041edy.97.2020.10.12.01.21.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Oct 2020 01:21:55 -0700 (PDT) Subject: [PATCH net-next v2 10/12] mac80211: 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: <93dda477-70ae-0ccf-71b4-bfebb66c9beb@gmail.com> Date: Mon, 12 Oct 2020 10:18:19 +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 --- net/mac80211/iface.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 240862a74..1be775979 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -709,28 +709,7 @@ static u16 ieee80211_netdev_select_queue(struct net_device *dev, static void ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) { - int i; - - for_each_possible_cpu(i) { - const struct pcpu_sw_netstats *tstats; - u64 rx_packets, rx_bytes, tx_packets, tx_bytes; - unsigned int start; - - tstats = per_cpu_ptr(dev->tstats, i); - - do { - start = u64_stats_fetch_begin_irq(&tstats->syncp); - rx_packets = tstats->rx_packets; - tx_packets = tstats->tx_packets; - rx_bytes = tstats->rx_bytes; - tx_bytes = tstats->tx_bytes; - } while (u64_stats_fetch_retry_irq(&tstats->syncp, start)); - - stats->rx_packets += rx_packets; - stats->tx_packets += tx_packets; - stats->rx_bytes += rx_bytes; - stats->tx_bytes += tx_bytes; - } + dev_fetch_sw_netstats(stats, dev->tstats); } static const struct net_device_ops ieee80211_dataif_ops = { -- 2.28.0