From: Jakub Kicinski <kuba@kernel.org>
To: Zahari Doychev <zaharido@web.de>
Cc: Zahari Doychev <zahari.doychev@linux.com>,
donald.hunter@gmail.com, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, horms@kernel.org,
jacob.e.keller@intel.com, ast@fiberby.net, matttbe@kernel.org,
netdev@vger.kernel.org, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us,
johannes@sipsolutions.net
Subject: Re: [PATCH v2 3/3] tools: ynl: ignore index 0 for indexed-arrays
Date: Tue, 11 Nov 2025 15:49:20 -0800 [thread overview]
Message-ID: <20251111154920.5803f208@kernel.org> (raw)
In-Reply-To: <xk64zrtvsbasla4winq5apbfmfcbbkfeq2td2cpqzlzwurdthx@4o3jwsoztwzt>
On Tue, 11 Nov 2025 21:34:28 +0200 Zahari Doychev wrote:
> On Mon, Nov 10, 2025 at 05:20:16PM -0800, Jakub Kicinski wrote:
> > On Thu, 6 Nov 2025 16:15:29 +0100 Zahari Doychev wrote:
> > > Linux tc actions expect the action order to start from index one.
> > > To accommodate this, update the code generation so array indexing
> > > begins at 1 for tc actions.
> > >
> > > This results in the following change:
> > >
> > > 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);
> > >
> > > This change does not impact other indexed array attributes at
> > > the moment, as analyzed in [1].
> >
> > YNL does not aim to provide perfect interfaces with weird old families.
>
> ok, maybe it is not that bad. I think I can workaround this by creating
> a dummy action at index 0. Does it make sense to send an update of the
> example with such change?
Yes, the sample itself is nice to have!
next prev parent reply other threads:[~2025-11-11 23:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 15:15 [PATCH v2 0/3] ynl: Fix tc filters with actions Zahari Doychev
2025-11-06 15:15 ` [PATCH v2 1/3] ynl: samples: add tc filter example Zahari Doychev
2025-11-11 1:17 ` Jakub Kicinski
2025-11-11 19:09 ` Zahari Doychev
2025-11-11 23:54 ` Jakub Kicinski
2025-11-06 15:15 ` [PATCH v2 2/3] tools: ynl: call nested attribute free function for indexed arrays Zahari Doychev
2025-11-06 15:15 ` [PATCH v2 3/3] tools: ynl: ignore index 0 for indexed-arrays Zahari Doychev
2025-11-11 1:20 ` Jakub Kicinski
2025-11-11 19:34 ` Zahari Doychev
2025-11-11 23:49 ` Jakub Kicinski [this message]
2025-11-11 1:30 ` [PATCH v2 0/3] ynl: Fix tc filters with actions patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251111154920.5803f208@kernel.org \
--to=kuba@kernel.org \
--cc=ast@fiberby.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=johannes@sipsolutions.net \
--cc=matttbe@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xiyou.wangcong@gmail.com \
--cc=zahari.doychev@linux.com \
--cc=zaharido@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).