Skip to content

Commit a2cfb96

Browse files
Madhuparna Bhowmikdavem330
authored andcommitted
flow_table.c: Use built-in RCU list checking
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 <madhuparnabhowmik10@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 53742e6 commit a2cfb96

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎net/openvswitch/flow_table.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
585585
head = find_bucket(ti, hash);
586586
(*n_mask_hit)++;
587587

588-
hlist_for_each_entry_rcu(flow, head, flow_table.node[ti->node_ver]) {
588+
hlist_for_each_entry_rcu(flow, head, flow_table.node[ti->node_ver],
589+
lockdep_ovsl_is_held()) {
589590
if (flow->mask == mask && flow->flow_table.hash == hash &&
590591
flow_cmp_masked_key(flow, &masked_key, &mask->range))
591592
return flow;
@@ -769,7 +770,8 @@ struct sw_flow *ovs_flow_tbl_lookup_ufid(struct flow_table *tbl,
769770

770771
hash = ufid_hash(ufid);
771772
head = find_bucket(ti, hash);
772-
hlist_for_each_entry_rcu(flow, head, ufid_table.node[ti->node_ver]) {
773+
hlist_for_each_entry_rcu(flow, head, ufid_table.node[ti->node_ver],
774+
lockdep_ovsl_is_held()) {
773775
if (flow->ufid_table.hash == hash &&
774776
ovs_flow_cmp_ufid(flow, ufid))
775777
return flow;

0 commit comments

Comments
 (0)