diff options
Diffstat (limited to 'net/openvswitch/actions.c')
| -rw-r--r-- | net/openvswitch/actions.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index b491c1c296fe..8a8c0b8b4f63 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c | |||
| @@ -608,17 +608,16 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port) | |||
| 608 | } | 608 | } |
| 609 | 609 | ||
| 610 | static int output_userspace(struct datapath *dp, struct sk_buff *skb, | 610 | static int output_userspace(struct datapath *dp, struct sk_buff *skb, |
| 611 | struct sw_flow_key *key, const struct nlattr *attr) | 611 | struct sw_flow_key *key, const struct nlattr *attr, |
| 612 | const struct nlattr *actions, int actions_len) | ||
| 612 | { | 613 | { |
| 613 | struct ovs_tunnel_info info; | 614 | struct ovs_tunnel_info info; |
| 614 | struct dp_upcall_info upcall; | 615 | struct dp_upcall_info upcall; |
| 615 | const struct nlattr *a; | 616 | const struct nlattr *a; |
| 616 | int rem; | 617 | int rem; |
| 617 | 618 | ||
| 619 | memset(&upcall, 0, sizeof(upcall)); | ||
| 618 | upcall.cmd = OVS_PACKET_CMD_ACTION; | 620 | upcall.cmd = OVS_PACKET_CMD_ACTION; |
| 619 | upcall.userdata = NULL; | ||
| 620 | upcall.portid = 0; | ||
| 621 | upcall.egress_tun_info = NULL; | ||
| 622 | 621 | ||
| 623 | for (a = nla_data(attr), rem = nla_len(attr); rem > 0; | 622 | for (a = nla_data(attr), rem = nla_len(attr); rem > 0; |
| 624 | a = nla_next(a, &rem)) { | 623 | a = nla_next(a, &rem)) { |
| @@ -647,6 +646,13 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb, | |||
| 647 | break; | 646 | break; |
| 648 | } | 647 | } |
| 649 | 648 | ||
| 649 | case OVS_USERSPACE_ATTR_ACTIONS: { | ||
| 650 | /* Include actions. */ | ||
| 651 | upcall.actions = actions; | ||
| 652 | upcall.actions_len = actions_len; | ||
| 653 | break; | ||
| 654 | } | ||
| 655 | |||
| 650 | } /* End of switch. */ | 656 | } /* End of switch. */ |
| 651 | } | 657 | } |
| 652 | 658 | ||
| @@ -654,7 +660,8 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb, | |||
| 654 | } | 660 | } |
| 655 | 661 | ||
| 656 | static int sample(struct datapath *dp, struct sk_buff *skb, | 662 | static int sample(struct datapath *dp, struct sk_buff *skb, |
| 657 | struct sw_flow_key *key, const struct nlattr *attr) | 663 | struct sw_flow_key *key, const struct nlattr *attr, |
| 664 | const struct nlattr *actions, int actions_len) | ||
| 658 | { | 665 | { |
| 659 | const struct nlattr *acts_list = NULL; | 666 | const struct nlattr *acts_list = NULL; |
| 660 | const struct nlattr *a; | 667 | const struct nlattr *a; |
| @@ -688,7 +695,7 @@ static int sample(struct datapath *dp, struct sk_buff *skb, | |||
| 688 | */ | 695 | */ |
| 689 | if (likely(nla_type(a) == OVS_ACTION_ATTR_USERSPACE && | 696 | if (likely(nla_type(a) == OVS_ACTION_ATTR_USERSPACE && |
| 690 | nla_is_last(a, rem))) | 697 | nla_is_last(a, rem))) |
| 691 | return output_userspace(dp, skb, key, a); | 698 | return output_userspace(dp, skb, key, a, actions, actions_len); |
| 692 | 699 | ||
| 693 | skb = skb_clone(skb, GFP_ATOMIC); | 700 | skb = skb_clone(skb, GFP_ATOMIC); |
| 694 | if (!skb) | 701 | if (!skb) |
| @@ -872,7 +879,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, | |||
| 872 | break; | 879 | break; |
| 873 | 880 | ||
| 874 | case OVS_ACTION_ATTR_USERSPACE: | 881 | case OVS_ACTION_ATTR_USERSPACE: |
| 875 | output_userspace(dp, skb, key, a); | 882 | output_userspace(dp, skb, key, a, attr, len); |
| 876 | break; | 883 | break; |
| 877 | 884 | ||
| 878 | case OVS_ACTION_ATTR_HASH: | 885 | case OVS_ACTION_ATTR_HASH: |
| @@ -916,7 +923,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, | |||
| 916 | break; | 923 | break; |
| 917 | 924 | ||
| 918 | case OVS_ACTION_ATTR_SAMPLE: | 925 | case OVS_ACTION_ATTR_SAMPLE: |
| 919 | err = sample(dp, skb, key, a); | 926 | err = sample(dp, skb, key, a, attr, len); |
| 920 | break; | 927 | break; |
| 921 | } | 928 | } |
| 922 | 929 | ||
