2
0
forked from Ivasoft/openwrt

generic: ar8216: group MIB counters and use two basic ones only by default

There are too many MIB counters that almost nobody needs since commit
d6366ce366 ("generic: ar8216: mib_work_func: read all port mibs
everytime").

In the worker function to poll MIB data, it deals with all ports instead
of only one port every time, which introduces too many mdio operations
that it becomes a heavy CPU load even on not-emulated MDIO bus.

This commit groups MIB counters and enable only TxBytes and RxGoodBytes
by default (both of which are necessary to get swconfig led working.)
and adds an swconfig attribute to allow enabling all counters if users
need them.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
This commit is contained in:
Chuanhong Guo
2019-04-11 21:45:45 +08:00
committed by Petr Štetiar
parent 107dc4326c
commit 01c0d7f86f
3 changed files with 150 additions and 81 deletions

View File

@@ -1328,6 +1328,13 @@ static const struct switch_attr ar8327_sw_attr_globals[] = {
.set = ar8xxx_sw_set_mib_poll_interval,
.get = ar8xxx_sw_get_mib_poll_interval
},
{
.type = SWITCH_TYPE_INT,
.name = "ar8xxx_mib_type",
.description = "MIB type (0=basic 1=extended)",
.set = ar8xxx_sw_set_mib_type,
.get = ar8xxx_sw_get_mib_type
},
{
.type = SWITCH_TYPE_INT,
.name = "enable_mirror_rx",