]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tcp_metrics: add netlink protocol spec in YAML
authorJakub Kicinski <kuba@kernel.org>
Thu, 27 Jun 2024 21:35:51 +0000 (14:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Jul 2024 08:44:27 +0000 (09:44 +0100)
commit85674625e0bc25be4dbaa165a556ef6037328379
tree1543cb769e391bb52fd912ea17407576bd7f1318
parent7c8110057b1bb9ab9f47ac0efc554d5c3a53b693
tcp_metrics: add netlink protocol spec in YAML

Add a protocol spec for tcp_metrics, so that it's accessible via YNL.
Useful at the very least for testing fixes.

In this episode of "10,000 ways to complicate netlink" the metric
nest has defines which are off by 1. iproute2 does:

        struct rtattr *m[TCP_METRIC_MAX + 1 + 1];

        parse_rtattr_nested(m, TCP_METRIC_MAX + 1, a);

        for (i = 0; i < TCP_METRIC_MAX + 1; i++) {
                // ...
                attr = m[i + 1];

This is too weird to support in YNL, add a new set of defines
with _correct_ values to the official kernel header.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/netlink/specs/tcp_metrics.yaml [new file with mode: 0644]
include/uapi/linux/tcp_metrics.h
tools/net/ynl/Makefile.deps