net_sched: fold tcf_block_cb_call() into tc_setup_cb_call()
After commit69bd48404f("net/sched: Remove egdev mechanism"), tc_setup_cb_call() is nearly identical to tcf_block_cb_call(), so we can just fold tcf_block_cb_call() into tc_setup_cb_call() and remove its unused parameter 'exts'. Fixes:69bd48404f("net/sched: Remove egdev mechanism") Cc: Oz Shlomo <ozsh@mellanox.com> Cc: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Oz Shlomo <ozsh@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
390de19404
commit
aeb3fecde8
@@ -1270,29 +1270,6 @@ void tcf_block_cb_unregister(struct tcf_block *block,
|
||||
}
|
||||
EXPORT_SYMBOL(tcf_block_cb_unregister);
|
||||
|
||||
static int tcf_block_cb_call(struct tcf_block *block, enum tc_setup_type type,
|
||||
void *type_data, bool err_stop)
|
||||
{
|
||||
struct tcf_block_cb *block_cb;
|
||||
int ok_count = 0;
|
||||
int err;
|
||||
|
||||
/* Make sure all netdevs sharing this block are offload-capable. */
|
||||
if (block->nooffloaddevcnt && err_stop)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
list_for_each_entry(block_cb, &block->cb_list, list) {
|
||||
err = block_cb->cb(type, type_data, block_cb->cb_priv);
|
||||
if (err) {
|
||||
if (err_stop)
|
||||
return err;
|
||||
} else {
|
||||
ok_count++;
|
||||
}
|
||||
}
|
||||
return ok_count;
|
||||
}
|
||||
|
||||
/* Main classifier routine: scans classifier chain attached
|
||||
* to this qdisc, (optionally) tests for protocol and asks
|
||||
* specific classifiers.
|
||||
@@ -2515,10 +2492,27 @@ int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts)
|
||||
}
|
||||
EXPORT_SYMBOL(tcf_exts_dump_stats);
|
||||
|
||||
int tc_setup_cb_call(struct tcf_block *block, struct tcf_exts *exts,
|
||||
enum tc_setup_type type, void *type_data, bool err_stop)
|
||||
int tc_setup_cb_call(struct tcf_block *block, enum tc_setup_type type,
|
||||
void *type_data, bool err_stop)
|
||||
{
|
||||
return tcf_block_cb_call(block, type, type_data, err_stop);
|
||||
struct tcf_block_cb *block_cb;
|
||||
int ok_count = 0;
|
||||
int err;
|
||||
|
||||
/* Make sure all netdevs sharing this block are offload-capable. */
|
||||
if (block->nooffloaddevcnt && err_stop)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
list_for_each_entry(block_cb, &block->cb_list, list) {
|
||||
err = block_cb->cb(type, type_data, block_cb->cb_priv);
|
||||
if (err) {
|
||||
if (err_stop)
|
||||
return err;
|
||||
} else {
|
||||
ok_count++;
|
||||
}
|
||||
}
|
||||
return ok_count;
|
||||
}
|
||||
EXPORT_SYMBOL(tc_setup_cb_call);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user