From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [patch net-next] net: sched: don't dump chains only held by actions Date: Tue, 31 Jul 2018 01:01:46 -0700 Message-ID: <20180731010146.0706283a@cakuba.netronome.com> References: <20180727074505.855-1-jiri@resnulli.us> <20180729075146.GA2260@nanopsycho.orion> <20180731063258.GA2154@nanopsycho> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Cong Wang , Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , mlxsw@mellanox.com To: Jiri Pirko Return-path: Received: from mail-pf1-f179.google.com ([209.85.210.179]:42610 "EHLO mail-pf1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727279AbeGaJk4 (ORCPT ); Tue, 31 Jul 2018 05:40:56 -0400 Received: by mail-pf1-f179.google.com with SMTP id l9-v6so5752768pff.9 for ; Tue, 31 Jul 2018 01:01:51 -0700 (PDT) In-Reply-To: <20180731063258.GA2154@nanopsycho> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 31 Jul 2018 08:32:58 +0200, Jiri Pirko wrote: > Mon, Jul 30, 2018 at 08:19:56PM CEST, xiyou.wangcong@gmail.com wrote: > >On Sun, Jul 29, 2018 at 12:54 AM Jiri Pirko wrote: > >> > >> Sat, Jul 28, 2018 at 07:39:36PM CEST, xiyou.wangcong@gmail.com wrote: > >> >On Sat, Jul 28, 2018 at 10:20 AM Cong Wang wrote: > >> >> > >> >> On Fri, Jul 27, 2018 at 12:47 AM Jiri Pirko wrote: > >> >> > > >> >> > From: Jiri Pirko > >> >> > > >> >> > In case a chain is empty and not explicitly created by a user, > >> >> > such chain should not exist. The only exception is if there is > >> >> > an action "goto chain" pointing to it. In that case, don't show the > >> >> > chain in the dump. Track the chain references held by actions and > >> >> > use them to find out if a chain should or should not be shown > >> >> > in chain dump. > >> >> > > >> >> > Signed-off-by: Jiri Pirko > >> >> > >> >> Looks reasonable to me. > >> >> > >> >> Acked-by: Cong Wang > >> > > >> >Hold on... > >> > > >> >If you increase the refcnt for a zombie chain on NEWCHAIN path, > >> >then it would become a non-zombie, this makes sense. However, > >> >if the action_refcnt gets increased again when another action uses it, > >> >it become a zombie again because refcnt==action_refcnt?? > >> > >> No. action always increases both refcnt and action_refcnt > > > >Hmm, then the name zombie is confusing, with your definition all > >chains implicitly created by actions are zombies, unless touched > >by user explicitly. Please find a better name. > > Okay. Perhaps chain_inactive? FWIW to me active brings to mind that it's handling traffic. Brining in my suggestions from an off-list discussion: tcf_chain_act_refs_only() or tcf_chain_pure_act_target() or maybe tcf_chain_has_no_filters() ?