linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Po Liu <po.liu@nxp.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"idosch@idosch.org" <idosch@idosch.org>
Cc: "jiri@resnulli.us" <jiri@resnulli.us>,
	"vinicius.gomes@intel.com" <vinicius.gomes@intel.com>,
	"vlad@buslov.dev" <vlad@buslov.dev>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Alexandru Marginean <alexandru.marginean@nxp.com>,
	"michael.chan@broadcom.com" <michael.chan@broadcom.com>,
	"vishal@chelsio.com" <vishal@chelsio.com>,
	"saeedm@mellanox.com" <saeedm@mellanox.com>,
	"leon@kernel.org" <leon@kernel.org>,
	"jiri@mellanox.com" <jiri@mellanox.com>,
	"idosch@mellanox.com" <idosch@mellanox.com>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"xiyou.wangcong@gmail.com" <xiyou.wangcong@gmail.com>,
	"simon.horman@netronome.com" <simon.horman@netronome.com>,
	"pablo@netfilter.org" <pablo@netfilter.org>,
	"moshe@mellanox.com" <moshe@mellanox.com>,
	"m-karicheri2@ti.com" <m-karicheri2@ti.com>,
	"andre.guedes@linux.intel.com" <andre.guedes@linux.intel.com>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	Edward Cree <ecree@solarflare.com>
Subject: Re: [v1,net-next 3/4] net: qos: police action add index for tc flower offloading
Date: Wed, 24 Jun 2020 08:44:34 -0400	[thread overview]
Message-ID: <18e0ceb0-7cc7-12cc-624d-286cfbd70b94@mojatatu.com> (raw)
In-Reply-To: <VE1PR04MB6496AD2BE9868D72A475935492940@VE1PR04MB6496.eurprd04.prod.outlook.com>

On 2020-06-23 7:52 p.m., Po Liu wrote:
> Hi Jamal,
> 
> 

>>>> My question: Is this any different from how stats are structured?
>>>

[..]
>> My question: Why cant you apply the same semantics for the counters?
>> Does your hardware have an indexed counter/stats table? If yes then you
> 
> Yes, 

That is the point i was trying to get to. Basically:
You have a counter table which is referenced by "index"
You also have a meter/policer table which is referenced by "index".

For policers, they maintain their own stats. So when i say:
tc ... flower ... action police ... index 5
The index referred to is in the policer table

But for other actions, example when i say:
tc ... flower ... action drop index 10
The index is in the counter/stats table.
It is not exactly "10" in hardware, the driver magically hides
it from the user - so it could be hw counter index 1234

The old approach is to assume the classifier (flower in this
case) has a counter. The reason for this assumption is older
hardware was designed to deal with a single action per match.
So a counter to the filter is also the counter to the
(single) action. I get the feeling your hardware fits in that
space.

Modern use cases have evolved from the ACL single match and action
approach. Maintaining the old thought/architecture breaks in two
use cases:
1) when you have multiple actions per policy filter. You need
counter-per-action for various reasons
2) Sharing of counters across filters and action. This can
be achieve

tc supports the above and is sufficient to cover the old use
cases.
I am just worried, architecturally, we are restricting ourselves
to the old scheme.

Another reason this is important is for the sake of analytics.
A user space app can poll just for the stats table in hardware
(or the cached version in the kernel) and reduce the amount of
data crossing to user space..

cheers,
jamal






  reply	other threads:[~2020-06-24 12:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 23:52 Re: [v1,net-next 3/4] net: qos: police action add index for tc flower offloading Po Liu
2020-06-24 12:44 ` Jamal Hadi Salim [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-25  0:34 Po Liu
2020-06-26 13:28 ` Jamal Hadi Salim
2020-06-23 11:55 Po Liu
2020-06-23 12:17 ` Jamal Hadi Salim
2020-03-06 12:56 [RFC,net-next 6/9] net: qos: add tc police offloading action with max frame size limit Po Liu
2020-06-23  6:34 ` [v1,net-next 1/4] " Po Liu
2020-06-23  6:34   ` [v1,net-next 3/4] net: qos: police action add index for tc flower offloading Po Liu
2020-06-23  7:09     ` Ido Schimmel
2020-06-23 10:08     ` 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=18e0ceb0-7cc7-12cc-624d-286cfbd70b94@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandru.marginean@nxp.com \
    --cc=andre.guedes@linux.intel.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=ecree@solarflare.com \
    --cc=idosch@idosch.org \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=michael.chan@broadcom.com \
    --cc=moshe@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=po.liu@nxp.com \
    --cc=saeedm@mellanox.com \
    --cc=simon.horman@netronome.com \
    --cc=stephen@networkplumber.org \
    --cc=vinicius.gomes@intel.com \
    --cc=vishal@chelsio.com \
    --cc=vlad@buslov.dev \
    --cc=vladimir.oltean@nxp.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 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).