lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VE1PR04MB64962289FD3F748DC3F2350992E00@VE1PR04MB6496.eurprd04.prod.outlook.com>
Date:   Sat, 7 Mar 2020 04:38:45 +0000
From:   Po Liu <po.liu@....com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "vinicius.gomes@...el.com" <vinicius.gomes@...el.com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        Vladimir Oltean <vladimir.oltean@....com>,
        Alexandru Marginean <alexandru.marginean@....com>,
        Xiaoliang Yang <xiaoliang.yang_1@....com>,
        Roy Zang <roy.zang@....com>, Mingkai Hu <mingkai.hu@....com>,
        Jerry Huang <jerry.huang@....com>, Leo Li <leoyang.li@....com>,
        "michael.chan@...adcom.com" <michael.chan@...adcom.com>,
        "vishal@...lsio.com" <vishal@...lsio.com>,
        "saeedm@...lanox.com" <saeedm@...lanox.com>,
        "leon@...nel.org" <leon@...nel.org>,
        "jiri@...lanox.com" <jiri@...lanox.com>,
        "idosch@...lanox.com" <idosch@...lanox.com>,
        "alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
        "UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
        "jhs@...atatu.com" <jhs@...atatu.com>,
        "xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>,
        "simon.horman@...ronome.com" <simon.horman@...ronome.com>,
        "pablo@...filter.org" <pablo@...filter.org>,
        "moshe@...lanox.com" <moshe@...lanox.com>,
        "m-karicheri2@...com" <m-karicheri2@...com>,
        "andre.guedes@...ux.intel.com" <andre.guedes@...ux.intel.com>,
        "jiri@...lanox.com" <jiri@...lanox.com>
Subject: RE: [EXT] Re: [RFC,net-next  3/9] net: schedule: add action gate
 offloading

Hi Jakub,


> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: 2020年3月7日 3:19
> To: Po Liu <po.liu@....com>
> Cc: davem@...emloft.net; linux-kernel@...r.kernel.org;
> netdev@...r.kernel.org; vinicius.gomes@...el.com; Claudiu Manoil
> <claudiu.manoil@....com>; Vladimir Oltean <vladimir.oltean@....com>;
> Alexandru Marginean <alexandru.marginean@....com>; Xiaoliang Yang
> <xiaoliang.yang_1@....com>; Roy Zang <roy.zang@....com>; Mingkai Hu
> <mingkai.hu@....com>; Jerry Huang <jerry.huang@....com>; Leo Li
> <leoyang.li@....com>; michael.chan@...adcom.com; vishal@...lsio.com;
> saeedm@...lanox.com; leon@...nel.org; jiri@...lanox.com;
> idosch@...lanox.com; alexandre.belloni@...tlin.com;
> UNGLinuxDriver@...rochip.com; jhs@...atatu.com;
> xiyou.wangcong@...il.com; john.hurley@...ronome.com;
> simon.horman@...ronome.com;
> pieter.jansenvanvuuren@...ronome.com; pablo@...filter.org;
> moshe@...lanox.com; ivan.khoronzhuk@...aro.org; m-karicheri2@...com;
> andre.guedes@...ux.intel.com; jakub.kicinski@...ronome.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ