DPDK patches and discussions
 help / color / mirror / Atom feed
From: Zhichao Zeng <zhichaox.zeng@intel.com>
To: dev@dpdk.org
Cc: yidingx.zhou@intel.com, ke1.xu@intel.com, qi.z.zhang@intel.com,
	Zhichao Zeng <zhichaox.zeng@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Radu Nicolau <radu.nicolau@intel.com>
Subject: [PATCH v2] net/iavf: fix outer udp checksum offload
Date: Tue, 13 Dec 2022 09:45:11 +0800	[thread overview]
Message-ID: <20221213014512.150575-1-zhichaox.zeng@intel.com> (raw)
In-Reply-To: <20221118070316.198683-1-zhichaox.zeng@intel.com>

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 fixes judgment of the EIPT flag and enables the
'csum set outer-udp hw/sw' command by adding judgment for the
outer-udp checksum offload flag.

Fixes: 0c550022fb82 ("net/iavf: fix Tx descriptors for IPsec")

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

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index cf87a6beda..8d49967538 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2453,8 +2453,11 @@ iavf_fill_ctx_desc_tunnelling_field(volatile uint64_t *qw0,
 		 * Calculate the tunneling UDP checksum.
 		 * 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))
+		if ((eip_typ & (IAVF_TX_CTX_EXT_IP_IPV6 |
+					IAVF_TX_CTX_EXT_IP_IPV4 |
+					IAVF_TX_CTX_EXT_IP_IPV4_NO_CSUM)) &&
+				(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;
 	}
 
-- 
2.25.1


  parent reply	other threads:[~2022-12-13  1:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  7:03 [PATCH] " Zhichao Zeng
2022-12-02  9:46 ` Xu, Ke1
2022-12-13  1:45 ` Zhichao Zeng [this message]
2022-12-14  1:50   ` [PATCH v2] " Xu, Ke1
2022-12-26  2:34     ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221213014512.150575-1-zhichaox.zeng@intel.com \
    --to=zhichaox.zeng@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=ke1.xu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=yidingx.zhou@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).