From: Jiri Pirko <jiri@resnulli.us>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Daniel Borkmann <daniel@iogearbox.net>,
mlxsw@mellanox.com
Subject: Re: [patch net-next 04/20] net: sched: use tcf_exts_has_actions in tcf_exts_exec
Date: Tue, 1 Aug 2017 06:53:45 +0200 [thread overview]
Message-ID: <20170801045345.GA1939@nanopsycho> (raw)
In-Reply-To: <CAM_iQpWRo1HG8WpZ-0zNferBe44yFpwoLpNWn5CKv9YuD9TKBQ@mail.gmail.com>
Mon, Jul 31, 2017 at 10:37:21PM CEST, xiyou.wangcong@gmail.com wrote:
>On Fri, Jul 28, 2017 at 7:40 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> +static inline int
>> +tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
>> + struct tcf_result *res)
>> +{
>> +#ifdef CONFIG_NET_CLS_ACT
>> + if (tcf_exts_has_actions(exts))
>> + return tcf_action_exec(skb, exts->actions, exts->nr_actions,
>> + res);
>> +#endif
>> + return 0;
>> +}
>
>
>While you are on it, can we get rid of this macro too?
>
>tcf_action_exec() is only defined with CONFIG_NET_CLS_ACT,
>not sure if compiler is kind enough to eliminate the false branch
>for us:
>
>if (false)
> return tcf_action_exec(...); // not defined but the branch is dead
>
>At least you can add a wrapper for tcf_action_exec() to just
>return 0.
Did you see?
net: sched: remove check for number of actions in tcf_exts_exec
I will add static inline stub for tcf_action_exec in case CONFIG_NET_CLS_ACT
is not set.
next prev parent reply other threads:[~2017-08-01 4:53 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 14:40 [patch net-next 00/20] net: sched: summer cleanup part 1, mainly in exts area Jiri Pirko
2017-07-28 14:40 ` [patch net-next 01/20] net: sched: sch_atm: use Qdisc_class_common structure Jiri Pirko
2017-07-30 19:04 ` Jamal Hadi Salim
2017-07-28 14:40 ` [patch net-next 02/20] net: sched: remove unneeded tcf_em_tree_change Jiri Pirko
2017-07-28 14:40 ` [patch net-next 03/20] net: sched: change names of action number helpers to be aligned with the rest Jiri Pirko
2017-07-30 19:46 ` Jamal Hadi Salim
2017-07-28 14:40 ` [patch net-next 04/20] net: sched: use tcf_exts_has_actions in tcf_exts_exec Jiri Pirko
2017-07-30 19:48 ` Jamal Hadi Salim
2017-07-31 6:36 ` Jiri Pirko
2017-07-31 12:09 ` Jamal Hadi Salim
2017-07-31 12:23 ` Jiri Pirko
2017-07-31 20:37 ` Cong Wang
2017-08-01 4:53 ` Jiri Pirko [this message]
2017-07-28 14:40 ` [patch net-next 05/20] net: sched: remove redundant helpers tcf_exts_is_predicative and tcf_exts_is_available Jiri Pirko
2017-07-28 14:40 ` [patch net-next 06/20] net: sched: fix return value of tcf_exts_exec Jiri Pirko
2017-07-28 14:40 ` [patch net-next 07/20] net: sched: remove check for number of actions in tcf_exts_exec Jiri Pirko
2017-07-28 14:40 ` [patch net-next 08/20] net: sched: use tcf_exts_has_actions instead of exts->nr_actions Jiri Pirko
2017-07-28 14:40 ` [patch net-next 09/20] net: sched: convert actions array into rcu list Jiri Pirko
2017-07-30 20:17 ` Jamal Hadi Salim
2017-07-31 21:07 ` Cong Wang
2017-08-01 4:59 ` Jiri Pirko
2017-07-28 14:40 ` [patch net-next 10/20] net: sched: cls_bpf: rename cls_bpf_modify_existing function Jiri Pirko
2017-07-31 9:30 ` Daniel Borkmann
2017-07-28 14:40 ` [patch net-next 11/20] net: sched: cls_fw: rename fw_change_attrs function Jiri Pirko
2017-07-28 14:40 ` [patch net-next 12/20] net: sched: cls_flower: no need to call tcf_exts_change for newly allocated struct Jiri Pirko
2017-07-28 14:40 ` [patch net-next 13/20] net: sched: cls_fw: " Jiri Pirko
2017-07-28 14:40 ` [patch net-next 14/20] net: sched: cls_matchall: " Jiri Pirko
2017-07-28 14:40 ` [patch net-next 15/20] net: sched: cls_basic: " Jiri Pirko
2017-07-28 14:40 ` [patch net-next 16/20] net: sched: cls_bpf: " Jiri Pirko
2017-07-31 10:02 ` Daniel Borkmann
2017-07-28 14:40 ` [patch net-next 17/20] net: sched: cls_cgroup: " Jiri Pirko
2017-07-28 14:40 ` [patch net-next 18/20] net: sched: cls_flow: " Jiri Pirko
2017-07-28 14:40 ` [patch net-next 19/20] net: sched: cls_route: " Jiri Pirko
2017-07-28 14:40 ` [patch net-next 20/20] net: sched: cls_u32: " Jiri Pirko
2017-07-31 21:35 ` [patch net-next 00/20] net: sched: summer cleanup part 1, mainly in exts area David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170801045345.GA1939@nanopsycho \
--to=jiri@resnulli.us \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.