From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8597606A322 for ; Thu, 3 Dec 2026 23:28:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=Fiuwd96Q Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC47E40E0B; Fri, 4 Dec 2026 00:27:07 +0100 (CET) Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) by mails.dpdk.org (Postfix) with ESMTPS id EB66B40E25 for ; Fri, 4 Dec 2026 00:27:06 +0100 (CET) Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-71bbae270c0so358056eaf.2 for ; Thu, 03 Dec 2026 15:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796340426; x=1796945226; darn=dpdk.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=u1KHFroDJYtzm/3U1ZIZ1Xtxy14H4N2SFwS1bZeiGsE=; b=Fiuwd96QgvLZL0Y8WQwmikC+bbZwGWPSofZEr3si+tJ3lCjsFZ5VHPXUaZKaxdLXuu xbtkAfgF4wf+7B21IS8fWaVL3Dkc6Nt6vrfOQTG8tvGahItoJ+0klHsHaJZLv5j8prZa UyBR9MdQLjkKiDiU9i18B9co/ZLNT1XOwQExJBUk5oIstPzi59zEH/bbp9eDmOjbjkLC JoH2abcf+bTIrhPt/ySNkXCNMpFKCuRzvQMJTPf+pp0xK515rF5893mn0BxtOcis57tM c1RpEhyokx0UHrV1oPRsymPuD5HXkvhHK4uSKSF8hLY1s6bq3j9d/Md/UkuF+8zD6v8I NCzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796340426; x=1796945226; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=u1KHFroDJYtzm/3U1ZIZ1Xtxy14H4N2SFwS1bZeiGsE=; b=uHC07B070OCmabsJFc3bwo7OaDIlWHkh/PeWu+iyX2nkhbKEmrzTRaok+9bGT3WkEV IqAynInrACB8kq56IpAXRwP6Nqqe7RishiiOnjLVhYwb8trypiWX9cmh8G/PRMMvCbln 2fO3dsewASjO8fvSS+hr0w+2dYfvl+RHODOmm5x2xMkXRGxL5H6mWagZiTwi/znsn2HI /zZaatG4a8qhW35941idah5e8uC0kmzOzb4aLGc0CDMkgcrUsS6qb0AfCuwx2KaDm4jA /2RDrA0cc3FKP/C5sl2vU9KnxBn2//8iBTPx/Qp0SHDbQ2ZvXLenqfj1/DWPQP2/RknG ssrA== X-Gm-Message-State: APuU4Z9LT5syhqtSURs7/kUAv2OFz6jeufCgRvmoYcvL9+kwIv0NHyjJ XaS/6C5DSzlDgo3SpyWjB0RpCkchuYhVhroihpCrxt+uJbDXXiGbvWBhzNXANw72YiXU60fOseQ 4BZSE11xKsjoOTQ== X-Received: from japv11.prod.google.com ([2002:a02:cbab:0:b0:622:c52a:d0cb]) (user=joshwash job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6820:f031:b0:716:df3b:e940 with SMTP id 006d021491bc7-71bf203df80mr184591eaf.16.1796340425509; Thu, 03 Dec 2026 15:27:05 -0800 (PST) Date: Thu, 3 Dec 2026 15:26:34 -0800 In-Reply-To: <20261203232637.1044501-1-joshwash@google.com> X-Archived-By: Mime-Version: 1.0 References: <20261203232637.1044501-1-joshwash@google.com> X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog Message-ID: <20261203232637.1044501-12-joshwash@google.com> Subject: [PATCH 11/12] net/gve: fix mbuf leak on GQI Rx queue start From: Joshua Washington To: Joshua Washington , Xiaoyun Li , Junfeng Guo Cc: dev@dpdk.org, "Jasper Tran O'Leary" , stable@dpdk.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Jasper Tran O'Leary When a GQI Rx queue is started, gve_rxq_mbufs_alloc() fills every slot of the software ring with an mbuf but posts only nb_rx_desc - 1 buffers to the device. The first refill then begins at the last slot of the ring and stores a newly allocated mbuf there without freeing the one the initial fill left in it. One mbuf per queue is lost every time a queue is started and goes on to receive traffic. Allocate nb_rx_desc - 1 mbufs up front. This is the number of buffers posted to the device, and it is what the fallback path taken when the bulk allocation fails already allocates. Fixes: a46583cf43c8 ("net/gve: support Rx/Tx") Cc: stable@dpdk.org Signed-off-by: Jasper Tran O'Leary Signed-off-by: Joshua Washington --- drivers/net/gve/gve_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c index 05430621de..f0ad420992 100644 --- a/drivers/net/gve/gve_rx.c +++ b/drivers/net/gve/gve_rx.c @@ -487,7 +487,7 @@ gve_rxq_mbufs_alloc(struct gve_rx_queue *rxq) uint16_t i; int diag; - diag = rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], rxq->nb_rx_desc); + diag = rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], rxq->nb_rx_desc - 1); if (diag < 0) { for (i = 0; i < rxq->nb_rx_desc - 1; i++) { nmb = rte_pktmbuf_alloc(rxq->mpool); -- 2.56.1.915.g69d5ec7298-goog