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 98841A00C2 for ; Thu, 3 Nov 2022 10:29:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9459D40694; Thu, 3 Nov 2022 10:29:56 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mails.dpdk.org (Postfix) with ESMTP id 4BEB740693 for ; Thu, 3 Nov 2022 10:29:55 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id v7so711142wmn.0 for ; Thu, 03 Nov 2022 02:29:55 -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=EkNZ/mEEuTAA/TUUm8qwPYAmfOvCkeedHh6je7OCnQ8=; b=SxI0lqBU1OZo/GpWuDp0csQJKittUUe+WrttJIvm8zI+fHg6PL13Jdvgo2TAaPqE0t 08AEHZApNPonJz7u7gy3k+DO6V0LaJG342bzx78sc3fj4uYZXtVIg1K0H6cDAbv9ozqa lPxTFlrkD6iwHobaHpTiA37hp9JwfpzCK+Nim0r3NNMvMvnbtk/N1Dw+i95WqUOvYt5E YdVsbbUe1yKSv2QUfRvRky89ZO7EWTwtIpN1Yj5WOnZUpLOh+s5SgUGw/Nabqtl8aUZB +lvKtH3jHG38zyzrw3qDsvskz9NDAeVwKlL1peYFvJo+DLH+LG9ePUEkA8QyDXIs/2d3 M4aw== 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=EkNZ/mEEuTAA/TUUm8qwPYAmfOvCkeedHh6je7OCnQ8=; b=J2baNSpeDNk4qmGYksWuJ5dXsyYQAkMyJUzqAKn2F2lYFQpFQqKrEOQk6thPBm0Lu4 fBRu57xi7jclJsvc8Zqxc9bAUpznREAf7skVLedGT1JV6ZRjZoL7ccnZUCgH8NdzMrDW ZWwmrqzhc2UDFBaYJPNRnC3Ns+dKnk6tXE+m7rNNuZBv96eEzEwoo/J70dP4WiXB+oa4 wCBUfpb7LNDtLWY/v9zbLlGroUTtTeMDmek5+0zRjn2ZiVj/NHJtQfIRhJI/XITYMf3M /a3w8zZJDgqqM57SHBlItdtKkkrzh51oL6s5fZh5UAgtFMrsW1ZJXAAsNMHRXAle9dCR kqTw== X-Gm-Message-State: ACrzQf0hP/H0y0QROdl+mhuBgL+Vv6hjEPdfmQDABvwttAc374lzspK7 XoN/5+2CQ0YxOWpQy4X3YOI= X-Google-Smtp-Source: AMsMyM7wLEjSEfl3VY7e+NYddK+8ECHxIcpOFifnS4WJrp4wyZ2IrFt3EUN9u2V8YamrvEnL3ZQr2Q== X-Received: by 2002:a05:600c:d0:b0:3cf:8e57:69e3 with SMTP id u16-20020a05600c00d000b003cf8e5769e3mr749600wmm.206.1667467794994; Thu, 03 Nov 2022 02:29:54 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id y10-20020a056000108a00b0022cd96b3ba6sm355523wrw.90.2022.11.03.02.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:29:54 -0700 (PDT) From: luca.boccassi@gmail.com To: Aleksandr Miloshenko Cc: Qi Zhang , dpdk stable Subject: patch 'net/iavf: fix Tx done descriptors cleanup' has been queued to stable release 20.11.7 Date: Thu, 3 Nov 2022 09:26:50 +0000 Message-Id: <20221103092758.1099402-32-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/9833aa00aa15466ddbea8d47b88214d25080a302 Thanks. Luca Boccassi --- >From 9833aa00aa15466ddbea8d47b88214d25080a302 Mon Sep 17 00:00:00 2001 From: Aleksandr Miloshenko Date: Mon, 29 Aug 2022 18:13:46 -0700 Subject: [PATCH] net/iavf: fix Tx done descriptors cleanup [ upstream commit 4e868408bf213dc92ac270bc06ac466ed81a8505 ] iavf_xmit_pkts() sets tx_tail to the next of last transmitted Tx descriptor. So the cleanup of Tx done descriptors must be started from tx_tail, not from the next of tx_tail. Otherwise rte_eth_tx_done_cleanup() doesn't free the first Tx done mbuf when tx queue is full. Fixes: 86e44244f95c ("net/iavf: cleanup Tx buffers") Signed-off-by: Aleksandr Miloshenko Acked-by: Qi Zhang --- drivers/net/iavf/iavf_rxtx.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 7689d7fa46..f6049d8694 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2565,14 +2565,14 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, uint32_t free_cnt) { struct iavf_tx_entry *swr_ring = txq->sw_ring; - uint16_t i, tx_last, tx_id; + uint16_t tx_last, tx_id; uint16_t nb_tx_free_last; uint16_t nb_tx_to_clean; - uint32_t pkt_cnt; + uint32_t pkt_cnt = 0; - /* Start free mbuf from the next of tx_tail */ - tx_last = txq->tx_tail; - tx_id = swr_ring[tx_last].next_id; + /* Start free mbuf from tx_tail */ + tx_id = txq->tx_tail; + tx_last = tx_id; if (txq->nb_free == 0 && iavf_xmit_cleanup(txq)) return 0; @@ -2585,10 +2585,8 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, /* Loop through swr_ring to count the amount of * freeable mubfs and packets. */ - for (pkt_cnt = 0; pkt_cnt < free_cnt; ) { - for (i = 0; i < nb_tx_to_clean && - pkt_cnt < free_cnt && - tx_id != tx_last; i++) { + while (pkt_cnt < free_cnt) { + do { if (swr_ring[tx_id].mbuf != NULL) { rte_pktmbuf_free_seg(swr_ring[tx_id].mbuf); swr_ring[tx_id].mbuf = NULL; @@ -2601,7 +2599,7 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, } tx_id = swr_ring[tx_id].next_id; - } + } while (--nb_tx_to_clean && pkt_cnt < free_cnt && tx_id != tx_last); if (txq->rs_thresh > txq->nb_tx_desc - txq->nb_free || tx_id == tx_last) -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-03 09:27:27.359864729 +0000 +++ 0032-net-iavf-fix-Tx-done-descriptors-cleanup.patch 2022-11-03 09:27:25.377422519 +0000 @@ -1 +1 @@ -From 4e868408bf213dc92ac270bc06ac466ed81a8505 Mon Sep 17 00:00:00 2001 +From 9833aa00aa15466ddbea8d47b88214d25080a302 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4e868408bf213dc92ac270bc06ac466ed81a8505 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index dfd021889e..3deabe1d7e 100644 +index 7689d7fa46..f6049d8694 100644 @@ -25 +26 @@ -@@ -3186,14 +3186,14 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, +@@ -2565,14 +2565,14 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, @@ -45 +46 @@ -@@ -3206,10 +3206,8 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, +@@ -2585,10 +2585,8 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, @@ -58 +59 @@ -@@ -3222,7 +3220,7 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, +@@ -2601,7 +2599,7 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq,