Skip to content

Commit 5845589

Browse files
hao022davem330
authored andcommitted
net: openvswitch: silence suspicious RCU usage warning
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]>
1 parent a0dced1 commit 5845589

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/openvswitch/flow_table.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ void ovs_flow_tbl_destroy(struct flow_table *table)
518518
{
519519
struct table_instance *ti = rcu_dereference_raw(table->ti);
520520
struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti);
521-
struct mask_cache *mc = rcu_dereference(table->mask_cache);
522-
struct mask_array *ma = rcu_dereference_ovsl(table->mask_array);
521+
struct mask_cache *mc = rcu_dereference_raw(table->mask_cache);
522+
struct mask_array *ma = rcu_dereference_raw(table->mask_array);
523523

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

938938
u32 ovs_flow_tbl_masks_cache_size(const struct flow_table *table)
939939
{
940-
struct mask_cache *mc = rcu_dereference(table->mask_cache);
940+
struct mask_cache *mc = rcu_dereference_ovsl(table->mask_cache);
941941

942942
return READ_ONCE(mc->cache_size);
943943
}

0 commit comments

Comments
 (0)