Skip to content

Commit 663efa3

Browse files
committed
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: Justin Pettit <jpettit@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Reviewed-by: Thomas Graf <tgraf@redhat.com>
1 parent 5bb5063 commit 663efa3

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎net/openvswitch/datapath.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,7 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
701701
if (start) {
702702
const struct sw_flow_actions *sf_acts;
703703

704-
sf_acts = rcu_dereference_check(flow->sf_acts,
705-
lockdep_ovsl_is_held());
704+
sf_acts = rcu_dereference_ovsl(flow->sf_acts);
706705

707706
err = ovs_nla_put_actions(sf_acts->actions,
708707
sf_acts->actions_len, skb);

‎net/openvswitch/datapath.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ int lockdep_ovsl_is_held(void);
145145
#define ASSERT_OVSL() WARN_ON(unlikely(!lockdep_ovsl_is_held()))
146146
#define ovsl_dereference(p) \
147147
rcu_dereference_protected(p, lockdep_ovsl_is_held())
148+
#define rcu_dereference_ovsl(p) \
149+
rcu_dereference_check(p, lockdep_ovsl_is_held())
148150

149151
static inline struct net *ovs_dp_get_net(struct datapath *dp)
150152
{

‎net/openvswitch/flow_table.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ struct sw_flow *ovs_flow_tbl_lookup_stats(struct flow_table *tbl,
433433
const struct sw_flow_key *key,
434434
u32 *n_mask_hit)
435435
{
436-
struct table_instance *ti = rcu_dereference(tbl->ti);
436+
struct table_instance *ti = rcu_dereference_ovsl(tbl->ti);
437437
struct sw_flow_mask *mask;
438438
struct sw_flow *flow;
439439

0 commit comments

Comments
 (0)