summaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-10-19 15:50:32 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-21 03:04:07 +0100
commit208c0f4b5237f1d6611b2c679a8022d6901577d6 (patch)
tree7a4e4893cbbdca353d7d4b917044a1a528943c62 /net/sched/cls_api.c
parentacb674428c3d57bccbe3f4a1a7a009f6d73e9f41 (diff)
downloadlinux-208c0f4b5237f1d6611b2c679a8022d6901577d6.tar.gz
linux-208c0f4b5237f1d6611b2c679a8022d6901577d6.tar.bz2
linux-208c0f4b5237f1d6611b2c679a8022d6901577d6.zip
net: sched: use tc_setup_cb_call to call per-block callbacks
Extend the tc_setup_cb_call entrypoint function originally used only for action egress devices callbacks to call per-block callbacks as well. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index b16c79c47be5..cdfdc24b89cf 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1206,10 +1206,25 @@ static int tc_exts_setup_cb_egdev_call(struct tcf_exts *exts,
return ok_count;
}
-int tc_setup_cb_call(struct tcf_exts *exts, enum tc_setup_type type,
- void *type_data, bool err_stop)
+int tc_setup_cb_call(struct tcf_block *block, struct tcf_exts *exts,
+ enum tc_setup_type type, void *type_data, bool err_stop)
{
- return tc_exts_setup_cb_egdev_call(exts, type, type_data, err_stop);
+ int ok_count;
+ int ret;
+
+ ret = tcf_block_cb_call(block, type, type_data, err_stop);
+ if (ret < 0)
+ return ret;
+ ok_count = ret;
+
+ if (!exts)
+ return ok_count;
+ ret = tc_exts_setup_cb_egdev_call(exts, type, type_data, err_stop);
+ if (ret < 0)
+ return ret;
+ ok_count += ret;
+
+ return ok_count;
}
EXPORT_SYMBOL(tc_setup_cb_call);