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 C38B348A44 for ; Fri, 31 Oct 2025 15:35:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD4984065A; Fri, 31 Oct 2025 15:35:41 +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 4741440652 for ; Fri, 31 Oct 2025 15:35:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761921339; 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=PR7PximbLn8aoFxQsDE4IMakII7//nQG1abxVV8DaBc=; b=H6eNCfr5UP5URY4hs3DcbqdR2RIpVj0b8dGbrkKm9OfubWHfBZYMqbN4ZgErUy4T8CDv3a XMZEmjKeO5mIg/WnA5cXkISRhBJlPVFUO/5ifNm175LZ26wMUf0QtzQTjZVzWPJnFuToPa 3cHP1o297FQfUK+lMXMFtN89xHgOdFU= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-Sx_8zh3-PSOASNW31qf9bQ-1; Fri, 31 Oct 2025 10:35:36 -0400 X-MC-Unique: Sx_8zh3-PSOASNW31qf9bQ-1 X-Mimecast-MFC-AGG-ID: Sx_8zh3-PSOASNW31qf9bQ_1761921335 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 686941800654; Fri, 31 Oct 2025 14:35:35 +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 A4B381800299; Fri, 31 Oct 2025 14:35:33 +0000 (UTC) From: Kevin Traynor To: Joshua Washington Cc: Ankit Garg , dpdk stable Subject: patch 'net/gve: send whole packet when mbuf is large' has been queued to stable release 24.11.4 Date: Fri, 31 Oct 2025 14:32:11 +0000 Message-ID: <20251031143421.324432-9-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: 7muDxMD82jpUkicAJ81dY6tlBbT0LIjsbo9S1B-lH8c_1761921335 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/4a67e59c4a033935ec137522d328d522f0b23c4f Thanks. Kevin --- >From 4a67e59c4a033935ec137522d328d522f0b23c4f Mon Sep 17 00:00:00 2001 From: Joshua Washington Date: Mon, 7 Jul 2025 16:18:05 -0700 Subject: [PATCH] net/gve: send whole packet when mbuf is large [ upstream commit ee06313a50a8ebf18254a923152bf6729771cbc2 ] Before this patch, only one descriptor would be written per mbuf in a packet. In cases like TSO, it is possible for a single mbuf to have more bytes than GVE_MAX_TX_BUF_SIZE_DQO. As such, instead of simply truncating the data down to this size, the driver should actually write descriptors for the rest of the buffers in the mbuf segment. To that effect, the number of descriptors needed to send a packet must be corrected to account for the potential additional descriptors. Fixes: 4022f9999f56 ("net/gve: support basic Tx data path for DQO") Signed-off-by: Joshua Washington Reviewed-by: Ankit Garg --- .mailmap | 1 + drivers/net/gve/gve_tx_dqo.c | 54 ++++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/.mailmap b/.mailmap index e19b01476e..be3cea2d34 100644 --- a/.mailmap +++ b/.mailmap @@ -125,4 +125,5 @@ Andy Moreton Anirudh Venkataramanan +Ankit Garg Ankur Dwivedi Anna Lukin diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c index 6984f92443..6227fa73b0 100644 --- a/drivers/net/gve/gve_tx_dqo.c +++ b/drivers/net/gve/gve_tx_dqo.c @@ -75,4 +75,17 @@ gve_tx_clean_dqo(struct gve_tx_queue *txq) } +static uint16_t +gve_tx_pkt_nb_data_descs(struct rte_mbuf *tx_pkt) +{ + int nb_descs = 0; + + while (tx_pkt) { + nb_descs += (GVE_TX_MAX_BUF_SIZE_DQO - 1 + tx_pkt->data_len) / + GVE_TX_MAX_BUF_SIZE_DQO; + tx_pkt = tx_pkt->next; + } + return nb_descs; +} + static inline void gve_tx_fill_seg_desc_dqo(volatile union gve_tx_desc_dqo *desc, struct rte_mbuf *tx_pkt) @@ -98,5 +111,5 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) uint16_t nb_tx = 0; uint64_t ol_flags; - uint16_t nb_used; + uint16_t nb_descs; uint16_t tx_id; uint16_t sw_id; @@ -125,5 +138,4 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) ol_flags = tx_pkt->ol_flags; - nb_used = tx_pkt->nb_segs; first_sw_id = sw_id; @@ -131,6 +143,7 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) csum = !!(ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO); - nb_used += tso; - if (txq->nb_free < nb_used) + nb_descs = gve_tx_pkt_nb_data_descs(tx_pkt); + nb_descs += tso; + if (txq->nb_free < nb_descs) break; @@ -145,19 +158,26 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) PMD_DRV_LOG(DEBUG, "Overwriting an entry in sw_ring"); - txd = &txr[tx_id]; sw_ring[sw_id] = tx_pkt; - /* fill Tx descriptor */ - txd->pkt.buf_addr = rte_cpu_to_le_64(rte_mbuf_data_iova(tx_pkt)); - txd->pkt.dtype = GVE_TX_PKT_DESC_DTYPE_DQO; - txd->pkt.compl_tag = rte_cpu_to_le_16(first_sw_id); - txd->pkt.buf_size = RTE_MIN(tx_pkt->data_len, GVE_TX_MAX_BUF_SIZE_DQO); - txd->pkt.end_of_packet = 0; - txd->pkt.checksum_offload_enable = csum; + /* fill Tx descriptors */ + int mbuf_offset = 0; + while (mbuf_offset < tx_pkt->data_len) { + uint64_t buf_addr = rte_mbuf_data_iova(tx_pkt) + + mbuf_offset; + + txd = &txr[tx_id]; + txd->pkt.buf_addr = rte_cpu_to_le_64(buf_addr); + txd->pkt.compl_tag = rte_cpu_to_le_16(first_sw_id); + txd->pkt.dtype = GVE_TX_PKT_DESC_DTYPE_DQO; + txd->pkt.buf_size = RTE_MIN(tx_pkt->data_len - mbuf_offset, + GVE_TX_MAX_BUF_SIZE_DQO); + txd->pkt.end_of_packet = 0; + txd->pkt.checksum_offload_enable = csum; + + mbuf_offset += txd->pkt.buf_size; + tx_id = (tx_id + 1) & mask; + } - /* size of desc_ring and sw_ring could be different */ - tx_id = (tx_id + 1) & mask; sw_id = (sw_id + 1) & sw_mask; - bytes += tx_pkt->data_len; tx_pkt = tx_pkt->next; @@ -167,6 +187,6 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) txd->pkt.end_of_packet = 1; - txq->nb_free -= nb_used; - txq->nb_used += nb_used; + txq->nb_free -= nb_descs; + txq->nb_used += nb_descs; } -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-31 13:53:52.576512063 +0000 +++ 0009-net-gve-send-whole-packet-when-mbuf-is-large.patch 2025-10-31 13:53:52.015523303 +0000 @@ -1 +1 @@ -From ee06313a50a8ebf18254a923152bf6729771cbc2 Mon Sep 17 00:00:00 2001 +From 4a67e59c4a033935ec137522d328d522f0b23c4f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ee06313a50a8ebf18254a923152bf6729771cbc2 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index d4c04f3b81..6e5234223b 100644 +index e19b01476e..be3cea2d34 100644 @@ -29 +30 @@ -@@ -126,4 +126,5 @@ Andy Moreton +@@ -125,4 +125,5 @@ Andy Moreton - Ankur Dwivedi + Ankur Dwivedi + Anna Lukin