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 455E1A00C2 for ; Thu, 3 Nov 2022 10:32:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3878F4069B; Thu, 3 Nov 2022 10:32:12 +0100 (CET) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mails.dpdk.org (Postfix) with ESMTP id 5270941614 for ; Thu, 3 Nov 2022 10:32:09 +0100 (CET) Received: by mail-wr1-f45.google.com with SMTP id cl5so1701718wrb.9 for ; Thu, 03 Nov 2022 02:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s5yJTyFQnorMkvvOIGTPz4x8kfQqRVprQmlpZUCHNso=; b=AIaeqRyp+E3nkFbGadUAimS/L8ydrv1Ui6QngAbi43rvSfLcFh87BkjQBger0GUzfK M+kNjaBE4/I9WCk9ChFZS43QpXSsieGTLyIJn7N8qRBoeF6UvZl1jak3h1gTTkkkuQYJ 12A3wTOaeb0ZXaQjyeOewfshqO5fk00HTCe998gTcFdpB+Q1JmkjJA5c9v62a9XIUc3a Vh6ZQZHMu9yG4uO5uB82TrT0Xu8xUlrC+kWl/WTZtoj4UmIoRVO6AONntvPQKU1fMnrd S0wCdKF3kfvGmYXdUJjpYOAjdmn52wiCV6mKPrWS9OjAu0v9Dtl0IwZs6KPrLa3McYwq CZKA== 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=s5yJTyFQnorMkvvOIGTPz4x8kfQqRVprQmlpZUCHNso=; b=kpGTOE3ettTyz5cpCaQhOz0hhzTw5PiFNnUA1kKfWBL3q1zWokWU1VDwtrJBG4Tg+K 8fsHfLjCTq3iTZdZmU6Wkwu0M7A68MJ28cjFSneuvchFqkjjdArjmaeo9erJFODYpXyn 5CydhJc2flPTJhIGVoenRLHEoVBILkzCx0s0FyfKByTJJAF5hwbWj/qTeeJWDqVQLKV6 bDhSJ3Ta1RJQspaoascviCPJozmAuuxtF0ueRYB6H/lNCnzLpA1KkIAgV1GrdImlnaqT bD3qJQwbJrrgTSGFBU2AJla/50505Os4MjDglihsOX3dxXbpBk6cqqEL24qQkp+mRjdZ 7tkQ== X-Gm-Message-State: ACrzQf0iXXE+S8/TqkUQdAVnlKGLK0zlss/SUR82aXjzl5+uiEv1yw1T 8Qb1r4tZbZ03zq9LhLfnH1WSadDuGDfBq8+k X-Google-Smtp-Source: AMsMyM40qFRblRZqkVlvHYzadKlYUpYhcNaAdkJHQgFm8fkVoDhxjrHsV3aKLAKh433QdlzENbpzew== X-Received: by 2002:a5d:4048:0:b0:236:659b:260e with SMTP id w8-20020a5d4048000000b00236659b260emr17374685wrp.445.1667467928922; Thu, 03 Nov 2022 02:32:08 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id d2-20020adfa402000000b0022e47b57735sm342831wra.97.2022.11.03.02.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:32:08 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: fix next-to-use overflow in simple Tx' has been queued to stable release 20.11.7 Date: Thu, 3 Nov 2022 09:27:31 +0000 Message-Id: <20221103092758.1099402-73-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221103092758.1099402-1-luca.boccassi@gmail.com> References: <20221103092758.1099402-1-luca.boccassi@gmail.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 20.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 11/05/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/19f514c65fdbaa94cf9e24ec0b9c05bbff342255 Thanks. Luca Boccassi --- >From 19f514c65fdbaa94cf9e24ec0b9c05bbff342255 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Mon, 5 Sep 2022 16:59:34 +0800 Subject: [PATCH] net/hns3: fix next-to-use overflow in simple Tx [ upstream commit 76a9c980cf61d8ee21402d1d1d650d2f9d49cfb0 ] If txq's next-to-use plus nb_pkts equal txq's nb_tx_desc when using simple xmit algorithm, the txq's next-to-use will equal nb_tx_desc fter the xmit, this does not cause Tx exceptions, but may affect other ops that depend on this field, such as tx_descriptor_status. Fixes: 7ef933908f04 ("net/hns3: add simple Tx path") Signed-off-by: Chengwen Feng Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_rxtx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index c5f5ed46a7..27f0fdbab2 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -3710,14 +3710,16 @@ hns3_xmit_pkts_simple(void *tx_queue, } txq->tx_bd_ready -= nb_pkts; - if (txq->next_to_use + nb_pkts > txq->nb_tx_desc) { + if (txq->next_to_use + nb_pkts >= txq->nb_tx_desc) { nb_tx = txq->nb_tx_desc - txq->next_to_use; hns3_tx_fill_hw_ring(txq, tx_pkts, nb_tx); txq->next_to_use = 0; } - hns3_tx_fill_hw_ring(txq, tx_pkts + nb_tx, nb_pkts - nb_tx); - txq->next_to_use += nb_pkts - nb_tx; + if (nb_pkts > nb_tx) { + hns3_tx_fill_hw_ring(txq, tx_pkts + nb_tx, nb_pkts - nb_tx); + txq->next_to_use += nb_pkts - nb_tx; + } hns3_write_reg_opt(txq->io_tail_reg, nb_pkts); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-03 09:27:29.780399340 +0000 +++ 0073-net-hns3-fix-next-to-use-overflow-in-simple-Tx.patch 2022-11-03 09:27:25.505424996 +0000 @@ -1 +1 @@ -From 76a9c980cf61d8ee21402d1d1d650d2f9d49cfb0 Mon Sep 17 00:00:00 2001 +From 19f514c65fdbaa94cf9e24ec0b9c05bbff342255 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 76a9c980cf61d8ee21402d1d1d650d2f9d49cfb0 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index a6481bb68b..ecee5363b2 100644 +index c5f5ed46a7..27f0fdbab2 100644 @@ -24 +25 @@ -@@ -4126,14 +4126,16 @@ hns3_xmit_pkts_simple(void *tx_queue, +@@ -3710,14 +3710,16 @@ hns3_xmit_pkts_simple(void *tx_queue, @@ -42 +43 @@ - hns3_write_txq_tail_reg(txq, nb_pkts); + hns3_write_reg_opt(txq->io_tail_reg, nb_pkts);