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 1F060A055A for ; Thu, 27 Feb 2020 10:34:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 158D81F1C; Thu, 27 Feb 2020 10:34:28 +0100 (CET) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 20D981BFA9 for ; Thu, 27 Feb 2020 10:34:26 +0100 (CET) Received: by mail-wm1-f67.google.com with SMTP id f15so2665018wml.3 for ; Thu, 27 Feb 2020 01:34:26 -0800 (PST) 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=yMjEEFQsGKno1pWkHYQvXsobogFDbxXyXu/J5tt7f5A=; b=PG80Fp6eqp1RXJaR5lWRbkvVWjGLfkUA1L6qjyMy6DOmAyG4m1lm5vpLLhUFxbJXC3 QYE4KLUL40swVIvTZdhb4xe2Ka4vZ5bRclrszfd1+AJxyz3qypdBsKa4XtDBte72pmbd PNWerh7Y9LxUZbwbL4poLJlISMB1aJyA2rAEKtrhiHYFDWgaMvTqUZ2Vor1fn1sCTiFO e/tS93Sk7PV12666Y+TxnImyU1el+xYC4yLNV4sFAWIjIAbonnrrRFWU6xgc1K/QADrM eelQv4hVKxh/TNLRiBpwm2sVHe8CVTmjTCTjUZPbFyqHoXMPpIrPNoyD5PAUYV362tJN Veig== 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=yMjEEFQsGKno1pWkHYQvXsobogFDbxXyXu/J5tt7f5A=; b=Yn5Z9H12sYO3EezuUgU1Q2xOWRiVLDkTqr6wPDKgT6eGyvH+DbTsOoAuvOcCwLjpLG JvmnAja6hUbMzmwiC70g5N+tQOzWFP7Hz7PxvwBUJJ/c1CLL3cHOlYlKLZaOiLOl7fIR OR4hXsz3CzUjnELQdzgqvHvXSRkk2bH4UyiRiEoZVq1oemIm1UqdAElkQ8Jzz1IK+85v z3r6pWlxQm3fKx3Zjoo9oKI8mwOpFmqDO/c66WmWm58yxcxcMtnIg0y31TY9KBULq5FE cfUgyeoHKCRdiI3wQP+30hKjvBvcQaLCbnHICluJE13lcgkVb7bMM8fyNN2lK2Y9BYgm skkA== X-Gm-Message-State: APjAAAWrbg0qJhFoEsiIGXXcj3pzE/Scch3j5gg6vZogEq+54uBjYgds lPucJRzhBarGV18W24zfJAc= X-Google-Smtp-Source: APXvYqw/K4Zb1nu36wknGJoMPfKbNcZcmg9qss1MGwb7zrQwvDQ+b3xzVeN0RT8oebStQM3fwl9Zwg== X-Received: by 2002:a05:600c:2283:: with SMTP id 3mr4147814wmf.100.1582796065838; Thu, 27 Feb 2020 01:34:25 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id r1sm6813004wrx.11.2020.02.27.01.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 01:34:25 -0800 (PST) From: luca.boccassi@gmail.com To: Xiao Zhang Cc: Konstantin Ananyev , Xiaolong Ye , dpdk stable Date: Thu, 27 Feb 2020 09:33:28 +0000 Message-Id: <20200227093402.17690-8-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200227093402.17690-1-luca.boccassi@gmail.com> References: <20200217174546.25334-54-luca.boccassi@gmail.com> <20200227093402.17690-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ixgbe: check for illegal Tx packets' has been queued to stable release 19.11.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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.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 02/29/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 dc50bc8425ce7964f6ac61a0396cb2d716243786 Mon Sep 17 00:00:00 2001 From: Xiao Zhang Date: Mon, 17 Feb 2020 22:51:15 +0800 Subject: [PATCH] net/ixgbe: check for illegal Tx packets [ upstream commit fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a ] For ixgbe, there is restriction that data buffers of any transmitted packet must include at least 12 bytes of the src/dst Ethernet MAC addresses as well as 2 bytes of the Type/Len field, otherwise, tx hang would happen. This patch adds check for those illegal packets and protects TX from hanging. Fixes: 7829b8d52be0 ("net/ixgbe: add Tx preparation") Signed-off-by: Xiao Zhang Acked-by: Konstantin Ananyev Acked-by: Xiaolong Ye --- drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++++++ drivers/net/ixgbe/ixgbe_rxtx.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 91f5fe1517..a7b24cd053 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -988,6 +988,12 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) return i; } + /* check the size of packet */ + if (m->pkt_len < IXGBE_TX_MIN_PKT_LEN) { + rte_errno = EINVAL; + return i; + } + #ifdef RTE_LIBRTE_ETHDEV_DEBUG ret = rte_validate_tx_offload(m); if (ret != 0) { diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h index 505d344b9c..5e1ac44942 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -53,6 +53,8 @@ #define IXGBE_TX_MAX_SEG 40 +#define IXGBE_TX_MIN_PKT_LEN 14 + #define IXGBE_PACKET_TYPE_MASK_82599 0X7F #define IXGBE_PACKET_TYPE_MASK_X550 0X10FF #define IXGBE_PACKET_TYPE_MASK_TUNNEL 0XFF -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-27 09:31:56.107195811 +0000 +++ 0008-net-ixgbe-check-for-illegal-Tx-packets.patch 2020-02-27 09:31:55.667945376 +0000 @@ -1,8 +1,10 @@ -From fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a Mon Sep 17 00:00:00 2001 +From dc50bc8425ce7964f6ac61a0396cb2d716243786 Mon Sep 17 00:00:00 2001 From: Xiao Zhang Date: Mon, 17 Feb 2020 22:51:15 +0800 Subject: [PATCH] net/ixgbe: check for illegal Tx packets +[ upstream commit fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a ] + For ixgbe, there is restriction that data buffers of any transmitted packet must include at least 12 bytes of the src/dst Ethernet MAC addresses as well as 2 bytes of the Type/Len field, otherwise, tx hang @@ -12,7 +14,6 @@ hanging. Fixes: 7829b8d52be0 ("net/ixgbe: add Tx preparation") -Cc: stable@dpdk.org Signed-off-by: Xiao Zhang Acked-by: Konstantin Ananyev @@ -23,10 +24,10 @@ 2 files changed, 8 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c -index 7b398f1a1b..f839bcaab7 100644 +index 91f5fe1517..a7b24cd053 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c -@@ -986,6 +986,12 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) +@@ -988,6 +988,12 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) return i; } @@ -40,7 +41,7 @@ ret = rte_validate_tx_offload(m); if (ret != 0) { diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h -index 000c5b1194..20a8b291d4 100644 +index 505d344b9c..5e1ac44942 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -53,6 +53,8 @@