netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jhs@mojatatu.com
Cc: eric.dumazet@gmail.com, jiri@resnulli.us, netdev@vger.kernel.org,
	xiyou.wangcong@gmail.com
Subject: Re: [PATCH net-next v4 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
Date: Thu, 20 Apr 2017 13:58:42 -0400 (EDT)	[thread overview]
Message-ID: <20170420.135842.510628867060301387.davem@davemloft.net> (raw)
In-Reply-To: <95110642-0f9c-d622-3ca5-16ad5115da2f@mojatatu.com>

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: Thu, 20 Apr 2017 13:38:14 -0400

> On 17-04-20 11:50 AM, David Miller wrote:
>> From: Jamal Hadi Salim <jhs@mojatatu.com>
>> Date: Thu, 20 Apr 2017 09:27:00 -0400
>>
>>> The issue Jiri is bringing up is unrelated. He is talking about
>>> a bitmap and conflating it with a data structure. They are not
>>> the same issue.
>>
>> Bitmaps can have the same exact problem as padding if we didn't code
>> it correctly.
>>
>> The issue is _purely_, "did we check unused 'fields' and enforce them
>> to be a certain value"
>>
>> If not, we lose, and can't use those "fields" in the future.
>>
>> This rule applies whether you are speaking about padding or a bitmask.
>>
> 
> There are no examples of such issues with bitmasks encapsulated in
> TLVs
> that exist.
> I grep iproute2 code and there are tons of example of bitmask flags
> being sent in TLVs. They all start with:
> 
> u64/32/16 mybitflags = 0;
> 
> if i want foo then
>        mybitflags |= BRIDGE_FLAGS_SELF;
> if i want bar then
>        mybitflags |= xxxx
> 
> addattr16/32/64(&req.n, sizeof(req), ATTR_XXX, mybitflags);
> 
> It does not make much sense to have a TLV for each of these
> bits when i can fit a bunch of them in u16/32/64.

I have not ruled out bitmasks.  I'm only saying that the kernel must
properly reject bits it doesn't recognize when they are set.

Each bit must have a strict semantic, even unused ones, otherwise
unused ones may never safely be used in the future.

  reply	other threads:[~2017-04-20 17:58 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 11:57 [PATCH net-next v4 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch Jamal Hadi Salim
2017-04-19 11:57 ` [PATCH net-next v4 2/2] net sched actions: add time filter for action dumping Jamal Hadi Salim
2017-04-19 12:53   ` Jiri Pirko
2017-04-19 13:11     ` Jamal Hadi Salim
2017-04-19 14:14       ` Jiri Pirko
2017-04-19 15:47         ` Jamal Hadi Salim
2017-04-19 15:55           ` Jiri Pirko
2017-04-19 12:36 ` [PATCH net-next v4 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch Jiri Pirko
2017-04-19 12:55   ` Roman Mashak
2017-04-19 13:05     ` Jiri Pirko
2017-04-19 13:03   ` Jamal Hadi Salim
2017-04-19 13:13     ` Jiri Pirko
2017-04-19 15:37       ` Jamal Hadi Salim
2017-04-19 15:54         ` Jiri Pirko
2017-04-19 16:07           ` Jamal Hadi Salim
2017-04-19 16:17             ` Jiri Pirko
2017-04-20 10:42               ` Jamal Hadi Salim
2017-04-20 11:35                 ` Jiri Pirko
2017-04-20 14:03                   ` Jamal Hadi Salim
2017-04-20 12:18                 ` Eric Dumazet
2017-04-20 13:27                   ` Jamal Hadi Salim
2017-04-20 15:50                     ` David Miller
2017-04-20 17:38                       ` Jamal Hadi Salim
2017-04-20 17:58                         ` David Miller [this message]
2017-04-21 10:36                           ` Jamal Hadi Salim
2017-04-21 14:51                             ` David Miller
2017-04-21 15:29                               ` Jamal Hadi Salim
2017-04-21 15:38                                 ` David Miller
2017-04-21 15:55                                   ` Jamal Hadi Salim
2017-04-21 16:01                                     ` Jamal Hadi Salim
2017-04-21 16:12                                       ` David Miller
2017-04-21 18:11                                         ` Jamal Hadi Salim
2017-04-22 11:30                                           ` Jamal Hadi Salim
2017-04-24  9:27                                           ` Simon Horman
2017-04-24 12:54                                             ` Jamal Hadi Salim
2017-04-21 16:11                                     ` David Miller
2017-04-20 15:23                   ` David Miller

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=20170420.135842.510628867060301387.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --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 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).