From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next 0/9] net: sched: introduce chain templates support with offloading to mlxsw Date: Thu, 28 Jun 2018 08:18:17 +0200 Message-ID: <20180628061817.GB2413@nanopsycho> References: <20180625210148.9386-1-jiri@resnulli.us> <20180625215850.001276b8@cakuba.netronome.com> <20180626064355.GQ2161@nanopsycho> <20180626071217.GR2161@nanopsycho> <20180626141858.7f18730f@cakuba.netronome.com> <20180627075017.GA2007@nanopsycho> <0272f671-802b-30b6-6ca2-2ffc1e205664@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: sridhar.samudrala@intel.com, Jakub Kicinski , Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , Simon Horman , john.hurley@netronome.com, David Ahern , mlxsw@mellanox.com To: Cong Wang Return-path: Received: from mail-wr0-f196.google.com ([209.85.128.196]:41667 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753497AbeF1GTq (ORCPT ); Thu, 28 Jun 2018 02:19:46 -0400 Received: by mail-wr0-f196.google.com with SMTP id h10-v6so4187804wrq.8 for ; Wed, 27 Jun 2018 23:19:46 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Wed, Jun 27, 2018 at 07:04:32PM CEST, xiyou.wangcong@gmail.com wrote: >On Wed, Jun 27, 2018 at 9:46 AM Samudrala, Sridhar > wrote: >> >> On 6/27/2018 12:50 AM, Jiri Pirko wrote: >> > if you don't like "tc filter template add dev dummy0 ingress", how >> > about: >> > "tc template add dev dummy0 ingress ..." >> > "tc template add dev dummy0 ingress chain 22 ..." >> > that makes more sense I think. > >Better than 'tc filter template', but this doesn't reflect 'template' >is a template of tc filter, it could be an action etc., since it is in the It's a template of filter per chain. I don't understand how it could be an action... >same position with 'tc action/filter/qdisc'. > > >> >> Isn't it possible to avoid introducing another keyword 'template', >> >> Can't we just do >> tc chain add dev dummy0 ingress flower chain_index 0 >> to create a chain that takes any types of flower rules with index 0 >> and >> tc chain add dev dummy0 ingress flower chain_index 22 >> dst_mac 00:00:00:00:00:00/00:00:00:00:FF:FF >> tc chain add dev dummy0 ingress flower chain_index 23 >> dst_ip 192.168.0.0/16 >> to create 2 chains 22 and 23 that allow rules with specific fields. > >Sounds good too. Since filter chain can be shared by qdiscs, >a 'tc chain' sub-command makes sense, and would probably make >it easier to be shared. We don't have such specific object. It is implicit. We create it whenever someone users it. Either filter of chain. I don't like new "tc chain" object in cmdline. It really isn't.