lkml.org 
[lkml]   [2020]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [EXT] Re: [RFC,net-next 3/9] net: schedule: add action gate offloading
Date
Hi Jakub,


> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: 2020年3月7日 3:19
> To: Po Liu <po.liu@nxp.com>
> Cc: davem@davemloft.net; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org; vinicius.gomes@intel.com; Claudiu Manoil
> <claudiu.manoil@nxp.com>; Vladimir Oltean <vladimir.oltean@nxp.com>;
> Alexandru Marginean <alexandru.marginean@nxp.com>; Xiaoliang Yang
> <xiaoliang.yang_1@nxp.com>; Roy Zang <roy.zang@nxp.com>; Mingkai Hu
> <mingkai.hu@nxp.com>; Jerry Huang <jerry.huang@nxp.com>; Leo Li
> <leoyang.li@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; jhs@mojatatu.com;
> xiyou.wangcong@gmail.com; john.hurley@netronome.com;
> simon.horman@netronome.com;
> pieter.jansenvanvuuren@netronome.com; pablo@netfilter.org;
> moshe@mellanox.com; ivan.khoronzhuk@linaro.org; m-karicheri2@ti.com;
> andre.guedes@linux.intel.com; jakub.kicinski@netronome.com
> Subject: [EXT] Re: [RFC,net-next 3/9] net: schedule: add action gate
> offloading
>
> Caution: EXT Email
>
> On Fri, 6 Mar 2020 11:02:00 -0800 Jakub Kicinski wrote:
> > On Fri, 6 Mar 2020 20:56:01 +0800 Po Liu wrote:
> > > +static int tcf_gate_get_entries(struct flow_action_entry *entry,
> > > + const struct tc_action *act) {
> > > + entry->gate.entries = tcf_gate_get_list(act);
> > > +
> > > + if (!entry->gate.entries)
> > > + return -EINVAL;
> > > +
> > > + entry->destructor = tcf_gate_entry_destructor;
> > > + entry->destructor_priv = entry->gate.entries;
> >
> > What's this destructor stuff doing? I don't it being called.

It prepare a gate list array parameters for offloading. So the driver side would not link the data with protocol side. Destructor would free the temporary gate list array.

>
> Ah, it's the action destructor, not something gate specific. Disregard.

I understand here with actions are:
Each tc flower follow up with actions. Each action defined:

struct flow_action_entry {
enum flow_action_id id;
action_destr destructor;
void *destructor_priv;
union {
......
{}sample,
{}police,
{}gate,
}
}

So for the destructor and destructor_priv are provided specific for the union action. So it is not gate specific. For mirror action, destructor_priv would be point to a mirror device data.
I suppose it is for destroy the temporary data like it name. And after tc_setup_flow_action() loaded, the destructor function would be loaded by tc_cleanup_flow_action() to destroy and free the temporary data.

Code flow is :
net/sched/cls_flower.c
static int fl_hw_replace_filter()
{
......
tc_setup_flow_action(); ---------------------------------------> assign action parameters (with the destructor and destructor_priv if the action needed)
......
tc_setup_cb_add() ----------------------------------------------> call the driver provide rules with actions datas for device
......
tc_cleanup_flow_action(&cls_flower.rule->action); ---> loading each action''s destructor(destructor_priv)
}

So for each action would be with its private destructor and destructor_priv if the action needed, and then destroyed at tc_cleanup_flow_action().

Did I misunderstand anything?

Thanks!

Br,
Po Liu
\
 
 \ /
  Last update: 2020-03-07 05:39    [W:0.130 / U:10.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site