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 4B432A0555 for ; Wed, 25 May 2022 18:29:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45ED5400EF; Wed, 25 May 2022 18:29:43 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 395C74280C for ; Wed, 25 May 2022 18:29:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653496181; 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=9gpQbeBXFcXIV8M+s2cHzkkcIACHhW3USPIqkaYCHXc=; b=hvUv3tkqcholTmVW7slOvPxbHfSSOMwoGwxl4sFZ83EDcarLP67Jj3DezRVILJUSm8Zvgy zN/cesdNHDJCqf80UBUBLhVg7PXaWEwKzG9bympEr3P4fKd/ZH1abgskUf5aVE9S6rpnsy QJpGUHe4EETVyzvSLRq8Qhj4/fllzhQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-487-xdqChLLpM6GyjOTqlr8aHw-1; Wed, 25 May 2022 12:29:38 -0400 X-MC-Unique: xdqChLLpM6GyjOTqlr8aHw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 672AD101036A; Wed, 25 May 2022 16:29:26 +0000 (UTC) Received: from rh.Home (unknown [10.39.193.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F4042026D64; Wed, 25 May 2022 16:29:25 +0000 (UTC) From: Kevin Traynor To: Chengwen Feng Cc: Min Hu , dpdk stable Subject: patch 'net/hns3: fix mbuf free on Tx done cleanup' has been queued to stable release 21.11.2 Date: Wed, 25 May 2022 17:28:14 +0100 Message-Id: <20220525162847.711753-22-ktraynor@redhat.com> In-Reply-To: <20220525162847.711753-1-ktraynor@redhat.com> References: <20220525162847.711753-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/30/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/8b00917c0834f462dcc79c0c31ff3a10d6f4f310 Thanks. Kevin --- >From 8b00917c0834f462dcc79c0c31ff3a10d6f4f310 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Thu, 5 May 2022 20:27:04 +0800 Subject: [PATCH] net/hns3: fix mbuf free on Tx done cleanup [ upstream commit 2d287ea3c2301219c201617df15efa161deabf76 ] Currently, the hns3 PMD may free more mbufs than free_cnt parameter, this is an incorrect implementation. This patch fixes it. Fixes: 0b77e8f3d364 ("net/hns3: optimize Tx performance") Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_rxtx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index c43131cac6..7c184a5850 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -4613,5 +4613,5 @@ static int hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt) { - uint16_t round_free_cnt; + uint16_t round_cnt; uint32_t idx; @@ -4622,11 +4622,11 @@ hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt) return 0; - round_free_cnt = roundup(free_cnt, txq->tx_rs_thresh); - for (idx = 0; idx < round_free_cnt; idx += txq->tx_rs_thresh) { + round_cnt = rounddown(free_cnt, txq->tx_rs_thresh); + for (idx = 0; idx < round_cnt; idx += txq->tx_rs_thresh) { if (hns3_tx_free_useless_buffer(txq) != 0) break; } - return RTE_MIN(idx, free_cnt); + return idx; } -- 2.34.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-05-25 17:26:59.118706255 +0100 +++ 0022-net-hns3-fix-mbuf-free-on-Tx-done-cleanup.patch 2022-05-25 17:26:58.572828339 +0100 @@ -1 +1 @@ -From 2d287ea3c2301219c201617df15efa161deabf76 Mon Sep 17 00:00:00 2001 +From 8b00917c0834f462dcc79c0c31ff3a10d6f4f310 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2d287ea3c2301219c201617df15efa161deabf76 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index a28de06dfd..0c91e4721e 100644 +index c43131cac6..7c184a5850 100644 @@ -22 +23 @@ -@@ -4596,5 +4596,5 @@ static int +@@ -4613,5 +4613,5 @@ static int @@ -29 +30 @@ -@@ -4605,11 +4605,11 @@ hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt) +@@ -4622,11 +4622,11 @@ hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt)