[ovs-dev] [PATCH 02/10] datapath: Use get_table_protected() in additional places.

Jesse Gross jesse at nicira.com
Wed Dec 29 04:50:40 UTC 2010


There are several places where the flow table is accessed
without any kind of RCU protection.  This is fine because dp
mutex is held so this adds checks for that condition.

Found with sparse.

Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 datapath/datapath.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 2be0ce1..bf9fc82 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -286,7 +286,7 @@ static int create_dp(int dp_idx, const char __user *devnamep)
 err_destroy_local_port:
 	dp_detach_port(dp->ports[ODPP_LOCAL]);
 err_destroy_table:
-	tbl_destroy(dp->table, NULL);
+	tbl_destroy(get_table_protected(dp), NULL);
 err_free_dp:
 	kfree(dp);
 err_put_module:
@@ -312,8 +312,7 @@ static void do_destroy_dp(struct datapath *dp)
 	rcu_assign_pointer(dps[dp->dp_idx], NULL);
 
 	dp_detach_port(dp->ports[ODPP_LOCAL]);
-
-	tbl_destroy(dp->table, flow_free_tbl);
+	tbl_destroy(get_table_protected(dp), flow_free_tbl);
 
 	for (i = 0; i < DP_N_QUEUES; i++)
 		skb_queue_purge(&dp->queues[i]);
-- 
1.7.1





More information about the dev mailing list