Commit 663efa36 authored by Jesse Gross's avatar Jesse Gross

openvswitch: Silence RCU lockdep checks from flow lookup.

Flow lookup can happen either in packet processing context or userspace
context but it was annotated as requiring RCU read lock to be held. This
also allows OVS mutex to be held without causing warnings.
Reported-by: default avatarJustin Pettit <jpettit@nicira.com>
Signed-off-by: default avatarJesse Gross <jesse@nicira.com>
Reviewed-by: default avatarThomas Graf <tgraf@redhat.com>
parent 5bb50632
...@@ -701,8 +701,7 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp, ...@@ -701,8 +701,7 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
if (start) { if (start) {
const struct sw_flow_actions *sf_acts; const struct sw_flow_actions *sf_acts;
sf_acts = rcu_dereference_check(flow->sf_acts, sf_acts = rcu_dereference_ovsl(flow->sf_acts);
lockdep_ovsl_is_held());
err = ovs_nla_put_actions(sf_acts->actions, err = ovs_nla_put_actions(sf_acts->actions,
sf_acts->actions_len, skb); sf_acts->actions_len, skb);
......
...@@ -145,6 +145,8 @@ int lockdep_ovsl_is_held(void); ...@@ -145,6 +145,8 @@ int lockdep_ovsl_is_held(void);
#define ASSERT_OVSL() WARN_ON(unlikely(!lockdep_ovsl_is_held())) #define ASSERT_OVSL() WARN_ON(unlikely(!lockdep_ovsl_is_held()))
#define ovsl_dereference(p) \ #define ovsl_dereference(p) \
rcu_dereference_protected(p, lockdep_ovsl_is_held()) rcu_dereference_protected(p, lockdep_ovsl_is_held())
#define rcu_dereference_ovsl(p) \
rcu_dereference_check(p, lockdep_ovsl_is_held())
static inline struct net *ovs_dp_get_net(struct datapath *dp) static inline struct net *ovs_dp_get_net(struct datapath *dp)
{ {
......
...@@ -433,7 +433,7 @@ struct sw_flow *ovs_flow_tbl_lookup_stats(struct flow_table *tbl, ...@@ -433,7 +433,7 @@ struct sw_flow *ovs_flow_tbl_lookup_stats(struct flow_table *tbl,
const struct sw_flow_key *key, const struct sw_flow_key *key,
u32 *n_mask_hit) u32 *n_mask_hit)
{ {
struct table_instance *ti = rcu_dereference(tbl->ti); struct table_instance *ti = rcu_dereference_ovsl(tbl->ti);
struct sw_flow_mask *mask; struct sw_flow_mask *mask;
struct sw_flow *flow; struct sw_flow *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