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 E291648A44 for ; Fri, 31 Oct 2025 15:35:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DAB8D40655; Fri, 31 Oct 2025 15:35:45 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 568FD40150 for ; Fri, 31 Oct 2025 15:35:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761921343; 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=5yKwSywYl5PVRgVdyz/sywjlYWpNPIjO5lrcFk3mymQ=; b=h/gq3m3QBWKWSg/DXKnDqGuWC/F1dZ876jlA1lE3ZhEV2ytLMVWVrRaZL5ge14nT98napH /LIR28jt7RwqB4iqTr00eyzbuIh+mGfjB/fe4E3s5nBqWQl/GaQ52b/0WcLLgfswnqxaW8 Pz1TbC2ixNda/1ySfIs93MW538ODwEs= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-62-Wh2t8-wsOkyMl2YbDV5KtA-1; Fri, 31 Oct 2025 10:35:38 -0400 X-MC-Unique: Wh2t8-wsOkyMl2YbDV5KtA-1 X-Mimecast-MFC-AGG-ID: Wh2t8-wsOkyMl2YbDV5KtA_1761921337 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8BBB61956046; Fri, 31 Oct 2025 14:35:37 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 03B931800452; Fri, 31 Oct 2025 14:35:35 +0000 (UTC) From: Kevin Traynor To: Joshua Washington Cc: Ankit Garg , dpdk stable Subject: patch 'net/gve: clean when insufficient Tx descriptors' has been queued to stable release 24.11.4 Date: Fri, 31 Oct 2025 14:32:12 +0000 Message-ID: <20251031143421.324432-10-ktraynor@redhat.com> In-Reply-To: <20251031143421.324432-1-ktraynor@redhat.com> References: <20251031143421.324432-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: CATArsaON6wIDCBZV1GtjEpl54MosOsIn-IFhSgnzR8_1761921337 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 24.11.4 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/25. 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/d04632254ef040dd4c79edf95b10a6e0e5902a8d Thanks. Kevin --- >From d04632254ef040dd4c79edf95b10a6e0e5902a8d Mon Sep 17 00:00:00 2001 From: Joshua Washington Date: Mon, 7 Jul 2025 16:18:06 -0700 Subject: [PATCH] net/gve: clean when insufficient Tx descriptors [ upstream commit 92d330a3eabb1ca2f74d494ebea0104bc7fd081f ] A single packet can technically require more than 32 (free_thresh) descriptors to send. Count the number of descriptors needed to send out a packet in DQO Tx, and ensure that there are enough descriptors in the ring before writing. If there are not enough free descriptors, drop the packet and increment drop counters. Fixes: 4022f9999f56 ("net/gve: support basic Tx data path for DQO") Signed-off-by: Joshua Washington Reviewed-by: Ankit Garg --- drivers/net/gve/gve_tx_dqo.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c index 6227fa73b0..652a0e5175 100644 --- a/drivers/net/gve/gve_tx_dqo.c +++ b/drivers/net/gve/gve_tx_dqo.c @@ -75,4 +75,10 @@ gve_tx_clean_dqo(struct gve_tx_queue *txq) } +static inline void +gve_tx_clean_descs_dqo(struct gve_tx_queue *txq, uint16_t nb_descs) { + while (--nb_descs) + gve_tx_clean_dqo(txq); +} + static uint16_t gve_tx_pkt_nb_data_descs(struct rte_mbuf *tx_pkt) @@ -108,5 +114,4 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) struct rte_mbuf *tx_pkt; uint16_t mask, sw_mask; - uint16_t nb_to_clean; uint16_t nb_tx = 0; uint64_t ol_flags; @@ -131,9 +136,7 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) tx_pkt = tx_pkts[nb_tx]; - if (txq->nb_free <= txq->free_thresh) { - nb_to_clean = DQO_TX_MULTIPLIER * txq->rs_thresh; - while (nb_to_clean--) - gve_tx_clean_dqo(txq); - } + if (txq->nb_free <= txq->free_thresh) + gve_tx_clean_descs_dqo(txq, DQO_TX_MULTIPLIER * + txq->rs_thresh); ol_flags = tx_pkt->ol_flags; @@ -145,6 +148,14 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) nb_descs = gve_tx_pkt_nb_data_descs(tx_pkt); nb_descs += tso; - if (txq->nb_free < nb_descs) - break; + + /* Clean if there aren't enough descriptors to send the packet. */ + if (unlikely(txq->nb_free < nb_descs)) { + int nb_to_clean = RTE_MAX(DQO_TX_MULTIPLIER * txq->rs_thresh, + nb_descs); + + gve_tx_clean_descs_dqo(txq, nb_to_clean); + if (txq->nb_free < nb_descs) + break; + } if (tso) { -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-31 13:53:52.603613932 +0000 +++ 0010-net-gve-clean-when-insufficient-Tx-descriptors.patch 2025-10-31 13:53:52.016523306 +0000 @@ -1 +1 @@ -From 92d330a3eabb1ca2f74d494ebea0104bc7fd081f Mon Sep 17 00:00:00 2001 +From d04632254ef040dd4c79edf95b10a6e0e5902a8d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 92d330a3eabb1ca2f74d494ebea0104bc7fd081f ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org