From: David Ahern Date: Fri, 15 Mar 2024 15:05:23 +0000 (+0000) Subject: Merge branch 'nexthop-grp-stats' into next X-Git-Tag: v6.10.0~10^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a6d30c95da98fbb375e7f1520fad34c1e959441;p=thirdparty%2Fiproute2.git Merge branch 'nexthop-grp-stats' into next Petr Machata says: ==================== Next hop group stats allow verification of balancedness of a next hop group. The feature was merged in kernel commit 7cf497e5a122 ("Merge branch 'nexthop-group-stats'"). This patchset adds to ip the corresponding support. NH group stats come in two flavors: as statistics for SW and for HW datapaths. The former is shown when -s is given to "ip nexthop". The latter demands more work from the kernel, and possibly driver and HW, and might not be always necessary. Therefore tie it to -s -s, similarly to how ip link shows more detailed stats when -s is given twice. Here's an example usage: # ip link add name gre1 up type gre \ local 172.16.1.1 remote 172.16.1.2 tos inherit # ip nexthop replace id 1001 dev gre1 # ip nexthop replace id 1002 dev gre1 # ip nexthop replace id 1111 group 1001/1002 hw_stats on # ip -s -s -j -p nexthop show id 1111 [ { [ ...snip... ] "hw_stats": { "enabled": true, "used": true }, "group_stats": [ { "id": 1001, "packets": 0, "packets_hw": 0 },{ "id": 1002, "packets": 0, "packets_hw": 0 } ] } ] hw_stats.enabled shows whether hw_stats have been requested for the given group. hw_stats.used shows whether any driver actually implemented the counter. group_stats[].packets show the total stats, packets_hw only the HW-datapath stats. ==================== Signed-off-by: David Ahern --- 7a6d30c95da98fbb375e7f1520fad34c1e959441