[ovs-dev] [PATCH net 4/5] openvswitch: Fix ovs_flow_free() ovs-lock assert.

Jesse Gross jesse at nicira.com
Wed Feb 5 06:41:00 UTC 2014

From: Pravin B Shelar <pshelar at nicira.com>

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 at nicira.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>
 net/openvswitch/flow_table.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
index bd14052..3c268b3 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)
 	if (!flow)
 	if (flow->mask) {
 		struct sw_flow_mask *mask = flow->mask;
+		/* ovs-lock is required to protect mask-refcount and
+		 * mask list.
+		 */

More information about the dev mailing list