Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd225bc6 authored by Francois Romieu's avatar Francois Romieu Committed by Jeff Kirsher
Browse files

i40e: remove open-coded skb_cow_head



Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent b14878cc
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -1713,9 +1713,11 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb,
				I40E_TX_FLAGS_VLAN_PRIO_SHIFT;
				I40E_TX_FLAGS_VLAN_PRIO_SHIFT;
		if (tx_flags & I40E_TX_FLAGS_SW_VLAN) {
		if (tx_flags & I40E_TX_FLAGS_SW_VLAN) {
			struct vlan_ethhdr *vhdr;
			struct vlan_ethhdr *vhdr;
			if (skb_header_cloned(skb) &&
			int rc;
			    pskb_expand_head(skb, 0, 0, GFP_ATOMIC))

				return -ENOMEM;
			rc = skb_cow_head(skb, 0);
			if (rc < 0)
				return rc;
			vhdr = (struct vlan_ethhdr *)skb->data;
			vhdr = (struct vlan_ethhdr *)skb->data;
			vhdr->h_vlan_TCI = htons(tx_flags >>
			vhdr->h_vlan_TCI = htons(tx_flags >>
						 I40E_TX_FLAGS_VLAN_SHIFT);
						 I40E_TX_FLAGS_VLAN_SHIFT);
@@ -1743,20 +1745,18 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
		    u64 *cd_type_cmd_tso_mss, u32 *cd_tunneling)
		    u64 *cd_type_cmd_tso_mss, u32 *cd_tunneling)
{
{
	u32 cd_cmd, cd_tso_len, cd_mss;
	u32 cd_cmd, cd_tso_len, cd_mss;
	struct ipv6hdr *ipv6h;
	struct tcphdr *tcph;
	struct tcphdr *tcph;
	struct iphdr *iph;
	struct iphdr *iph;
	u32 l4len;
	u32 l4len;
	int err;
	int err;
	struct ipv6hdr *ipv6h;


	if (!skb_is_gso(skb))
	if (!skb_is_gso(skb))
		return 0;
		return 0;


	if (skb_header_cloned(skb)) {
	err = skb_cow_head(skb, 0);
		err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
	if (err < 0)
		if (err)
		return err;
		return err;
	}


	if (protocol == htons(ETH_P_IP)) {
	if (protocol == htons(ETH_P_IP)) {
		iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb);
		iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb);