From patchwork Mon Jan 22 12:46:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10178451 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 249B160224 for ; Mon, 22 Jan 2018 12:47:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2278528236 for ; Mon, 22 Jan 2018 12:47:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 167E328305; Mon, 22 Jan 2018 12:47:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7637C28236 for ; Mon, 22 Jan 2018 12:47:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751124AbeAVMrH (ORCPT ); Mon, 22 Jan 2018 07:47:07 -0500 Received: from mail-bl2nam02on0073.outbound.protection.outlook.com ([104.47.38.73]:37088 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751004AbeAVMrC (ORCPT ); Mon, 22 Jan 2018 07:47:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hAwP8o+1nFRKyNa/wSxRedUx8DFCnDEB95dEXLR0DAY=; b=JmpzBm94qKSAWXMXp7c5LNMbAWms8AR1dgvM0T3uwTqkwkjJHsgdbVMRurlafRZBq/705TwAQMs8770rcxOycqrdWZNF2Hn24wVjOmxYI6ExP7ry0uZFLlMzVd3zvRN6OO6DCPTPCNO0MzlGCx0E+lNGPjCF9F8mifADBzCZ8+g= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.5; Mon, 22 Jan 2018 12:46:59 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Vasily Ulyanov Subject: [PATCH 03/11] qtnfmac: support 64-bit network interface stats Date: Mon, 22 Jan 2018 15:46:26 +0300 Message-Id: <20180122124634.8430-4-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180122124634.8430-1-sergey.matyukevich.os@quantenna.com> References: <20180122124634.8430-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: VI1PR08CA0220.eurprd08.prod.outlook.com (10.170.234.157) To CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f638b12-9c3b-44e6-738b-08d561963b3d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:CY1PR05MB1931; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 3:/87ys+4dhfMziGFsKu3Xc35Xj9n66NJHWuEpBbnj+6Pa4glzpHo83r8zAzWKjKZis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PEBfFKHRQvK8RP8fGi4ZaMSvifG1v2Ehcb9+D9YuRkwiMt8xwrqKNfIbZpXqRZvcONefywX8irwzHYihwPVNC91sccUWBh7FudR4gJdFglPSIqBA43y25NPhW6sDXXZtR49JceJrzpowDJ9KNH5NPsrLyp2RqADUJHpKzQ6wrYNYeqfIML48f3qo0ree8y3UnW5Chy+UGytZ/O00H/JK3rRbwG4wiBTkkkhibffRJoJBlDvu4UMhdp5QxWcRlzbTHv43vHl+6qlPievefsKtNR5Tjxq6AC3aMCUamcRNt1bvB5ZRzDqUNa7NEJEyg7mpsSK3pvY; 4:VG2gyYddu/Q1q5exE9X7W4JuXgUrvAlq2DqWBCBtruPH7W8X5uTEr74ZjauFovPCWe83MhHpAqJ6f9xjXjqnEkh339liH0HM+pqKQ0VJ5cQnLtO6J+dF+e6uLOOZRvX9BPXvEtqFpSVX85nmL3cFZ1oPPMcXf6DWSQYpxSqmy+IkIOfAfYtvaDw1pLmu+Oy8yG293prNAxxuHk2osqxLVEyIaRjkzsP/c8Fy03CBT3MECVulWHIqq2MfFo5EXK/4L4/Xo14c9zsiFjV9fmKcEw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231023)(2400081)(944501161)(10201501046)(3002001)(93006095)(93001095)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY1PR05MB1931; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR05MB1931; X-Forefront-PRVS: 0560A2214D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39840400004)(396003)(366004)(346002)(39380400002)(199004)(189003)(2351001)(25786009)(52116002)(1076002)(6116002)(26005)(59450400001)(2361001)(36756003)(4326008)(76176011)(107886003)(478600001)(8676002)(8936002)(50226002)(7736002)(81166006)(6916009)(6666003)(2950100002)(305945005)(2906002)(106356001)(105586002)(68736007)(6486002)(81156014)(53936002)(48376002)(66066001)(16526018)(47776003)(103116003)(97736004)(50466002)(5660300001)(3846002)(386003)(16586007)(316002)(51416003)(7696005)(53416004)(54906003)(69596002)(86362001)(575784001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR05MB1931; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB1931; 23:XOJnJ3weFbsAqgmwGfhVyoXGRN2gqhpJG3fC2ywQT?= =?us-ascii?Q?2xlnCeeL8IR+YCzih0ZB4byTo52FFzDdzjplxwBRrSEX3Bpp2QYGwueDuwD8?= =?us-ascii?Q?KNwPdpB/v8wFO+AB+zeu+Trad/WaA8tzRei9g3N1wkn2QJ/HvupNd2p6MII3?= =?us-ascii?Q?jJAhr8p4V9YxdvuPR9+QChOWQVNH6VFUFJ2NyHYLJzZqCvzwaIGtE8lpahyV?= =?us-ascii?Q?zN2Dam66UKJJb9oaQmp7UgGxdnGaPm6McIYKFGfTTFHUdk1n9AFUsk1KO/fD?= =?us-ascii?Q?z2SaR856+iM549sc+LmjML4cMQ2UHRoP8XfESJuIeU85tAjQjdzaznoc86OF?= =?us-ascii?Q?qLQJDVNHY/I+0hdp+M7DeER7U2eUN/1/rDyqaFyJpdyL2uMia6ifLG1JPQ/3?= =?us-ascii?Q?xUZc+J9bHrxIqbbL0nc8NhV5NPjp7i083A65P/DjEk6lVcRyjvabxJ+Njj7G?= =?us-ascii?Q?u+Siil3+SsfzwvOV8W8Ztx2m4niTfaj3vHvHd3MDrVUZ84peIqhuCFnWuNIM?= =?us-ascii?Q?u8MnpC8Z79cqCVYNnb/DCFfC+2tmKeizpMoc1Ap8HQhmrITXUz+fUuy6LQFx?= =?us-ascii?Q?Dqo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Q1+laimfN3FnwadHIi9SAcjwgeiXZG/LMVN/dRwcZ0M+SVdipOkxzZQCo2xRVly76EfeR0eUizosTphEwiUqZF96tDkCSKOl1MVu8nzyUSX/71fVb7hYyci1uW1oJmdQwhQKno3zxHaTyKb+3BQqYA8IewMF4glz+8nPFTWWUjW2Qww=; 5:tnxS0Ht/+QqLzSuqM6qnRG75WqYa4/YzUlZ8oiIESLr74d/TYLbsIXILFkdl1NdMD/ShChLqPFjKgGbN1EkKT/779JRwILCpD+KIZlf+csz8R9jXDqy0KHgFidHwbqxNhYC0v8OC0pyjHaX6/RQhXbwawqaOFifuu4x4jJv12gI=; 24:NPH4teXJIf9bZJx5ShL5TwulXlx+tpBPGt1K0rgKBvrSTJxKQsce/tXwyx6cfxpOrBmoeKqyqBJ6OZczACUJFdzDieVm5esc1F8OsQSC8/8=; 7:B/xfAq9on823byBESdKyMvcFoGF7+tvPu4l0+HNcsh2pB4lsxOiHuEQrqVluw6vOsWZpx+FLp0sgzDFgmPknywygiFDJAcx/unEJC8QqtnnRhS803KXtozo6cSKATsyKBhRvSYbXHgQfRUaHwOvJRFAOCnTGmRyUzUezbfjc95bv6aENJidqkJhPo+0Zwp5PpN5WHRflOU0YvGTHnDqLy0Zl/+Ji5AHqGLM2f1v1iv6f8ByFBQzbSJMZBpY1P9gn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2018 12:46:59.6695 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f638b12-9c3b-44e6-738b-08d561963b3d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB1931 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vasily Ulyanov On 32-bit platforms packet counters are stored in a net_device_stats struct as unsigned long integers. As a result, after some time of network activity an overflow takes place in network packet counters. This patch makes use of new structs for holding interface statistics. Signed-off-by: Vasily Ulyanov --- drivers/net/wireless/quantenna/qtnfmac/core.c | 81 +++++++++++++++++++++- drivers/net/wireless/quantenna/qtnfmac/core.h | 5 ++ .../net/wireless/quantenna/qtnfmac/pearl/pcie.c | 7 +- 3 files changed, 85 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index ccd982b1c957..c10f24f0a0ce 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -119,9 +119,38 @@ qtnf_netdev_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) /* Netdev handler for getting stats. */ -static struct net_device_stats *qtnf_netdev_get_stats(struct net_device *dev) +static void qtnf_netdev_get_stats64(struct net_device *ndev, + struct rtnl_link_stats64 *stats) { - return &dev->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; + } } /* Netdev handler for transmission timeout. @@ -156,7 +185,7 @@ const struct net_device_ops qtnf_netdev_ops = { .ndo_stop = qtnf_netdev_close, .ndo_start_xmit = qtnf_netdev_hard_start_xmit, .ndo_tx_timeout = qtnf_netdev_tx_timeout, - .ndo_get_stats = qtnf_netdev_get_stats, + .ndo_get_stats64 = qtnf_netdev_get_stats64, }; static int qtnf_mac_init_single_band(struct wiphy *wiphy, @@ -289,6 +318,11 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, qtnf_sta_list_init(&mac->iflist[i].sta_list); mutex_init(&mac->mac_lock); timer_setup(&mac->scan_timeout, NULL, 0); + mac->iflist[i].stats64 = + netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); + if (!mac->iflist[i].stats64) + pr_warn("VIF%u.%u: per cpu stats allocation failed\n", + macid, i); } qtnf_mac_init_primary_intf(mac); @@ -364,6 +398,7 @@ static void qtnf_core_mac_detach(struct qtnf_bus *bus, unsigned int macid) } rtnl_unlock(); qtnf_sta_list_free(&vif->sta_list); + free_percpu(vif->stats64); } if (mac->wiphy_registered) @@ -643,6 +678,46 @@ void qtnf_wake_all_queues(struct net_device *ndev) } EXPORT_SYMBOL_GPL(qtnf_wake_all_queues); +void qtnf_update_rx_stats(struct net_device *ndev, const struct sk_buff *skb) +{ + struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); + struct pcpu_sw_netstats *stats64; + + if (unlikely(!vif || !vif->stats64)) { + ndev->stats.rx_packets++; + ndev->stats.rx_bytes += skb->len; + return; + } + + stats64 = this_cpu_ptr(vif->stats64); + + u64_stats_update_begin(&stats64->syncp); + stats64->rx_packets++; + stats64->rx_bytes += skb->len; + u64_stats_update_end(&stats64->syncp); +} +EXPORT_SYMBOL_GPL(qtnf_update_rx_stats); + +void qtnf_update_tx_stats(struct net_device *ndev, const struct sk_buff *skb) +{ + struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); + struct pcpu_sw_netstats *stats64; + + if (unlikely(!vif || !vif->stats64)) { + ndev->stats.tx_packets++; + ndev->stats.tx_bytes += skb->len; + return; + } + + stats64 = this_cpu_ptr(vif->stats64); + + u64_stats_update_begin(&stats64->syncp); + stats64->tx_packets++; + stats64->tx_bytes += skb->len; + u64_stats_update_end(&stats64->syncp); +} +EXPORT_SYMBOL_GPL(qtnf_update_tx_stats); + MODULE_AUTHOR("Quantenna Communications"); MODULE_DESCRIPTION("Quantenna 802.11 wireless LAN FullMAC driver."); MODULE_LICENSE("GPL"); diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index c10900162297..09fa5d28cc2a 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -89,6 +89,8 @@ struct qtnf_vif { struct qtnf_sta_list sta_list; unsigned long cons_tx_timeout_cnt; int generation; + + struct pcpu_sw_netstats __percpu *stats64; }; struct qtnf_mac_info { @@ -157,6 +159,9 @@ int qtnf_cmd_send_get_phy_params(struct qtnf_wmac *mac); struct qtnf_wmac *qtnf_core_get_mac(const struct qtnf_bus *bus, u8 macid); struct net_device *qtnf_classify_skb(struct qtnf_bus *bus, struct sk_buff *skb); void qtnf_wake_all_queues(struct net_device *ndev); +void qtnf_update_rx_stats(struct net_device *ndev, const struct sk_buff *skb); +void qtnf_update_tx_stats(struct net_device *ndev, const struct sk_buff *skb); + void qtnf_virtual_intf_cleanup(struct net_device *ndev); void qtnf_netdev_updown(struct net_device *ndev, bool up); diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c index 7e487622d87d..6f6190964320 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c @@ -615,8 +615,7 @@ static void qtnf_pcie_data_tx_reclaim(struct qtnf_pcie_bus_priv *priv) PCI_DMA_TODEVICE); if (skb->dev) { - skb->dev->stats.tx_packets++; - skb->dev->stats.tx_bytes += skb->len; + qtnf_update_tx_stats(skb->dev, skb); if (unlikely(priv->tx_stopped)) { qtnf_wake_all_queues(skb->dev); priv->tx_stopped = 0; @@ -855,9 +854,7 @@ static int qtnf_rx_poll(struct napi_struct *napi, int budget) skb_put(skb, psize); ndev = qtnf_classify_skb(bus, skb); if (likely(ndev)) { - ndev->stats.rx_packets++; - ndev->stats.rx_bytes += skb->len; - + qtnf_update_rx_stats(ndev, skb); skb->protocol = eth_type_trans(skb, ndev); napi_gro_receive(napi, skb); } else {