lkml.org 
[lkml]   [2020]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: Re: [v1,net-next 3/4] net: qos: police action add index for tc flower offloading
Date
Hi Jamal,


> -----Original Message-----
> From: Jamal Hadi Salim <jhs@mojatatu.com>
> Sent: 2020年6月23日 20:18
> To: Po Liu <po.liu@nxp.com>; davem@davemloft.net; linux-
> kernel@vger.kernel.org; netdev@vger.kernel.org; idosch@idosch.org
> Cc: jiri@resnulli.us; vinicius.gomes@intel.com; 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;
> vishal@chelsio.com; saeedm@mellanox.com; leon@kernel.org;
> jiri@mellanox.com; idosch@mellanox.com;
> alexandre.belloni@bootlin.com; UNGLinuxDriver@microchip.com;
> kuba@kernel.org; xiyou.wangcong@gmail.com;
> simon.horman@netronome.com; pablo@netfilter.org;
> moshe@mellanox.com; m-karicheri2@ti.com;
> andre.guedes@linux.intel.com; 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
>
> On 2020-06-23 7:55 a.m., Po Liu wrote:
>
>
> [..]
> >> My question: Is this any different from how stats are structured?
> >
> > I don't know I fully catch the question. Are you trying to get how many
> frames for each filter chain passing one index policing action?
> > If one index police action bind to multiple tc filter(they should have
> differnt chain index ). All those filter should get same index police action
> stats value since they are sharing the same hardware entry. But I don't
> think this is the problem.
> >
>
> This is a good thing. What is nice is i can use the same index for s/w and
> h/w (and no need for a translation/remapping).
>
> > With index provide to device driver(map the s/w action index to a h/w
> table index ), user could list the police actions list by command:
> > # tc actions show action police
> > Shows the police action table by index.
>
> This is also nice.
>
> 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, but I think tc flower can only care about the counters of that chain. And action police care about how many frames for each police entry.

> should be able to do similar thing for counters as you do for policer (i.e
> use an index and share counters across actions). So when i say:
> tc action drop index 5

Do you mean something like "tc xxx flower action police index 5 drop" since '' tc action drop index 5" is not a proper command? (there is 'action drop' follow the tc filter command but not with index assigned).

> and
> tc action ok index 5
> infact they use the same counter.

Maybe you are saying if action police follow with 'CONTROL' (reclassify | pipe | drop | continue | ok) when offloading to hardware. With different 'CONTROL', the hardware counter won't changed since hardware never known what the 'CONTROL' is. This is still software part and will do at software part(although software seems not deal with this, I also suggest to after offloading should back to tcf_police_act() continue the action).

When set to be offloading mode, the counters only showing the hardware counters(even different vendor could set different counter register.). But I don't think the index offloading could break anything.

>
>
> cheers,
> jamal


Br,
Po Liu
\
 
 \ /
  Last update: 2020-06-24 01:54    [W:0.064 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site