diff options
author | Victor Nogueira <victor@mojatatu.com> | 2023-12-19 21:16:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-12-27 00:20:08 +0300 |
commit | 913b47d3424e7d99eaf34b798c47dfa840c64a08 (patch) | |
tree | 9bc8fe26272a2fb1d1ae0fe011c3367fceced8c0 /net/sched/cls_api.c | |
parent | b1dffcf0da221d1f9d8007dfa2a41a325921d7fa (diff) | |
download | linux-913b47d3424e7d99eaf34b798c47dfa840c64a08.tar.xz |
net/sched: Introduce tc block netdev tracking infra
This commit makes tc blocks track which ports have been added to them.
And, with that, we'll be able to use this new information to send
packets to the block's ports. Which will be done in the patch #3 of this
series.
Suggested-by: Jiri Pirko <jiri@nvidia.com>
Co-developed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Co-developed-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: Victor Nogueira <victor@mojatatu.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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 8978cf5531d0..421ea10bc82a 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -531,6 +531,7 @@ static void tcf_block_destroy(struct tcf_block *block) { mutex_destroy(&block->lock); mutex_destroy(&block->proto_destroy_lock); + xa_destroy(&block->ports); kfree_rcu(block, rcu); } @@ -1002,6 +1003,7 @@ static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q, refcount_set(&block->refcnt, 1); block->net = net; block->index = block_index; + xa_init(&block->ports); /* Don't store q pointer for blocks which are shared */ if (!tcf_block_shared(block)) |