net/iavf: fix outer udp checksum offload

Message ID 20221118070316.198683-1-zhichaox.zeng@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix outer udp checksum offload |

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

Commit Message

Zhichao Zeng Nov. 18, 2022, 7:03 a.m. UTC
  Currently, when dealing with UDP tunnel pkts checksum offloading,
the outer-udp checksum will be offloaded by default. So the
'csum set outer-udp hw/sw' command does not work.

This patch enables the 'csum set outer-udp hw/sw' command by adding
judgment on the outer-udp chekcusm offload flag.

Fixes: f7c8c36fdeb7 ("net/iavf: enable inner and outer Tx checksum offload")

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

Comments

Ke Xu Dec. 2, 2022, 9:46 a.m. UTC | #1
> -----Original Message-----
> From: Zhichao Zeng <zhichaox.zeng@intel.com>
> Sent: Friday, November 18, 2022 3:03 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhou, YidingX
> <yidingx.zhou@intel.com>; Zeng, ZhichaoX <zhichaox.zeng@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Peng
> Zhang <peng1x.zhang@intel.com>
> Subject: [PATCH] net/iavf: fix outer udp checksum offload
> 
> Currently, when dealing with UDP tunnel pkts checksum offloading, the
> outer-udp checksum will be offloaded by default. So the 'csum set outer-udp
> hw/sw' command does not work.
> 
> This patch enables the 'csum set outer-udp hw/sw' command by adding
> judgment on the outer-udp chekcusm offload flag.
> 
> Fixes: f7c8c36fdeb7 ("net/iavf: enable inner and outer Tx checksum offload")
> 
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>

Tested and passed. Verified applying only outer IP checksum without outer UDP checksum.
Outer UDP checksum will be errors as this feature is to ignore this checksum error.
Inner checksum is not influenced.
Outer IP checksum is not influenced.

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

> ---
>  drivers/net/iavf/iavf_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index cf87a6beda..c12fb96cfd 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2454,7 +2454,8 @@  iavf_fill_ctx_desc_tunnelling_field(volatile uint64_t *qw0,
 		 * Shall be set only if L4TUNT = 01b and EIPT is not zero
 		 */
 		if (!(eip_typ & IAVF_TX_CTX_EXT_IP_NONE) &&
-		    (eip_typ & IAVF_TXD_CTX_UDP_TUNNELING))
+		    (eip_typ & IAVF_TXD_CTX_UDP_TUNNELING) &&
+			(m->ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM))
 			eip_typ |= IAVF_TXD_CTX_QW0_L4T_CS_MASK;
 	}