From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [patch net-next 3/5] net: sched: introduce block mechanism to handle netif_keep_dst calls Date: Fri, 03 Nov 2017 21:15:54 +0100 Message-ID: <59FCCE7A.4090003@iogearbox.net> References: <20171103171912.26681-1-jiri@resnulli.us> <20171103171912.26681-4-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: 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 To: Jiri Pirko , netdev@vger.kernel.org Return-path: Received: from www62.your-server.de ([213.133.104.62]:56729 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750857AbdKCUQZ (ORCPT ); Fri, 3 Nov 2017 16:16:25 -0400 In-Reply-To: <20171103171912.26681-4-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: 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 ... > + netif_keep_dst(qdisc_dev(q)); > +} > + > +void tcf_block_netif_keep_dst(struct tcf_block *block) > +{ > + struct tcf_block_owner_item *item; > + > + block->keep_dst = true; > + list_for_each_entry(item, &block->owner_list, list)