netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Edward Cree <ecree@solarflare.com>,
	netdev@vger.kernel.org, davem@davemloft.net,
	netfilter-devel@vger.kernel.org, jiri@resnulli.us
Subject: Re: [RFC PATCH net] net: flow_offload: simplify hw stats check handling
Date: Thu, 7 May 2020 16:48:20 -0700	[thread overview]
Message-ID: <20200507164820.0f48c36b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200507164643.GA10994@salvia>

On Thu, 7 May 2020 18:46:43 +0200 Pablo Neira Ayuso wrote:
> On Thu, May 07, 2020 at 04:49:15PM +0100, Edward Cree wrote:
> > On 07/05/2020 16:32, Pablo Neira Ayuso wrote:  
> > > On Thu, May 07, 2020 at 03:59:09PM +0100, Edward Cree wrote:  
> > >> Make FLOW_ACTION_HW_STATS_DONT_CARE be all bits, rather than none, so that
> > >>  drivers and __flow_action_hw_stats_check can use simple bitwise checks.  
> > > 
> > > You have have to explain why this makes sense in terms of semantics.
> > > 
> > > _DISABLED and _ANY are contradicting each other.  
> > No, they aren't.  The DISABLED bit means "I will accept disabled", it doesn't
> >  mean "I insist on disabled".  What _does_ mean "I insist on disabled" is if
> >  the DISABLED bit is set and no other bits are.
> > So DISABLED | ANY means "I accept disabled; I also accept immediate or
> >  delayed".  A.k.a. "I don't care, do what you like".  
> 
> Jiri said Disabled means: bail out if you cannot disable it.

That's in TC uAPI Jiri chose... doesn't mean we have to do the same
internally.

> If the driver cannot disable, then it will have to check if the
> frontend is asking for Disabled (hence, report error to the frontend)
> or if it is actually asking for Don't care.
> 
> What you propose is a context-based interpretation of the bits. So
> semantics depend on how you accumulate/combine bits.
> 
> I really think bits semantics should be interpreted on the bit alone
> itself.

These 3 paragraphs sound to me like you were arguing for Ed's approach..

> There is one exception though, that is _ANY case, where you let the
> driver pick between delayed or immediate. But if the driver does not
> support for counters, it bails out in any case, so the outcome in both
> request is basically the same.
> 
> You are asking for different outcome depending on how bits are
> combined, which can be done, but it sounds innecessarily complicated
> to me.

No, quite the opposite, the code as committed to net has magic values
which drivers have to check.

The counter-proposal is that each bit represents a configuration, and
if more than one bit is set the driver gets to choose which it prefers. 
What could be simpler?

netfilter just has to explicitly set the field to DONT_CARE rather than 
depending on 0 form zalloc() coinciding with the correct value.

  reply	other threads:[~2020-05-07 23:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 14:59 [RFC PATCH net] net: flow_offload: simplify hw stats check handling Edward Cree
2020-05-07 15:32 ` Pablo Neira Ayuso
2020-05-07 15:49   ` Edward Cree
2020-05-07 16:46     ` Pablo Neira Ayuso
2020-05-07 23:48       ` Jakub Kicinski [this message]
2020-05-11  5:33         ` Jiri Pirko
2020-05-11 10:09           ` Edward Cree
2020-05-07 15:36 ` Pablo Neira Ayuso

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=20200507164820.0f48c36b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=ecree@solarflare.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@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 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).