ip stats: A new front-end for RTM_GETSTATS / RTM_SETSTATS
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest11 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | libnetlink: Add filtering to rtnl_statsdump_req_filter()bridge/ include/ ip/ +3 more | +33 | 0 replies | |
| 2/11 | ip: Publish functions for stats formattingip/ ip/ | +25 | 0 replies | |
| 3/11 | ip: Add a new family of commands, "stats"ip/ ip/ ip/ +1 more | +35 | 0 replies | |
| 4/11 | ipstats: Add a "set" commandip/ | +78 | 0 replies | |
| 5/11 | ipstats: Add a shell of "show" commandip/ ip/ | +638 | 0 replies | |
| 6/11 | ipstats: Add a group "link"ip/ | +90 | 4 replies | |
| 7/11 | ipstats: Add a group "offload", subgroup "cpu_hit"ip/ | +37 | 0 replies | |
| 8/11 | ipstats: Add offload subgroup "hw_stats_info"ip/ | +217 | 0 replies | |
| 9/11 | ipstats: Add offload subgroup "l3_stats"ip/ | +158 | 0 replies | |
| 10/11 | ipmonitor: Add monitoring support for stats eventsip/ ip/ ip/ | +36 | 0 replies | |
| 11/11 | man: Add man pages for the "stats" functionsman/ man/ man/ | +167 | 0 replies |
Reviews trailers per patch
All 11 patches have a Reviewed-by or Acked-by.
| Patch | Ido Schimmel |
|---|---|
| 1/11 | R-b |
| 2/11 | R-b |
| 3/11 | R-b |
| 4/11 | R-b |
| 5/11 | R-b |
| 6/11 | R-b |
| 7/11 | R-b |
| 8/11 | R-b |
| 9/11 | R-b |
| 10/11 | R-b |
| 11/11 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH iproute2-next 00/11] ip stats: A new front-end for RTM_GETSTATS / RTM_SETSTATS
A new rtnetlink message, RTM_SETSTATS, has been added recently in kernel commit ca0a53dcec94 ("Merge branch 'net-hw-counters-for-soft-devices'").
At the same time, RTM_GETSTATS has been around for a while. The users of this API are spread in a couple different places: "ip link xstats" reads stats from the IFLA_STATS_LINK_XSTATS and _XSTATS_SLAVE subgroups, "ip link afstats" then reads IFLA_STATS_AF_SPEC.
Finally, to read IFLA_STATS_LINK_OFFLOAD_XSTATS, one would use ifstats. This does not seem to be a good fit for IFLA_OFFLOAD_XSTATS_HW_S_INFO in particular.
The obvious place to expose all these offload stats suites would be under a new link subcommand "ip link offload_xstats", or similar, which would then have syntax for both showing stats and setting them.
However, this looks like a good opportunity to introduce a new top-level command, "ip stats", that would be the go-to place to access anything backed by RTM_GETSTATS and RTM_SETSTATS.
This patchset therefore does the following:
- It adds the new "stats" infrastructure
- It adds specifically the ability to toggle and show the suites that were recently added to Linux, IFLA_OFFLOAD_XSTATS_HW_S_INFO and IFLA_OFFLOAD_XSTATS_L3_STATS.
- It adds support to dump IFLA_OFFLOAD_XSTATS_CPU_HIT, which was not available under "ip" at all.
- Does all this in a way that is easy to extend for new stats suites.
The patchset proceeds as follows:
- Patches #1 and #2 lay some groundwork and tweak existing code.
- Patch #3 adds the shell of the new "ip stats" command.
- Patch #4 adds "ip stats set" and the ability to toggle l3_stats in particular.
- Patch #5 adds "ip stats show", but no actual stats suites.
- Patches #6-#9 add support for showing individual stats suites:
respectively, IFLA_STATS_LINK_64, IFLA_OFFLOAD_XSTATS_CPU_HIT, IFLA_OFFLOAD_XSTATS_HW_S_INFO and IFLA_OFFLOAD_XSTATS_L3_STATS.
- Patch #10 adds support for monitoring stats events to "ip monitor".
- Patch #11 adds man page verbiage for the above.
The plan is to contribute support for afstats and xstats in a follow-up patch set.
Petr Machata (11):
libnetlink: Add filtering to rtnl_statsdump_req_filter()
ip: Publish functions for stats formatting
ip: Add a new family of commands, "stats"
ipstats: Add a "set" command
ipstats: Add a shell of "show" command
ipstats: Add a group "link"
ipstats: Add a group "offload", subgroup "cpu_hit"
ipstats: Add offload subgroup "hw_stats_info"
ipstats: Add offload subgroup "l3_stats"
ipmonitor: Add monitoring support for stats events
man: Add man pages for the "stats" functions
bridge/vlan.c | 6 +- include/libnetlink.h | 11 +- ip/Makefile | 3 +- ip/ip.c | 1 + ip/ip_common.h | 31 + ip/ipaddress.c | 33 +- ip/iplink.c | 3 +- ip/iplink_xstats.c | 3 +- ip/ipmonitor.c | 16 +- ip/ipstats.c | 1241 +++++++++++++++++++++++++++++++++++++++++ lib/libnetlink.c | 19 +- man/man8/ip-monitor.8 | 2 +- man/man8/ip-stats.8 | 160 ++++++ man/man8/ip.8 | 7 +- misc/ifstat.c | 2 +- 15 files changed, 1512 insertions(+), 26 deletions(-) create mode 100644 ip/ipstats.c create mode 100644 man/man8/ip-stats.8
Signature · 1 line
2.31.1