[dpdk-stable] patch 'net/ice: calculate TCP header size for offload' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Aug 6 11:54:01 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/08/20. 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.

Thanks.

Luca Boccassi

---
>From f411d19ebaee03020fbcdc9bbb6cbb99eb049932 Mon Sep 17 00:00:00 2001
From: Haiyue Wang <haiyue.wang at intel.com>
Date: Wed, 29 Jul 2020 15:50:39 +0800
Subject: [PATCH] net/ice: calculate TCP header size for offload

[ upstream commit 7365a3cee51fb0a0535336f5a5da1c3d41ee256a ]

The ice needs the exact TCP header size including options for TCP
checksum offload, but according to PKT_TX_TCP_CKSUM note, l4_len
is not required to be set, so it needs to calculate the TCP header
size if not set.

Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")

Signed-off-by: Haiyue Wang <haiyue.wang at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
Acked-by: Qiming Yang <qiming.yang at intel.com>
---
 drivers/net/ice/ice_rxtx.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index bd4a50ab9..eb27a66cd 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2398,6 +2398,28 @@ ice_calc_pkt_desc(struct rte_mbuf *tx_pkt)
 	return count;
 }
 
+/* Calculate TCP header length for PKT_TX_TCP_CKSUM if not provided */
+static inline uint16_t
+ice_calc_pkt_tcp_hdr(struct rte_mbuf *tx_pkt, union ice_tx_offload tx_offload)
+{
+	uint16_t tcpoff = tx_offload.l2_len + tx_offload.l3_len;
+	const struct rte_tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr _tcp_hdr;
+
+	if (tcpoff + sizeof(struct rte_tcp_hdr) < tx_pkt->data_len) {
+		tcp_hdr = rte_pktmbuf_mtod_offset(tx_pkt, struct rte_tcp_hdr *,
+						  tcpoff);
+
+		return (tcp_hdr->data_off & 0xf0) >> 2;
+	}
+
+	tcp_hdr = rte_pktmbuf_read(tx_pkt, tcpoff, sizeof(_tcp_hdr), &_tcp_hdr);
+	if (tcp_hdr)
+		return (tcp_hdr->data_off & 0xf0) >> 2;
+	else
+		return 0;
+}
+
 uint16_t
 ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 {
@@ -2495,6 +2517,11 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* Enable checksum offloading */
 		if (ol_flags & ICE_TX_CKSUM_OFFLOAD_MASK) {
+			if ((ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM &&
+			    !tx_offload.l4_len)
+				tx_offload.l4_len =
+				     ice_calc_pkt_tcp_hdr(tx_pkt, tx_offload);
+
 			ice_txd_enable_checksum(ol_flags, &td_cmd,
 						&td_offset, tx_offload);
 		}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-08-06 10:53:17.073970729 +0100
+++ 0033-net-ice-calculate-TCP-header-size-for-offload.patch	2020-08-06 10:53:15.828597956 +0100
@@ -1,15 +1,16 @@
-From 7365a3cee51fb0a0535336f5a5da1c3d41ee256a Mon Sep 17 00:00:00 2001
+From f411d19ebaee03020fbcdc9bbb6cbb99eb049932 Mon Sep 17 00:00:00 2001
 From: Haiyue Wang <haiyue.wang at intel.com>
 Date: Wed, 29 Jul 2020 15:50:39 +0800
 Subject: [PATCH] net/ice: calculate TCP header size for offload
 
+[ upstream commit 7365a3cee51fb0a0535336f5a5da1c3d41ee256a ]
+
 The ice needs the exact TCP header size including options for TCP
 checksum offload, but according to PKT_TX_TCP_CKSUM note, l4_len
 is not required to be set, so it needs to calculate the TCP header
 size if not set.
 
 Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
-Cc: stable at dpdk.org
 
 Signed-off-by: Haiyue Wang <haiyue.wang at intel.com>
 Acked-by: Qi Zhang <qi.z.zhang at intel.com>
@@ -19,10 +20,10 @@
  1 file changed, 27 insertions(+)
 
 diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
-index ddf6a93fb..bcb67ec25 100644
+index bd4a50ab9..eb27a66cd 100644
 --- a/drivers/net/ice/ice_rxtx.c
 +++ b/drivers/net/ice/ice_rxtx.c
-@@ -2371,6 +2371,28 @@ ice_calc_pkt_desc(struct rte_mbuf *tx_pkt)
+@@ -2398,6 +2398,28 @@ ice_calc_pkt_desc(struct rte_mbuf *tx_pkt)
  	return count;
  }
  
@@ -51,7 +52,7 @@
  uint16_t
  ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
  {
-@@ -2468,6 +2490,11 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -2495,6 +2517,11 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
  
  		/* Enable checksum offloading */
  		if (ol_flags & ICE_TX_CKSUM_OFFLOAD_MASK) {


More information about the stable mailing list