From: Andrew Lunn <andrew@lunn.ch>
To: Tristram.Ha@microchip.com
Cc: sergio.paracuellos@gmail.com, f.fainelli@gmail.com, pavel@ucw.cz,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org
Subject: Re: [PATCH v1 net-next 2/4] net: dsa: microchip: add MIB counter reading support
Date: Wed, 13 Feb 2019 04:28:16 +0100 [thread overview]
Message-ID: <20190213032816.GE7527@lunn.ch> (raw)
In-Reply-To: <SN1PR11MB04465D50382C3F7438DA0FADEC660@SN1PR11MB0446.namprd11.prod.outlook.com>
> All of the MIB counters, except some that may be marked by driver,
> do not get updated when the link is down, so it is a waste of time
> to read them.
Hi Tristram
O.K, so make this clear in the code. Maybe rather than having this
link_just_down, have the adjust link callback update the cached
values for all counters?
> My intention is the driver eventually reads the MIB counters at
> least every second or faster so that the ethtool API called to show
> MIB counters gets them from memory rather than starting a read
> operation.
The user expects to see the current counters, not some cached values.
For me it is O.K. to frequently read the counters to prevent wrap
around, but each ethtool call should update the counters before
returning them to user space.
> For simple switches that do not need to do anything special the MIB
> read operation does not cause any issue except CPU load, for more
> complicate switches that need to do some background operations too
> many read operation can affect some critical functions.
Sounds like a bad design of the switch, if reading statistics from it
can upset its operation. You might want to consider rate limiting the
ethtool call.
Andrew
next prev parent reply other threads:[~2019-02-13 3:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-08 4:07 [PATCH v1 net-next 0/4] net: dsa: microchip: add MIB counters support Tristram.Ha
2019-02-08 4:07 ` [PATCH v1 net-next 1/4] net: dsa: microchip: prepare PHY for proper advertisement Tristram.Ha
2019-02-09 16:54 ` Andrew Lunn
2019-02-08 4:07 ` [PATCH v1 net-next 2/4] net: dsa: microchip: add MIB counter reading support Tristram.Ha
2019-02-09 17:22 ` Andrew Lunn
2019-02-13 2:39 ` Tristram.Ha
2019-02-13 3:28 ` Andrew Lunn [this message]
2019-02-13 3:51 ` Florian Fainelli
2019-02-14 19:26 ` Tristram.Ha
2019-02-14 19:33 ` Florian Fainelli
2019-02-20 23:49 ` Joe Perches
2019-02-25 18:34 ` Pavel Machek
2019-02-08 4:07 ` [PATCH v1 net-next 3/4] net: dsa: microchip: use readx_poll_time for polling Tristram.Ha
2019-02-09 17:01 ` Andrew Lunn
2019-02-13 2:53 ` Tristram.Ha
2019-02-08 4:07 ` [PATCH v1 net-next 4/4] net: dsa: microchip: remove unnecessary include headers Tristram.Ha
2019-02-09 17:01 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190213032816.GE7527@lunn.ch \
--to=andrew@lunn.ch \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=sergio.paracuellos@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.