Commit 1abcd82c authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

openvswitch: actions: use skb_postpull_rcsum when possible

Replace duplicated code by calling skb_postpull_rcsum
Suggested-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Acked-by: default avatarPravin B Shelar <pshelar@nicira.com>
Acked-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe159122
...@@ -175,10 +175,7 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key, ...@@ -175,10 +175,7 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key,
if (unlikely(err)) if (unlikely(err))
return err; return err;
if (skb->ip_summed == CHECKSUM_COMPLETE) skb_postpull_rcsum(skb, skb_mpls_header(skb), MPLS_HLEN);
skb->csum = csum_sub(skb->csum,
csum_partial(skb_mpls_header(skb),
MPLS_HLEN, 0));
memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb), memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb),
skb->mac_len); skb->mac_len);
...@@ -230,9 +227,7 @@ static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci) ...@@ -230,9 +227,7 @@ static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci)
if (unlikely(err)) if (unlikely(err))
return err; return err;
if (skb->ip_summed == CHECKSUM_COMPLETE) skb_postpull_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN);
skb->csum = csum_sub(skb->csum, csum_partial(skb->data
+ (2 * ETH_ALEN), VLAN_HLEN, 0));
vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN); vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
*current_tci = vhdr->h_vlan_TCI; *current_tci = vhdr->h_vlan_TCI;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment