[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251020163221.2c8347ea@kernel.org>
Date: Mon, 20 Oct 2025 16:32:21 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Zahari Doychev <zahari.doychev@...ux.com>
Cc: donald.hunter@...il.com, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, horms@...nel.org, jacob.e.keller@...el.com,
ast@...erby.net, matttbe@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
jiri@...nulli.us, johannes@...solutions.net
Subject: Re: [PATCH 4/4] tools: ynl: add start-index property for indexed
arrays
On Sat, 18 Oct 2025 17:17:37 +0200 Zahari Doychev wrote:
> The Linux tc actions expect that the action order starts from index
> one. To accommodate this, add a start-index property to the ynl spec
> for indexed arrays. This property allows the starting index to be
> specified, ensuring compatibility with consumers that require a
> non-zero-based index.
>
> For example if we have "start_index = 1" then we get the following
> diff.
>
> ynl_attr_put_str(nlh, TCA_FLOWER_INDEV, obj->indev);
> array = ynl_attr_nest_start(nlh, TCA_FLOWER_ACT);
> for (i = 0; i < obj->_count.act; i++)
> - tc_act_attrs_put(nlh, i, &obj->act[i]);
> + tc_act_attrs_put(nlh, i + 1, &obj->act[i]);
> ynl_attr_nest_end(nlh, array);
The first one is just silently skipped by the kernel right?
We need to be selective about what API stupidity we try to
cover up in YNL. Otherwise the specs will be unmanageably complex.
IMO this one should be a comment in the spec explaining that action
0 is ignore and that's it.
Powered by blists - more mailing lists