• Vladimir Oltean's avatar
    net/sched: taprio: add netlink reporting for offload statistics counters · 6c1adb65
    Vladimir Oltean authored
    Offloading drivers may report some additional statistics counters, some
    of them even suggested by 802.1Q, like TransmissionOverrun.
    
    In my opinion we don't have to limit ourselves to reporting counters
    only globally to the Qdisc/interface, especially if the device has more
    detailed reporting (per traffic class), since the more detailed info is
    valuable for debugging and can help identifying who is exceeding its
    time slot.
    
    But on the other hand, some devices may not be able to report both per
    TC and global stats.
    
    So we end up reporting both ways, and use the good old ethtool_put_stat()
    strategy to determine which statistics are supported by this NIC.
    Statistics which aren't set are simply not reported to netlink. For this
    reason, we need something dynamic (a nlattr nest) to be reported through
    TCA_STATS_APP, and not something daft like the fixed-size and
    inextensible struct tc_codel_xstats. A good model for xstats which are a
    nlattr nest rather than a fixed struct seems to be cake.
    
     # Global stats
     $ tc -s qdisc show dev eth0 root
     # Per-tc stats
     $ tc -s class show dev eth0
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6c1adb65
sch_taprio.c 65.1 KB