Skip to content

Commit c4d7000

Browse files
congwangthom311
authored andcommitted
tc: add co_groups for tc qdisc and filter
Otherwise these tc caches would not be able to be updated asynchronously. Cc: Thomas Haller <[email protected]> Cc: Thomas Graf <[email protected]> Signed-off-by: Cong Wang <[email protected]> Acked-by: Thomas Graf <[email protected]> Signed-off-by: Thomas Haller <[email protected]>
1 parent 94e1345 commit c4d7000

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

include/netlink-private/tc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ static inline void *tca_xstats(struct rtnl_tc *tca)
4848
return tca->tc_xstats->d_data;
4949
}
5050

51+
extern struct nl_af_group tc_groups[];
52+
5153
#ifdef __cplusplus
5254
}
5355
#endif

lib/route/class.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ static struct nl_cache_ops rtnl_class_ops = {
453453
END_OF_MSGTYPES_LIST,
454454
},
455455
.co_protocol = NETLINK_ROUTE,
456+
.co_groups = tc_groups,
456457
.co_request_update = &class_request_update,
457458
.co_msg_parser = &class_msg_parser,
458459
.co_obj_ops = &class_obj_ops,

lib/route/cls.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ static struct nl_cache_ops rtnl_cls_ops = {
411411
END_OF_MSGTYPES_LIST,
412412
},
413413
.co_protocol = NETLINK_ROUTE,
414+
.co_groups = tc_groups,
414415
.co_request_update = cls_request_update,
415416
.co_msg_parser = cls_msg_parser,
416417
.co_obj_ops = &cls_obj_ops,

lib/route/qdisc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ static struct nl_cache_ops rtnl_qdisc_ops = {
541541
END_OF_MSGTYPES_LIST,
542542
},
543543
.co_protocol = NETLINK_ROUTE,
544+
.co_groups = tc_groups,
544545
.co_request_update = qdisc_request_update,
545546
.co_msg_parser = qdisc_msg_parser,
546547
.co_obj_ops = &qdisc_obj_ops,

lib/route/tc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,12 @@ void *rtnl_tc_data_check(struct rtnl_tc *tc, struct rtnl_tc_ops *ops)
10561056
return rtnl_tc_data(tc);
10571057
}
10581058

1059+
struct nl_af_group tc_groups[] = {
1060+
{ AF_UNSPEC, RTNLGRP_TC },
1061+
{ END_OF_GROUP_LIST },
1062+
};
1063+
1064+
10591065
void rtnl_tc_type_register(struct rtnl_tc_type_ops *ops)
10601066
{
10611067
if (ops->tt_type > RTNL_TC_TYPE_MAX)

0 commit comments

Comments
 (0)