From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next 3/5] net: sched: introduce block mechanism to handle netif_keep_dst calls Date: Sat, 4 Nov 2017 14:01:37 +0100 Message-ID: <20171104130137.GH2024@nanopsycho> References: <20171103171912.26681-1-jiri@resnulli.us> <20171103171912.26681-4-jiri@resnulli.us> <59FCCE7A.4090003@iogearbox.net> <20171104095531.GG2024@nanopsycho> <59FD9796.5030904@iogearbox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, nogahf@mellanox.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, mlxsw@mellanox.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, michael.chan@broadcom.com, ganeshgr@chelsio.com, saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com, john.hurley@netronome.com, alexander.h.duyck@intel.com, ogerlitz@mellanox.com, john.fastabend@gmail.com, alexei.starovoitov@gmail.com To: Daniel Borkmann Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:53678 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbdKDNBk (ORCPT ); Sat, 4 Nov 2017 09:01:40 -0400 Received: by mail-wm0-f68.google.com with SMTP id r196so6276887wmf.2 for ; Sat, 04 Nov 2017 06:01:39 -0700 (PDT) Content-Disposition: inline In-Reply-To: <59FD9796.5030904@iogearbox.net> Sender: netdev-owner@vger.kernel.org List-ID: Sat, Nov 04, 2017 at 11:33:58AM CET, daniel@iogearbox.net wrote: >On 11/04/2017 10:55 AM, Jiri Pirko wrote: >> Fri, Nov 03, 2017 at 09:15:54PM CET, daniel@iogearbox.net wrote: >> > On 11/03/2017 06:19 PM, Jiri Pirko wrote: >> > > From: Jiri Pirko >> > > >> > > Couple of classifiers call netif_keep_dst directly on q->dev. That is >> > > not possible to do directly for shared blocke where multiple qdiscs are >> > > owning the block. So introduce a infrastructure to keep track of the >> > > block owners in list and use this list to implement block variant of >> > > netif_keep_dst. >> > > >> > > Signed-off-by: Jiri Pirko >> > [...] >> > > +struct tcf_block_owner_item { >> > > + struct list_head list; >> > > + struct Qdisc *q; >> > > + enum tcf_block_binder_type binder_type; >> > > +}; >> > > + >> > > +static void >> > > +tcf_block_owner_netif_keep_dst(struct tcf_block *block, >> > > + struct Qdisc *q, >> > > + enum tcf_block_binder_type binder_type) >> > > +{ >> > > + if (block->keep_dst && >> > > + binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS) >> > >> > Why we need to keep dst on TCF_BLOCK_BINDER_TYPE_CLSACT_EGRESS ? >> > I presume this enum means sch_handle_egress() ? dst is dropped >> > later ... >> >> This is because of the bpf check: >> if (fp->dst_needed && !(tp->q->flags & TCQ_F_INGRESS)) >> netif_keep_dst(qdisc_dev(tp->q)); >> >> I just maintain the same logic here. > >No, that's a wrong claim, really ... > >clsact in general hooks into the same logic as ingress, so TC_H_CLSACT >as major needs to reuse TC_H_INGRESS, and qdiscs set up as such set >TCQ_F_INGRESS as flags. For clsact that means both your block binder >types for clsact here (ingress/egress). Ah, indeed, I missed this. I will rename TCQ_F_INGRESS to TCQ_F_CLSACT as a part of this patchset too. > >Please make sure that your other changes don't have similar assumption. They don't. Thanks for the review!