Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3807562pxu; Mon, 12 Oct 2020 01:24:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGJCyljLpw/R9Gp+FUD96XTxAOUHp2uxzhQSJ3y4r9OW4nAlX8ebPdVXX5D92ePzsSqjTe X-Received: by 2002:a17:906:1a04:: with SMTP id i4mr28221304ejf.24.1602491046124; Mon, 12 Oct 2020 01:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602491046; cv=none; d=google.com; s=arc-20160816; b=aescEKcklL9yl7c37Mz7OYxTubTf63O7+/+cYe80U325Ct8bqzY6MLAJG8nmHsGRSG +b6d+uo0pLChhQo3I6/27QioaEJVqpBOQuwKFBsn74pILtX2CQjP8rPqvVsQ+G3YHCh/ aJbDhuwUr/JS7Xv8NbbpdgHHuHHHyL6k77FQMproYeNpsT1WvHbmiOds3sU9shhq/q7y pwJIjxXuxNm0TSu1yh7CTdcboAf5KFrj4NZMi1l/QXPxuAj7dzLPI0RUrpGmL5txfXFR 1RcjvGr4mbYVEPoeyTAplqsstWfZpNm85E3b9KKUya3SrRDwhrB0inEewgsQT9ZuJv/L v7Vw== 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=1wOWozXJ4utk2al1FxKRLR9aiEc2n/7R7pCk8KlT/EY=; b=Ho3NLRzOtGUtcUCqq9fD/6+GeKRZKDT1C7bB5u8SpO7UaDMWPqO6uBONt+U2aBwcDi SlQevxUz88To52zHuRsadHjNvnFJG+9vTGujGPBZz9wvQm+tYjePYplSHE2jTzjFyONy qPPrNDU5/YpofQhgjtRWzflnHV/zozH7pDYpaAkCuVKxNF1GZ1joD4y/PYQNJ+2a64Q7 etMKam7ZKHrmJNEtgGjVOZMmWvj+CU8A2E1ucX/FqU3+1iSJ1KHSa5ncOPbnowuE0BDH 7xA+E9WmTm+hWOp1192RzuLJv4HvyJ3scm8BZtDU24N62jdETWpdgfUrNO8fjpbkEAF6 tFzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gdWvMc+d; 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 v13si871798eju.630.2020.10.12.01.23.41; Mon, 12 Oct 2020 01:24:06 -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=gdWvMc+d; 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 S1728884AbgJLIWW (ORCPT + 99 others); Mon, 12 Oct 2020 04:22:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726796AbgJLIVs (ORCPT ); Mon, 12 Oct 2020 04:21:48 -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 E1111C0613D0; Mon, 12 Oct 2020 01:21:47 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id e22so22009148ejr.4; Mon, 12 Oct 2020 01:21:47 -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=1wOWozXJ4utk2al1FxKRLR9aiEc2n/7R7pCk8KlT/EY=; b=gdWvMc+ds5lggRfkD+SUMGUuH638xQkwAy+e8n5Mo7ZRSDYEPzaQtR9qfL++MOHP20 va97/CqWm8hgjDrEzG2Hcg36FXA5MGYZqe4cXAP3EtfNmxLRRM+z4aZkd1av+qmz3vKJ Hdb/EbLySehHW9Lnwdok4qok7d36BK2J4cmWsgto/oGZRRT9W9X9mBYmgTLe+5XbAzAq PlIBELAmZtoMmLhS3/E59H5AU2F7w43TqXNZ1ZGiQAYY5AUfa0/GYYWjvEuf2lOfJgd2 9NvJWF1sBhqoPd+8EIXuDQRt1to6QYk60Yc3HXpSawKyP0ZIINF96WNCqYC/SkbBjEer tiOA== 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=1wOWozXJ4utk2al1FxKRLR9aiEc2n/7R7pCk8KlT/EY=; b=nHyVRNssQM28Ay0haSKc5D7HODo+0qbFmIka6jIREo03QcBk3qgEnqa/amhMbwlHrq cZMYYYBcbmbugGkIj3WiZmxvBBBJuFU+ZxWGBOL9UvODAh90RKtr4VHaZBTbs+oBiORy EjEadmD1xef5Sro/vegRigB+7Y36dHt3CBM+19PFm/hM6EsA66FFfy7TZEeUBHr7KFl1 49WkuYfWec4Ndld3T/y61DA7YlJoUrTZpzGQgkieQNmNoCQJl4IrJKz1zZADO536kKKM yHkzOrOwlWUg1ypfSUZMejc3NFwWEExngk0vn1FRbXG02BnwTk6mD1r0fURDw9r6GvI1 j66A== X-Gm-Message-State: AOAM533zayrkUCB1N/SCKm+6msjSDj0Dsk/ag0QY+jmQik8CIBth3b0a pIB7hZ7lCe+C/SVuWTxlE7Qe69k+PiU4lw== X-Received: by 2002:a17:906:a8b:: with SMTP id y11mr26283425ejf.302.1602490906538; Mon, 12 Oct 2020 01:21:46 -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 lb11sm10190517ejb.27.2020.10.12.01.21.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Oct 2020 01:21:46 -0700 (PDT) Subject: [PATCH net-next v2 04/12] net: usb: qmi_wwan: 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: <2c97b75b-107e-0ab6-d9ef-9f38bb03f495@gmail.com> Date: Mon, 12 Oct 2020 10:06:44 +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: 8bit 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: Bjørn Mork --- drivers/net/usb/qmi_wwan.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 5ca1356b8..a322f5187 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -126,31 +126,9 @@ static void qmimux_get_stats64(struct net_device *net, struct rtnl_link_stats64 *stats) { struct qmimux_priv *priv = netdev_priv(net); - unsigned int start; - int cpu; netdev_stats_to_stats64(stats, &net->stats); - - for_each_possible_cpu(cpu) { - struct pcpu_sw_netstats *stats64; - u64 rx_packets, rx_bytes; - u64 tx_packets, tx_bytes; - - stats64 = per_cpu_ptr(priv->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, priv->stats64); } static const struct net_device_ops qmimux_netdev_ops = { -- 2.28.0