All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
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 09:44:55 -0700	[thread overview]
Message-ID: <20200930094455.668b6bff@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <a772c03bfbc8cf8230df631fe2db6f2dd7b96a2a.camel@sipsolutions.net>

On Wed, 30 Sep 2020 18:17:47 +0200 Johannes Berg wrote:
> On Wed, 2020-09-30 at 18:06 +0200, Johannes Berg wrote:
> > 
> > That's the historic info I guess - I'll take a look at ethtool later and
> > see what it's doing there.  
> 
> Oh, ok, I see how that works ... you *do* have a sort of common/aliased
> attribute inside each per-op family that then carries common sub-
> attributes. That can be linked into the policy.
> 
> I guess that's not a bad idea. I'd still prefer not to add
> maxattr/policy into the ops struct because like I said, that's a large
> amount of wasted space?
> 
> Perhaps then a "struct nla_policy *get_policy(int cmd, int *maxattr)"
> function (method) could work, and fall back to just "->policy" and"-
> >maxattr" if unset, and then you'd just have to write a few lines of  
> code for this case? Seems like overall that'd still be smaller than
> putting the pointer/maxattr into each and every op struct.

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.

What do you think about "ops light"? Insufficiently flexible?

  reply	other threads:[~2020-09-30 16:44 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 [this message]
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
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=20200930094455.668b6bff@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=dsahern@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=johannes@sipsolutions.net \
    --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 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.