Skip to content

Commit

Permalink
net: openvswitch: silence suspicious RCU usage warning
Browse files Browse the repository at this point in the history
ovs_flow_tbl_destroy always is called from RCU callback
or error path. It is no need to check if rcu_read_lock
or lockdep_ovsl_is_held was held.

ovs_dp_cmd_fill_info always is called with ovs_mutex,
So use the rcu_dereference_ovsl instead of rcu_dereference
in ovs_flow_tbl_masks_cache_size.

Fixes: 9bf24f5 ("net: openvswitch: make masks cache size configurable")
Cc: Eelco Chaudron <[email protected]>
Reported-by: [email protected]
Reported-by: [email protected]
Signed-off-by: Tonghao Zhang <[email protected]>
Acked-by: Paolo Abeni <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
xpu22 authored and davem330 committed Aug 5, 2020
1 parent a0dced1 commit 5845589
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/openvswitch/flow_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ void ovs_flow_tbl_destroy(struct flow_table *table)
{
struct table_instance *ti = rcu_dereference_raw(table->ti);
struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti);
struct mask_cache *mc = rcu_dereference(table->mask_cache);
struct mask_array *ma = rcu_dereference_ovsl(table->mask_array);
struct mask_cache *mc = rcu_dereference_raw(table->mask_cache);
struct mask_array *ma = rcu_dereference_raw(table->mask_array);

call_rcu(&mc->rcu, mask_cache_rcu_cb);
call_rcu(&ma->rcu, mask_array_rcu_cb);
Expand Down Expand Up @@ -937,7 +937,7 @@ int ovs_flow_tbl_num_masks(const struct flow_table *table)

u32 ovs_flow_tbl_masks_cache_size(const struct flow_table *table)
{
struct mask_cache *mc = rcu_dereference(table->mask_cache);
struct mask_cache *mc = rcu_dereference_ovsl(table->mask_cache);

return READ_ONCE(mc->cache_size);
}
Expand Down

0 comments on commit 5845589

Please sign in to comment.