From c4d700038b93a961711169c954e5e0877abea1d0 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Fri, 11 Jul 2014 17:19:03 -0700 Subject: [PATCH] tc: add co_groups for tc qdisc and filter Otherwise these tc caches would not be able to be updated asynchronously. Cc: Thomas Haller Cc: Thomas Graf Signed-off-by: Cong Wang Acked-by: Thomas Graf Signed-off-by: Thomas Haller --- include/netlink-private/tc.h | 2 ++ lib/route/class.c | 1 + lib/route/cls.c | 1 + lib/route/qdisc.c | 1 + lib/route/tc.c | 6 ++++++ 5 files changed, 11 insertions(+) diff --git a/include/netlink-private/tc.h b/include/netlink-private/tc.h index 182adaa..d0cb283 100644 --- a/include/netlink-private/tc.h +++ b/include/netlink-private/tc.h @@ -48,6 +48,8 @@ static inline void *tca_xstats(struct rtnl_tc *tca) return tca->tc_xstats->d_data; } +extern struct nl_af_group tc_groups[]; + #ifdef __cplusplus } #endif diff --git a/lib/route/class.c b/lib/route/class.c index 050f42a..56ad1d8 100644 --- a/lib/route/class.c +++ b/lib/route/class.c @@ -453,6 +453,7 @@ static struct nl_cache_ops rtnl_class_ops = { END_OF_MSGTYPES_LIST, }, .co_protocol = NETLINK_ROUTE, + .co_groups = tc_groups, .co_request_update = &class_request_update, .co_msg_parser = &class_msg_parser, .co_obj_ops = &class_obj_ops, diff --git a/lib/route/cls.c b/lib/route/cls.c index b7860c3..649a7d0 100644 --- a/lib/route/cls.c +++ b/lib/route/cls.c @@ -411,6 +411,7 @@ static struct nl_cache_ops rtnl_cls_ops = { END_OF_MSGTYPES_LIST, }, .co_protocol = NETLINK_ROUTE, + .co_groups = tc_groups, .co_request_update = cls_request_update, .co_msg_parser = cls_msg_parser, .co_obj_ops = &cls_obj_ops, diff --git a/lib/route/qdisc.c b/lib/route/qdisc.c index 250d191..b8b6fa5 100644 --- a/lib/route/qdisc.c +++ b/lib/route/qdisc.c @@ -541,6 +541,7 @@ static struct nl_cache_ops rtnl_qdisc_ops = { END_OF_MSGTYPES_LIST, }, .co_protocol = NETLINK_ROUTE, + .co_groups = tc_groups, .co_request_update = qdisc_request_update, .co_msg_parser = qdisc_msg_parser, .co_obj_ops = &qdisc_obj_ops, diff --git a/lib/route/tc.c b/lib/route/tc.c index 0886e8e..0f150cc 100644 --- a/lib/route/tc.c +++ b/lib/route/tc.c @@ -1056,6 +1056,12 @@ void *rtnl_tc_data_check(struct rtnl_tc *tc, struct rtnl_tc_ops *ops) return rtnl_tc_data(tc); } +struct nl_af_group tc_groups[] = { + { AF_UNSPEC, RTNLGRP_TC }, + { END_OF_GROUP_LIST }, +}; + + void rtnl_tc_type_register(struct rtnl_tc_type_ops *ops) { if (ops->tt_type > RTNL_TC_TYPE_MAX)