From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next v2 0/9] net: sched: introduce chain templates support with offloading to mlxsw Date: Wed, 27 Jun 2018 09:03:44 +0200 Message-ID: <20180627070344.GT2161@nanopsycho> References: <20180626080000.12964-1-jiri@resnulli.us> <20180627060504.GS2161@nanopsycho> <4b2e7870-b225-3855-f3ac-183126142c1c@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Cong Wang , Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , Jakub Kicinski , Simon Horman , john.hurley@netronome.com, David Ahern , mlxsw@mellanox.com To: "Samudrala, Sridhar" Return-path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:35259 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046AbeF0HFD (ORCPT ); Wed, 27 Jun 2018 03:05:03 -0400 Received: by mail-wm0-f65.google.com with SMTP id z137-v6so4223322wmc.0 for ; Wed, 27 Jun 2018 00:05:03 -0700 (PDT) Content-Disposition: inline In-Reply-To: <4b2e7870-b225-3855-f3ac-183126142c1c@intel.com> Sender: netdev-owner@vger.kernel.org List-ID: Wed, Jun 27, 2018 at 08:34:46AM CEST, sridhar.samudrala@intel.com wrote: > >On 6/26/2018 11:05 PM, Jiri Pirko wrote: >> Wed, Jun 27, 2018 at 02:04:31AM CEST, xiyou.wangcong@gmail.com wrote: >> > On Tue, Jun 26, 2018 at 1:01 AM Jiri Pirko wrote: >> > > Create dummy device with clsact first: >> > > # ip link add type dummy >> > > # tc qdisc add dev dummy0 clsact >> > > >> > > There is no template assigned by default: >> > > # tc filter template show dev dummy0 ingress >> > > >> > > Add a template of type flower allowing to insert rules matching on last >> > > 2 bytes of destination mac address: >> > > # tc filter template add dev dummy0 ingress proto ip flower dst_mac 00:00:00:00:00:00/00:00:00:00:FF:FF >> > Now you are extending 'tc filter' command with a new >> > subcommand 'template', which looks weird. >> > >> > Why not make it a new property of filter like you did for chain? >> > Like: >> > >> > tc filter add dev dummy0 ingress proto ip template flower >> But unlike chain, this is not a filter property. For chain, when you add >> filter, you add it to a specific chain. That makes sense. >> But for template, you need to add the template first. Then, later on, >> you add filters which either match or does not match the template. > >So can we say that template defines the types of rules(match fields/masks) that >can be added to a specific chain and there is 1-1 relationship between a template >and a chain? yes > >Without attaching a template to a chain, i guess it is possible to add different >types of rules to a chain? yes > > >> Does not make sense to have "template" the filter property as you >> suggest. > >template seems to a chain property. yes > >> > which is much better IMHO. >