[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180528213147.GF3787@localhost.localdomain>
Date: Mon, 28 May 2018 18:31:48 -0300
From: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To: Vlad Buslov <vladbu@...lanox.com>
Cc: jiri@...nulli.us, netdev@...r.kernel.org, jhs@...atatu.com,
xiyou.wangcong@...il.com, davem@...emloft.net, ast@...nel.org,
daniel@...earbox.net, kliteyn@...lanox.com
Subject: Re: [PATCH v3 11/11] net: sched: change action API to use array of
pointers to actions
On Mon, May 28, 2018 at 12:17:29AM +0300, Vlad Buslov wrote:
...
> -int tcf_action_destroy(struct list_head *actions, int bind)
> +int tcf_action_destroy(struct tc_action *actions[], int bind)
> {
> const struct tc_action_ops *ops;
> - struct tc_action *a, *tmp;
> - int ret = 0;
> + struct tc_action *a;
> + int ret = 0, i;
>
> - list_for_each_entry_safe(a, tmp, actions, list) {
> + for (i = 0; i < TCA_ACT_MAX_PRIO && actions[i]; i++) {
...
> @@ -878,10 +881,9 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
> if (TC_ACT_EXT_CMP(a->tcfa_action, TC_ACT_GOTO_CHAIN)) {
> err = tcf_action_goto_chain_init(a, tp);
> if (err) {
> - LIST_HEAD(actions);
> + struct tc_action *actions[TCA_ACT_MAX_PRIO] = { a };
Somewhat nit.. Considering tcf_action_destroy will stop at the first
NULL, you need only 2 slots here.
>
> - list_add_tail(&a->list, &actions);
> - tcf_action_destroy(&actions, bind);
> + tcf_action_destroy(actions, bind);
> NL_SET_ERR_MSG(extack, "Failed to init TC action chain");
> return ERR_PTR(err);
> }
Powered by blists - more mailing lists