Commit 64948427 authored by Tonghao Zhang's avatar Tonghao Zhang Committed by David S. Miller

net: openvswitch: use hlist_for_each_entry_rcu instead of hlist_for_each_entry

The struct sw_flow is protected by RCU, when traversing them,
use hlist_for_each_entry_rcu.
Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
Tested-by: default avatarGreg Rose <gvrose8192@gmail.com>
Reviewed-by: default avatarGreg Rose <gvrose8192@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c427bfec
...@@ -462,12 +462,14 @@ static void flow_table_copy_flows(struct table_instance *old, ...@@ -462,12 +462,14 @@ static void flow_table_copy_flows(struct table_instance *old,
struct hlist_head *head = &old->buckets[i]; struct hlist_head *head = &old->buckets[i];
if (ufid) if (ufid)
hlist_for_each_entry(flow, head, hlist_for_each_entry_rcu(flow, head,
ufid_table.node[old_ver]) ufid_table.node[old_ver],
lockdep_ovsl_is_held())
ufid_table_instance_insert(new, flow); ufid_table_instance_insert(new, flow);
else else
hlist_for_each_entry(flow, head, hlist_for_each_entry_rcu(flow, head,
flow_table.node[old_ver]) flow_table.node[old_ver],
lockdep_ovsl_is_held())
table_instance_insert(new, flow); table_instance_insert(new, flow);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment