diff options
| author | David S. Miller <davem@davemloft.net> | 2017-08-21 20:06:42 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-08-21 20:06:42 -0400 |
| commit | e2a7c34fb2856fd5306e307e170e3dde358d0dce (patch) | |
| tree | afeb300b04186b1a1f649b2cd8a401a75878297c /net/openvswitch | |
| parent | 7d3f0cd43feea1636dd7746f22fe8249b34d1b79 (diff) | |
| parent | 6470812e22261d2342ef1597be62e63a0423d691 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/openvswitch')
| -rw-r--r-- | net/openvswitch/actions.c | 1 | ||||
| -rw-r--r-- | net/openvswitch/datapath.c | 7 | ||||
| -rw-r--r-- | net/openvswitch/datapath.h | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index e4610676299b..a54a556fcdb5 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c | |||
| @@ -1337,6 +1337,7 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb, | |||
| 1337 | goto out; | 1337 | goto out; |
| 1338 | } | 1338 | } |
| 1339 | 1339 | ||
| 1340 | OVS_CB(skb)->acts_origlen = acts->orig_len; | ||
| 1340 | err = do_execute_actions(dp, skb, key, | 1341 | err = do_execute_actions(dp, skb, key, |
| 1341 | acts->actions, acts->actions_len); | 1342 | acts->actions, acts->actions_len); |
| 1342 | 1343 | ||
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index f6e229b51dfb..76cf273a56c7 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
| @@ -367,7 +367,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb, | |||
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info, | 369 | static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info, |
| 370 | unsigned int hdrlen) | 370 | unsigned int hdrlen, int actions_attrlen) |
| 371 | { | 371 | { |
| 372 | size_t size = NLMSG_ALIGN(sizeof(struct ovs_header)) | 372 | size_t size = NLMSG_ALIGN(sizeof(struct ovs_header)) |
| 373 | + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */ | 373 | + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */ |
| @@ -384,7 +384,7 @@ static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info, | |||
| 384 | 384 | ||
| 385 | /* OVS_PACKET_ATTR_ACTIONS */ | 385 | /* OVS_PACKET_ATTR_ACTIONS */ |
| 386 | if (upcall_info->actions_len) | 386 | if (upcall_info->actions_len) |
| 387 | size += nla_total_size(upcall_info->actions_len); | 387 | size += nla_total_size(actions_attrlen); |
| 388 | 388 | ||
| 389 | /* OVS_PACKET_ATTR_MRU */ | 389 | /* OVS_PACKET_ATTR_MRU */ |
| 390 | if (upcall_info->mru) | 390 | if (upcall_info->mru) |
| @@ -451,7 +451,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, | |||
| 451 | else | 451 | else |
| 452 | hlen = skb->len; | 452 | hlen = skb->len; |
| 453 | 453 | ||
| 454 | len = upcall_msg_size(upcall_info, hlen - cutlen); | 454 | len = upcall_msg_size(upcall_info, hlen - cutlen, |
| 455 | OVS_CB(skb)->acts_origlen); | ||
| 455 | user_skb = genlmsg_new(len, GFP_ATOMIC); | 456 | user_skb = genlmsg_new(len, GFP_ATOMIC); |
| 456 | if (!user_skb) { | 457 | if (!user_skb) { |
| 457 | err = -ENOMEM; | 458 | err = -ENOMEM; |
diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h index 5d8dcd88815f..480600649d0b 100644 --- a/net/openvswitch/datapath.h +++ b/net/openvswitch/datapath.h | |||
| @@ -99,11 +99,13 @@ struct datapath { | |||
| 99 | * when a packet is received by OVS. | 99 | * when a packet is received by OVS. |
| 100 | * @mru: The maximum received fragement size; 0 if the packet is not | 100 | * @mru: The maximum received fragement size; 0 if the packet is not |
| 101 | * fragmented. | 101 | * fragmented. |
| 102 | * @acts_origlen: The netlink size of the flow actions applied to this skb. | ||
| 102 | * @cutlen: The number of bytes from the packet end to be removed. | 103 | * @cutlen: The number of bytes from the packet end to be removed. |
| 103 | */ | 104 | */ |
| 104 | struct ovs_skb_cb { | 105 | struct ovs_skb_cb { |
| 105 | struct vport *input_vport; | 106 | struct vport *input_vport; |
| 106 | u16 mru; | 107 | u16 mru; |
| 108 | u16 acts_origlen; | ||
| 107 | u32 cutlen; | 109 | u32 cutlen; |
| 108 | }; | 110 | }; |
| 109 | #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb) | 111 | #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb) |
