@@ -1651,9 +1651,10 @@ static int iavf_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
exthdr = ip.hdr + sizeof(*ip.v6);
l4_proto = ip.v6->nexthdr;
- if (l4.hdr != exthdr)
- ipv6_skip_exthdr(skb, exthdr - skb->data,
- &l4_proto, &frag_off);
+ if (l4.hdr != exthdr &&
+ ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data,
+ &l4_proto, &frag_off) < 0)
+ goto no_csum_offload;
}
/* define outer transport */
@@ -1672,6 +1673,7 @@ static int iavf_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
l4.hdr = skb_inner_network_header(skb);
break;
default:
+no_csum_offload:
if (*tx_flags & IAVF_TX_FLAGS_TSO)
return -1;
@@ -1725,9 +1727,10 @@ static int iavf_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
exthdr = ip.hdr + sizeof(*ip.v6);
l4_proto = ip.v6->nexthdr;
- if (l4.hdr != exthdr)
- ipv6_skip_exthdr(skb, exthdr - skb->data,
- &l4_proto, &frag_off);
+ if (l4.hdr != exthdr &&
+ ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data,
+ &l4_proto, &frag_off) < 0)
+ goto no_csum_offload;
}
/* compute inner L3 header size */
@@ -1753,10 +1756,7 @@ static int iavf_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
break;
default:
- if (*tx_flags & IAVF_TX_FLAGS_TSO)
- return -1;
- skb_checksum_help(skb);
- return 0;
+ goto no_csum_offload;
}
*td_cmd |= cmd;