[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200930120129.620a49f0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Wed, 30 Sep 2020 12:01:29 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Johannes Berg <johannes@...solutions.net>
Cc: Jiri Pirko <jiri@...nulli.us>, Michal Kubecek <mkubecek@...e.cz>,
dsahern@...nel.org, pablo@...filter.org, netdev@...r.kernel.org
Subject: Re: Genetlink per cmd policies
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.
Don't have the code yet, but shouldnt take long to get a PoC...
Powered by blists - more mailing lists