diff mbox series

[11/11] mt76: mt7915: poll mib counters every 200ms

Message ID 20211118164056.2965-11-greearb@candelatech.com (mailing list archive)
State Rejected
Delegated to: Felix Fietkau
Headers show
Series [01/11] mt76: mt7915: add comments about rx descriptor parsing | expand

Commit Message

Ben Greear Nov. 18, 2021, 4:40 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

Instead of every 500ms, this will do better job of catching wraps
of 16-bit pkt counters.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Ryder Lee Nov. 18, 2021, 5:01 p.m. UTC | #1
On Thu, 2021-11-18 at 08:40 -0800, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> Instead of every 500ms, this will do better job of catching wraps
> of 16-bit pkt counters.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> index 3c89c7573015..7cfa6b2abda5 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> @@ -2390,7 +2390,11 @@ void mt7915_mac_work(struct work_struct *work)
>  	mutex_lock(&mphy->dev->mutex);
>  
>  	mt76_update_survey(mphy);
> -	if (++mphy->mac_work_count == 5) {
> +
> +	/* this method is called about every 100ms.  Some pkt counters
> are 16-bit,
> +	 * so poll every 200ms to keep overflows at a minimum.
> +	 */
> +	if (++mphy->mac_work_count == 2) {
>  		mphy->mac_work_count = 0;
>  
>  		mt7915_mac_update_stats(phy);

I guess we need to do some testing on embedded platform to see it hurts
performance.

Ryder
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index 3c89c7573015..7cfa6b2abda5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -2390,7 +2390,11 @@  void mt7915_mac_work(struct work_struct *work)
 	mutex_lock(&mphy->dev->mutex);
 
 	mt76_update_survey(mphy);
-	if (++mphy->mac_work_count == 5) {
+
+	/* this method is called about every 100ms.  Some pkt counters are 16-bit,
+	 * so poll every 200ms to keep overflows at a minimum.
+	 */
+	if (++mphy->mac_work_count == 2) {
 		mphy->mac_work_count = 0;
 
 		mt7915_mac_update_stats(phy);