netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jiri@resnulli.us
Cc: xiyou.wangcong@gmail.com, netdev@vger.kernel.org,
	jhs@mojatatu.com, jiri@mellanox.com
Subject: Re: [Patch net-next] net_sched: only create filter chains for new filters/actions
Date: Fri, 26 May 2017 10:54:43 -0400 (EDT)	[thread overview]
Message-ID: <20170526.105443.1489276661727770629.davem@davemloft.net> (raw)
In-Reply-To: <20170526055352.GA1898@nanopsycho>

From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 26 May 2017 07:53:52 +0200

> Thu, May 25, 2017 at 06:14:56PM CEST, davem@davemloft.net wrote:
>>From: Cong Wang <xiyou.wangcong@gmail.com>
>>Date: Tue, 23 May 2017 09:42:37 -0700
>>
>>> tcf_chain_get() always creates a new filter chain if not found
>>> in existing ones. This is totally unnecessary when we get or
>>> delete filters, new chain should be only created for new filters
>>> (or new actions).
>>> 
>>> Fixes: 5bc1701881e3 ("net: sched: introduce multichain support for filters")
>>> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
>>> Cc: Jiri Pirko <jiri@mellanox.com>
>>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>>
>>Indeed, get and delete requests should not create new objects, ever.
>>
>>I have pretty much no idea why Jiri is making such a big fuss about
>>this change, to be quite honest. :-)
> 
> Because it makes already hard to read code even worse, for *no* benefit.
> That's why.

Jiri, if you say the same thing 100 times, it doesn't help anyone
understand your arguments any better.

Creating new objects when a GET or a DEL is requested is flat out
wrong.

And Cong is fixing that.

And I also didn't find the boolean logic hard to understand at all.

It is in fact a very common pattern to pass a "create" boolean into
lookup functions, to tell them whether to create a new object on
lookup failure or not.  And then also to control that boolean via
what kind of netlink request we are processing.

So you tell me what's so bad about his change given the above?

Give me details and real facts, like I just did, rather than vague
statements about "benefit" and "hard to read".

Thank you.

  reply	other threads:[~2017-05-26 14:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 16:42 [Patch net-next] net_sched: only create filter chains for new filters/actions Cong Wang
2017-05-24  6:37 ` Jiri Pirko
2017-05-24 15:53   ` Cong Wang
2017-05-24 20:23     ` Jiri Pirko
2017-05-25 16:14 ` David Miller
2017-05-26  5:53   ` Jiri Pirko
2017-05-26 14:54     ` David Miller [this message]
2017-05-26 16:55       ` Cong Wang
2017-05-27 10:05         ` Jiri Pirko
2017-05-30 17:05           ` Cong Wang
2017-05-27 10:02       ` Jiri Pirko

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=20170526.105443.1489276661727770629.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@mellanox.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).