Skip to contentSkip to conversation

net/iavf: fix building data desc

PATCH Applied Zhichao Zeng 2 participants 2 messages Jan 12, 2023 – Jan 17, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: fix building data desc

Build correct data desc for UFO pkt by adding UDP_SEG flag, and disable L4 checksum offload when TSO/UFO is enabled to prevent the MDD.

Fixes 1e728b01120c ("net/iavf: rework Tx path")
---
 drivers/net/iavf/iavf_rxtx.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_rxtx.c +13 -2
index 8d49967538..3d9224b38d 100644
@@ -2619,10 +2619,21 @@ iavf_build_data_desc_cmd_offset_fields(volatile uint64_t *qw1,
 		offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;
 	}
 
-	if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
-		command |= IAVF_TX_DESC_CMD_L4T_EOFT_TCP;
+	if (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) {
+		if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG)
+			command |= IAVF_TX_DESC_CMD_L4T_EOFT_TCP;
+		else
+			command |= IAVF_TX_DESC_CMD_L4T_EOFT_UDP;
 		offset |= (m->l4_len >> 2) <<
 			      IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
+
+		*qw1 = rte_cpu_to_le_64((((uint64_t)command <<
+			IAVF_TXD_DATA_QW1_CMD_SHIFT) & IAVF_TXD_DATA_QW1_CMD_MASK) |
+			(((uint64_t)offset << IAVF_TXD_DATA_QW1_OFFSET_SHIFT) &
+			IAVF_TXD_DATA_QW1_OFFSET_MASK) |
+			((uint64_t)l2tag1 << IAVF_TXD_DATA_QW1_L2TAG1_SHIFT));
+
+		return;
 	}
 
 	/* Enable L4 checksum offloads */
Signature · 1 line
2.25.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: Zhichao Zeng <[email protected]>
Sent: Thursday, January 12, 2023 5:32 PM
To: [email protected]
Cc: [email protected]; Zhou, YidingX <[email protected]>; Zeng, ZhichaoX <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Doherty, Declan <[email protected]>; Sinha, Abhijit <[email protected]>; Nicolau, Radu <[email protected]>
Subject: [PATCH] net/iavf: fix building data desc

Quoted 7 lines

Build correct data desc for UFO pkt by adding UDP_SEG flag, and disable L4 checksum offload when TSO/UFO is enabled to prevent the MDD.

Fixes 1e728b01120c ("net/iavf: rework Tx path")

Applied to dpdk-next-net-intel.

Thanks
Qi