Skip to content

Commit

Permalink
datapath: Fix ovs_flow_free() ovs-lock assert.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Andy Zhou <[email protected]>
Acked-by: Jesse Gross <[email protected]>
  • Loading branch information
Pravin B Shelar committed Jan 28, 2014
1 parent b73d3fe commit b1705c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datapath/flow_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,12 @@ void ovs_flow_free(struct sw_flow *flow, bool deferred)
if (!flow)
return;

ASSERT_OVSL();

if (flow->mask) {
struct sw_flow_mask *mask = flow->mask;

/* ovs-lock is required to protect mask-refcount and
* mask list. */
ASSERT_OVSL();
BUG_ON(!mask->ref_count);
mask->ref_count--;

Expand Down

0 comments on commit b1705c5

Please sign in to comment.