net: flow_offload: rename TC_BLOCK_{UN}BIND to FLOW_BLOCK_{UN}BIND

Rename from TC_BLOCK_{UN}BIND to FLOW_BLOCK_{UN}BIND and remove
temporary tc_block_command alias.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Pablo Neira Ayuso 2019-07-09 22:55:40 +02:00 committed by David S. Miller
parent 4e95bc268b
commit 9c0e189ec9
9 changed files with 27 additions and 28 deletions

View File

@ -705,7 +705,7 @@ mlx5e_rep_indr_setup_tc_block(struct net_device *netdev,
return -EOPNOTSUPP;
switch (f->command) {
case TC_BLOCK_BIND:
case FLOW_BLOCK_BIND:
indr_priv = mlx5e_rep_indr_block_priv_lookup(rpriv, netdev);
if (indr_priv)
return -EEXIST;
@ -728,7 +728,7 @@ mlx5e_rep_indr_setup_tc_block(struct net_device *netdev,
}
return err;
case TC_BLOCK_UNBIND:
case FLOW_BLOCK_UNBIND:
indr_priv = mlx5e_rep_indr_block_priv_lookup(rpriv, netdev);
if (!indr_priv)
return -ENOENT;

View File

@ -1679,7 +1679,7 @@ static int mlxsw_sp_setup_tc_block(struct mlxsw_sp_port *mlxsw_sp_port,
}
switch (f->command) {
case TC_BLOCK_BIND:
case FLOW_BLOCK_BIND:
err = tcf_block_cb_register(f->block, cb, mlxsw_sp_port,
mlxsw_sp_port, f->extack);
if (err)
@ -1692,7 +1692,7 @@ static int mlxsw_sp_setup_tc_block(struct mlxsw_sp_port *mlxsw_sp_port,
return err;
}
return 0;
case TC_BLOCK_UNBIND:
case FLOW_BLOCK_UNBIND:
mlxsw_sp_setup_tc_block_flower_unbind(mlxsw_sp_port,
f->block, ingress);
tcf_block_cb_unregister(f->block, cb, mlxsw_sp_port);

View File

@ -147,14 +147,14 @@ static int ocelot_setup_tc_block(struct ocelot_port *port,
}
switch (f->command) {
case TC_BLOCK_BIND:
case FLOW_BLOCK_BIND:
ret = tcf_block_cb_register(f->block, cb, port,
port, f->extack);
if (ret)
return ret;
return ocelot_setup_tc_block_flower_bind(port, f);
case TC_BLOCK_UNBIND:
case FLOW_BLOCK_UNBIND:
ocelot_setup_tc_block_flower_unbind(port, f);
tcf_block_cb_unregister(f->block, cb, port);
return 0;

View File

@ -1315,11 +1315,11 @@ static int nfp_flower_setup_tc_block(struct net_device *netdev,
repr_priv->block_shared = tcf_block_shared(f->block);
switch (f->command) {
case TC_BLOCK_BIND:
case FLOW_BLOCK_BIND:
return tcf_block_cb_register(f->block,
nfp_flower_setup_tc_block_cb,
repr, repr, f->extack);
case TC_BLOCK_UNBIND:
case FLOW_BLOCK_UNBIND:
tcf_block_cb_unregister(f->block,
nfp_flower_setup_tc_block_cb,
repr);
@ -1395,7 +1395,7 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app,
return -EOPNOTSUPP;
switch (f->command) {
case TC_BLOCK_BIND:
case FLOW_BLOCK_BIND:
cb_priv = kmalloc(sizeof(*cb_priv), GFP_KERNEL);
if (!cb_priv)
return -ENOMEM;
@ -1413,7 +1413,7 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app,
}
return err;
case TC_BLOCK_UNBIND:
case FLOW_BLOCK_UNBIND:
cb_priv = nfp_flower_indr_block_cb_priv_lookup(app, netdev);
if (!cb_priv)
return -ENOENT;

View File

@ -239,8 +239,8 @@ static inline void flow_stats_update(struct flow_stats *flow_stats,
}
enum flow_block_command {
TC_BLOCK_BIND,
TC_BLOCK_UNBIND,
FLOW_BLOCK_BIND,
FLOW_BLOCK_UNBIND,
};
enum flow_block_binder_type {

View File

@ -27,7 +27,6 @@ int register_tcf_proto_ops(struct tcf_proto_ops *ops);
int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
#define tc_block_offload flow_block_offload
#define tc_block_command flow_block_command
#define tcf_block_binder_type flow_block_binder_type
struct tcf_block_ext_info {

View File

@ -178,10 +178,10 @@ int flow_block_cb_setup_simple(struct flow_block_offload *f,
f->driver_block_list = driver_block_list;
switch (f->command) {
case TC_BLOCK_BIND:
case FLOW_BLOCK_BIND:
return tcf_block_cb_register(f->block, cb, cb_ident, cb_priv,
f->extack);
case TC_BLOCK_UNBIND:
case FLOW_BLOCK_UNBIND:
tcf_block_cb_unregister(f->block, cb, cb_ident);
return 0;
default:

View File

@ -955,9 +955,9 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
return -EOPNOTSUPP;
switch (f->command) {
case TC_BLOCK_BIND:
case FLOW_BLOCK_BIND:
return tcf_block_cb_register(f->block, cb, dev, dev, f->extack);
case TC_BLOCK_UNBIND:
case FLOW_BLOCK_UNBIND:
tcf_block_cb_unregister(f->block, cb, dev);
return 0;
default:

View File

@ -675,7 +675,7 @@ static void tc_indr_block_cb_del(struct tc_indr_block_cb *indr_block_cb)
static void tc_indr_block_ing_cmd(struct tc_indr_block_dev *indr_dev,
struct tc_indr_block_cb *indr_block_cb,
enum tc_block_command command)
enum flow_block_command command)
{
struct tc_block_offload bo = {
.command = command,
@ -706,7 +706,7 @@ int __tc_indr_block_cb_register(struct net_device *dev, void *cb_priv,
if (err)
goto err_dev_put;
tc_indr_block_ing_cmd(indr_dev, indr_block_cb, TC_BLOCK_BIND);
tc_indr_block_ing_cmd(indr_dev, indr_block_cb, FLOW_BLOCK_BIND);
return 0;
err_dev_put:
@ -743,7 +743,7 @@ void __tc_indr_block_cb_unregister(struct net_device *dev,
return;
/* Send unbind message if required to free any block cbs. */
tc_indr_block_ing_cmd(indr_dev, indr_block_cb, TC_BLOCK_UNBIND);
tc_indr_block_ing_cmd(indr_dev, indr_block_cb, FLOW_BLOCK_UNBIND);
tc_indr_block_cb_del(indr_block_cb);
tc_indr_block_dev_put(indr_dev);
}
@ -760,7 +760,7 @@ EXPORT_SYMBOL_GPL(tc_indr_block_cb_unregister);
static void tc_indr_block_call(struct tcf_block *block, struct net_device *dev,
struct tcf_block_ext_info *ei,
enum tc_block_command command,
enum flow_block_command command,
struct netlink_ext_ack *extack)
{
struct tc_indr_block_cb *indr_block_cb;
@ -776,7 +776,7 @@ static void tc_indr_block_call(struct tcf_block *block, struct net_device *dev,
if (!indr_dev)
return;
indr_dev->block = command == TC_BLOCK_BIND ? block : NULL;
indr_dev->block = command == FLOW_BLOCK_BIND ? block : NULL;
list_for_each_entry(indr_block_cb, &indr_dev->cb_list, list)
indr_block_cb->cb(dev, indr_block_cb->cb_priv, TC_SETUP_BLOCK,
@ -791,7 +791,7 @@ static bool tcf_block_offload_in_use(struct tcf_block *block)
static int tcf_block_offload_cmd(struct tcf_block *block,
struct net_device *dev,
struct tcf_block_ext_info *ei,
enum tc_block_command command,
enum flow_block_command command,
struct netlink_ext_ack *extack)
{
struct tc_block_offload bo = {};
@ -821,20 +821,20 @@ static int tcf_block_offload_bind(struct tcf_block *block, struct Qdisc *q,
return -EOPNOTSUPP;
}
err = tcf_block_offload_cmd(block, dev, ei, TC_BLOCK_BIND, extack);
err = tcf_block_offload_cmd(block, dev, ei, FLOW_BLOCK_BIND, extack);
if (err == -EOPNOTSUPP)
goto no_offload_dev_inc;
if (err)
return err;
tc_indr_block_call(block, dev, ei, TC_BLOCK_BIND, extack);
tc_indr_block_call(block, dev, ei, FLOW_BLOCK_BIND, extack);
return 0;
no_offload_dev_inc:
if (tcf_block_offload_in_use(block))
return -EOPNOTSUPP;
block->nooffloaddevcnt++;
tc_indr_block_call(block, dev, ei, TC_BLOCK_BIND, extack);
tc_indr_block_call(block, dev, ei, FLOW_BLOCK_BIND, extack);
return 0;
}
@ -844,11 +844,11 @@ static void tcf_block_offload_unbind(struct tcf_block *block, struct Qdisc *q,
struct net_device *dev = q->dev_queue->dev;
int err;
tc_indr_block_call(block, dev, ei, TC_BLOCK_UNBIND, NULL);
tc_indr_block_call(block, dev, ei, FLOW_BLOCK_UNBIND, NULL);
if (!dev->netdev_ops->ndo_setup_tc)
goto no_offload_dev_dec;
err = tcf_block_offload_cmd(block, dev, ei, TC_BLOCK_UNBIND, NULL);
err = tcf_block_offload_cmd(block, dev, ei, FLOW_BLOCK_UNBIND, NULL);
if (err == -EOPNOTSUPP)
goto no_offload_dev_dec;
return;