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 08E94A00C2 for ; Thu, 3 Nov 2022 10:32:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 04EDE40694; Thu, 3 Nov 2022 10:32:09 +0100 (CET) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id CA76440693 for ; Thu, 3 Nov 2022 10:32:07 +0100 (CET) Received: by mail-wr1-f49.google.com with SMTP id bs21so1738744wrb.4 for ; Thu, 03 Nov 2022 02:32:07 -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=EXjA5ixEvO9cV0WIfTh2DeA2exPKnBduaEEdoo1nVMo=; b=B2yKOH4ZeMf6UlMPviA/uWMU8No0UieyGmH3U1Po/M7N9ycd690cVbONHjBE6qmsJ4 DFDift/Wpf2d2M+bVqD1F9O/QRVzlpXzUfN3rBwEkMLRm1bSblidW9rDaY2sTuP1XZkK 43zKcMi+iDTUKhAzVTlFvA31uI1KTULla7y9vrOjbjkx91rbyYODyQEe1PvF7rV5qp9N 5H06PaGwelX8ATVDhWp820FNRvhsMo6sjgFb3L4EO6YlYI4S1B3tSqsSHUXF+BmYYFFw G6XxIspIEgMtXe1myHc+zmhVZFph6KKEj4E07R4MGE3mC/wXtkD5R6Wq9X7BdPVxvNTq dlHQ== 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=EXjA5ixEvO9cV0WIfTh2DeA2exPKnBduaEEdoo1nVMo=; b=ET727Ul5WvjIUOET3hRz1tGm9vdM0jGXokWU7Ye6igdD+sBtPU/UnyFKGmHtQjzZMN tyDAPRJtue7D1ih+V+fvFI6pZvv03IdDdmeM4OWUnCV+UIQObN4Vwu7D6sBZi60zznw0 xU9dJ04aDr61wCaH5nKGjWfJGy8BhXoeCds1bwMIf1+svvcBMMuMwFzQr/N1PsZ+67Zm MTma9aXkrz57OTEmsvcUdNYqQ95vxj8UnCG1Me6NjTAbOCOL4hJtZ5x3SjHq/41iIaWr xzSA/E2qeMV1KMqZ5nIg52EYWXpJh2AunpyGFNsDNiGDix1152ZGZPPMhpGVe08DTx8Q UTjg== X-Gm-Message-State: ACrzQf2o2AhDgda/dwHEvDbws0cJrMQuKyhTTAxTD8yGGluYOqRVXmQY tMpPULuwRySOR8XLWWORpWBHlElmD0/pb27u X-Google-Smtp-Source: AMsMyM67OMm/o7PqA0wFKRjzJELSBmSd/u4dEYhR1cysilvLyw6/a5MtPUKdooVTqMD3w2PjIQvWVA== X-Received: by 2002:adf:fc07:0:b0:236:6f04:2010 with SMTP id i7-20020adffc07000000b002366f042010mr17872989wrr.227.1667467927552; Thu, 03 Nov 2022 02:32:07 -0700 (PDT) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id f11-20020a05600c4e8b00b003b435c41103sm5565099wmq.0.2022.11.03.02.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:32:06 -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 SVE Tx' has been queued to stable release 20.11.7 Date: Thu, 3 Nov 2022 09:27:30 +0000 Message-Id: <20221103092758.1099402-72-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/cf08ee6b1f4a9d442b078e84e72d06f672b7833a Thanks. Luca Boccassi --- >From cf08ee6b1f4a9d442b078e84e72d06f672b7833a Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Mon, 5 Sep 2022 16:59:33 +0800 Subject: [PATCH] net/hns3: fix next-to-use overflow in SVE Tx [ upstream commit 3efbc3c4027c87c14727a6a5ce13b099cd8d5866 ] If txq's next-to-use plus nb_pkts equal txq's nb_tx_desc when using SVE xmit algorithm, the txq's next-to-use will equal nb_tx_desc after the xmit, this does not cause Tx exceptions, but may affect other ops that depend on this field, such as tx_descriptor_status. Fixes: f0c243a6cb6f ("net/hns3: support SVE Tx") Signed-off-by: Chengwen Feng Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_rxtx_vec_sve.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx_vec_sve.c b/drivers/net/hns3/hns3_rxtx_vec_sve.c index 67bf8ccdc5..e7446eb017 100644 --- a/drivers/net/hns3/hns3_rxtx_vec_sve.c +++ b/drivers/net/hns3/hns3_rxtx_vec_sve.c @@ -454,14 +454,16 @@ hns3_xmit_fixed_burst_vec_sve(void *__restrict tx_queue, return 0; } - 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_sve(txq, tx_pkts, nb_tx); txq->next_to_use = 0; } - hns3_tx_fill_hw_ring_sve(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_sve(txq, tx_pkts + nb_tx, nb_pkts - nb_tx); + txq->next_to_use += nb_pkts - nb_tx; + } txq->tx_bd_ready -= nb_pkts; 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.718787706 +0000 +++ 0072-net-hns3-fix-next-to-use-overflow-in-SVE-Tx.patch 2022-11-03 09:27:25.501424919 +0000 @@ -1 +1 @@ -From 3efbc3c4027c87c14727a6a5ce13b099cd8d5866 Mon Sep 17 00:00:00 2001 +From cf08ee6b1f4a9d442b078e84e72d06f672b7833a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3efbc3c4027c87c14727a6a5ce13b099cd8d5866 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index b0dfb052bb..f09a81dbd5 100644 +index 67bf8ccdc5..e7446eb017 100644 @@ -24 +25 @@ -@@ -464,14 +464,16 @@ hns3_xmit_fixed_burst_vec_sve(void *__restrict tx_queue, +@@ -454,14 +454,16 @@ hns3_xmit_fixed_burst_vec_sve(void *__restrict tx_queue, @@ -43 +44 @@ - hns3_write_txq_tail_reg(txq, nb_pkts); + hns3_write_reg_opt(txq->io_tail_reg, nb_pkts);