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 46C1EA0561 for ; Thu, 27 Feb 2020 18:38:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 40C2E2C4F; Thu, 27 Feb 2020 18:38:54 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 3988A2C4F for ; Thu, 27 Feb 2020 18:38:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582825132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qGZDRBxf79FVUH2d6fqCf0wONi5dxRxPJ/T7T+Hj/Qk=; b=DXGxVR1PRMBnEhh5BdktmW3YZypch/nsC+PoyWtWKujXzH1EIy+IYlXjOkDF8/qWyck3D+ xa9utK1uKU1MJHWkixRBk8WURPagMlDtHBN9kJ3OUMLbXAoSmpIVUFnBsIsEX4fQT4U/Xa 0Jyw2BcdIx8xa2uDgLpNX5cKV2SdWAw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-54-wPt7qhHrOqSQaU_jfDHIKg-1; Thu, 27 Feb 2020 12:38:48 -0500 X-MC-Unique: wPt7qhHrOqSQaU_jfDHIKg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 561F418C35A0; Thu, 27 Feb 2020 17:38:47 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id F38FF8C087; Thu, 27 Feb 2020 17:38:40 +0000 (UTC) From: Kevin Traynor To: Xiao Zhang Cc: Konstantin Ananyev , Xiaolong Ye , dpdk stable Date: Thu, 27 Feb 2020 17:37:56 +0000 Message-Id: <20200227173807.28004-5-ktraynor@redhat.com> In-Reply-To: <20200227173807.28004-1-ktraynor@redhat.com> References: <20200227173807.28004-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/ixgbe: check for illegal Tx packets' has been queued to LTS release 18.11.7 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 LTS release 18.11.7 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/02/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 rebasi= ng (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-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/0b6691a41938f88445= 75f9426ad8b69f39bbfaad Thanks. Kevin. --- >From 0b6691a41938f8844575f9426ad8b69f39bbfaad 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 7f98db15a4..08a79a0ea9 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -986,4 +986,10 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_p= kts, uint16_t nb_pkts) =09=09} =20 +=09=09/* check the size of packet */ +=09=09if (m->pkt_len < IXGBE_TX_MIN_PKT_LEN) { +=09=09=09rte_errno =3D EINVAL; +=09=09=09return i; +=09=09} + #ifdef RTE_LIBRTE_ETHDEV_DEBUG =09=09ret =3D rte_validate_tx_offload(m); diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.= h index 39378f7547..7ae16967c6 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -54,4 +54,6 @@ #define IXGBE_TX_MAX_SEG 40 =20 +#define IXGBE_TX_MIN_PKT_LEN=09=09 14 + #define IXGBE_PACKET_TYPE_MASK_82599 0X7F #define IXGBE_PACKET_TYPE_MASK_X550 0X10FF --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-27 17:26:23.961231347 +0000 +++ 0005-net-ixgbe-check-for-illegal-Tx-packets.patch=092020-02-27 17:26:23= .625831617 +0000 @@ -1 +1 @@ -From fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a Mon Sep 17 00:00:00 2001 +From 0b6691a41938f8844575f9426ad8b69f39bbfaad Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index 7b398f1a1b..f839bcaab7 100644 +index 7f98db15a4..08a79a0ea9 100644 @@ -29 +30 @@ -@@ -987,4 +987,10 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_= pkts, uint16_t nb_pkts) +@@ -986,4 +986,10 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_= pkts, uint16_t nb_pkts) @@ -41 +42 @@ -index 000c5b1194..20a8b291d4 100644 +index 39378f7547..7ae16967c6 100644