txbd1->lflags |= TX_BD_LONG_LFLAGS_LSO |
TX_BD_LONG_LFLAGS_T_IPID;
hdr_size = tx_pkt->l2_len + tx_pkt->l3_len +
- tx_pkt->l4_len + tx_pkt->outer_l2_len +
- tx_pkt->outer_l3_len;
+ tx_pkt->l4_len;
+ hdr_size += (tx_pkt->ol_flags & PKT_TX_TUNNEL_MASK) ?
+ tx_pkt->outer_l2_len +
+ tx_pkt->outer_l3_len : 0;
/* The hdr_size is multiple of 16bit units not 8bit.
* Hence divide by 2.
*/
rte_cpu_to_le_16(rte_pktmbuf_data_len(mb));
if (mb->ol_flags & PKT_TX_TCP_SEG) {
- hdrlen = mb->outer_l2_len + mb->outer_l3_len + mb->l2_len +
- mb->l3_len + mb->l4_len;
+ hdrlen = mb->l2_len + mb->l3_len + mb->l4_len;
+ hdrlen += (mb->ol_flags & PKT_TX_TUNNEL_MASK) ?
+ mb->outer_l2_len + mb->outer_l3_len : 0;
if (q->hw_ring[q->next_free].flags & FM10K_TXD_FLAG_FTAG)
hdrlen += sizeof(struct fm10k_ftag);
return ctx_desc;
}
- /**
- * in case of non tunneling packet, the outer_l2_len and
- * outer_l3_len must be 0.
- */
- hdr_len = tx_offload.outer_l2_len +
- tx_offload.outer_l3_len +
- tx_offload.l2_len +
- tx_offload.l3_len +
- tx_offload.l4_len;
+ hdr_len = tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len;
+ hdr_len += (mbuf->ol_flags & PKT_TX_TUNNEL_MASK) ?
+ tx_offload.outer_l2_len + tx_offload.outer_l3_len : 0;
cd_cmd = I40E_TX_CTX_DESC_TSO;
cd_tso_len = mbuf->pkt_len - hdr_len;
return ctx_desc;
}
- /* in case of non tunneling packet, the outer_l2_len and
- * outer_l3_len must be 0.
- */
hdr_len = tx_offload.l2_len +
tx_offload.l3_len +
tx_offload.l4_len;
return ctx_desc;
}
- /**
- * in case of non tunneling packet, the outer_l2_len and
- * outer_l3_len must be 0.
- */
- hdr_len = tx_offload.outer_l2_len +
- tx_offload.outer_l3_len +
- tx_offload.l2_len +
- tx_offload.l3_len +
- tx_offload.l4_len;
+ hdr_len = tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len;
+ hdr_len += (mbuf->ol_flags & PKT_TX_TUNNEL_MASK) ?
+ tx_offload.outer_l2_len + tx_offload.outer_l3_len : 0;
cd_cmd = ICE_TX_CTX_DESC_TSO;
cd_tso_len = mbuf->pkt_len - hdr_len;
uint64_t tso_segsz:RTE_MBUF_TSO_SEGSZ_BITS;
/**< TCP TSO segment size */
- /* fields for TX offloading of tunnels */
+ /*
+ * Fields for Tx offloading of tunnels.
+ * These are undefined for packets which don't request
+ * any tunnel offloads (outer IP or UDP checksum,
+ * tunnel TSO).
+ *
+ * PMDs should not use these fields unconditionally
+ * when calculating offsets.
+ *
+ * Applications are expected to set appropriate tunnel
+ * offload flags when they fill in these fields.
+ */
uint64_t outer_l3_len:RTE_MBUF_OUTL3_LEN_BITS;
/**< Outer L3 (IP) Hdr Length. */
uint64_t outer_l2_len:RTE_MBUF_OUTL2_LEN_BITS;