diff mbox series

[3/3] ath10k: Support ethtool gstats2 API.

Message ID 1524016176-3881-3-git-send-email-greearb@candelatech.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show
Series [1/3] ethtool: Support ETHTOOL_GSTATS2 command. | expand

Commit Message

Ben Greear April 18, 2018, 1:49 a.m. UTC
From: Ben Greear <greearb@candelatech.com>

Skip a firmware stats update when calling
code indicates the stats refresh is not needed.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 18 +++++++++++++++---
 drivers/net/wireless/ath/ath10k/debug.h |  4 ++++
 drivers/net/wireless/ath/ath10k/mac.c   |  1 +
 3 files changed, 20 insertions(+), 3 deletions(-)

Comments

kernel test robot April 19, 2018, 11:19 a.m. UTC | #1
Hi Ben,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mac80211/master]
[also build test ERROR on v4.17-rc1 next-20180419]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/greearb-candelatech-com/ethtool-Support-ETHTOOL_GSTATS2-command/20180419-105301
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git master
config: x86_64-randconfig-ne0-04191514 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> drivers/net/wireless/ath/ath10k/mac.c:7706:21: error: 'ath10k_debug_get_et_stats2' undeclared here (not in a function)
     .get_et_stats2   = ath10k_debug_get_et_stats2,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/ath10k_debug_get_et_stats2 +7706 drivers/net/wireless/ath/ath10k/mac.c

  7672	
  7673	static const struct ieee80211_ops ath10k_ops = {
  7674		.tx				= ath10k_mac_op_tx,
  7675		.wake_tx_queue			= ath10k_mac_op_wake_tx_queue,
  7676		.start				= ath10k_start,
  7677		.stop				= ath10k_stop,
  7678		.config				= ath10k_config,
  7679		.add_interface			= ath10k_add_interface,
  7680		.remove_interface		= ath10k_remove_interface,
  7681		.configure_filter		= ath10k_configure_filter,
  7682		.bss_info_changed		= ath10k_bss_info_changed,
  7683		.set_coverage_class		= ath10k_mac_op_set_coverage_class,
  7684		.hw_scan			= ath10k_hw_scan,
  7685		.cancel_hw_scan			= ath10k_cancel_hw_scan,
  7686		.set_key			= ath10k_set_key,
  7687		.set_default_unicast_key        = ath10k_set_default_unicast_key,
  7688		.sta_state			= ath10k_sta_state,
  7689		.conf_tx			= ath10k_conf_tx,
  7690		.remain_on_channel		= ath10k_remain_on_channel,
  7691		.cancel_remain_on_channel	= ath10k_cancel_remain_on_channel,
  7692		.set_rts_threshold		= ath10k_set_rts_threshold,
  7693		.set_frag_threshold		= ath10k_mac_op_set_frag_threshold,
  7694		.flush				= ath10k_flush,
  7695		.tx_last_beacon			= ath10k_tx_last_beacon,
  7696		.set_antenna			= ath10k_set_antenna,
  7697		.get_antenna			= ath10k_get_antenna,
  7698		.reconfig_complete		= ath10k_reconfig_complete,
  7699		.get_survey			= ath10k_get_survey,
  7700		.set_bitrate_mask		= ath10k_mac_op_set_bitrate_mask,
  7701		.sta_rc_update			= ath10k_sta_rc_update,
  7702		.offset_tsf			= ath10k_offset_tsf,
  7703		.ampdu_action			= ath10k_ampdu_action,
  7704		.get_et_sset_count		= ath10k_debug_get_et_sset_count,
  7705		.get_et_stats			= ath10k_debug_get_et_stats,
> 7706		.get_et_stats2			= ath10k_debug_get_et_stats2,
  7707		.get_et_strings			= ath10k_debug_get_et_strings,
  7708		.add_chanctx			= ath10k_mac_op_add_chanctx,
  7709		.remove_chanctx			= ath10k_mac_op_remove_chanctx,
  7710		.change_chanctx			= ath10k_mac_op_change_chanctx,
  7711		.assign_vif_chanctx		= ath10k_mac_op_assign_vif_chanctx,
  7712		.unassign_vif_chanctx		= ath10k_mac_op_unassign_vif_chanctx,
  7713		.switch_vif_chanctx		= ath10k_mac_op_switch_vif_chanctx,
  7714		.sta_pre_rcu_remove		= ath10k_mac_op_sta_pre_rcu_remove,
  7715		.sta_statistics			= ath10k_sta_statistics,
  7716	
  7717		CFG80211_TESTMODE_CMD(ath10k_tm_cmd)
  7718	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index bac832c..d559a3f 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_SKIP_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..595d964 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)
 {
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,