[PATCH v3] ath10k: Fix 10.4 extended peer stats update
From: Mohammed Shafi Shajakhan 10.4 'extended peer stats' will be not be appended with normal peer stats data and they shall be coming in separate chunks. Fix this by maintaining a separate linked list 'extender peer stats' for 10.4 and update rx_duration for per station statistics. Also parse through beacon filter (if enabled), to make sure we parse the extended peer stats properly. This issue was exposed when more than one client is connected and extended peer stats for 10.4 is enabled The order for the stats is as below S - standard peer stats, E- extended peer stats, B - beacon filter stats {S1, S2, S3..} -> {B1, B2, B3..}(if available) -> {E1, E2, E3..} Fixes: f9575793d44c ("ath10k: enable parsing per station rx duration for 10.4") Signed-off-by: Mohammed Shafi Shajakhan --- [v1: addressed line wrap around comment from Kalle] [v2: fixed ; in dummy inline function definition - thanks Sven Eckelmann] [v3: removed wmi-op-version suggested by Kalle, introduced fw specifi hw param for extd_stats] drivers/net/wireless/ath/ath10k/core.c|3 ++ drivers/net/wireless/ath/ath10k/core.h|9 + drivers/net/wireless/ath/ath10k/debug.c | 18 - drivers/net/wireless/ath/ath10k/debug.h |8 ++-- drivers/net/wireless/ath/ath10k/debugfs_sta.c | 32 ++- drivers/net/wireless/ath/ath10k/wmi.c | 53 ++--- drivers/net/wireless/ath/ath10k/wmi.h | 14 ++- 7 files changed, 117 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 9ccb69c..bfa96ac 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -181,6 +181,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .board = QCA99X0_HW_2_0_BOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, + .extd_peer_stats = true, }, }, { @@ -203,6 +204,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .board = QCA9984_HW_1_0_BOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, + .extd_peer_stats = true, }, }, { @@ -261,6 +263,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .board = QCA4019_HW_1_0_BOARD_DATA_FILE, .board_size = QCA4019_BOARD_DATA_SZ, .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, + .extd_peer_stats = true, }, }, }; diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index bbc4e0f..da9b2a9 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -165,6 +165,13 @@ struct ath10k_fw_stats_peer { u32 rx_duration; }; +struct ath10k_fw_extd_stats_peer { + struct list_head list; + + u8 peer_macaddr[ETH_ALEN]; + u32 rx_duration; +}; + struct ath10k_fw_stats_vdev { struct list_head list; @@ -259,6 +266,7 @@ struct ath10k_fw_stats { struct list_head pdevs; struct list_head vdevs; struct list_head peers; + struct list_head peers_extd; }; #define ATH10K_TPC_TABLE_TYPE_FLAG 1 @@ -752,6 +760,7 @@ struct ath10k { const char *board; size_t board_size; size_t board_ext_size; + bool extd_peer_stats; } fw; } hw_params; diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 8fbb8f2..001c0a1 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -313,6 +313,16 @@ static void ath10k_fw_stats_peers_free(struct list_head *head) } } +static void ath10k_fw_extd_stats_peers_free(struct list_head *head) +{ + struct ath10k_fw_extd_stats_peer *i, *tmp; + + list_for_each_entry_safe(i, tmp, head, list) { + list_del(&i->list); + kfree(i); + } +} + static void ath10k_debug_fw_stats_reset(struct ath10k *ar) { spin_lock_bh(&ar->data_lock); @@ -320,6 +330,7 @@ static void ath10k_debug_fw_stats_reset(struct ath10k *ar) ath10k_fw_stats_pdevs_free(&ar->debug.fw_stats.pdevs); ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); + ath10k_fw_extd_stats_peers_free(&ar->debug.fw_stats.peers_extd); spin_unlock_bh(&ar->data_lock); } @@ -334,6 +345,7 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) INIT_LIS
Re: [v3] ath10k: Fix 10.4 extended peer stats update
Mohammed Shafi Shajakhan wrote: > From: Mohammed Shafi Shajakhan > > 10.4 'extended peer stats' will be not be appended with normal peer stats > data and they shall be coming in separate chunks. Fix this by maintaining > a separate linked list 'extender peer stats' for 10.4 and update > rx_duration for per station statistics. Also parse through beacon filter > (if enabled), to make sure we parse the extended peer stats properly. > This issue was exposed when more than one client is connected and > extended peer stats for 10.4 is enabled > > The order for the stats is as below > S - standard peer stats, E- extended peer stats, B - beacon filter stats > > {S1, S2, S3..} -> {B1, B2, B3..}(if available) -> {E1, E2, E3..} > > Fixes: f9575793d44c ("ath10k: enable parsing per station rx duration for > 10.4") > Signed-off-by: Mohammed Shafi Shajakhan Thanks, 1 patch applied to ath-next branch of ath.git: 4a49ae94a448 ath10k: fix 10.4 extended peer stats update -- Sent by pwcli https://patchwork.kernel.org/patch/9149357/ -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] ath10k: Fix 10.4 extended peer stats update
Mohammed Shafi Shajakhan writes: > From: Mohammed Shafi Shajakhan > > 10.4 'extended peer stats' will be not be appended with normal peer stats > data and they shall be coming in separate chunks. Fix this by maintaining > a separate linked list 'extender peer stats' for 10.4 and update > rx_duration for per station statistics. Also parse through beacon filter > (if enabled), to make sure we parse the extended peer stats properly. > This issue was exposed when more than one client is connected and > extended peer stats for 10.4 is enabled > > The order for the stats is as below > S - standard peer stats, E- extended peer stats, B - beacon filter stats > > {S1, S2, S3..} -> {B1, B2, B3..}(if available) -> {E1, E2, E3..} > > Fixes: f9575793d44c ("ath10k: enable parsing per station rx duration for > 10.4") > Signed-off-by: Mohammed Shafi Shajakhan > --- > [v1: addressed line wrap around comment from Kalle] > [v2: fixed ; in dummy inline function definition - thanks Sven Eckelmann] > [v3: removed wmi-op-version suggested by Kalle, introduced fw specifi hw > param for extd_stats] I was sure I replied to this, but I can't find my reply anywhere. So I guess I didn't, sorry about that. > --- a/drivers/net/wireless/ath/ath10k/core.c > +++ b/drivers/net/wireless/ath/ath10k/core.c > @@ -181,6 +181,7 @@ static const struct ath10k_hw_params > ath10k_hw_params_list[] = { > .board = QCA99X0_HW_2_0_BOARD_DATA_FILE, > .board_size = QCA99X0_BOARD_DATA_SZ, > .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, > + .extd_peer_stats = true, > }, > }, > { > @@ -203,6 +204,7 @@ static const struct ath10k_hw_params > ath10k_hw_params_list[] = { > .board = QCA9984_HW_1_0_BOARD_DATA_FILE, > .board_size = QCA99X0_BOARD_DATA_SZ, > .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, > + .extd_peer_stats = true, > }, > }, > { > @@ -261,6 +263,7 @@ static const struct ath10k_hw_params > ath10k_hw_params_list[] = { > .board = QCA4019_HW_1_0_BOARD_DATA_FILE, > .board_size = QCA4019_BOARD_DATA_SZ, > .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, > + .extd_peer_stats = true, > }, > }, > }; This is not a hardware feature so hw_params is not really the right place to handle this. In the pending branch I tried to solve this a bit differently: https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=ecf4daadc7677518ec7185dbddab959ac6e2db96 I added a bool "extended" to struct ath10k_fw_stats which is used to detect if extended stats are used. Would that work? Please note that I have only compile tested the patch. -- Kalle Valo-- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] ath10k: Fix 10.4 extended peer stats update
Kalle Valo writes: >> @@ -261,6 +263,7 @@ static const struct ath10k_hw_params >> ath10k_hw_params_list[] = { >> .board = QCA4019_HW_1_0_BOARD_DATA_FILE, >> .board_size = QCA4019_BOARD_DATA_SZ, >> .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, >> +.extd_peer_stats = true, >> }, >> }, >> }; > > This is not a hardware feature so hw_params is not really the right > place to handle this. In the pending branch I tried to solve this a bit > differently: > > https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=ecf4daadc7677518ec7185dbddab959ac6e2db96 > > I added a bool "extended" to struct ath10k_fw_stats which is used to > detect if extended stats are used. Would that work? Please note that I > have only compile tested the patch. Here's a diff of what I did: diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 58932c09efc5..b734345ab598 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -180,7 +180,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .board = QCA99X0_HW_2_0_BOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, - .extd_peer_stats = true, }, }, { @@ -203,7 +202,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .board = QCA9984_HW_1_0_BOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, - .extd_peer_stats = true, }, }, { @@ -261,7 +259,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .board = QCA4019_HW_1_0_BOARD_DATA_FILE, .board_size = QCA4019_BOARD_DATA_SZ, .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, - .extd_peer_stats = true, }, }, }; diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 73a0b1ae1559..3707d8a707a2 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -263,6 +263,7 @@ struct ath10k_fw_stats_pdev { }; struct ath10k_fw_stats { + bool extended; struct list_head pdevs; struct list_head vdevs; struct list_head peers; @@ -754,7 +755,6 @@ struct ath10k { const char *board; size_t board_size; size_t board_ext_size; - bool extd_peer_stats; } fw; } hw_params; diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 001c0a144614..355e1ae665f9 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -327,6 +327,7 @@ static void ath10k_debug_fw_stats_reset(struct ath10k *ar) { spin_lock_bh(&ar->data_lock); ar->debug.fw_stats_done = false; + ar->debug.fw_stats.extended = false; ath10k_fw_stats_pdevs_free(&ar->debug.fw_stats.pdevs); ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index af3d49af9eab..0da8a57e0ba7 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -19,14 +19,14 @@ #include "debug.h" static void ath10k_sta_update_extd_stats_rx_duration(struct ath10k *ar, -struct list_head *head) +struct ath10k_fw_stats *stats) { - struct ieee80211_sta *sta; struct ath10k_fw_extd_stats_peer *peer; + struct ieee80211_sta *sta; struct ath10k_sta *arsta; rcu_read_lock(); - list_for_each_entry(peer, head, list) { + list_for_each_entry(peer, &stats->peers_extd, list) { sta = ieee80211_find_sta_by_ifaddr(ar->hw, peer->peer_macaddr, NULL); if (!sta) @@ -38,13 +38,14 @@ static void ath10k_sta_update_extd_stats_rx_duration(struct ath10k *ar, } static void ath10k_sta_update_stats_rx_duration(struct ath10k *ar, - struct list_head *head) -{ struct ieee80211_sta *sta; + struct ath10k_fw_stats *stats) +{ struct ath10k_fw_stats_peer *peer; + struct ieee80211_sta *sta; struct ath10k_sta *arsta; rcu_rea
Re: [PATCH v3] ath10k: Fix 10.4 extended peer stats update
Hi Kalle, On Thu, Jun 30, 2016 at 10:49:02AM +, Valo, Kalle wrote: > Kalle Valo writes: > > >> @@ -261,6 +263,7 @@ static const struct ath10k_hw_params > >> ath10k_hw_params_list[] = { > >>.board = QCA4019_HW_1_0_BOARD_DATA_FILE, > >>.board_size = QCA4019_BOARD_DATA_SZ, > >>.board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, > >> + .extd_peer_stats = true, > >>}, > >>}, > >> }; > > > > This is not a hardware feature so hw_params is not really the right > > place to handle this. In the pending branch I tried to solve this a bit > > differently: > > > > https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=ecf4daadc7677518ec7185dbddab959ac6e2db96 > > > > I added a bool "extended" to struct ath10k_fw_stats which is used to > > detect if extended stats are used. Would that work? Please note that I > > have only compile tested the patch. [shafi] thanks for taking time to do this, the change looks fine to me ! since 'ath10k_sta_update_rx_duration' is called right after 'ath10k_wmi_pull_fw_stats' this should properly update the rx_duration based on the current data > > Here's a diff of what I did: > > diff --git a/drivers/net/wireless/ath/ath10k/core.c > b/drivers/net/wireless/ath/ath10k/core.c > index 58932c09efc5..b734345ab598 100644 > --- a/drivers/net/wireless/ath/ath10k/core.c > +++ b/drivers/net/wireless/ath/ath10k/core.c > @@ -180,7 +180,6 @@ static const struct ath10k_hw_params > ath10k_hw_params_list[] = { > .board = QCA99X0_HW_2_0_BOARD_DATA_FILE, > .board_size = QCA99X0_BOARD_DATA_SZ, > .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, > - .extd_peer_stats = true, > }, > }, > { > @@ -203,7 +202,6 @@ static const struct ath10k_hw_params > ath10k_hw_params_list[] = { > .board = QCA9984_HW_1_0_BOARD_DATA_FILE, > .board_size = QCA99X0_BOARD_DATA_SZ, > .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, > - .extd_peer_stats = true, > }, > }, > { > @@ -261,7 +259,6 @@ static const struct ath10k_hw_params > ath10k_hw_params_list[] = { > .board = QCA4019_HW_1_0_BOARD_DATA_FILE, > .board_size = QCA4019_BOARD_DATA_SZ, > .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, > - .extd_peer_stats = true, > }, > }, > }; > diff --git a/drivers/net/wireless/ath/ath10k/core.h > b/drivers/net/wireless/ath/ath10k/core.h > index 73a0b1ae1559..3707d8a707a2 100644 > --- a/drivers/net/wireless/ath/ath10k/core.h > +++ b/drivers/net/wireless/ath/ath10k/core.h > @@ -263,6 +263,7 @@ struct ath10k_fw_stats_pdev { > }; > > struct ath10k_fw_stats { > + bool extended; > struct list_head pdevs; > struct list_head vdevs; > struct list_head peers; > @@ -754,7 +755,6 @@ struct ath10k { > const char *board; > size_t board_size; > size_t board_ext_size; > - bool extd_peer_stats; > } fw; > } hw_params; > > diff --git a/drivers/net/wireless/ath/ath10k/debug.c > b/drivers/net/wireless/ath/ath10k/debug.c > index 001c0a144614..355e1ae665f9 100644 > --- a/drivers/net/wireless/ath/ath10k/debug.c > +++ b/drivers/net/wireless/ath/ath10k/debug.c > @@ -327,6 +327,7 @@ static void ath10k_debug_fw_stats_reset(struct ath10k *ar) > { > spin_lock_bh(&ar->data_lock); > ar->debug.fw_stats_done = false; > + ar->debug.fw_stats.extended = false; > ath10k_fw_stats_pdevs_free(&ar->debug.fw_stats.pdevs); > ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); > ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); > diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c > b/drivers/net/wireless/ath/ath10k/debugfs_sta.c > index af3d49af9eab..0da8a57e0ba7 100644 > --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c > +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c > @@ -19,14 +19,14 @@ > #include "debug.h" > > static void ath10k_sta_update_extd_stats_rx_duration(struct ath10k *ar, > - struct list_head *head) > + struct ath10k_fw_stats > *stats) > { > - struct ieee80211_sta *sta; > struct ath10k_fw_extd_stats_peer *peer; > + struct ieee80211_sta *sta; > struct ath10k_sta *arsta; > > rcu_read_lock(); > - list_for_each_entry(peer, head, list) { > + list_for_each_entry(peer, &stats->peers_extd, list) { > sta = ieee80211_find_sta_by_ifaddr(ar->hw, peer->peer_macaddr, > NULL); > if (!sta) > @@ -38,13 +38,14 @@ static void > ath10k_sta_update_extd
Re: [PATCH v3] ath10k: Fix 10.4 extended peer stats update
Mohammed Shafi Shajakhan writes: > Hi Kalle, > > On Thu, Jun 30, 2016 at 10:49:02AM +, Valo, Kalle wrote: >> Kalle Valo writes: >> >> >> @@ -261,6 +263,7 @@ static const struct ath10k_hw_params >> >> ath10k_hw_params_list[] = { >> >> .board = QCA4019_HW_1_0_BOARD_DATA_FILE, >> >> .board_size = QCA4019_BOARD_DATA_SZ, >> >> .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, >> >> + .extd_peer_stats = true, >> >> }, >> >> }, >> >> }; >> > >> > This is not a hardware feature so hw_params is not really the right >> > place to handle this. In the pending branch I tried to solve this a bit >> > differently: >> > >> > https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=ecf4daadc7677518ec7185dbddab959ac6e2db96 >> > >> > I added a bool "extended" to struct ath10k_fw_stats which is used to >> > detect if extended stats are used. Would that work? Please note that I >> > have only compile tested the patch. > > [shafi] thanks for taking time to do this, the change looks fine to me ! > since 'ath10k_sta_update_rx_duration' is called right after > 'ath10k_wmi_pull_fw_stats' > this should properly update the rx_duration based on the current data Could you also run some tests to make sure? I don't trust my own code :) -- Kalle Valo-- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] ath10k: Fix 10.4 extended peer stats update
On Thu, Jun 30, 2016 at 11:09:31AM +, Valo, Kalle wrote: > Mohammed Shafi Shajakhan writes: > > > Hi Kalle, > > > > On Thu, Jun 30, 2016 at 10:49:02AM +, Valo, Kalle wrote: > >> Kalle Valo writes: > >> > >> >> @@ -261,6 +263,7 @@ static const struct ath10k_hw_params > >> >> ath10k_hw_params_list[] = { > >> >> .board = QCA4019_HW_1_0_BOARD_DATA_FILE, > >> >> .board_size = QCA4019_BOARD_DATA_SZ, > >> >> .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, > >> >> + .extd_peer_stats = true, > >> >> }, > >> >> }, > >> >> }; > >> > > >> > This is not a hardware feature so hw_params is not really the right > >> > place to handle this. In the pending branch I tried to solve this a bit > >> > differently: > >> > > >> > https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=ecf4daadc7677518ec7185dbddab959ac6e2db96 > >> > > >> > I added a bool "extended" to struct ath10k_fw_stats which is used to > >> > detect if extended stats are used. Would that work? Please note that I > >> > have only compile tested the patch. > > > > [shafi] thanks for taking time to do this, the change looks fine to me ! > > since 'ath10k_sta_update_rx_duration' is called right after > > 'ath10k_wmi_pull_fw_stats' > > this should properly update the rx_duration based on the current data > > Could you also run some tests to make sure? I don't trust my own code :) > [shafi] sure no problem, will do that, thanks for fixing this properly regards, shafi -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html