patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Kevin Liu <kevinx.liu@intel.com>
Cc: Ting Xu <ting.xu@intel.com>, Qi Zhang <qi.z.zhang@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: patch 'net/ice: fix Tx offload path choice' has been queued to stable release 21.11.1
Date: Tue,  8 Mar 2022 14:14:46 +0000	[thread overview]
Message-ID: <20220308141500.286915-31-ktraynor@redhat.com> (raw)
In-Reply-To: <20220308141500.286915-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 21.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/14/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/50e654bee488260ee53bfab105563b1fed20226e

Thanks.

Kevin

---
From 50e654bee488260ee53bfab105563b1fed20226e Mon Sep 17 00:00:00 2001
From: Kevin Liu <kevinx.liu@intel.com>
Date: Wed, 29 Dec 2021 09:37:01 +0000
Subject: [PATCH] net/ice: fix Tx offload path choice

[ upstream commit d852fec1be63126bb2c16be187340eb89a3d8a32 ]

Testpmd forwards packets in checksum mode that it needs to calculate
the checksum of each layer's protocol.

When setting the hardware calculates the outer UDP checksum and the
software calculates the outer IP checksum, the dev->tx_pkt_burst in
ice_set_tx_function is set to ice_xmit_pkts_vec_avx2.
The inner and outer UDP checksum of the tunnel packet after forwarding
is wrong.The dev->tx_pkt_burst should be set to ice_xmit_pkts.

The patch adds RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM to
ICE_TX_NO_VECTOR_FLAGS, set dev->tx_pkt_burst to ice_xmit_pkts. After
the tunnel packet is forwarded, the inner and outer UDP checksum is
correct.

At the same time, the patch of "net/ice: fix Tx Checksum offload" will
cause interrupt errors in a special case that only inner IP and inner
UDP checksum are set for hardware calculation. The patch is updating
ICE_TX_NO_VECTOR_FLAGS, the problem can be solved, so I will restore the
code modification of that patch.

Fixes: 28f9002ab67f ("net/ice: add Tx AVX512 offload path")
Fixes: 295968d17407 ("ethdev: add namespace")
Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Ting Xu <ting.xu@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_rxtx.c            | 41 ++++++-------------
 drivers/net/ice/ice_rxtx_vec_common.h | 57 +++++++++------------------
 2 files changed, 30 insertions(+), 68 deletions(-)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 4f218bcd0d..041f4bc91f 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2502,33 +2502,16 @@ ice_txd_enable_checksum(uint64_t ol_flags,
 
 	/* Enable L3 checksum offloads */
-	/*Tunnel package usage outer len enable L3 checksum offload*/
-	if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) {
-		if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
-			*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
-			*td_offset |= (tx_offload.outer_l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		} else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
-			*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
-			*td_offset |= (tx_offload.outer_l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		} else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
-			*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
-			*td_offset |= (tx_offload.outer_l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		}
-	} else {
-		if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
-			*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
-			*td_offset |= (tx_offload.l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		} else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
-			*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
-			*td_offset |= (tx_offload.l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		} else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
-			*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
-			*td_offset |= (tx_offload.l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		}
+	if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
+		*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
+		*td_offset |= (tx_offload.l3_len >> 2) <<
+			ICE_TX_DESC_LEN_IPLEN_S;
+	} else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
+		*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
+		*td_offset |= (tx_offload.l3_len >> 2) <<
+			ICE_TX_DESC_LEN_IPLEN_S;
+	} else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
+		*td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
+		*td_offset |= (tx_offload.l3_len >> 2) <<
+			ICE_TX_DESC_LEN_IPLEN_S;
 	}
 
diff --git a/drivers/net/ice/ice_rxtx_vec_common.h b/drivers/net/ice/ice_rxtx_vec_common.h
index 8ff01046e1..2dd2d83650 100644
--- a/drivers/net/ice/ice_rxtx_vec_common.h
+++ b/drivers/net/ice/ice_rxtx_vec_common.h
@@ -251,5 +251,6 @@ ice_rxq_vec_setup_default(struct ice_rx_queue *rxq)
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |		\
 		RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |	\
-		RTE_ETH_TX_OFFLOAD_TCP_TSO)
+		RTE_ETH_TX_OFFLOAD_TCP_TSO |	\
+		RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM)
 
 #define ICE_TX_VECTOR_OFFLOAD (				\
@@ -365,43 +366,21 @@ ice_txd_enable_offload(struct rte_mbuf *tx_pkt,
 
 	/* Tx Checksum Offload */
-	/*Tunnel package usage outer len enable L2/L3 checksum offload*/
-	if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) {
-		/* SET MACLEN */
-		td_offset |= (tx_pkt->outer_l2_len >> 1) <<
-			ICE_TX_DESC_LEN_MACLEN_S;
+	/* SET MACLEN */
+	td_offset |= (tx_pkt->l2_len >> 1) <<
+		ICE_TX_DESC_LEN_MACLEN_S;
 
-		/* Enable L3 checksum offload */
-		if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
-			td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
-			td_offset |= (tx_pkt->outer_l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		} else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
-			td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
-			td_offset |= (tx_pkt->outer_l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		} else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
-			td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
-			td_offset |= (tx_pkt->outer_l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		}
-	} else {
-		/* SET MACLEN */
-		td_offset |= (tx_pkt->l2_len >> 1) <<
-			ICE_TX_DESC_LEN_MACLEN_S;
-
-		/* Enable L3 checksum offload */
-		if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
-			td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
-			td_offset |= (tx_pkt->l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		} else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
-			td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
-			td_offset |= (tx_pkt->l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		} else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
-			td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
-			td_offset |= (tx_pkt->l3_len >> 2) <<
-				ICE_TX_DESC_LEN_IPLEN_S;
-		}
+	/* Enable L3 checksum offload */
+	if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
+		td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
+		td_offset |= (tx_pkt->l3_len >> 2) <<
+			ICE_TX_DESC_LEN_IPLEN_S;
+	} else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
+		td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
+		td_offset |= (tx_pkt->l3_len >> 2) <<
+			ICE_TX_DESC_LEN_IPLEN_S;
+	} else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
+		td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
+		td_offset |= (tx_pkt->l3_len >> 2) <<
+			ICE_TX_DESC_LEN_IPLEN_S;
 	}
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-03-08 13:55:29.190254911 +0000
+++ 0031-net-ice-fix-Tx-offload-path-choice.patch	2022-03-08 13:55:28.504315185 +0000
@@ -1 +1 @@
-From d852fec1be63126bb2c16be187340eb89a3d8a32 Mon Sep 17 00:00:00 2001
+From 50e654bee488260ee53bfab105563b1fed20226e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d852fec1be63126bb2c16be187340eb89a3d8a32 ]
+
@@ -29 +30,0 @@
-Cc: stable@dpdk.org


  parent reply	other threads:[~2022-03-08 14:16 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 14:14 patch 'event/cnxk: fix sub-event clearing mask length' " Kevin Traynor
2022-03-08 14:14 ` patch 'event/cnxk: fix Rx adapter config check' " Kevin Traynor
2022-03-08 14:14 ` patch 'event/dlb2: add shift value check in sparse dequeue' " Kevin Traynor
2022-03-08 14:14 ` patch 'app/compress-perf: fix cycle count operations allocation' " Kevin Traynor
2022-03-08 14:14 ` patch 'app/compress-perf: optimize operations pool " Kevin Traynor
2022-03-08 14:14 ` patch 'compress/mlx5: support out-of-space status' " Kevin Traynor
2022-03-08 14:14 ` patch 'app/compress-perf: fix socket ID type during init' " Kevin Traynor
2022-03-08 14:14 ` patch 'app/compress-perf: fix number of queue pairs to setup' " Kevin Traynor
2022-03-08 14:14 ` patch 'compressdev: fix socket ID type' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/hns3: remove duplicate macro definition' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/hns3: fix RSS TC mode entry' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/hns3: fix VF " Kevin Traynor
2022-03-08 14:14 ` patch 'net/hns3: increase time waiting for PF reset completion' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/ixgbe: fix FSP check for X550EM devices' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/iavf: support NAT-T / UDP encapsulation' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/iavf: fix function pointer in multi-process' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/mlx5: fix indexed pool fetch overlap' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/mlx5: fix destroying empty matchers list' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/mlx5: fix shared counter flag in flow validation' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/mlx5: fix check in count action " Kevin Traynor
2022-03-08 14:14 ` patch 'net/txgbe: fix queue statistics mapping' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/kni: fix config initialization' " Kevin Traynor
2022-03-08 14:14 ` patch 'doc: fix typos and punctuation in flow API guide' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/mlx5: fix GRE item translation in Verbs' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/mlx5: reduce flex item flow handle size' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/mlx5: fix matcher priority with ICMP or ICMPv6' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/mlx5: fix flex item header length translation' " Kevin Traynor
2022-03-08 14:14 ` patch 'net/iavf: fix AES-GMAC IV size' " Kevin Traynor
2022-03-08 14:14 ` patch 'common/cnxk: fix bitmap usage for TM' " Kevin Traynor
2022-03-08 14:14 ` patch 'common/cnxk: fix mbuf data offset for VF' " Kevin Traynor
2022-03-08 14:14 ` Kevin Traynor [this message]
2022-03-08 14:14 ` patch 'vhost: fix linker script syntax' " Kevin Traynor
2022-03-08 14:14 ` patch 'examples/vhost: fix launch with physical port' " Kevin Traynor
2022-03-08 14:14 ` patch 'eal/linux: fix device monitor stop return' " Kevin Traynor
2022-03-08 14:14 ` patch 'sched: remove useless malloc in PIE data init' " Kevin Traynor
2022-03-08 14:14 ` patch 'gpu/cuda: fix dependency loading path' " Kevin Traynor
2022-03-08 14:14 ` patch 'raw/ifpga: fix variable initialization in probing' " Kevin Traynor
2022-03-08 14:14 ` patch 'raw/ifpga: fix interrupt handle allocation' " Kevin Traynor
2022-03-08 14:14 ` patch 'raw/ifpga: fix monitor thread' " Kevin Traynor
2022-03-08 14:14 ` patch 'app/pdump: abort on multi-core capture limit' " Kevin Traynor
2022-03-08 14:14 ` patch 'pcapng: handle failure of link status query' " Kevin Traynor
2022-03-08 14:14 ` patch 'test/bpf: skip dump if conversion fails' " Kevin Traynor
2022-03-08 14:14 ` patch 'app/dumpcap: check for failure to set promiscuous' " Kevin Traynor
2022-03-08 14:14 ` patch 'examples/distributor: reduce Tx queue number to 1' " Kevin Traynor
2022-03-08 14:15 ` patch 'examples/flow_classify: fix failure message' " Kevin Traynor

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=20220308141500.286915-31-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=kevinx.liu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=ting.xu@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).