From mboxrd@z Thu Jan 1 00:00:00 1970 From: Davide Caratti Subject: Re: [PATCH net] net/sched: properly init chain in case of multiple control actions Date: Sat, 13 Oct 2018 17:23:06 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Jiri Pirko , Jamal Hadi Salim , David Miller , Linux Kernel Network Developers To: Cong Wang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44198 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbeJMXAm (ORCPT ); Sat, 13 Oct 2018 19:00:42 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: > Why not just validate the fallback action in each action init()? > For example, checking tcfg_paction in tcf_gact_init(). > > I don't see the need of making it generic. hello Cong, once again thanks for looking at this. what you say is doable, and I evaluated doing it before proposing this patch. But I felt unconfortable, because I needed to pass struct tcf_proto *tp in tcf_gact_init() to initialize a->goto_chain with the chain_idx encoded in the fallback action. So, I would have changed all the init() functions in all TC actions, just to fix two of them. A (legal?) trick is to let tcf_action store the fallback action when it contains a 'goto chain' command, I just posted a proposal for gact. If you think it's ok, I will test and post the same for act_police. regards, -- davide