[v2] net/ice:fix tunnel packet TX descriptor error

Message ID 20230608101904.65340-1-shiyangx.he@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/ice:fix tunnel packet TX descriptor error |

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-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing warning Testing issues
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Shiyang He June 8, 2023, 10:19 a.m. UTC
  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: bd70c451532c ("net/ice: support Tx checksum offload for tunnel")
Cc: stable@dpdk.org

Signed-off-by: Shiyang He <shiyangx.he@intel.com>
---
 drivers/net/ice/ice_rxtx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Qi Zhang June 12, 2023, 12:55 p.m. UTC | #1
> -----Original Message-----
> From: He, ShiyangX <shiyangx.he@intel.com>
> Sent: Thursday, June 8, 2023 6:19 PM
> To: dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; He, ShiyangX
> <shiyangx.he@intel.com>; stable@dpdk.org; Yang, Qiming
> <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Subject: [PATCH v2] net/ice:fix tunnel packet TX descriptor error

Please check the title format next time.

> 
> 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: bd70c451532c ("net/ice: support Tx checksum offload for tunnel")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shiyang He <shiyangx.he@intel.com>

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

Applied to dpdk-next-net-intel.

Thanks
Qi
  
Ke Xu June 14, 2023, 1:26 a.m. UTC | #2
> From: Shiyang He <shiyangx.he@intel.com>
> Sent: Thursday, June 8, 2023 6:19 PM
> To: dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; He, ShiyangX
> <shiyangx.he@intel.com>; stable@dpdk.org; Yang, Qiming
> <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Subject: [PATCH v2] net/ice: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: bd70c451532c ("net/ice: support Tx checksum offload for tunnel")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shiyang He <shiyangx.he@intel.com>

Verified passed.

Tested-by: Ke Xu <ke1.xu@intel.com>

> ---
>  drivers/net/ice/ice_rxtx.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
  

Patch

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 0ea0045836..3af552f3e1 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2738,10 +2738,7 @@  ice_txd_enable_checksum(uint64_t ol_flags,
 			union ice_tx_offload tx_offload)
 {
 	/* Set MACLEN */
-	if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
-		*td_offset |= (tx_offload.outer_l2_len >> 1)
-			<< ICE_TX_DESC_LEN_MACLEN_S;
-	else
+	if (!(ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK))
 		*td_offset |= (tx_offload.l2_len >> 1)
 			<< ICE_TX_DESC_LEN_MACLEN_S;
 
@@ -3002,9 +2999,12 @@  ice_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)
+				<< ICE_TX_DESC_LEN_MACLEN_S;
 			ice_parse_tunneling_params(ol_flags, tx_offload,
 						   &cd_tunneling_params);
+		}
 
 		/* Enable checksum offloading */
 		if (ol_flags & ICE_TX_CKSUM_OFFLOAD_MASK)