From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0EA92A0351 for ; Thu, 6 Aug 2020 11:59:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 072731C127; Thu, 6 Aug 2020 11:59:21 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 013641C135 for ; Thu, 6 Aug 2020 11:59:19 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id p14so8290352wmg.1 for ; Thu, 06 Aug 2020 02:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PWgblRHkW7VdqYItRC9lMu46+Od+nXUuPoGO7LkBuTs=; b=gqmDKO16BAuL5QvzmQs5JuLCTWwhJ2GlKoC02J8wPzWYQAVZLer6Srq+RXCNJkGKn/ HohhS7leisbtFvprRBgxgQrHoob2/dzZAiIhIq4YqVvCZ2EPlkNQ8pxw08jqhFQC9k9I 6lgAbJg2SZdDDO8d7SmVj9pp6J37dZ5+V6ka2E362wraQXTKyR4rVtLS1DU+Lez6Sypy 27n65ou43m8wbG74aXR5N4RbujGRtcnuhl6UAxhhTsWisPLkjSFfMLiAZI6N78CvyN4d 7UVedqN3tAcmgXSLmW5AXknvkrXDnQTVSep837eD0VTgc/V4XwW/ANOGFi8FGehETduh 8T4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PWgblRHkW7VdqYItRC9lMu46+Od+nXUuPoGO7LkBuTs=; b=J+CKcY8jbw1ph+hSyXTUpqheAD5IWIin9614pSwHm2Ka7jlusLDCBv7o2InPCjlax2 XyzgVT+92pE5+f42iEGow5AM06W5sXp9/TiHvYXRe1X3eNzSQ+b6nIE4Q9gcGcsqjbCG 2mVFV53AXL6Rlst5rHQOU04lP/INio9sp1b5YGkF7u1oCSCUSpxbVAEF8GeB09beU8ya JQc44UyEofbjN2SCM1pgdPmK6Ee2itnH/U0yrpd488oSoZyqxSdf0fOutBjNyFhWKHN2 QEKgX9kcUoNREEy3vWfEf3zEn6yu0GDLJcuEWtOe2WEA7bitSEritHj3pX4iNsVq2ZiM X0sw== X-Gm-Message-State: AOAM531axFC0gdchUYTtPw5OD7XXEoiz7osS9NPoGQaIKHq/Mzd5QDGP DhRwmXeRMCNKuP4qw+GDRS0= X-Google-Smtp-Source: ABdhPJwofJHRsbMlruEuvQvgTLyKLhylZ70yyWS7CbsZvF41x+HDR/DXfaGHSd9g7lplEiwjQeE5mA== X-Received: by 2002:a1c:a9ce:: with SMTP id s197mr7047054wme.58.1596707959664; Thu, 06 Aug 2020 02:59:19 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id f63sm5940722wmf.9.2020.08.06.02.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 02:59:19 -0700 (PDT) From: luca.boccassi@gmail.com To: Haiyue Wang Cc: Qi Zhang , Qiming Yang , dpdk stable Date: Thu, 6 Aug 2020 10:54:01 +0100 Message-Id: <20200806095411.774624-33-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200806095411.774624-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> <20200806095411.774624-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice: calculate TCP header size for offload' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 Acked-by: Qi Zhang Acked-by: Qiming Yang --- 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 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@dpdk.org Signed-off-by: Haiyue Wang Acked-by: Qi Zhang @@ -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) {