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 9B72FA054A for ; Tue, 25 Oct 2022 17:09:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96A0942C4E; Tue, 25 Oct 2022 17:09:11 +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 E388942C4C for ; Tue, 25 Oct 2022 17:09:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666710549; 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=7QGj2vJkwb9xtHfw6h2qSgli06LJscXIJsEh20QwqWk=; b=I4D8ZfJM3wefXyeLVnupp5e7FypsdO4q/6Ek8dI52unBgXxTGsgwaVADucgCT1yC+sSEK+ Q6kSJRgu5oo+MLYdpyyWCUL/kO0LGZikc6JONW2U5Ln9hZcPdUONpmxa0BsXEdomhomEFe YXYGiQJGkuYCQF3LYNf9h81FX7j04LY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-651-X8uqTzSQP1-xH0rZOpgHDA-1; Tue, 25 Oct 2022 11:09:08 -0400 X-MC-Unique: X8uqTzSQP1-xH0rZOpgHDA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA1B929DD994; Tue, 25 Oct 2022 15:09:02 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id D51FA4B400F; Tue, 25 Oct 2022 15:09:01 +0000 (UTC) From: Kevin Traynor To: Aleksandr Miloshenko Cc: Qi Zhang , dpdk stable Subject: patch 'net/iavf: fix Tx done descriptors cleanup' has been queued to stable release 21.11.3 Date: Tue, 25 Oct 2022 16:06:41 +0100 Message-Id: <20221025150734.142189-46-ktraynor@redhat.com> In-Reply-To: <20221025150734.142189-1-ktraynor@redhat.com> References: <20221025150734.142189-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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.3 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/01/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/30fc18b4dc9f055ab2651e9cffd73e0a57d94a69 Thanks. Kevin --- >From 30fc18b4dc9f055ab2651e9cffd73e0a57d94a69 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 285aeebff6..afe5981cac 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -3061,12 +3061,12 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, { 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)) @@ -3081,8 +3081,6 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, * 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); @@ -3097,5 +3095,5 @@ 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 - -- 2.37.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-10-25 14:18:59.576325016 +0100 +++ 0046-net-iavf-fix-Tx-done-descriptors-cleanup.patch 2022-10-25 14:18:58.410798088 +0100 @@ -1 +1 @@ -From 4e868408bf213dc92ac270bc06ac466ed81a8505 Mon Sep 17 00:00:00 2001 +From 30fc18b4dc9f055ab2651e9cffd73e0a57d94a69 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 285aeebff6..afe5981cac 100644 @@ -25 +26 @@ -@@ -3187,12 +3187,12 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, +@@ -3061,12 +3061,12 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, @@ -43 +44 @@ -@@ -3207,8 +3207,6 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, +@@ -3081,8 +3081,6 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, @@ -54 +55 @@ -@@ -3223,5 +3221,5 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq, +@@ -3097,5 +3095,5 @@ iavf_tx_done_cleanup_full(struct iavf_tx_queue *txq,