Skip to content

Commit

Permalink
vport.c: Use built-in RCU list checking
Browse files Browse the repository at this point in the history
hlist_for_each_entry_rcu() has built-in RCU and lock checking.

Pass cond argument to list_for_each_entry_rcu() to silence
false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
by default.

Signed-off-by: Madhuparna Bhowmik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Madhuparna Bhowmik authored and davem330 committed Feb 18, 2020
1 parent 7790614 commit fed4842
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/openvswitch/vport.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ struct vport *ovs_vport_locate(const struct net *net, const char *name)
struct hlist_head *bucket = hash_bucket(net, name);
struct vport *vport;

hlist_for_each_entry_rcu(vport, bucket, hash_node)
hlist_for_each_entry_rcu(vport, bucket, hash_node,
lockdep_ovsl_is_held())
if (!strcmp(name, ovs_vport_name(vport)) &&
net_eq(ovs_dp_get_net(vport->dp), net))
return vport;
Expand Down

0 comments on commit fed4842

Please sign in to comment.