diff options
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r-- | net/openvswitch/datapath.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 458096da138a..0cce8e60d5ed 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -237,8 +237,9 @@ 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. */ |
240 | void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb) | 240 | void ovs_dp_process_received_packet(struct sk_buff *skb) |
241 | { | 241 | { |
242 | const struct vport *p = OVS_CB(skb)->input_vport; | ||
242 | struct datapath *dp = p->dp; | 243 | struct datapath *dp = p->dp; |
243 | struct sw_flow *flow; | 244 | struct sw_flow *flow; |
244 | struct dp_stats_percpu *stats; | 245 | struct dp_stats_percpu *stats; |
@@ -250,7 +251,7 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb) | |||
250 | stats = this_cpu_ptr(dp->stats_percpu); | 251 | stats = this_cpu_ptr(dp->stats_percpu); |
251 | 252 | ||
252 | /* Extract flow from 'skb' into 'key'. */ | 253 | /* Extract flow from 'skb' into 'key'. */ |
253 | error = ovs_flow_extract(skb, p->port_no, &key); | 254 | error = ovs_flow_key_extract(skb, &key); |
254 | if (unlikely(error)) { | 255 | if (unlikely(error)) { |
255 | kfree_skb(skb); | 256 | kfree_skb(skb); |
256 | return; | 257 | return; |
@@ -514,6 +515,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info) | |||
514 | struct sw_flow *flow; | 515 | struct sw_flow *flow; |
515 | struct datapath *dp; | 516 | struct datapath *dp; |
516 | struct ethhdr *eth; | 517 | struct ethhdr *eth; |
518 | struct vport *input_vport; | ||
517 | int len; | 519 | int len; |
518 | int err; | 520 | int err; |
519 | 521 | ||
@@ -548,13 +550,11 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info) | |||
548 | if (IS_ERR(flow)) | 550 | if (IS_ERR(flow)) |
549 | goto err_kfree_skb; | 551 | goto err_kfree_skb; |
550 | 552 | ||
551 | err = ovs_flow_extract(packet, -1, &flow->key); | 553 | err = ovs_flow_key_extract_userspace(a[OVS_PACKET_ATTR_KEY], packet, |
554 | &flow->key); | ||
552 | if (err) | 555 | if (err) |
553 | goto err_flow_free; | 556 | goto err_flow_free; |
554 | 557 | ||
555 | err = ovs_nla_get_flow_metadata(flow, a[OVS_PACKET_ATTR_KEY]); | ||
556 | if (err) | ||
557 | goto err_flow_free; | ||
558 | acts = ovs_nla_alloc_flow_actions(nla_len(a[OVS_PACKET_ATTR_ACTIONS])); | 558 | acts = ovs_nla_alloc_flow_actions(nla_len(a[OVS_PACKET_ATTR_ACTIONS])); |
559 | err = PTR_ERR(acts); | 559 | err = PTR_ERR(acts); |
560 | if (IS_ERR(acts)) | 560 | if (IS_ERR(acts)) |
@@ -576,6 +576,15 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info) | |||
576 | if (!dp) | 576 | if (!dp) |
577 | goto err_unlock; | 577 | goto err_unlock; |
578 | 578 | ||
579 | input_vport = ovs_vport_rcu(dp, flow->key.phy.in_port); | ||
580 | if (!input_vport) | ||
581 | input_vport = ovs_vport_rcu(dp, OVSP_LOCAL); | ||
582 | |||
583 | if (!input_vport) | ||
584 | goto err_unlock; | ||
585 | |||
586 | OVS_CB(packet)->input_vport = input_vport; | ||
587 | |||
579 | local_bh_disable(); | 588 | local_bh_disable(); |
580 | err = ovs_execute_actions(dp, packet, &flow->key); | 589 | err = ovs_execute_actions(dp, packet, &flow->key); |
581 | local_bh_enable(); | 590 | local_bh_enable(); |