2022-02-21 09:08:37

by Oleksij Rempel

[permalink] [raw]
Subject: [PATCH net-next v1 1/1] net: dsa: microchip: ksz9477: reduce polling interval for statistics

30 seconds is too long interval especially if it used with ip -s l.
Reduce polling interval to 5 sec.

Signed-off-by: Oleksij Rempel <[email protected]>
---
drivers/net/dsa/microchip/ksz_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 27cae9f04322..0531aa671574 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -453,7 +453,7 @@ int ksz_switch_register(struct ksz_device *dev,
}

/* Read MIB counters every 30 seconds to avoid overflow. */
- dev->mib_read_interval = msecs_to_jiffies(30000);
+ dev->mib_read_interval = msecs_to_jiffies(5000);

/* Start the MIB timer. */
schedule_delayed_work(&dev->mib_read, 0);
--
2.30.2


2022-02-23 02:34:50

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH net-next v1 1/1] net: dsa: microchip: ksz9477: reduce polling interval for statistics

On Mon, 21 Feb 2022 09:41:29 +0100 Oleksij Rempel wrote:
> 30 seconds is too long interval especially if it used with ip -s l.
> Reduce polling interval to 5 sec.
>
> Signed-off-by: Oleksij Rempel <[email protected]>
> ---
> drivers/net/dsa/microchip/ksz_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
> index 27cae9f04322..0531aa671574 100644
> --- a/drivers/net/dsa/microchip/ksz_common.c
> +++ b/drivers/net/dsa/microchip/ksz_common.c
> @@ -453,7 +453,7 @@ int ksz_switch_register(struct ksz_device *dev,
> }
>
> /* Read MIB counters every 30 seconds to avoid overflow. */
> - dev->mib_read_interval = msecs_to_jiffies(30000);
> + dev->mib_read_interval = msecs_to_jiffies(5000);
>
> /* Start the MIB timer. */
> schedule_delayed_work(&dev->mib_read, 0);

Seems reasonable, although who knows how slow the buses get.
In case we need to make it configurable in the future there's already
uAPI for it - stats_block_coalesce_usecs

2022-02-23 11:51:05

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next v1 1/1] net: dsa: microchip: ksz9477: reduce polling interval for statistics

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <[email protected]>:

On Mon, 21 Feb 2022 09:41:29 +0100 you wrote:
> 30 seconds is too long interval especially if it used with ip -s l.
> Reduce polling interval to 5 sec.
>
> Signed-off-by: Oleksij Rempel <[email protected]>
> ---
> drivers/net/dsa/microchip/ksz_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [net-next,v1,1/1] net: dsa: microchip: ksz9477: reduce polling interval for statistics
https://git.kernel.org/netdev/net-next/c/12c740c8683f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html