From: Jakub Kicinski <kuba@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, robh@kernel.org, stephen@networkplumber.org,
ecree.xilinx@gmail.com, sdf@google.com, f.fainelli@gmail.com,
fw@strlen.de, linux-doc@vger.kernel.org, razor@blackwall.org,
nicolas.dichtel@6wind.com, Bagas Sanjaya <bagasdotme@gmail.com>
Subject: Re: [PATCH net-next v3 1/8] docs: add more netlink docs (incl. spec docs)
Date: Fri, 20 Jan 2023 09:23:23 -0800 [thread overview]
Message-ID: <20230120092323.39d3787e@kernel.org> (raw)
In-Reply-To: <2b7f7f76aac4fcf2a51eb5588e64316b62f27d65.camel@sipsolutions.net>
On Fri, 20 Jan 2023 10:15:39 +0100 Johannes Berg wrote:
> > > > +Support dump consistency
> > > > +------------------------
> > > > +
> > > > +If iterating over objects during dump may skip over objects or repeat
> > > > +them - make sure to report dump inconsistency with ``NLM_F_DUMP_INTR``.
> > >
> > > That could be a bit more fleshed out on _how_ to do that, if it's not
> > > somewhere else?
> >
> > I was thinking about adding a sentence like "To avoid consistency
> > issues store your objects in an Xarray and correctly use the ID during
> > iteration".. but it seems to hand-wavy. Really the coder needs to
> > understand dumps quite well to get what's going on, and then the
> > consistency is kinda obvious. IDK. Almost nobody gets this right :(
>
> Yeah agree, it's tricky one way or the other. To be honest I was
> thinking less of documenting the mechanics of the underlying code to
> ensure that, but rather of the mechanics of using the APIs to ensure
> that, i.e. how to use cb->seq and friends.
I see. Let me add that.
My hope was to steer people towards data structures with stable
indexes, so the problem doesn't occur. But I'll add a mention of
the helpers.
> > > Unrelated to this particular document, but ...
> > >
> > > I'm all for this, btw, but maybe we should have a way of representing in
> > > the policy that an attribute is used as multi-attr for an array, and a
> > > way of exposing that in the policy export? Hmm. Haven't thought about
> > > this for a while.
> >
> > Informational-only or enforced? Enforcing this now would be another
> > backward-compat nightmare :(
>
> More informational - for userspace to know from policy dump that certain
> attributes have that property. With nested it's easy to know (there's a
> special nested-array type), but multi-attr there's no way to distinguish
> "is this one" and "is this multiple".
Makes sense.
> Now ... you might say you don't really care now since you want
> everything to be auto-generated and then you have it in the docs
> (actually, do you?), and that's a fair point.
Have in the docs that we want everything to be auto-generated?
> > FWIW I have a set parked on a branch to add "required" bit to policies,
> > so for per-op policies one can reject requests with missing attrs
> > during validation.
>
> Nice. That might yet convince me of per-op policies ;-)
>
> Though IMHO the namespace issue remains - I'd still not like to have 100
> definitions of NL80211_ATTR_IFINDEX or similar.
Yeah, there's different ways of dealing with it. The ethtool way is
pretty neat - have a nest in each command for "common attrs" with
ifindex and stuff in it.
next prev parent reply other threads:[~2023-01-20 17:23 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 0:36 [PATCH net-next v3 0/8] Netlink protocol specs Jakub Kicinski
2023-01-19 0:36 ` [PATCH net-next v3 1/8] docs: add more netlink docs (incl. spec docs) Jakub Kicinski
2023-01-19 15:48 ` Vladimir Oltean
2023-01-19 20:29 ` Johannes Berg
2023-01-20 0:23 ` Jacob Keller
2023-01-20 9:10 ` Johannes Berg
2023-01-20 18:35 ` Keller, Jacob E
2023-01-20 2:13 ` Jakub Kicinski
2023-01-20 9:15 ` Johannes Berg
2023-01-20 17:23 ` Jakub Kicinski [this message]
2023-01-19 0:36 ` [PATCH net-next v3 2/8] netlink: add schemas for YAML specs Jakub Kicinski
2023-01-19 14:07 ` Rob Herring
2023-01-19 21:49 ` Jakub Kicinski
2023-01-19 22:24 ` Jakub Kicinski
2023-01-19 23:02 ` Rob Herring
2023-01-20 0:08 ` Jakub Kicinski
2023-01-20 14:43 ` Rob Herring
2023-01-19 0:36 ` [PATCH net-next v3 3/8] net: add basic C code generators for Netlink Jakub Kicinski
2023-01-19 20:53 ` Johannes Berg
2023-01-20 1:53 ` Jakub Kicinski
2023-01-20 9:17 ` Johannes Berg
2023-01-19 0:36 ` [PATCH net-next v3 4/8] netlink: add a proto specification for FOU Jakub Kicinski
2023-01-19 0:36 ` [PATCH net-next v3 5/8] net: fou: regenerate the uAPI from the spec Jakub Kicinski
2023-01-19 0:36 ` [PATCH net-next v3 6/8] net: fou: rename the source for linking Jakub Kicinski
2023-01-19 0:36 ` [PATCH net-next v3 7/8] net: fou: use policy and operation tables generated from the spec Jakub Kicinski
2023-01-19 20:56 ` Johannes Berg
2023-01-20 0:18 ` Jacob Keller
2023-01-20 1:04 ` Jakub Kicinski
2023-01-19 0:36 ` [PATCH net-next v3 8/8] tools: ynl: add a completely generic client Jakub Kicinski
2023-01-20 0:50 ` Jacob Keller
2023-01-19 17:07 ` [PATCH net-next v3 0/8] Netlink protocol specs Stanislav Fomichev
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=20230120092323.39d3787e@kernel.org \
--to=kuba@kernel.org \
--cc=bagasdotme@gmail.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=fw@strlen.de \
--cc=johannes@sipsolutions.net \
--cc=linux-doc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=robh@kernel.org \
--cc=sdf@google.com \
--cc=stephen@networkplumber.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.