From: Johannes Berg <johannes@sipsolutions.net>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Jiri Pirko <jiri@resnulli.us>, Michal Kubecek <mkubecek@suse.cz>,
dsahern@kernel.org, pablo@netfilter.org, netdev@vger.kernel.org
Subject: Re: Genetlink per cmd policies
Date: Wed, 30 Sep 2020 21:03:08 +0200 [thread overview]
Message-ID: <563a2334a42cc5f33089c2bff172d92e118575ea.camel@sipsolutions.net> (raw)
In-Reply-To: <20200930120129.620a49f0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On Wed, 2020-09-30 at 12:01 -0700, Jakub Kicinski wrote:
> On Wed, 30 Sep 2020 20:36:24 +0200 Johannes Berg wrote:
> > On Wed, 2020-09-30 at 09:44 -0700, Jakub Kicinski wrote:
> >
> > > I started with a get_policy() callback, but I didn't like it much.
> > > Static data is much more pleasant for a client of the API IMHO.
> >
> > Yeah, true.
> >
> > > What do you think about "ops light"? Insufficiently flexible?
> >
> > TBH, I'm not really sure how you'd do it?
>
> There are very few users who actually access ops, I was thinking that
> callers to genl_get_cmd() should declare a full struct genl_ops on the
> stack (or in some context, not sure yet), and then genl_get_cmd() will
> fill it in.
>
> If family has full ops it will do a memcpy(); if the ops are "light" it
> can assign the right pointers.
>
> Plus it can propagate the policy and maxattr from family if needed in
> both cases.
Oh, so you were thinking you'd have to sort of decide on the *family*
level whether you want "light" or "heavy" ops?
Hm. I guess you could even have both?
struct genl_ops *ops;
struct genl_ops_ext *extops;
and then search both arrays, no need for memcpy/pointer assignment?
johannes
next prev parent reply other threads:[~2020-09-30 19:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 15:49 Genetlink per cmd policies Jakub Kicinski
2020-09-30 16:03 ` Michal Kubecek
2020-09-30 16:11 ` Jakub Kicinski
2020-09-30 16:06 ` Johannes Berg
2020-09-30 16:17 ` Johannes Berg
2020-09-30 16:44 ` Jakub Kicinski
2020-09-30 18:36 ` Johannes Berg
2020-09-30 18:42 ` Michal Kubecek
2020-09-30 18:42 ` Johannes Berg
2020-09-30 19:01 ` Jakub Kicinski
2020-09-30 19:03 ` Johannes Berg [this message]
2020-09-30 19:14 ` Jakub Kicinski
2020-09-30 19:15 ` Johannes Berg
2020-09-30 19:46 ` Jakub Kicinski
2020-09-30 20:13 ` Johannes Berg
2020-09-30 20:47 ` Jakub Kicinski
2020-09-30 23:38 ` Andrew Lunn
2020-10-01 0:23 ` Jakub Kicinski
2020-10-01 1:53 ` Andrew Lunn
2020-10-01 15:50 ` Jakub Kicinski
2020-10-01 15:52 ` Johannes Berg
2020-09-30 16:18 ` Jakub Kicinski
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=563a2334a42cc5f33089c2bff172d92e118575ea.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=dsahern@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=pablo@netfilter.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 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).