aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2014-01-31 12:43:23 -0500
committerJesse Gross <jesse@nicira.com>2014-02-05 01:21:45 -0500
commite4c6d7595403e943a3afc334eb8c0efcd840043a (patch)
tree66cff145611dcd24a267ace5e6e48b86b4747dcf /net
parent45fb9c35b27c9982e9a55d04ed0a5230a2d0b306 (diff)
openvswitch: Fix ovs_flow_free() ovs-lock assert.
ovs_flow_free() is not called under ovs-lock during packet execute path (ovs_packet_cmd_execute()). Since packet execute does not touch flow->mask, there is no need to take that lock either. So move assert in case where flow->mask is checked. Found by code inspection. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net')
-rw-r--r--net/openvswitch/flow_table.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
index bd14052ed342..3c268b3d71c3 100644
--- a/net/openvswitch/flow_table.c
+++ b/net/openvswitch/flow_table.c
@@ -158,11 +158,13 @@ void ovs_flow_free(struct sw_flow *flow, bool deferred)
158 if (!flow) 158 if (!flow)
159 return; 159 return;
160 160
161 ASSERT_OVSL();
162
163 if (flow->mask) { 161 if (flow->mask) {
164 struct sw_flow_mask *mask = flow->mask; 162 struct sw_flow_mask *mask = flow->mask;
165 163
164 /* ovs-lock is required to protect mask-refcount and
165 * mask list.
166 */
167 ASSERT_OVSL();
166 BUG_ON(!mask->ref_count); 168 BUG_ON(!mask->ref_count);
167 mask->ref_count--; 169 mask->ref_count--;
168 170