Skip to contentSkip to conversation

net/i40e: fix tunnel packet TX descriptor error

PATCH Applied Shiyang He 2 participants 2 messages Jun 14, 2023 – Jun 15, 2023 Network drivers

lore
Share & tools
lore

Shiyang He

author
#0 lore raw

PATCH 1/1 net/i40e: fix tunnel packet TX descriptor error

The TX descriptor of tunnel packet filled incorrectly due to the MACLEN is not set.

This patch fixes this issue by setting MACLEN to correctly fill the TX descriptor.

Fixes c59faf3fe8fe ("net/i40e: support TSO on tunneling packet")
---
 drivers/net/i40e/i40e_rxtx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/i40e/i40e_rxtx.c +5 -5
index fbbefb5015..b4f65b58fa 100644
@@ -304,10 +304,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,
 			union i40e_tx_offload tx_offload)
 {
 	/* Set MACLEN */
-	if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
-		*td_offset |= (tx_offload.outer_l2_len >> 1)
-				<< I40E_TX_DESC_LENGTH_MACLEN_SHIFT;
-	else
+	if (!(ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK))
 		*td_offset |= (tx_offload.l2_len >> 1)
 			<< I40E_TX_DESC_LENGTH_MACLEN_SHIFT;
 
@@ -1171,9 +1168,12 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* Fill in tunneling parameters if necessary */
 		cd_tunneling_params = 0;
-		if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
+		if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) {
+			td_offset |= (tx_offload.outer_l2_len >> 1)
+					<< I40E_TX_DESC_LENGTH_MACLEN_SHIFT;
 			i40e_parse_tunneling_params(ol_flags, tx_offload,
 						    &cd_tunneling_params);
+		}
 		/* Enable checksum offloading */
 		if (ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK)
 			i40e_txd_enable_checksum(ol_flags, &td_cmd,
Signature · 1 line
2.37.2
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 15 lines

-----Original Message-----
From: Shiyang He <[email protected]>
Sent: Wednesday, June 14, 2023 5:59 PM
To: [email protected]
Cc: Zhou, YidingX <[email protected]>; He, ShiyangX <[email protected]>; [email protected]; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Zhe Tao <[email protected]>; Jianfeng Tan <[email protected]>
Subject: [PATCH] net/i40e: fix tunnel packet TX descriptor error

The TX descriptor of tunnel packet filled incorrectly due to the MACLEN is not set.

Quoted 7 lines

This patch fixes this issue by setting MACLEN to correctly fill the TX descriptor.

Fixes c59faf3fe8fe ("net/i40e: support TSO on tunneling packet")

Applied to dpdk-next-net-intel.

Thanks
Qi