tc: add co_groups for tc qdisc and filter

Otherwise these tc caches would not be able to be updated
asynchronously.

Cc: Thomas Haller <thaller@redhat.com>
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Cong Wang 2014-07-11 17:19:03 -07:00 committed by Thomas Haller
parent 94e1345873
commit c4d700038b
5 changed files with 11 additions and 0 deletions

View file

@ -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

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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)