mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 02:36:21 +00:00
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:
parent
4e95bc268b
commit
9c0e189ec9
@ -705,7 +705,7 @@ mlx5e_rep_indr_setup_tc_block(struct net_device *netdev,
|
|||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
switch (f->command) {
|
switch (f->command) {
|
||||||
case TC_BLOCK_BIND:
|
case FLOW_BLOCK_BIND:
|
||||||
indr_priv = mlx5e_rep_indr_block_priv_lookup(rpriv, netdev);
|
indr_priv = mlx5e_rep_indr_block_priv_lookup(rpriv, netdev);
|
||||||
if (indr_priv)
|
if (indr_priv)
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
@ -728,7 +728,7 @@ mlx5e_rep_indr_setup_tc_block(struct net_device *netdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
case TC_BLOCK_UNBIND:
|
case FLOW_BLOCK_UNBIND:
|
||||||
indr_priv = mlx5e_rep_indr_block_priv_lookup(rpriv, netdev);
|
indr_priv = mlx5e_rep_indr_block_priv_lookup(rpriv, netdev);
|
||||||
if (!indr_priv)
|
if (!indr_priv)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
@ -1679,7 +1679,7 @@ static int mlxsw_sp_setup_tc_block(struct mlxsw_sp_port *mlxsw_sp_port,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (f->command) {
|
switch (f->command) {
|
||||||
case TC_BLOCK_BIND:
|
case FLOW_BLOCK_BIND:
|
||||||
err = tcf_block_cb_register(f->block, cb, mlxsw_sp_port,
|
err = tcf_block_cb_register(f->block, cb, mlxsw_sp_port,
|
||||||
mlxsw_sp_port, f->extack);
|
mlxsw_sp_port, f->extack);
|
||||||
if (err)
|
if (err)
|
||||||
@ -1692,7 +1692,7 @@ static int mlxsw_sp_setup_tc_block(struct mlxsw_sp_port *mlxsw_sp_port,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case TC_BLOCK_UNBIND:
|
case FLOW_BLOCK_UNBIND:
|
||||||
mlxsw_sp_setup_tc_block_flower_unbind(mlxsw_sp_port,
|
mlxsw_sp_setup_tc_block_flower_unbind(mlxsw_sp_port,
|
||||||
f->block, ingress);
|
f->block, ingress);
|
||||||
tcf_block_cb_unregister(f->block, cb, mlxsw_sp_port);
|
tcf_block_cb_unregister(f->block, cb, mlxsw_sp_port);
|
||||||
|
@ -147,14 +147,14 @@ static int ocelot_setup_tc_block(struct ocelot_port *port,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (f->command) {
|
switch (f->command) {
|
||||||
case TC_BLOCK_BIND:
|
case FLOW_BLOCK_BIND:
|
||||||
ret = tcf_block_cb_register(f->block, cb, port,
|
ret = tcf_block_cb_register(f->block, cb, port,
|
||||||
port, f->extack);
|
port, f->extack);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return ocelot_setup_tc_block_flower_bind(port, f);
|
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);
|
ocelot_setup_tc_block_flower_unbind(port, f);
|
||||||
tcf_block_cb_unregister(f->block, cb, port);
|
tcf_block_cb_unregister(f->block, cb, port);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1315,11 +1315,11 @@ static int nfp_flower_setup_tc_block(struct net_device *netdev,
|
|||||||
repr_priv->block_shared = tcf_block_shared(f->block);
|
repr_priv->block_shared = tcf_block_shared(f->block);
|
||||||
|
|
||||||
switch (f->command) {
|
switch (f->command) {
|
||||||
case TC_BLOCK_BIND:
|
case FLOW_BLOCK_BIND:
|
||||||
return tcf_block_cb_register(f->block,
|
return tcf_block_cb_register(f->block,
|
||||||
nfp_flower_setup_tc_block_cb,
|
nfp_flower_setup_tc_block_cb,
|
||||||
repr, repr, f->extack);
|
repr, repr, f->extack);
|
||||||
case TC_BLOCK_UNBIND:
|
case FLOW_BLOCK_UNBIND:
|
||||||
tcf_block_cb_unregister(f->block,
|
tcf_block_cb_unregister(f->block,
|
||||||
nfp_flower_setup_tc_block_cb,
|
nfp_flower_setup_tc_block_cb,
|
||||||
repr);
|
repr);
|
||||||
@ -1395,7 +1395,7 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app,
|
|||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
switch (f->command) {
|
switch (f->command) {
|
||||||
case TC_BLOCK_BIND:
|
case FLOW_BLOCK_BIND:
|
||||||
cb_priv = kmalloc(sizeof(*cb_priv), GFP_KERNEL);
|
cb_priv = kmalloc(sizeof(*cb_priv), GFP_KERNEL);
|
||||||
if (!cb_priv)
|
if (!cb_priv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -1413,7 +1413,7 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
case TC_BLOCK_UNBIND:
|
case FLOW_BLOCK_UNBIND:
|
||||||
cb_priv = nfp_flower_indr_block_cb_priv_lookup(app, netdev);
|
cb_priv = nfp_flower_indr_block_cb_priv_lookup(app, netdev);
|
||||||
if (!cb_priv)
|
if (!cb_priv)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
@ -239,8 +239,8 @@ static inline void flow_stats_update(struct flow_stats *flow_stats,
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum flow_block_command {
|
enum flow_block_command {
|
||||||
TC_BLOCK_BIND,
|
FLOW_BLOCK_BIND,
|
||||||
TC_BLOCK_UNBIND,
|
FLOW_BLOCK_UNBIND,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum flow_block_binder_type {
|
enum flow_block_binder_type {
|
||||||
|
@ -27,7 +27,6 @@ int register_tcf_proto_ops(struct tcf_proto_ops *ops);
|
|||||||
int unregister_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_offload flow_block_offload
|
||||||
#define tc_block_command flow_block_command
|
|
||||||
#define tcf_block_binder_type flow_block_binder_type
|
#define tcf_block_binder_type flow_block_binder_type
|
||||||
|
|
||||||
struct tcf_block_ext_info {
|
struct tcf_block_ext_info {
|
||||||
|
@ -178,10 +178,10 @@ int flow_block_cb_setup_simple(struct flow_block_offload *f,
|
|||||||
f->driver_block_list = driver_block_list;
|
f->driver_block_list = driver_block_list;
|
||||||
|
|
||||||
switch (f->command) {
|
switch (f->command) {
|
||||||
case TC_BLOCK_BIND:
|
case FLOW_BLOCK_BIND:
|
||||||
return tcf_block_cb_register(f->block, cb, cb_ident, cb_priv,
|
return tcf_block_cb_register(f->block, cb, cb_ident, cb_priv,
|
||||||
f->extack);
|
f->extack);
|
||||||
case TC_BLOCK_UNBIND:
|
case FLOW_BLOCK_UNBIND:
|
||||||
tcf_block_cb_unregister(f->block, cb, cb_ident);
|
tcf_block_cb_unregister(f->block, cb, cb_ident);
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
|
@ -955,9 +955,9 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
|
|||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
switch (f->command) {
|
switch (f->command) {
|
||||||
case TC_BLOCK_BIND:
|
case FLOW_BLOCK_BIND:
|
||||||
return tcf_block_cb_register(f->block, cb, dev, dev, f->extack);
|
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);
|
tcf_block_cb_unregister(f->block, cb, dev);
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
|
@ -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,
|
static void tc_indr_block_ing_cmd(struct tc_indr_block_dev *indr_dev,
|
||||||
struct tc_indr_block_cb *indr_block_cb,
|
struct tc_indr_block_cb *indr_block_cb,
|
||||||
enum tc_block_command command)
|
enum flow_block_command command)
|
||||||
{
|
{
|
||||||
struct tc_block_offload bo = {
|
struct tc_block_offload bo = {
|
||||||
.command = command,
|
.command = command,
|
||||||
@ -706,7 +706,7 @@ int __tc_indr_block_cb_register(struct net_device *dev, void *cb_priv,
|
|||||||
if (err)
|
if (err)
|
||||||
goto err_dev_put;
|
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;
|
return 0;
|
||||||
|
|
||||||
err_dev_put:
|
err_dev_put:
|
||||||
@ -743,7 +743,7 @@ void __tc_indr_block_cb_unregister(struct net_device *dev,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Send unbind message if required to free any block cbs. */
|
/* 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_cb_del(indr_block_cb);
|
||||||
tc_indr_block_dev_put(indr_dev);
|
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,
|
static void tc_indr_block_call(struct tcf_block *block, struct net_device *dev,
|
||||||
struct tcf_block_ext_info *ei,
|
struct tcf_block_ext_info *ei,
|
||||||
enum tc_block_command command,
|
enum flow_block_command command,
|
||||||
struct netlink_ext_ack *extack)
|
struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
struct tc_indr_block_cb *indr_block_cb;
|
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)
|
if (!indr_dev)
|
||||||
return;
|
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)
|
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,
|
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,
|
static int tcf_block_offload_cmd(struct tcf_block *block,
|
||||||
struct net_device *dev,
|
struct net_device *dev,
|
||||||
struct tcf_block_ext_info *ei,
|
struct tcf_block_ext_info *ei,
|
||||||
enum tc_block_command command,
|
enum flow_block_command command,
|
||||||
struct netlink_ext_ack *extack)
|
struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
struct tc_block_offload bo = {};
|
struct tc_block_offload bo = {};
|
||||||
@ -821,20 +821,20 @@ static int tcf_block_offload_bind(struct tcf_block *block, struct Qdisc *q,
|
|||||||
return -EOPNOTSUPP;
|
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)
|
if (err == -EOPNOTSUPP)
|
||||||
goto no_offload_dev_inc;
|
goto no_offload_dev_inc;
|
||||||
if (err)
|
if (err)
|
||||||
return 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;
|
return 0;
|
||||||
|
|
||||||
no_offload_dev_inc:
|
no_offload_dev_inc:
|
||||||
if (tcf_block_offload_in_use(block))
|
if (tcf_block_offload_in_use(block))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
block->nooffloaddevcnt++;
|
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;
|
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;
|
struct net_device *dev = q->dev_queue->dev;
|
||||||
int err;
|
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)
|
if (!dev->netdev_ops->ndo_setup_tc)
|
||||||
goto no_offload_dev_dec;
|
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)
|
if (err == -EOPNOTSUPP)
|
||||||
goto no_offload_dev_dec;
|
goto no_offload_dev_dec;
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user