aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2014-09-15 22:28:44 -0400
committerPravin B Shelar <pshelar@nicira.com>2014-09-16 02:28:13 -0400
commit8c8b1b83fcdd0f05e1f66ed6f8a2e831d5d374a2 (patch)
tree639e2202b5ded18df0c38daabedcdeeb3e6c2482 /net/openvswitch/datapath.c
parent83c8df26a3b654871c0503fcf6eac61777e12ea1 (diff)
openvswitch: Use tun_key only for egress tunnel path.
Currently tun_key is used for passing tunnel information on ingress and egress path, this cause confusion. Following patch removes its use on ingress path make it egress only parameter. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 0cce8e60d5ed..7e0819919b8a 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -237,33 +237,25 @@ void ovs_dp_detach_port(struct vport *p)
237} 237}
238 238
239/* Must be called with rcu_read_lock. */ 239/* Must be called with rcu_read_lock. */
240void ovs_dp_process_received_packet(struct sk_buff *skb) 240void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
241{ 241{
242 const struct vport *p = OVS_CB(skb)->input_vport; 242 const struct vport *p = OVS_CB(skb)->input_vport;
243 struct datapath *dp = p->dp; 243 struct datapath *dp = p->dp;
244 struct sw_flow *flow; 244 struct sw_flow *flow;
245 struct dp_stats_percpu *stats; 245 struct dp_stats_percpu *stats;
246 struct sw_flow_key key;
247 u64 *stats_counter; 246 u64 *stats_counter;
248 u32 n_mask_hit; 247 u32 n_mask_hit;
249 int error;
250 248
251 stats = this_cpu_ptr(dp->stats_percpu); 249 stats = this_cpu_ptr(dp->stats_percpu);
252 250
253 /* Extract flow from 'skb' into 'key'. */
254 error = ovs_flow_key_extract(skb, &key);
255 if (unlikely(error)) {
256 kfree_skb(skb);
257 return;
258 }
259
260 /* Look up flow. */ 251 /* Look up flow. */
261 flow = ovs_flow_tbl_lookup_stats(&dp->table, &key, &n_mask_hit); 252 flow = ovs_flow_tbl_lookup_stats(&dp->table, key, &n_mask_hit);
262 if (unlikely(!flow)) { 253 if (unlikely(!flow)) {
263 struct dp_upcall_info upcall; 254 struct dp_upcall_info upcall;
255 int error;
264 256
265 upcall.cmd = OVS_PACKET_CMD_MISS; 257 upcall.cmd = OVS_PACKET_CMD_MISS;
266 upcall.key = &key; 258 upcall.key = key;
267 upcall.userdata = NULL; 259 upcall.userdata = NULL;
268 upcall.portid = ovs_vport_find_upcall_portid(p, skb); 260 upcall.portid = ovs_vport_find_upcall_portid(p, skb);
269 error = ovs_dp_upcall(dp, skb, &upcall); 261 error = ovs_dp_upcall(dp, skb, &upcall);
@@ -277,8 +269,8 @@ void ovs_dp_process_received_packet(struct sk_buff *skb)
277 269
278 OVS_CB(skb)->flow = flow; 270 OVS_CB(skb)->flow = flow;
279 271
280 ovs_flow_stats_update(OVS_CB(skb)->flow, key.tp.flags, skb); 272 ovs_flow_stats_update(OVS_CB(skb)->flow, key->tp.flags, skb);
281 ovs_execute_actions(dp, skb, &key); 273 ovs_execute_actions(dp, skb, key);
282 stats_counter = &stats->n_hit; 274 stats_counter = &stats->n_hit;
283 275
284out: 276out: