From patchwork Tue Nov 10 19:47:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 323609 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=-11.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 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 254BEC388F7 for ; Tue, 10 Nov 2020 19:51:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B947220809 for ; Tue, 10 Nov 2020 19:51:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YeBxn6BC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731603AbgKJTvX (ORCPT ); Tue, 10 Nov 2020 14:51:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbgKJTvW (ORCPT ); Tue, 10 Nov 2020 14:51:22 -0500 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 403FEC0613D1; Tue, 10 Nov 2020 11:51:22 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id k9so14104996edo.5; Tue, 10 Nov 2020 11:51:22 -0800 (PST) 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-transfer-encoding; bh=bOdWylhtQ7csIcx3x7AgcGPRiivjTYceou3ldTAJsAs=; b=YeBxn6BCTsEDT2K3jc2JwEBRjqhWJ4MxrIdcqijDmpwNxmHZjSSoL1c7tNj79zov0u jGcdzUbaafpV+7md60rfV7XhBJ0spqnBGkFLNbS1urJ9tR5zo1lrzsKH3lR32S+6v2ev 4aWuKJw5QZP15QpGRBfS0Q2NJtJhg+Hv9dAl0MPJr2BAlO4gqfRv9BlI/oj04n0I51C3 gV2CQ8oWuZ/3aRAo/kbS2hRju9wCOxa59FFjJ2cXwvJyKHfTrrKtn+ECQTYbBmk6DYlL TCjnVxgxtu99AAuOb5XdESLmFIYghJawyJhELlyKn+XWUXg8PQgVPF/Lwn9hCTt977GC pHoQ== 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-transfer-encoding; bh=bOdWylhtQ7csIcx3x7AgcGPRiivjTYceou3ldTAJsAs=; b=GdyfFJsoiV/9vuvsYXj8qV+9tzIFlRFzEK4w1yWeypSB/5W1ctIkYgKTKtwRwVspQb JzLKIfsSwqVTan42Uk23gCZ/nyGQbIl033RLVpjC2bTHUMRIEaKu4Dc2zizGfU5YvUSz 5hx5e2TvKLHKXiQV2u8m6jnDr+b46HXw09g98Vfv0kLdnpRKZO4FHgH/bxdgAxJrtvnH 5IkQJ0iTjSoPB7nJ1oB+nqCFzFVAbJcPVdS1iWPPTrAjN2gV6oCK/PtdXCss3y4GJvg2 AIELCfxUlUCvRqePEbbEJPyRtRqza9v81z3TlEdSPtcaIFR03dTpSnFweel8sOGUd6ba kAYQ== X-Gm-Message-State: AOAM530OrErErBHpJ1XR1kLNoaVtJDX/x9P7qQDdNuqVCuzDl9Xrh37F 9lzVHtemob8f6E8Ak1RGOnutRAfeund+yw== X-Google-Smtp-Source: ABdhPJxk7DTsgCEZiCcDHIK6P7rRocDMeZD9EY8ECUBsYZPrhDfIBIbmqWIZBZNqp8eLRr7R6QyMEQ== X-Received: by 2002:a05:6402:31b6:: with SMTP id dj22mr23495415edb.348.1605037880671; Tue, 10 Nov 2020 11:51:20 -0800 (PST) Received: from ?IPv6:2003:ea:8f23:2800:895e:e59d:3602:de4b? (p200300ea8f232800895ee59d3602de4b.dip0.t-ipconnect.de. [2003:ea:8f23:2800:895e:e59d:3602:de4b]) by smtp.googlemail.com with ESMTPSA id a1sm11311622edv.88.2020.11.10.11.51.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2020 11:51:20 -0800 (PST) Subject: [PATCH net-next 1/5] IB/hfi1: switch to core handling of rx/tx byte/packet counters From: Heiner Kallweit To: Jakub Kicinski , David Miller , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Jason Gunthorpe , =?utf-8?q?Bj=C3=B8rn_Mork?= , Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Oliver Neukum , Peter Korsgaard , Steve Glendinning , Microchip Linux Driver Support , Jussi Kivilinna Cc: "netdev@vger.kernel.org" , linux-rdma@vger.kernel.org, Linux USB Mailing List , linux-wireless References: <5fbe3a1f-6625-eadc-b1c9-f76f78debb94@gmail.com> Message-ID: <5093239e-2d3b-a716-3039-790abdb7a5ba@gmail.com> Date: Tue, 10 Nov 2020 20:47:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <5fbe3a1f-6625-eadc-b1c9-f76f78debb94@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use netdev->tstats instead of a member of hfi1_ipoib_dev_priv for storing a pointer to the per-cpu counters. This allows us to use core functionality for statistics handling. Signed-off-by: Heiner Kallweit --- drivers/infiniband/hw/hfi1/driver.c | 4 +--- drivers/infiniband/hw/hfi1/ipoib.h | 27 ------------------------- drivers/infiniband/hw/hfi1/ipoib_main.c | 15 +++----------- drivers/infiniband/hw/hfi1/ipoib_tx.c | 2 +- 4 files changed, 5 insertions(+), 43 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index a40701a6e..0b64aa87a 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c @@ -1686,7 +1686,6 @@ static void hfi1_ipoib_ib_rcv(struct hfi1_packet *packet) u32 extra_bytes; u32 tlen, qpnum; bool do_work, do_cnp; - struct hfi1_ipoib_dev_priv *priv; trace_hfi1_rcvhdr(packet); @@ -1734,8 +1733,7 @@ static void hfi1_ipoib_ib_rcv(struct hfi1_packet *packet) if (unlikely(!skb)) goto drop; - priv = hfi1_ipoib_priv(netdev); - hfi1_ipoib_update_rx_netstats(priv, 1, skb->len); + dev_sw_netstats_rx_add(netdev, skb->len); skb->dev = netdev; skb->pkt_type = PACKET_HOST; diff --git a/drivers/infiniband/hw/hfi1/ipoib.h b/drivers/infiniband/hw/hfi1/ipoib.h index b8c9d0a00..f650cac9d 100644 --- a/drivers/infiniband/hw/hfi1/ipoib.h +++ b/drivers/infiniband/hw/hfi1/ipoib.h @@ -110,7 +110,6 @@ struct hfi1_ipoib_dev_priv { const struct net_device_ops *netdev_ops; struct rvt_qp *qp; - struct pcpu_sw_netstats __percpu *netstats; }; /* hfi1 ipoib rdma netdev's private data structure */ @@ -126,32 +125,6 @@ hfi1_ipoib_priv(const struct net_device *dev) return &((struct hfi1_ipoib_rdma_netdev *)netdev_priv(dev))->dev_priv; } -static inline void -hfi1_ipoib_update_rx_netstats(struct hfi1_ipoib_dev_priv *priv, - u64 packets, - u64 bytes) -{ - struct pcpu_sw_netstats *netstats = this_cpu_ptr(priv->netstats); - - u64_stats_update_begin(&netstats->syncp); - netstats->rx_packets += packets; - netstats->rx_bytes += bytes; - u64_stats_update_end(&netstats->syncp); -} - -static inline void -hfi1_ipoib_update_tx_netstats(struct hfi1_ipoib_dev_priv *priv, - u64 packets, - u64 bytes) -{ - struct pcpu_sw_netstats *netstats = this_cpu_ptr(priv->netstats); - - u64_stats_update_begin(&netstats->syncp); - netstats->tx_packets += packets; - netstats->tx_bytes += bytes; - u64_stats_update_end(&netstats->syncp); -} - int hfi1_ipoib_send_dma(struct net_device *dev, struct sk_buff *skb, struct ib_ah *address, diff --git a/drivers/infiniband/hw/hfi1/ipoib_main.c b/drivers/infiniband/hw/hfi1/ipoib_main.c index 9f71b9d70..3242290eb 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_main.c +++ b/drivers/infiniband/hw/hfi1/ipoib_main.c @@ -21,7 +21,7 @@ static int hfi1_ipoib_dev_init(struct net_device *dev) struct hfi1_ipoib_dev_priv *priv = hfi1_ipoib_priv(dev); int ret; - priv->netstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); + dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); ret = priv->netdev_ops->ndo_init(dev); if (ret) @@ -93,21 +93,12 @@ static int hfi1_ipoib_dev_stop(struct net_device *dev) return priv->netdev_ops->ndo_stop(dev); } -static void hfi1_ipoib_dev_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *storage) -{ - struct hfi1_ipoib_dev_priv *priv = hfi1_ipoib_priv(dev); - - netdev_stats_to_stats64(storage, &dev->stats); - dev_fetch_sw_netstats(storage, priv->netstats); -} - static const struct net_device_ops hfi1_ipoib_netdev_ops = { .ndo_init = hfi1_ipoib_dev_init, .ndo_uninit = hfi1_ipoib_dev_uninit, .ndo_open = hfi1_ipoib_dev_open, .ndo_stop = hfi1_ipoib_dev_stop, - .ndo_get_stats64 = hfi1_ipoib_dev_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, }; static int hfi1_ipoib_send(struct net_device *dev, @@ -182,7 +173,7 @@ static void hfi1_ipoib_netdev_dtor(struct net_device *dev) hfi1_ipoib_txreq_deinit(priv); hfi1_ipoib_rxq_deinit(priv->netdev); - free_percpu(priv->netstats); + free_percpu(dev->tstats); } static void hfi1_ipoib_free_rdma_netdev(struct net_device *dev) diff --git a/drivers/infiniband/hw/hfi1/ipoib_tx.c b/drivers/infiniband/hw/hfi1/ipoib_tx.c index 9df292b51..edd4eeac8 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_tx.c +++ b/drivers/infiniband/hw/hfi1/ipoib_tx.c @@ -121,7 +121,7 @@ static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget) struct hfi1_ipoib_dev_priv *priv = tx->priv; if (likely(!tx->sdma_status)) { - hfi1_ipoib_update_tx_netstats(priv, 1, tx->skb->len); + dev_sw_netstats_tx_add(priv->netdev, 1, tx->skb->len); } else { ++priv->netdev->stats.tx_errors; dd_dev_warn(priv->dd, From patchwork Tue Nov 10 19:48:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 323607 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=-11.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 A9A4CC56201 for ; Tue, 10 Nov 2020 19:51:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41EC020781 for ; Tue, 10 Nov 2020 19:51:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WAzzuLpw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731681AbgKJTv0 (ORCPT ); Tue, 10 Nov 2020 14:51:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbgKJTvY (ORCPT ); Tue, 10 Nov 2020 14:51:24 -0500 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 CCCF1C0613D1; Tue, 10 Nov 2020 11:51:23 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id w13so19330168eju.13; Tue, 10 Nov 2020 11:51:23 -0800 (PST) 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-transfer-encoding; bh=fqQzZPFdwUoIi61+74s2tJDUiiLXIPVm1vc/LuVT+UM=; b=WAzzuLpwx3lQWSi9dW5jFp6+CCEoH24YnMXivjI2nttQ8RRXW+IUZyEapY/CnRlA8m K6GuwxhihBBPt7hXu+fgVqtxIDX3usa+uY4lrTGJikrNEM1RFIc+wyIob7fKpdfIcJVw Sx5XvNxCCvx091/h/yzYJ6at7gYYdSqsgFSX8S0l/Mm2ELIETebG6YT09zxom/+6rljw an9jiJLE9AnZ/IVKz0chNGBrHP8D9kT+nv2GG1l7lWvfD71fANFjGPNdeS+55CrAo13j RMucccgPPsMbMFebxHM1NHz4hUhXSTJ4YymF821NHvMnJBxAClF+zxV7sljGubER+r9X D8vQ== 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-transfer-encoding; bh=fqQzZPFdwUoIi61+74s2tJDUiiLXIPVm1vc/LuVT+UM=; b=m/ZPIc6cqWMyTKQn4zcRYYD2BJ/h2AeHDTwJXn/YJgISAiQT7UBF+u2qg5GDOvBvXW 5YLB+WS5i5YHMRPc+DVu4jIGsDjH8O9zqAiu9DfGAOYDM0cZ8oe9DwXGJKiuEWK2O9Zo g7x+oQlOSjWoJowd1oZ0w8EOGGsSgdeJb2E/dF8fnk+T9WT1HAmpQCsWcuYETaLKOahA vz/3YDI/KCmA7Q9xkQD6C5rX9R/FEBqtH6UrGI1rj4pDosZvQefVOkcKmqRg5KGe3dwB 9i4dwUBDWUBaSu6nruoBDt1z/fzjplUpDIOoqNROWgWJOH6ZzQiWXBNsSNuJ/Qr4Uun9 WqyA== X-Gm-Message-State: AOAM533LVZNlGAX9KsfTgOEi4UjnayECPfNcuyqsYoLUagpvb4x+1d59 L4ZY01kw6viV/jynIQqMJeBBCBpp3wIz0A== X-Google-Smtp-Source: ABdhPJw2pUNEDKoB9g04hdsxUC1eo3fbKJVX8oizhRE8OZsS5qANAdeC6A6ODx9OSbsEDjVBTOzvBQ== X-Received: by 2002:a17:906:138c:: with SMTP id f12mr22613982ejc.108.1605037882273; Tue, 10 Nov 2020 11:51:22 -0800 (PST) Received: from ?IPv6:2003:ea:8f23:2800:895e:e59d:3602:de4b? (p200300ea8f232800895ee59d3602de4b.dip0.t-ipconnect.de. [2003:ea:8f23:2800:895e:e59d:3602:de4b]) by smtp.googlemail.com with ESMTPSA id e2sm11153502edu.93.2020.11.10.11.51.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2020 11:51:21 -0800 (PST) Subject: [PATCH net-next 2/5] qmi_wwan: switch to core handling of rx/tx byte/packet counters From: Heiner Kallweit To: Jakub Kicinski , David Miller , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Jason Gunthorpe , =?utf-8?q?Bj=C3=B8rn_Mork?= , Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Oliver Neukum , Peter Korsgaard , Steve Glendinning , Microchip Linux Driver Support , Jussi Kivilinna Cc: "netdev@vger.kernel.org" , linux-rdma@vger.kernel.org, Linux USB Mailing List , linux-wireless References: <5fbe3a1f-6625-eadc-b1c9-f76f78debb94@gmail.com> Message-ID: Date: Tue, 10 Nov 2020 20:48:14 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <5fbe3a1f-6625-eadc-b1c9-f76f78debb94@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use netdev->tstats instead of a member of qmimux_priv for storing a pointer to the per-cpu counters. This allows us to use core functionality for statistics handling. Signed-off-by: Heiner Kallweit --- drivers/net/usb/qmi_wwan.c | 39 ++++++++------------------------------ 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 581ed51ab..b9d74d9a7 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -72,7 +72,6 @@ struct qmimux_hdr { struct qmimux_priv { struct net_device *real_dev; u8 mux_id; - struct pcpu_sw_netstats __percpu *stats64; }; static int qmimux_open(struct net_device *dev) @@ -108,34 +107,19 @@ static netdev_tx_t qmimux_start_xmit(struct sk_buff *skb, struct net_device *dev skb->dev = priv->real_dev; ret = dev_queue_xmit(skb); - if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) { - struct pcpu_sw_netstats *stats64 = this_cpu_ptr(priv->stats64); - - u64_stats_update_begin(&stats64->syncp); - stats64->tx_packets++; - stats64->tx_bytes += len; - u64_stats_update_end(&stats64->syncp); - } else { + if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) + dev_sw_netstats_tx_add(dev, 1, len); + else dev->stats.tx_dropped++; - } return ret; } -static void qmimux_get_stats64(struct net_device *net, - struct rtnl_link_stats64 *stats) -{ - struct qmimux_priv *priv = netdev_priv(net); - - netdev_stats_to_stats64(stats, &net->stats); - dev_fetch_sw_netstats(stats, priv->stats64); -} - static const struct net_device_ops qmimux_netdev_ops = { .ndo_open = qmimux_open, .ndo_stop = qmimux_stop, .ndo_start_xmit = qmimux_start_xmit, - .ndo_get_stats64 = qmimux_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, }; static void qmimux_setup(struct net_device *dev) @@ -224,14 +208,7 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb) net->stats.rx_errors++; return 0; } else { - struct pcpu_sw_netstats *stats64; - struct qmimux_priv *priv = netdev_priv(net); - - stats64 = this_cpu_ptr(priv->stats64); - u64_stats_update_begin(&stats64->syncp); - stats64->rx_packets++; - stats64->rx_bytes += pkt_len; - u64_stats_update_end(&stats64->syncp); + dev_sw_netstats_rx_add(net, pkt_len); } skip: @@ -256,8 +233,8 @@ static int qmimux_register_device(struct net_device *real_dev, u8 mux_id) priv->mux_id = mux_id; priv->real_dev = real_dev; - priv->stats64 = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); - if (!priv->stats64) { + new_dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); + if (!new_dev->tstats) { err = -ENOBUFS; goto out_free_newdev; } @@ -292,7 +269,7 @@ static void qmimux_unregister_device(struct net_device *dev, struct qmimux_priv *priv = netdev_priv(dev); struct net_device *real_dev = priv->real_dev; - free_percpu(priv->stats64); + free_percpu(dev->tstats); netdev_upper_dev_unlink(real_dev, dev); unregister_netdevice_queue(dev, head); From patchwork Tue Nov 10 19:51:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 323608 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=-11.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 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 DCDC6C388F7 for ; Tue, 10 Nov 2020 19:51:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6ED44206D8 for ; Tue, 10 Nov 2020 19:51:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K7WBROx+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731799AbgKJTvd (ORCPT ); Tue, 10 Nov 2020 14:51:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731613AbgKJTv3 (ORCPT ); Tue, 10 Nov 2020 14:51:29 -0500 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 2D79DC0613D1; Tue, 10 Nov 2020 11:51:29 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id o23so19373999ejn.11; Tue, 10 Nov 2020 11:51:29 -0800 (PST) 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-transfer-encoding; bh=HH3eQpgACFc0U7/w0sEUlYSVeHEP4oODaS+YLEBlqzk=; b=K7WBROx+NQYbR4nWTmYwYSoLBjquYRRNJUYANnNuVwBOfSGxffrEZsbRmOK4pFg+hV h+2ALZaHn/SjgGHYjul25syEsCXxShqAk/Hza3VuOs8lPmK25OPtx6XH/CyV/z8aIyZU sfc3yG2EQ9YjYcGvgsnP+LmEvtdlROiNwZ5Mck3wo+jHCeUnsKCK8e8jhnXfz6HywR9w CTNZ3x43OsxB7vmXt/o+1y53Ponh0LRShKzgVKb2DTdZ0+axHWLaq5pJFWktcpT6dLb6 nOam/wXBAremig+CLzi/qYnWpbWOSz86uvvzNdjJpEnmkGtP1mATiiEbf0BQ7ZahoTHh e+QQ== 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-transfer-encoding; bh=HH3eQpgACFc0U7/w0sEUlYSVeHEP4oODaS+YLEBlqzk=; b=h8De7nWNofLLkkpbYZSDAuhj98RCtgYGHAqEZYSNQau499UprdwXdGA6/cIGrQQNZZ qWiLCCH32kszOjjIH8j8Dt8i8JGJJSDEFr0uUlt03eWJ9IsjyIeiHARTgBdc/InCO0Pm wK3APlcxcDXTQkzJRCcRi4HX5BM53HpkbU2GGnAIa+o09RSIwuEgftvDsFaSkroC+xOF hllm3mkZtGQV8l20iWeHP0jowrPr7ZkRc1/CwwmF+DlQXwLo4IVpkUF8/80C/PaFCBft wzEQ1gk+aNqSjt+EjTbn0cW2kQIU10jd6EGf+wbtAZs51CbUFXbIQ6ZN94CGT4/ImP2p CL7w== X-Gm-Message-State: AOAM533hnIra35zlN5xfW8SDS3WCQwfzim7x/a0P1MloopldhTXPcOF4 AEXFRy6GVnlun4NsEKbO0ws3TjbRXiotbA== X-Google-Smtp-Source: ABdhPJzOpD+iG/6Kqb/nWpvnuEymcgQb7LmaE3K2QMu6lKg5LMdkfUVDy7WhCeJrttpFy6FWM4Y/Ow== X-Received: by 2002:a17:906:f84f:: with SMTP id ks15mr20944652ejb.337.1605037887372; Tue, 10 Nov 2020 11:51:27 -0800 (PST) Received: from ?IPv6:2003:ea:8f23:2800:895e:e59d:3602:de4b? (p200300ea8f232800895ee59d3602de4b.dip0.t-ipconnect.de. [2003:ea:8f23:2800:895e:e59d:3602:de4b]) by smtp.googlemail.com with ESMTPSA id d23sm8595042edy.57.2020.11.10.11.51.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2020 11:51:26 -0800 (PST) Subject: [PATCH net-next 5/5] net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias From: Heiner Kallweit To: Jakub Kicinski , David Miller , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Jason Gunthorpe , =?utf-8?q?Bj=C3=B8rn_Mork?= , Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Oliver Neukum , Peter Korsgaard , Steve Glendinning , Microchip Linux Driver Support , Jussi Kivilinna Cc: "netdev@vger.kernel.org" , linux-rdma@vger.kernel.org, Linux USB Mailing List , linux-wireless References: <5fbe3a1f-6625-eadc-b1c9-f76f78debb94@gmail.com> Message-ID: <35569407-d028-ed00-bf2a-2fc572a938e9@gmail.com> Date: Tue, 10 Nov 2020 20:51:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <5fbe3a1f-6625-eadc-b1c9-f76f78debb94@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Replace usbnet_get_stats64() with new identical core function dev_get_tstats64() in all users and remove usbnet_get_stats64(). Signed-off-by: Heiner Kallweit --- drivers/net/usb/aqc111.c | 2 +- drivers/net/usb/asix_devices.c | 6 +++--- drivers/net/usb/ax88172a.c | 2 +- drivers/net/usb/ax88179_178a.c | 2 +- drivers/net/usb/cdc_mbim.c | 2 +- drivers/net/usb/cdc_ncm.c | 2 +- drivers/net/usb/dm9601.c | 2 +- drivers/net/usb/int51x1.c | 2 +- drivers/net/usb/mcs7830.c | 2 +- drivers/net/usb/qmi_wwan.c | 2 +- drivers/net/usb/rndis_host.c | 2 +- drivers/net/usb/sierra_net.c | 2 +- drivers/net/usb/smsc75xx.c | 2 +- drivers/net/usb/smsc95xx.c | 2 +- drivers/net/usb/sr9700.c | 2 +- drivers/net/usb/sr9800.c | 2 +- drivers/net/wireless/rndis_wlan.c | 2 +- include/linux/usb/usbnet.h | 2 -- 18 files changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 0717c1801..73b97f4cc 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -641,7 +641,7 @@ static const struct net_device_ops aqc111_netdev_ops = { .ndo_stop = usbnet_stop, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_change_mtu = aqc111_change_mtu, .ndo_set_mac_address = aqc111_set_mac_addr, .ndo_validate_addr = eth_validate_addr, diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index ef548beba..6e13d8165 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -194,7 +194,7 @@ static const struct net_device_ops ax88172_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, .ndo_do_ioctl = asix_ioctl, @@ -580,7 +580,7 @@ static const struct net_device_ops ax88772_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = asix_set_mac_address, .ndo_validate_addr = eth_validate_addr, .ndo_do_ioctl = asix_ioctl, @@ -1050,7 +1050,7 @@ static const struct net_device_ops ax88178_netdev_ops = { .ndo_stop = usbnet_stop, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = asix_set_mac_address, .ndo_validate_addr = eth_validate_addr, .ndo_set_rx_mode = asix_set_multicast, diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c index fd3a04d98..b404c9462 100644 --- a/drivers/net/usb/ax88172a.c +++ b/drivers/net/usb/ax88172a.c @@ -120,7 +120,7 @@ static const struct net_device_ops ax88172a_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = asix_set_mac_address, .ndo_validate_addr = eth_validate_addr, .ndo_do_ioctl = phy_do_ioctl_running, diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 5541f3fae..d650b39b6 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -1031,7 +1031,7 @@ static const struct net_device_ops ax88179_netdev_ops = { .ndo_stop = usbnet_stop, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_change_mtu = ax88179_change_mtu, .ndo_set_mac_address = ax88179_set_mac_addr, .ndo_validate_addr = eth_validate_addr, diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c index eb100eb33..5db66272f 100644 --- a/drivers/net/usb/cdc_mbim.c +++ b/drivers/net/usb/cdc_mbim.c @@ -98,7 +98,7 @@ static const struct net_device_ops cdc_mbim_netdev_ops = { .ndo_stop = usbnet_stop, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_change_mtu = cdc_ncm_change_mtu, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index e04f58853..abe1162dc 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -793,7 +793,7 @@ static const struct net_device_ops cdc_ncm_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_set_rx_mode = usbnet_set_rx_mode, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_change_mtu = cdc_ncm_change_mtu, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 915ac75b5..b5d2ac55a 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c @@ -343,7 +343,7 @@ static const struct net_device_ops dm9601_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_validate_addr = eth_validate_addr, .ndo_do_ioctl = dm9601_ioctl, .ndo_set_rx_mode = dm9601_set_multicast, diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c index cb5bc1a7f..ed05f992c 100644 --- a/drivers/net/usb/int51x1.c +++ b/drivers/net/usb/int51x1.c @@ -133,7 +133,7 @@ static const struct net_device_ops int51x1_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, .ndo_set_rx_mode = int51x1_set_multicast, diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index 09bfa6a4d..fc512b780 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c @@ -462,7 +462,7 @@ static const struct net_device_ops mcs7830_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_validate_addr = eth_validate_addr, .ndo_do_ioctl = mcs7830_ioctl, .ndo_set_rx_mode = mcs7830_set_multicast, diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index b9d74d9a7..afeb09b96 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -575,7 +575,7 @@ static const struct net_device_ops qmi_wwan_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = qmi_wwan_mac_addr, .ndo_validate_addr = eth_validate_addr, }; diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 6fa7a009a..6609d21ef 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c @@ -279,7 +279,7 @@ static const struct net_device_ops rndis_netdev_ops = { .ndo_stop = usbnet_stop, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, }; diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 0abd257b6..55a244eca 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c @@ -184,7 +184,7 @@ static const struct net_device_ops sierra_net_device_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, }; diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 8689835a5..4353b3702 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -1435,7 +1435,7 @@ static const struct net_device_ops smsc75xx_netdev_ops = { .ndo_stop = usbnet_stop, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_change_mtu = smsc75xx_change_mtu, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index ea0d5f04d..4c8ee1cff 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -1041,7 +1041,7 @@ static const struct net_device_ops smsc95xx_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, .ndo_do_ioctl = smsc95xx_ioctl, diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c index e04c8054c..878557ad0 100644 --- a/drivers/net/usb/sr9700.c +++ b/drivers/net/usb/sr9700.c @@ -308,7 +308,7 @@ static const struct net_device_ops sr9700_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_validate_addr = eth_validate_addr, .ndo_do_ioctl = sr9700_ioctl, .ndo_set_rx_mode = sr9700_set_multicast, diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c index 681e0def6..da56735d7 100644 --- a/drivers/net/usb/sr9800.c +++ b/drivers/net/usb/sr9800.c @@ -681,7 +681,7 @@ static const struct net_device_ops sr9800_netdev_ops = { .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = sr_set_mac_address, .ndo_validate_addr = eth_validate_addr, .ndo_do_ioctl = sr_ioctl, diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 75b5d545b..9fe775568 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c @@ -3379,7 +3379,7 @@ static const struct net_device_ops rndis_wlan_netdev_ops = { .ndo_stop = usbnet_stop, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, - .ndo_get_stats64 = usbnet_get_stats64, + .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, .ndo_set_rx_mode = rndis_wlan_set_multicast_list, diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 1f6dfa977..88a767389 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h @@ -284,6 +284,4 @@ extern void usbnet_status_stop(struct usbnet *dev); extern void usbnet_update_max_qlen(struct usbnet *dev); -#define usbnet_get_stats64 dev_get_tstats64 - #endif /* __LINUX_USB_USBNET_H */