[ovs-dev] [PATCH v4 2/7] datapath: Clarify locking.

Jarno Rajahalme jrajahalme at nicira.com
Tue Mar 25 20:17:07 UTC 2014


Thanks for the review, Pushed to master with this incremental:

diff --git a/datapath/flow.c b/datapath/flow.c
index 4e9c4c7..5d1d2f2 100644
--- a/datapath/flow.c
+++ b/datapath/flow.c
@@ -123,6 +123,7 @@ unlock:
 	spin_unlock(&stats->lock);
 }
 
+/* Called with ovs_mutex. */
 void ovs_flow_stats_get(struct sw_flow *flow, struct ovs_flow_stats *ovs_stats,
 			unsigned long *used, __be16 *tcp_flags)
 {
@@ -133,7 +134,7 @@ void ovs_flow_stats_get(struct sw_flow *flow, struct ovs_flow_stats *ovs_stats,
 	memset(ovs_stats, 0, sizeof(*ovs_stats));
 
 	for_each_node(node) {
-		struct flow_stats *stats = rcu_dereference(flow->stats[node]);
+		struct flow_stats *stats = ovsl_dereference(flow->stats[node]);
 
 		if (stats) {
 			/* Local CPU may write on non-local stats, so we must

  Jarno

On Mar 25, 2014, at 9:05 AM, Thomas Graf <tgraf at redhat.com> wrote:

> On 03/24/2014 07:56 PM, Jarno Rajahalme wrote:
>> Remove unnecessary locking from functions that are always called with
>> appropriate locking.
>> 
>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
> 
> Acked-by: Thomas Graf <tgraf at redhat.com>




More information about the dev mailing list