From patchwork Thu Apr 19 18:17:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 10351441 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 DE44960365 for ; Thu, 19 Apr 2018 18:18:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCCFC2434C for ; Thu, 19 Apr 2018 18:18:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C14C228399; Thu, 19 Apr 2018 18:18:38 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3908C2434C for ; Thu, 19 Apr 2018 18:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=emkDNYZdNSaqZRBsVIoLMwR8tdTJGzAAmCYBriUCubc=; b=OPcpQqHicpekRiF5E2utcJ7pls EWN981QBUWaTl73cYtTCCBVzB41nIkS31MypkeuNqCQSJ/u+9esygRRWFtqyP+blyYXMszpa72M8i DBq9NSg+vdtwIJlcxKkQCaMs0JfmbN6HrzW3bHn9bl+RLafzByyDFHlwzswv2Als6if/8q8Bkech6 BuGv/oJQs0SrlY9bD9gJFF+CfQh/Ka8PgcVV30yT1v3TETGjSvBNs2Jpir7rIXqJbaQOp2XMYz1HK He+IAHQ6oeYhmutsW4TbRue00azogFnBrOR7NQPH97N2Y7Ds+vIwjqSpF5KdW0lXE8iSR9ez4vrcK Nx/kmigw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9E8b-0002se-5X; Thu, 19 Apr 2018 18:18:29 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9E8F-0002kK-G2 for ath10k@lists.infradead.org; Thu, 19 Apr 2018 18:18:11 +0000 Received: from ben-dt3.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id 3A27C40B2C6; Thu, 19 Apr 2018 11:17:57 -0700 (PDT) From: greearb@candelatech.com To: netdev@vger.kernel.org Subject: [PATCH v2 3/3] ath10k: Support ethtool gstats2 API. Date: Thu, 19 Apr 2018 11:17:43 -0700 Message-Id: <1524161863-30860-3-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1524161863-30860-1-git-send-email-greearb@candelatech.com> References: <1524161863-30860-1-git-send-email-greearb@candelatech.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180419_111807_634927_0B3C5772 X-CRM114-Status: GOOD ( 11.55 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ben Greear , linux-wireless@vger.kernel.org, ath10k@lists.infradead.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear Skip a firmware stats update when calling code indicates the stats refresh is not needed. Signed-off-by: Ben Greear --- v2: Convert to new flag name, attempt to fix build when there is not DEBUGFS enabled for ath10k. drivers/net/wireless/ath/ath10k/debug.c | 18 +++++++++++++++--- drivers/net/wireless/ath/ath10k/debug.h | 5 +++++ drivers/net/wireless/ath/ath10k/mac.c | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index bac832c..235cd04 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -1159,9 +1159,10 @@ int ath10k_debug_get_et_sset_count(struct ieee80211_hw *hw, return 0; } -void ath10k_debug_get_et_stats(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ethtool_stats *stats, u64 *data) +void ath10k_debug_get_et_stats2(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ethtool_stats *stats, u64 *data, + u32 flags) { struct ath10k *ar = hw->priv; static const struct ath10k_fw_stats_pdev zero_stats = {}; @@ -1170,6 +1171,9 @@ void ath10k_debug_get_et_stats(struct ieee80211_hw *hw, mutex_lock(&ar->conf_mutex); + if (flags & ETHTOOL_GS2_NO_REFRESH_FW) + goto skip_query_fw_stats; + if (ar->state == ATH10K_STATE_ON) { ret = ath10k_debug_fw_stats_request(ar); if (ret) { @@ -1180,6 +1184,7 @@ void ath10k_debug_get_et_stats(struct ieee80211_hw *hw, } } +skip_query_fw_stats: pdev_stats = list_first_entry_or_null(&ar->debug.fw_stats.pdevs, struct ath10k_fw_stats_pdev, list); @@ -1244,6 +1249,13 @@ void ath10k_debug_get_et_stats(struct ieee80211_hw *hw, WARN_ON(i != ATH10K_SSTATS_LEN); } +void ath10k_debug_get_et_stats(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ethtool_stats *stats, u64 *data) +{ + ath10k_debug_get_et_stats2(hw, vif, stats, data, 0); +} + static const struct file_operations fops_fw_dbglog = { .read = ath10k_read_fw_dbglog, .write = ath10k_write_fw_dbglog, diff --git a/drivers/net/wireless/ath/ath10k/debug.h b/drivers/net/wireless/ath/ath10k/debug.h index 0afca5c..e953dd0 100644 --- a/drivers/net/wireless/ath/ath10k/debug.h +++ b/drivers/net/wireless/ath/ath10k/debug.h @@ -117,6 +117,10 @@ int ath10k_debug_get_et_sset_count(struct ieee80211_hw *hw, void ath10k_debug_get_et_stats(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ethtool_stats *stats, u64 *data); +void ath10k_debug_get_et_stats2(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ethtool_stats *stats, u64 *data, + u32 level); static inline u64 ath10k_debug_get_fw_dbglog_mask(struct ath10k *ar) { @@ -195,6 +199,7 @@ static inline u32 ath10k_debug_get_fw_dbglog_level(struct ath10k *ar) #define ath10k_debug_get_et_strings NULL #define ath10k_debug_get_et_sset_count NULL #define ath10k_debug_get_et_stats NULL +#define ath10k_debug_get_et_stats2 NULL #endif /* CONFIG_ATH10K_DEBUGFS */ #ifdef CONFIG_MAC80211_DEBUGFS diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index bf05a36..27b793c 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7734,6 +7734,7 @@ static const struct ieee80211_ops ath10k_ops = { .ampdu_action = ath10k_ampdu_action, .get_et_sset_count = ath10k_debug_get_et_sset_count, .get_et_stats = ath10k_debug_get_et_stats, + .get_et_stats2 = ath10k_debug_get_et_stats2, .get_et_strings = ath10k_debug_get_et_strings, .add_chanctx = ath10k_mac_op_add_chanctx, .remove_chanctx = ath10k_mac_op_remove_chanctx,