diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2014-03-29 23:14:48 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-04-18 20:33:28 -0400 |
commit | dd225bc675bc16972cc11f73fa0dc3ccb1ed9da1 (patch) | |
tree | 052e15b891ce6923ef523509233c89969eb9e4ab | |
parent | b14878ccb7fac0242db82720b784ab62c467c0dc (diff) |
i40e: remove open-coded skb_cow_head
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 0f5d96ad281d..1fdc8e977147 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -1713,9 +1713,11 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb, | |||
1713 | I40E_TX_FLAGS_VLAN_PRIO_SHIFT; | 1713 | I40E_TX_FLAGS_VLAN_PRIO_SHIFT; |
1714 | if (tx_flags & I40E_TX_FLAGS_SW_VLAN) { | 1714 | if (tx_flags & I40E_TX_FLAGS_SW_VLAN) { |
1715 | struct vlan_ethhdr *vhdr; | 1715 | struct vlan_ethhdr *vhdr; |
1716 | if (skb_header_cloned(skb) && | 1716 | int rc; |
1717 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | 1717 | |
1718 | return -ENOMEM; | 1718 | rc = skb_cow_head(skb, 0); |
1719 | if (rc < 0) | ||
1720 | return rc; | ||
1719 | vhdr = (struct vlan_ethhdr *)skb->data; | 1721 | vhdr = (struct vlan_ethhdr *)skb->data; |
1720 | vhdr->h_vlan_TCI = htons(tx_flags >> | 1722 | vhdr->h_vlan_TCI = htons(tx_flags >> |
1721 | I40E_TX_FLAGS_VLAN_SHIFT); | 1723 | I40E_TX_FLAGS_VLAN_SHIFT); |
@@ -1743,20 +1745,18 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, | |||
1743 | u64 *cd_type_cmd_tso_mss, u32 *cd_tunneling) | 1745 | u64 *cd_type_cmd_tso_mss, u32 *cd_tunneling) |
1744 | { | 1746 | { |
1745 | u32 cd_cmd, cd_tso_len, cd_mss; | 1747 | u32 cd_cmd, cd_tso_len, cd_mss; |
1748 | struct ipv6hdr *ipv6h; | ||
1746 | struct tcphdr *tcph; | 1749 | struct tcphdr *tcph; |
1747 | struct iphdr *iph; | 1750 | struct iphdr *iph; |
1748 | u32 l4len; | 1751 | u32 l4len; |
1749 | int err; | 1752 | int err; |
1750 | struct ipv6hdr *ipv6h; | ||
1751 | 1753 | ||
1752 | if (!skb_is_gso(skb)) | 1754 | if (!skb_is_gso(skb)) |
1753 | return 0; | 1755 | return 0; |
1754 | 1756 | ||
1755 | if (skb_header_cloned(skb)) { | 1757 | err = skb_cow_head(skb, 0); |
1756 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 1758 | if (err < 0) |
1757 | if (err) | 1759 | return err; |
1758 | return err; | ||
1759 | } | ||
1760 | 1760 | ||
1761 | if (protocol == htons(ETH_P_IP)) { | 1761 | if (protocol == htons(ETH_P_IP)) { |
1762 | iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb); | 1762 | iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb); |