All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	xiyou.wangcong@gmail.com, eric.dumazet@gmail.com,
	simon.horman@netronome.com, mrv@mojatatu.com
Subject: Re: [PATCH net-next v10 1/4] net netlink: Add new type NLA_FLAG_BITS
Date: Mon, 12 Jun 2017 12:34:32 +0200	[thread overview]
Message-ID: <20170612103432.GA1993@nanopsycho> (raw)
In-Reply-To: <4441aa62-d00e-82b6-d337-f86cf97e3c6d@mojatatu.com>

Sun, Jun 11, 2017 at 08:37:25PM CEST, jhs@mojatatu.com wrote:
>On 17-06-11 01:38 PM, Jamal Hadi Salim wrote:
>> On 17-06-11 09:49 AM, Jiri Pirko wrote:
>> > Sun, Jun 11, 2017 at 01:53:43PM CEST, jhs@mojatatu.com wrote:
>> > > From: Jamal Hadi Salim <jhs@mojatatu.com>
>> 
>> 
>> > > This patch also provides an extra feature: a validation callback
>> > > that could be speaciliazed for other types.
>> > 
>> > s/speaciliazed/speciliazed/
>> > 
>> 
>> Will fix.
>> 
>> 
>> > > 
>> > > [ATTR_GOO] = { .type = MYTYPE,
>> > >            .validation_data = &myvalidation_data,
>> > >                .validate_content = mycontent_validator },
>> > 
>> > Indent is wrong. (Does not matter really in desc, but anyway)
>> > 
>> 
>> I cant find out how it got indented that way; my source
>> or email dont show it as such (but really doesnt matter).
>> 
>> 
>> > Suggested-by: Jiri Pirko <jiri@mellanox.com>
>> > 
>> 
>> Will add.
>> 
>> > 
>> > > ---
>> > > include/net/netlink.h          | 11 +++++++++++
>> > > include/uapi/linux/rtnetlink.h | 17 +++++++++++++++++
>> > > lib/nlattr.c                   | 25 +++++++++++++++++++++++++
>> > > 3 files changed, 53 insertions(+)
>> > > 
>> > > diff --git a/include/net/netlink.h b/include/net/netlink.h
>> > > index 0170917..8ab9784 100644
>> > > --- a/include/net/netlink.h
>> > > +++ b/include/net/netlink.h
>> > > @@ -6,6 +6,11 @@
>> > > #include <linux/jiffies.h>
>> > > #include <linux/in6.h>
>> > > 
>> > > +struct nla_bit_flags {
>> > > +    u32 nla_flag_values;
>> > > +    u32 nla_flag_selector;
>> > > +};
>> > 
>> > I don't understand why you redefine the struct here. You already have it
>> > defined in the uapi: struct __nla_bit_flags
>> > 
>> > Just move this (struct nla_bit_flags) to the uapi and remove
>> > __nla_bit_flags ?
>> > 
>> 
>> I am not sure that will compile since the type is defined in netlink.h
>> Also, note: uapi uses _u32 and kernel uses u32 as types i.e it is pretty
>> common approach; i will try to move it to uapi and keep that uapi
>> format. If it doesnt compile without acrobatics I will keep it as is.
>> 
>
>It doesnt compile - I could move it to linux/netlink.h but it seems
>so out of place.
>so i will keep things as is for now unless you can think of something
>else.

First of all, makes no sense to put this struct "struct __nla_bit_flags"
into rtnetlink.h uapi file. This is generic netlink stuff, not specifict
to rtnetlink.

I believe that this struct should go into:
include/uapi/linux/netlink.h

struct nla_flag_bits {
	__u32 nla_flag_bits_values;
	__u32 nla_flag_bits_selector;
};

Then you can use it from userspace and everywhere in kernel.

Btw, I find it very odd that enum containling NLA_* like NLA_U32 and
others is not part of uapi file and is rather defined in
include/net/netlink.h. Any idea why?

  reply	other threads:[~2017-06-12 10:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-11 11:53 [PATCH net-next v10 0/4] net sched actions: improve dump performance Jamal Hadi Salim
2017-06-11 11:53 ` [PATCH net-next v10 1/4] net netlink: Add new type NLA_FLAG_BITS Jamal Hadi Salim
2017-06-11 13:49   ` Jiri Pirko
2017-06-11 17:38     ` Jamal Hadi Salim
2017-06-11 18:37       ` Jamal Hadi Salim
2017-06-12 10:34         ` Jiri Pirko [this message]
2017-06-12 11:10           ` Jamal Hadi Salim
2017-06-12 11:43             ` Jiri Pirko
2017-06-12 13:51               ` Jamal Hadi Salim
2017-06-12 14:14                 ` Jiri Pirko
2017-06-12 15:00                   ` David Ahern
2017-06-12 19:22                     ` Jiri Pirko
2017-06-12 19:58                       ` David Ahern
2017-06-13  5:32                         ` Jiri Pirko
2017-06-13 10:53                           ` Jamal Hadi Salim
2017-06-13 11:25                             ` Jiri Pirko
2017-06-13 13:58                               ` David Ahern
2017-06-11 11:53 ` [PATCH net-next v10 2/4] net sched actions: Use proper root attribute table for actions Jamal Hadi Salim
2017-06-11 13:55   ` Jiri Pirko
2017-06-11 11:53 ` [PATCH net-next v10 3/4] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch Jamal Hadi Salim
2017-06-11 14:13   ` Jiri Pirko
2017-06-11 17:45     ` Jamal Hadi Salim
2017-06-12 11:16     ` Jamal Hadi Salim
2017-06-12 11:47       ` Jiri Pirko
2017-06-12 13:57         ` Jamal Hadi Salim
2017-06-12 14:16           ` Jiri Pirko
2017-06-11 11:53 ` [PATCH net-next v10 4/4] net sched actions: add time filter for action dumping Jamal Hadi Salim
2017-06-11 12:06 ` [PATCH net-next v10 0/4] net sched actions: improve dump performance Jamal Hadi Salim

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=20170612103432.GA1993@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.com \
    --cc=xiyou.wangcong@gmail.com \
    /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.