Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3661174pxu; Sun, 11 Oct 2020 19:13:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPqZo5OLLu3Ja4I4I3X/LFF0I1zaUxBuMP4XBvMSWzkV62LBy0yVpt6Azob9cuntb53wPd X-Received: by 2002:a17:906:1418:: with SMTP id p24mr8669022ejc.46.1602468807984; Sun, 11 Oct 2020 19:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602468807; cv=none; d=google.com; s=arc-20160816; b=Nz/I1hVd7Ie6GP6dMijqScBqsctOx3/zwTOkM6FN6TVFu0YozzVW14jdfKqFZ1IRLQ RCC0dw6DhI+b4fxrHHWM7WRvuKe+C4LRjVZVhGcPociJ6HdBRmpOgFDBQQMyEtdNEXaK dpqLeKzh3UnteT78qZ3cFrmdGPlLYg2tcLhb3ikp4nABVEraCe6tMnOQtLRrt5TSwSF8 a2+73Zb5IeuZb7mor1TMVYvYTBKKCMNBBKTjaTy32Lr4Us0dPX/tJ6eOHP8MjP/BwcWZ 3SmSWpr70ZEppJhXyvPqbzmiw7LfJSu+z5+6FXZKfnb7Yc72/tm4Bo7AA9vUEzDXcBax UQRQ== 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=aV1L6wUlsDJ417K+vWkxd9PqzQtaTsmN6jk9saEo5uyWqA6w95j5ztnii6sTqw4Ftw dRX+hrptpwzbL8S0ZSX4oUyv/vtsFPIPKhk3PScXL919EGt8dg/JUaxOHn1LGpJxOb6z JGtWzV64CuwAATkFKAx1Qs9BPTr9W1ghf35TjVKkqzCA/xOu+n5/+DHvK+UazPNhkO7C 884G4DdGuJ+Sv9Dk733PkgWx+CH9VTlWKpY1sWyvWRrKdzOJy0Wb8XHdWEZy9SR2XBzX infOpV0zP02lQpZhFK+fCbnQu77rzF5TYTCg4MoMWZWmgA7buRbs3w61OPD9kL7NUVi6 Wv4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JUFyhhlZ; 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 g23si11254512edh.164.2020.10.11.19.13.04; Sun, 11 Oct 2020 19:13:27 -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=JUFyhhlZ; 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 S1729023AbgJKTpF (ORCPT + 99 others); Sun, 11 Oct 2020 15:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727001AbgJKTom (ORCPT ); Sun, 11 Oct 2020 15:44:42 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68809C0613D1; Sun, 11 Oct 2020 12:44:42 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id c22so20364789ejx.0; Sun, 11 Oct 2020 12:44:42 -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=JUFyhhlZn+ptpsepXb1APxQLXmKc+A0UsqSaItDHceRBS1uFfQtykf8t35FDOfwehx BjY3ka/KZKHhmzb3hJq4RTqP9Vf7yO1TZtFwKQJZOp5365c7oUF9WlXHLeLPsyeWW1Y1 Il2+Koe5lEP4rCOvaECTtv7h1u2kkfEaong9M1gEfRlHvDeNQ6fFbuG2jN6t0SmAm1iY MZtLjBE3JtV6R6gckMWLqd4awrHduTa63Nvyy3I1zvyEIsQYxghczsg8OkUKJ/wHv1+Z PzNWuc0OB7oUfG7q7TILqqsQVaXhCtVC/dEbI3JyGy+Wj2kM0dS3BhArtpvOxozdV45q OgTA== 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=gKaH/AgO0eEGnDLsMFV8/2uhcUKee7lfXS9EXNa5MHaFdf+rWNfsdKgDJO+quLBaa0 vlkUkhxHN61E4HG0CPeZVLiIlu0IDOPh7hOSfhSNQfS9MWoYRdJeONr/l90KEZH0Ypat 67ON97QjBgc5nvgomfPo0yoeK2s16kKYmQWngFTsny/p0pYzwi/L6TSRhJ5dn3rrID/Q zNdLh1Ycf+++o3ZrD161ft5lD8fPov+n2NAwCHRhbS09FXR+LD22MX2wlcuda5t+Jt7g cVIC3Gn9eTzTDqzBmyuMBewIcvKz+AFKIgmI4eVkvLYgbYgTciY90zF+uXE+YyDxl0kr 9kcA== X-Gm-Message-State: AOAM5319IFh4SF61tF7wDhzRSwOxJIdXNG2kDwTl6WslOUyqegM8HkbC QgVJMN8BSyIRbU1Y1Lmee3c= X-Received: by 2002:a17:906:82d5:: with SMTP id a21mr24499463ejy.548.1602445481119; Sun, 11 Oct 2020 12:44:41 -0700 (PDT) Received: from ?IPv6:2003:ea:8f00:6a00:51b7:bf4f:604:7d3d? (p200300ea8f006a0051b7bf4f06047d3d.dip0.t-ipconnect.de. [2003:ea:8f00:6a00:51b7:bf4f:604:7d3d]) by smtp.googlemail.com with ESMTPSA id j24sm2070303ejf.21.2020.10.11.12.44.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 11 Oct 2020 12:44:40 -0700 (PDT) Subject: [PATCH net-next 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: <3b4e5d1f-16b3-dfa9-2f43-7061edbf9b1e@gmail.com> Date: Sun, 11 Oct 2020 21:42:43 +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