[v2] net/iavf: fix Tx L3 checksum offload flag

Message ID 20220810095707.20865-1-ke1x.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/iavf: fix Tx L3 checksum offload flag |

Checks

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

Commit Message

Zhang, Ke1X Aug. 10, 2022, 9:57 a.m. UTC
  When ol_flag is only RTE_MBUF_F_TX_IPV4, the Tx L3
checksum offload is still configured to IIPT in the
command field of Tx data descriptor.

This patch is to fix the issue to make the Tx L3
checksum offload flags and Tx data descriptor
consistent.

Fixes: 1e728b01120c ("net/iavf: rework Tx path")
Cc: stable@dpdk.org

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
---
v2: Update the commit log
---
---
 drivers/net/iavf/iavf_rxtx.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
  

Comments

Qi Zhang Aug. 12, 2022, 2:36 a.m. UTC | #1
> -----Original Message-----
> From: Ke Zhang <ke1x.zhang@intel.com>
> Sent: Wednesday, August 10, 2022 5:57 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; dev@dpdk.org
> Cc: Zhang, Ke1X <ke1x.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/iavf: fix Tx L3 checksum offload flag
> 
> When ol_flag is only RTE_MBUF_F_TX_IPV4, the Tx L3 checksum offload is still
> configured to IIPT in the command field of Tx data descriptor.
> 
> This patch is to fix the issue to make the Tx L3 checksum offload flags and Tx
> data descriptor consistent.
> 
> Fixes: 1e728b01120c ("net/iavf: rework Tx path")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ke Zhang <ke1x.zhang@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 109ba756f8..dfd021889e 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2538,9 +2538,11 @@  iavf_build_data_desc_cmd_offset_fields(volatile uint64_t *qw1,
 	offset |= (m->l2_len >> 1) << IAVF_TX_DESC_LENGTH_MACLEN_SHIFT;
 
 	/* Enable L3 checksum offloading inner */
-	if (m->ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_IPV4)) {
-		command |= IAVF_TX_DESC_CMD_IIPT_IPV4_CSUM;
-		offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;
+	if (m->ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
+		if (m->ol_flags & RTE_MBUF_F_TX_IPV4) {
+			command |= IAVF_TX_DESC_CMD_IIPT_IPV4_CSUM;
+			offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;
+		}
 	} else if (m->ol_flags & RTE_MBUF_F_TX_IPV4) {
 		command |= IAVF_TX_DESC_CMD_IIPT_IPV4;
 		offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;