From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B8D001B4AA for ; Thu, 29 Nov 2018 14:22:41 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 261329FDC6; Thu, 29 Nov 2018 13:22:41 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-230.ams2.redhat.com [10.36.117.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CCF6101962B; Thu, 29 Nov 2018 13:22:39 +0000 (UTC) From: Kevin Traynor To: Hyong Youb Kim Cc: John Daley , dpdk stable Date: Thu, 29 Nov 2018 13:20:28 +0000 Message-Id: <20181129132128.7609-28-ktraynor@redhat.com> In-Reply-To: <20181129132128.7609-1-ktraynor@redhat.com> References: <20181129132128.7609-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 29 Nov 2018 13:22:41 +0000 (UTC) Subject: [dpdk-stable] patch 'net/enic: fix size check in Tx prepare handler' has been queued to stable release 18.08.1 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: , X-List-Received-Date: Thu, 29 Nov 2018 13:22:42 -0000 Hi, FYI, your patch has been queued to stable release 18.08.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 12/08/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 32898b7e5d6decd525ec1cc98beec611a2842b87 Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Tue, 13 Nov 2018 07:38:10 -0800 Subject: [PATCH] net/enic: fix size check in Tx prepare handler [ upstream commit 7ac790d63bf0045d79b1c9f3bf692fc460fcd375 ] The current code wrongly assumes that packets are non-TSO and ends up rejecting large TSO packets. Check non-TSO and TSO max packet sizes separately. Fixes: 5a12c387405a ("net/enic: check maximum packet size in Tx prepare handler") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_rxtx.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c index 0eb113d75..6ccb2e1ad 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -655,9 +655,20 @@ uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, for (i = 0; i != nb_pkts; i++) { m = tx_pkts[i]; - if (unlikely(m->pkt_len > ENIC_TX_MAX_PKT_SIZE)) { - rte_errno = EINVAL; - return i; - } ol_flags = m->ol_flags; + if (!(ol_flags & PKT_TX_TCP_SEG)) { + if (unlikely(m->pkt_len > ENIC_TX_MAX_PKT_SIZE)) { + rte_errno = EINVAL; + return i; + } + } else { + uint16_t header_len; + + header_len = m->l2_len + m->l3_len + m->l4_len; + if (m->tso_segsz + header_len > ENIC_TX_MAX_PKT_SIZE) { + rte_errno = EINVAL; + return i; + } + } + if (ol_flags & wq->tx_offload_notsup_mask) { rte_errno = ENOTSUP; -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 13:11:35.742625578 +0000 +++ 0027-net-enic-fix-size-check-in-Tx-prepare-handler.patch 2018-11-29 13:11:34.000000000 +0000 @@ -1,14 +1,15 @@ -From 7ac790d63bf0045d79b1c9f3bf692fc460fcd375 Mon Sep 17 00:00:00 2001 +From 32898b7e5d6decd525ec1cc98beec611a2842b87 Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Tue, 13 Nov 2018 07:38:10 -0800 Subject: [PATCH] net/enic: fix size check in Tx prepare handler +[ upstream commit 7ac790d63bf0045d79b1c9f3bf692fc460fcd375 ] + The current code wrongly assumes that packets are non-TSO and ends up rejecting large TSO packets. Check non-TSO and TSO max packet sizes separately. Fixes: 5a12c387405a ("net/enic: check maximum packet size in Tx prepare handler") -Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley @@ -17,10 +18,10 @@ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c -index 5189ee635..0aadd3426 100644 +index 0eb113d75..6ccb2e1ad 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c -@@ -394,9 +394,20 @@ uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -655,9 +655,20 @@ uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, for (i = 0; i != nb_pkts; i++) { m = tx_pkts[i]; - if (unlikely(m->pkt_len > ENIC_TX_MAX_PKT_SIZE)) {