Skip to content

Commit

Permalink
net: sched: Change the block's chain list to an rcu list
Browse files Browse the repository at this point in the history
To allow lookup of a block's chain under atomic context.

Co-developed-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Paul Blakey authored and Saeed Mahameed committed Feb 20, 2020
1 parent 7d17c54 commit 4371929
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/sched/cls_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/idr.h>
#include <linux/rhashtable.h>
#include <linux/jhash.h>
#include <linux/rculist.h>
#include <net/net_namespace.h>
#include <net/sock.h>
#include <net/netlink.h>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 4371929

Please sign in to comment.