提交 5251ef82 编写于 作者: J Jakub Kicinski 提交者: David S. Miller

net: make sure napi_list is safe for RCU traversal

netpoll needs to traverse dev->napi_list under RCU, make
sure it uses the right iterator and that removal from this
list is handled safely.
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4d092dd2
......@@ -6656,7 +6656,7 @@ void __netif_napi_del(struct napi_struct *napi)
return;
napi_hash_del(napi);
list_del_init(&napi->dev_list);
list_del_rcu(&napi->dev_list);
napi_free_frags(napi);
flush_gro_hash(napi);
......
......@@ -297,7 +297,7 @@ static int netpoll_owner_active(struct net_device *dev)
{
struct napi_struct *napi;
list_for_each_entry(napi, &dev->napi_list, dev_list) {
list_for_each_entry_rcu(napi, &dev->napi_list, dev_list) {
if (napi->poll_owner == smp_processor_id())
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册