From: Paul Blakey Date: Sun, 16 Feb 2020 10:01:23 +0000 (+0200) Subject: net: sched: Change the block's chain list to an rcu list X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=43719298193224c9a76c355de1622bd70242bc08;p=linux.git net: sched: Change the block's chain list to an rcu list To allow lookup of a block's chain under atomic context. Co-developed-by: Vlad Buslov Signed-off-by: Vlad Buslov Signed-off-by: Paul Blakey Reviewed-by: Jiri Pirko Signed-off-by: Saeed Mahameed --- diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index bbd8b5e7b74be..a634c85f1e0ed 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -354,7 +355,7 @@ static struct tcf_chain *tcf_chain_create(struct tcf_block *block, chain = kzalloc(sizeof(*chain), GFP_KERNEL); if (!chain) return NULL; - list_add_tail(&chain->list, &block->chain_list); + list_add_tail_rcu(&chain->list, &block->chain_list); mutex_init(&chain->filter_chain_lock); chain->block = block; chain->index = chain_index; @@ -394,7 +395,7 @@ static bool tcf_chain_detach(struct tcf_chain *chain) ASSERT_BLOCK_LOCKED(block); - list_del(&chain->list); + list_del_rcu(&chain->list); if (!chain->index) block->chain0.chain = NULL;