[PATCH net-next 7/7] netlink: specs: tc: set ignore-index on indexed-arrays

Asbjørn Sloth Tønnesen posted 7 patches 3 months, 2 weeks ago
[PATCH net-next 7/7] netlink: specs: tc: set ignore-index on indexed-arrays
Posted by Asbjørn Sloth Tønnesen 3 months, 2 weeks ago
The indexes in tc indexed-arrays are mostly used for defining
the priority winin an array of actions, and when parsed by the
kernel they must be unique, and not exceed TCA_ACT_MAX_PRIO (32).

Therefore this patch only sets ignore-index on a single
attribute TCA_CAKE_STATS_TIN_STATS, which is only used for
dumping statistics, and never ingested by the kernel.

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓
┃                                  ┃ out/    ┃ input/ ┃ ignore ┃
┃ Attribute                        ┃ dump    ┃ parsed ┃ -index ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━┩
│ TCA_BASIC_ACT                    │ 1++ (2) │ yes(3) │ no     │
│ TCA_BPF_ACT                      │ 1++ (2) │ yes(3) │ no     │
│ TCA_CAKE_STATS_TIN_STATS         │ 1++ (4) │ -      │ yes    │
│ TCA_CGROUP_ACT                   │ 1++ (2) │ yes(3) │ no     │
│ TCA_FLOWER_ACT                   │ 1++ (2) │ yes(3) │ no     │
│ TCA_FW_ACT                       │ 1++ (2) │ yes(3) │ no     │
│ TCA_MATCHALL_ACT                 │ 1++ (2) │ yes(3) │ no     │
│ TCA_ROUTE4_ACT                   │ 1++ (2) │ yes(3) │ no     │
│ TCA_U32_ACT                      │ 1++ (2) │ yes(3) │ no     │
└──────────────────────────────────┴─────────┴────────┴────────┘

Where:
  1++) incrementing index starting from 1
  2)   All _ACT are dumped with tcf_exts_dump() calling tcf_action_dump().
  3)   Parsed in tcf_action_init().
  4)   Dumped in cake_dump_stats().

Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
---
 Documentation/netlink/specs/tc.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/specs/tc.yaml
index b398f7a46dae1..24866fccb7d15 100644
--- a/Documentation/netlink/specs/tc.yaml
+++ b/Documentation/netlink/specs/tc.yaml
@@ -2188,6 +2188,7 @@ attribute-sets:
         name: tin-stats
         type: indexed-array
         sub-type: nest
+        ignore-index: true
         nested-attributes: cake-tin-stats-attrs
       -
         name: deficit
-- 
2.51.0