• Vladimir Oltean's avatar
    net: mscc: ocelot: keep ocelot_stat_layout by reg address, not offset · d4c36765
    Vladimir Oltean authored
    With so many counter addresses recently discovered as being wrong, it is
    desirable to at least have a central database of information, rather
    than two: one through the SYS_COUNT_* registers (used for
    ndo_get_stats64), and the other through the offset field of struct
    ocelot_stat_layout elements (used for ethtool -S).
    
    The strategy will be to keep the SYS_COUNT_* definitions as the single
    source of truth, but for that we need to expand our current definitions
    to cover all registers. Then we need to convert the ocelot region
    creation logic, and stats worker, to the read semantics imposed by going
    through SYS_COUNT_* absolute register addresses, rather than offsets
    of 32-bit words relative to SYS_COUNT_RX_OCTETS (which should have been
    SYS_CNT, by the way).
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    d4c36765
seville_vsc9953.c 45.4 KB