2021-11-18 16:41:37

by Ben Greear

[permalink] [raw]
Subject: [PATCH 11/11] mt76: mt7915: poll mib counters every 200ms

From: Ben Greear <[email protected]>

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

Signed-off-by: Ben Greear <[email protected]>
---
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);
--
2.20.1



2021-11-18 17:01:38

by Ryder Lee

[permalink] [raw]
Subject: Re: [PATCH 11/11] mt76: mt7915: poll mib counters every 200ms

On Thu, 2021-11-18 at 08:40 -0800, [email protected] wrote:
> From: Ben Greear <[email protected]>
>
> Instead of every 500ms, this will do better job of catching wraps
> of 16-bit pkt counters.
>
> Signed-off-by: Ben Greear <[email protected]>
> ---
> 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