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 D87DB41C71; Sun, 19 Feb 2023 01:31:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DE2540C35; Sun, 19 Feb 2023 01:31:05 +0100 (CET) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id 277CB40698 for ; Sun, 19 Feb 2023 01:31:04 +0100 (CET) Received: by mail-wm1-f44.google.com with SMTP id n6so1277280wmq.4 for ; Sat, 18 Feb 2023 16:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=srhobp8CZo367vJG2CgECDfct9NbXKT3GEhfge3H9b8=; b=BmoLaQlJigPEyym/FIfHZBr1zobkldUy/+xXQb2CF3E5tI73OqtO2tuMcZGxIYl/bh umov9Z4a0AoNi4meK8zr32EFdJ+b6BuRV6O1ulWwdR/Q3Ywv5boSnRLmfV7+a52lnGrK Hnk/Dm+Un5bBvqeyoIy7FO2cbV1XVcz/mejw2pHIvqdCOEeTpqgu12Z0teshujXngmA1 Biw9/Td/weAGzqRC5TDoz/Hq96WwtkGBmZNIQcMyQTsMNdtEOLmxcBeDzAScJ9L5KJbD EZhXlsTr92XRkMjP7JVh9gyyFrBh6KriFfRyqEjbc8mcIt45SS+VlCf6c6pbUfpoRnFf Mtwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=srhobp8CZo367vJG2CgECDfct9NbXKT3GEhfge3H9b8=; b=0KgbhLGDEs7f0xj80IbVL5mMIguIqg/Mri5QsGQm4ew9UvlX/GFQS41QwbglAfl234 i7jVFtzvizjt0L9/VMotw01DlIyLBZoTrWbe5afDDlgmUfzj6KlHPaMyYohjCd5vS0Pj mCkDxKHPa4dz5SsqOv7C5ktar58Hb5rgjJWS5+EGsHz6xnjp5/QtUvNt9ujFyiu6qv95 AJvq07tCPga9lSE2+OVm9+f+ijlQsCQV+VBr/WMmhfb9F90ysZCC+c7jovIYU9KxQlhg ijFHRTK7FS7lwdblqR7CtphVClW1cXJQwo/a0Dw9CJ9u6Aq7cpDaLwOAPCj0ArDXrJcF 0rGA== X-Gm-Message-State: AO0yUKXuPE68mWMQg21UxVzit8TqaPvfMd9a8yIWXEBSVNO8DrlFY2Bn 8/OyjBZ4F61HZiYu1swoP+0VLkd/y6s= X-Google-Smtp-Source: AK7set9fRgXktgOAP3ZHk1vnATkhFJFpvb4goBDUc9H1TAKVeTZo4HlNuvh218HoqsqSMHSFoGbYTA== X-Received: by 2002:a05:600c:4d05:b0:3dc:5937:35a2 with SMTP id u5-20020a05600c4d0500b003dc593735a2mr4476813wmp.9.1676766663743; Sat, 18 Feb 2023 16:31:03 -0800 (PST) Received: from localhost.localdomain ([176.41.28.141]) by smtp.gmail.com with ESMTPSA id ip24-20020a05600ca69800b003e223fe0a3asm6060590wmb.27.2023.02.18.16.31.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 18 Feb 2023 16:31:03 -0800 (PST) From: Levend Sayar To: junfeng.guo@intel.com Cc: dev@dpdk.org, Levend Sayar Subject: [PATCH] net/gve: fix Rx no mbufs stats counter update Date: Sun, 19 Feb 2023 03:30:59 +0300 Message-Id: <20230219003059.85479-1-levendsayar@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org rx no_mbufs stats counter update is added for another error case. Fixes: 4f6b1dd8240c ("net/gve: support basic statistics") Cc: junfeng.guo@intel.com Signed-off-by: Levend Sayar --- drivers/net/gve/gve_rx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c index 66fbcf3930..b0427731f8 100644 --- a/drivers/net/gve/gve_rx.c +++ b/drivers/net/gve/gve_rx.c @@ -24,6 +24,7 @@ gve_rx_refill(struct gve_rx_queue *rxq) nmb = rte_pktmbuf_alloc(rxq->mpool); if (!nmb) break; + rxq->sw_ring[idx + i] = nmb; } if (i != nb_alloc) { @@ -59,9 +60,13 @@ gve_rx_refill(struct gve_rx_queue *rxq) nmb = rte_pktmbuf_alloc(rxq->mpool); if (!nmb) break; + rxq->sw_ring[idx + i] = nmb; } - nb_alloc = i; + if (i != nb_alloc) { + rxq->no_mbufs += nb_alloc - i; + nb_alloc = i; + } } rxq->nb_avail -= nb_alloc; next_avail += nb_alloc; -- 2.37.1 (Apple Git-137.1)