[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20131202.162752.2143617473594386587.davem@davemloft.net>
Date: Mon, 02 Dec 2013 16:27:52 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: jhs@...atatu.com
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com,
alexander.h.duyck@...el.com, ebiederm@...ssion.com
Subject: Re: [PATCH 0/4] net_sched: actions - Add default lookup and walker
From: Jamal Hadi Salim <jhs@...atatu.com>
Date: Sun, 1 Dec 2013 17:30:05 -0500
> This set of patches provide defaults for lookup and walkers for actions.
> Users can override when needed.
>
> Jamal Hadi Salim (4):
> Provide default lookup function for actions that dont provide one
> Use default lookup functions. Users are free to override when needed.
> Provide default walker function for actions that dont provide one
> Use default walker functions. Users who need something special can
> override.
Ok, but can you respin this set, adding in changes to remove
the code that checks for NULL in these operations?
Specifically, we still have:
if (a->ops->lookup == NULL)
goto err_mod;
in tcf_action_get_1(). And:
if (a_o->walk == NULL) {
in tc_dump_action().
Furthermore, there is a hard assumption that a_o->init() is non-NULL
as well. So maybe add a:
if (!act->init)
return -EINVAL;
at the top of tcf_register_action().
It also occurred to me that it would be simpler to audit and be a
simpler patch set to review if you just added the missing ".lookup ="
assignments to the actions and added a similar "if (!act->lookup)" et
al. check to tcf_register_action().
That looks more like a rigorous requirement to have a valid method
present for these three operations: init, lookup, walk.
What do you think?
Thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists