summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2014-10-20 15:05:56 -0700
committerPravin B Shelar <pshelar@nicira.com>2014-10-23 19:09:23 -0700
commit46051cf8ad1437d7c0d4da33ead1e915611dde67 (patch)
tree60b31379fa52d1bd4cf8883f3defc3b9d21f6b58
parent4efe455d79b0253d45a3a52d745529798ea1cf3e (diff)
downloadopenvswitch-46051cf8ad1437d7c0d4da33ead1e915611dde67.tar.gz
datapath: Replace __force type cast with rcu_dereference_raw().
rcu_dereference_raw() api is cleaner way of accessing RCU pointer when no locking is required. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
-rw-r--r--datapath/datapath.c2
-rw-r--r--datapath/flow_table.c8
-rw-r--r--datapath/vport.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 31db569aa..e53c5d52d 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1204,7 +1204,7 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
ovs_flow_tbl_remove(&dp->table, flow);
ovs_unlock();
- reply = ovs_flow_cmd_alloc_info((const struct sw_flow_actions __force *)flow->sf_acts,
+ reply = ovs_flow_cmd_alloc_info(rcu_dereference_raw(flow->sf_acts),
info, false);
if (likely(reply)) {
diff --git a/datapath/flow_table.c b/datapath/flow_table.c
index 4efef1347..9656cfe04 100644
--- a/datapath/flow_table.c
+++ b/datapath/flow_table.c
@@ -146,11 +146,11 @@ static void flow_free(struct sw_flow *flow)
{
int node;
- kfree((struct sw_flow_actions __force *)flow->sf_acts);
+ kfree(rcu_dereference_raw(flow->sf_acts));
for_each_node(node)
if (flow->stats[node])
kmem_cache_free(flow_stats_cache,
- (struct flow_stats __force *)flow->stats[node]);
+ rcu_dereference_raw(flow->stats[node]));
kmem_cache_free(flow_cache, flow);
}
@@ -334,10 +334,10 @@ skip_flows:
* error path. */
void ovs_flow_tbl_destroy(struct flow_table *table)
{
- struct table_instance *ti = (struct table_instance __force *)table->ti;
+ struct table_instance *ti = rcu_dereference_raw(table->ti);
free_percpu(table->mask_cache);
- kfree((struct mask_array __force *)table->mask_array);
+ kfree(rcu_dereference_raw(table->mask_array));
table_instance_destroy(ti, false);
}
diff --git a/datapath/vport.c b/datapath/vport.c
index fd5290342..18f39569f 100644
--- a/datapath/vport.c
+++ b/datapath/vport.c
@@ -166,7 +166,7 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops,
*/
void ovs_vport_free(struct vport *vport)
{
- kfree((struct vport_portids __force *)vport->upcall_portids);
+ kfree(rcu_dereference_raw(vport->upcall_portids));
free_percpu(vport->percpu_stats);
kfree(vport);
}