[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190705162729.67ee3d66@cakuba.netronome.com>
Date: Fri, 5 Jul 2019 16:27:29 -0700
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Pablo Neira Ayuso <pablo@...filter.org>
Cc: netdev@...r.kernel.org, netfilter-devel@...r.kernel.org,
davem@...emloft.net, thomas.lendacky@....com, f.fainelli@...il.com,
ariel.elior@...ium.com, michael.chan@...adcom.com,
madalin.bucur@....com, yisen.zhuang@...wei.com,
salil.mehta@...wei.com, jeffrey.t.kirsher@...el.com,
tariqt@...lanox.com, saeedm@...lanox.com, jiri@...lanox.com,
idosch@...lanox.com, peppe.cavallaro@...com,
grygorii.strashko@...com, andrew@...n.ch, vivien.didelot@...il.com,
alexandre.torgue@...com, joabreu@...opsys.com,
linux-net-drivers@...arflare.com, ogerlitz@...lanox.com,
Manish.Chopra@...ium.com, marcelo.leitner@...il.com,
mkubecek@...e.cz, venkatkumar.duvvuru@...adcom.com,
maxime.chevallier@...tlin.com, cphealy@...il.com
Subject: Re: [PATCH 06/15 net-next,v2] net: sched: add
tcf_setup_block_offload()
On Fri, 5 Jul 2019 01:48:34 +0200, Pablo Neira Ayuso wrote:
> Most drivers do the same thing to set up the block, add a helper
> function to do this.
>
> Signed-off-by: Pablo Neira Ayuso <pablo@...filter.org>
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index 534a545ea51e..003f24a1323f 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -922,6 +922,26 @@ static int tcf_block_setup(struct tcf_block *block, struct tc_block_offload *bo)
> return err;
> }
>
> +int tcf_setup_block_offload(struct tc_block_offload *f, tc_setup_cb_t *cb,
> + void *cb_ident, void *cb_priv, bool ingress_only)
> +{
> + if (ingress_only &&
> + f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
> + return -EOPNOTSUPP;
> +
> + switch (f->command) {
> + case TC_BLOCK_BIND:
> + return tcf_block_cb_register(f->block, cb, cb_ident, cb_priv,
> + f->extack);
> + case TC_BLOCK_UNBIND:
> + tcf_block_cb_unregister(f->block, cb, cb_ident);
> + return 0;
> + default:
> + return -EOPNOTSUPP;
> + }
> +}
> +EXPORT_SYMBOL(tcf_setup_block_offload);
> +
> static struct rhashtable indr_setup_block_ht;
>
> struct tc_indr_block_dev {
This change is pretty much unrelated to the rest of the series, isn't
it? Can you please post it separately and make the series smaller
this way?
Perhaps tcf_setup_block_offload_simple() would be a good name for this
helper?
Powered by blists - more mailing lists