net/iavf: fix building data desc

Message ID 20230112093151.868142-1-zhichaox.zeng@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix building data desc |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Zhichao Zeng Jan. 12, 2023, 9:31 a.m. UTC
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")
Cc: stable@dpdk.org

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
  

Comments

Qi Zhang Jan. 17, 2023, 2:13 a.m. UTC | #1
> -----Original Message-----
> From: Zhichao Zeng <zhichaox.zeng@intel.com>
> Sent: Thursday, January 12, 2023 5:32 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhou, YidingX <yidingx.zhou@intel.com>; Zeng,
> ZhichaoX <zhichaox.zeng@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; Sinha, Abhijit <abhijit.sinha@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>
> Subject: [PATCH] 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 8d49967538..3d9224b38d 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -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 */