From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 74339A0557 for ; Wed, 16 Nov 2022 11:40:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7085A40F16; Wed, 16 Nov 2022 11:40:54 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 51BF640E03 for ; Wed, 16 Nov 2022 11:40:53 +0100 (CET) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id D2D653F0A2 for ; Wed, 16 Nov 2022 10:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1668595252; bh=pWd2WAGaXAOMQhm57UIwWh9Fbxzwg0JWyU/vzF0k9XY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uh0WqGa6Om1zQcNCZgKlwtbbmLNh2FOdlegC+lReWgGxFGFEvoijINTXuPxP3wPS+ HcKC1FbWaZFoKeDjd6wIfVEWMpdT5CzBVMdc+aRGeHxAQVwmPMMDXkt6ZiZYSSxG5Z yA5UzrIRLit64BT+UmpwWbzQLOuBkr4iXNxs9BntM1HSHLdX9r+5HdMTIbK9D21TGL +2DBEK8mbABhrEjsrbfpobTzgdwhNCiP61wx5sYodMWCCi7lSoLwm0dSv9e1hX0QUt 7xqio8uMZUrdv3B9o5oZYZfNgTnmxLR6e3M/PxrMs4yDW5XtM14bI+Qo2FHHjMm3yH It4bDQN92g8Dg== Received: by mail-wr1-f70.google.com with SMTP id w11-20020adfbacb000000b002418a90da01so2140188wrg.16 for ; Wed, 16 Nov 2022 02:40:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pWd2WAGaXAOMQhm57UIwWh9Fbxzwg0JWyU/vzF0k9XY=; b=jn/OpgueCoZPQ9W/McLaehcqWoPMKxZGLztQiZNHd60IAj5Nzz3C83Ckth6FrBbzNy hV9X3HCIRQiE8+qXEoUqcVah0nx2jJ963QQWZk6jAxIzninMHhwnV03rUp52YfjfZlyL SyebOVUvRmICX7sqlCFtjB9ISrpBN3OJQrZu3rD0qTd+KZI1VzQFHEIsZLUiYQHuhemC Z+XHkU1kNjy5fkMQT5Dp3OF3CK0h/ODhq8kLUpHCHLxNehQ52DtZw9YZUr7h+MbFmTph UUiVmdFRmyWFloKaOQbxk+4YzQnfrUGY7k8FF4bXJMtG8mKmChaa75nKFgojKT0YDxjt lIsw== X-Gm-Message-State: ANoB5pkx6kFoolOs1KvKrsLCJjj7xu/a0RZ6iJBWj2TPbwpg2+9FuOI6 YEo6FW1mEoEwbbmapYR6Py2TCXv/dM8XdZ2Rg2mEiiO8iEjwaMDsYBqWunB/IUdOu2Fxxkuddgl tqIvwN8XBghH+frO2K2iJbAb4 X-Received: by 2002:a1c:4b0f:0:b0:3cf:758f:161f with SMTP id y15-20020a1c4b0f000000b003cf758f161fmr1623299wma.54.1668595252590; Wed, 16 Nov 2022 02:40:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf7CoJwc2rnN5vkVjpMoi51OJxh2BeY4SV2fPt2ZL5fpkJlZ0f2SaOugC2O8+/0YbzsdKflMUw== X-Received: by 2002:a1c:4b0f:0:b0:3cf:758f:161f with SMTP id y15-20020a1c4b0f000000b003cf758f161fmr1623285wma.54.1668595252375; Wed, 16 Nov 2022 02:40:52 -0800 (PST) Received: from localhost.localdomain ([2a02:6d40:39e5:dd00:975:f38b:96af:696f]) by smtp.gmail.com with ESMTPSA id s3-20020adfecc3000000b0022e653f5abbsm14719833wro.69.2022.11.16.02.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:40:52 -0800 (PST) From: christian.ehrhardt@canonical.com To: Mingjin Ye Cc: Qi Zhang , dpdk stable Subject: patch 'net/ice: fix scalar Tx path segment' has been queued to stable release 19.11.14 Date: Wed, 16 Nov 2022 11:40:06 +0100 Message-Id: <20221116104012.2975036-11-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116104012.2975036-1-christian.ehrhardt@canonical.com> References: <20221116104012.2975036-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 19.11.14 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/23/22. 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. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/1274818d662debbe19758e0db331d537fce35dbe Thanks. Christian Ehrhardt --- >From 1274818d662debbe19758e0db331d537fce35dbe Mon Sep 17 00:00:00 2001 From: Mingjin Ye Date: Fri, 11 Nov 2022 16:12:41 +0000 Subject: [PATCH] net/ice: fix scalar Tx path segment [ upstream commit 688cb2f2c61e48552fb9a211fdcfdb754a795b40 ] The scalar Tx path would send empty buffer that causes the Tx queue to overflow. This patch adds the last buffer length judgment in tx_prepare to fix this issue, rte_errno will be set to EINVAL and returned if the last buffer is empty. Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx") Fixes: ccf33dccf7aa ("net/ice: check illegal packet sizes") Signed-off-by: Mingjin Ye Acked-by: Qi Zhang --- drivers/net/ice/ice_rxtx.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 6dcb2f702a..c115fcf896 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -2952,6 +2952,22 @@ ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq) #define ICE_MIN_TSO_MSS 64 #define ICE_MAX_TSO_MSS 9728 #define ICE_MAX_TSO_FRAME_SIZE 262144 + +/*Check for empty mbuf*/ +static inline uint16_t +ice_check_empty_mbuf(struct rte_mbuf *tx_pkt) +{ + struct rte_mbuf *txd = tx_pkt; + + while (txd != NULL) { + if (txd->data_len == 0) + return -1; + txd = txd->next; + } + + return 0; +} + uint16_t ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) @@ -2998,6 +3014,12 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, rte_errno = -ret; return i; } + + if (ice_check_empty_mbuf(m) != 0) { + rte_errno = EINVAL; + PMD_DRV_LOG(ERR, "INVALID mbuf: last mbuf data_len=[0]"); + return i; + } } return i; } -- 2.38.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-16 11:36:50.834078304 +0100 +++ 0011-net-ice-fix-scalar-Tx-path-segment.patch 2022-11-16 11:36:50.424775526 +0100 @@ -1 +1 @@ -From 688cb2f2c61e48552fb9a211fdcfdb754a795b40 Mon Sep 17 00:00:00 2001 +From 1274818d662debbe19758e0db331d537fce35dbe Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 688cb2f2c61e48552fb9a211fdcfdb754a795b40 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 3224a02db2..0ea0045836 100644 +index 6dcb2f702a..c115fcf896 100644 @@ -27 +28 @@ -@@ -3645,6 +3645,22 @@ ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq) +@@ -2952,6 +2952,22 @@ ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq) @@ -50 +51 @@ -@@ -3691,6 +3707,12 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -2998,6 +3014,12 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,