From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next v7 09/13] net: sched: allow ingress and clsact qdiscs to share filter blocks Date: Thu, 11 Jan 2018 17:11:55 +0100 Message-ID: <20180111161155.GP2053@nanopsycho.orion> References: <20180109140731.1022-1-jiri@resnulli.us> <20180109140731.1022-10-jiri@resnulli.us> <66883304-2004-7154-4700-9839203cecff@mojatatu.com> <20180111142457.GJ2053@nanopsycho.orion> <3da16333-3954-91c4-98c3-22a19d2bd5d9@mojatatu.com> <20180111144151.GM2053@nanopsycho.orion> <6193cf78-2dba-0d63-c745-3b48439a0a85@mojatatu.com> <20180111150708.GN2053@nanopsycho.orion> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jamal Hadi Salim , netdev@vger.kernel.org, David Miller , Cong Wang , mlxsw , Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Chan , ganeshgr@chelsio.com, Saeed Mahameed , matanb@mellanox.com, leonro@mellanox.com, Ido Schimmel , jakub.kicinski@netronome.com, Simon Horman , pieter.jansenvanvuuren@netronome.com, john.hurley@netronome.com, Alexander Duyck , Or Gerlitz , John Fastabend , Daniel Borkmann , To: Roopa Prabhu Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:44137 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933305AbeAKQL5 (ORCPT ); Thu, 11 Jan 2018 11:11:57 -0500 Received: by mail-wm0-f66.google.com with SMTP id t8so6559032wmc.3 for ; Thu, 11 Jan 2018 08:11:56 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Thu, Jan 11, 2018 at 04:41:27PM CET, roopa@cumulusnetworks.com wrote: >On Thu, Jan 11, 2018 at 7:07 AM, Jiri Pirko wrote: >> Thu, Jan 11, 2018 at 03:46:09PM CET, jhs@mojatatu.com wrote: >>>On 18-01-11 09:41 AM, Jiri Pirko wrote: >>>> Thu, Jan 11, 2018 at 03:37:08PM CET, jhs@mojatatu.com wrote: >>>> > On 18-01-11 09:24 AM, Jiri Pirko wrote: >>>> > > Thu, Jan 11, 2018 at 02:36:01PM CET, jhs@mojatatu.com wrote: >>>> > > > On 18-01-09 09:07 AM, Jiri Pirko wrote: >>>> > > > > From: Jiri Pirko >>>> > > > > >>>> > > > > Benefit from the previously introduced shared filter blocks >>>> > > > > infrastructure and allow ingress and clsact qdisc instances to share >>>> > > > > filter blocks. The block index is coming from userspace as qdisc option. >>>> > > > >>>> > > > Didnt quiet follow why ingress is special and needs attributes to >>>> > > > set the block but other qdiscs didnt. >>>> > > >>>> > > Jamal, again, other qdiscs does not support block sharing. This patchset >>>> > > only adds support for sharing of block for ingress and clsact qdiscs. >>>> > > Later on, other qdiscs could also support block sharing. >>>> > > >>>> > >>>> > Can you stop a config which says: >>>> > tc qdisc add dev ens9 root block 22 handle 1:0 prio ? >>>> >>>> Please see the iproute2 patches. Parsing of "block" command line option >>>> is done inside q_ingress.c >>>> >>> >>>I only looked at the kernel code. Good you can stop it at tc >>>but the API does not stop it (unless you expect the rest of the >>>world to only use tc). >> >> Jamal, apparently, you did not looked at the kernel code either :) >> Look at the changes done in net/sched/sch_ingress.c - there is where the >> parsing of block attr takes place. >> >> >>>Really - there is no reason for this API to be only via ingress qdisc >>>attributes. You can add a check in cls api to reject any parent that is >>>not either of the clsacts + ingress (depending on tc doesnt sound >>>right). >> >> I was thinking to take this direction originally. To have another >> generic attr called TCA_BLOCK or something that would be used when qdisc >> is created. For ingress, what would work. But for clsact, you need to be >> able to specify 2 block during qdisc creation - one for ingress, one for >> egress. That's when I realized this has to be per-qdisc-type attr. > > >yeah, see the problem...but.., would it help if we just introduce two >generic attrs TCA_BLOCK_INGRESS and TCA_BLOCK_EGRESS instead of having >to duplicate these attrs at every qdisc ?. >and add proper validation depending on qdisc type.. I guess it would make sense. I just did not want to introduce this limitation. But allright. Will do this.