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 E3E5741CFC; Tue, 21 Feb 2023 11:07:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBDA1431A7; Tue, 21 Feb 2023 11:07:49 +0100 (CET) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by mails.dpdk.org (Postfix) with ESMTP id BDE8F406A2 for ; Tue, 21 Feb 2023 11:07:48 +0100 (CET) Received: by mail-ed1-f53.google.com with SMTP id h16so15054931edz.10 for ; Tue, 21 Feb 2023 02:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7RgEhQwn5oShwDRthODjROP3u7pm9dhbHMxtf6D0cww=; b=Lu4WoetGoayEx5eiVJv/RqOi6yQtyzFjKU4fILaMNEXhq4uGdyOfv1+jyy8ltkoPLW Z4BwHZrE5bVGUakt+Y0YAD4z82w6oBkpt+yRf1NqFc5EjFJ2mBoAo+V4b/a1Sy1qENGQ XJNiITavqXiKFa8Soir4YKNy1AqD73b2QTDVmlLIw3T7/a2UgHHD8o6rzCpEDh4laSWp BngmLVw9rbhqeaicWl5G2qlYTXCBv/qoKCpMFe8trJ0zv3Hx3B8kyBqL7c487dBjonWa NxTRjivjbyr26U7AVNK3hPURQZzMvJyzEW8s9VJo1EK4eIk4VhWJBsRX9fEFEpOj8Dy7 /1Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7RgEhQwn5oShwDRthODjROP3u7pm9dhbHMxtf6D0cww=; b=s8RYTt+adQGr/CYpjXaXlBx3KfyhtEfFYgPvMC9ln9s9s3yqlYs20OciXsyWMwMQin DiXgG+wnWQNnAwVOmemhUOdrkhLO6C7JvH+Cxz1xtu+BdDgA6SHKRRED3BWBrFTHfWDT yqAVn6VxW6eLlHyN3aPW9FziInax3mpFwx0BTUlGFBqxU0xRWzafwi8vBhCDARq26nax 26Pwc3teHBDz2xMhhs9vTpWUmv2jOasZ99oy+i3OzOaWr0VAAEr7rgME+XmOdbOZIc4G QBj2J7AucrdllLyzaTWIhUq3zjtebbY50jKJbXEh+ojTVtIAgMz4Z5l6YJVT5zlv43sh GxWA== X-Gm-Message-State: AO0yUKVD4K8JDruaRy+e0wcot118AVzdykDFvgY6q0TqSV6iCxvKJno3 V6mjk34Gh7yDEh7kJYsn6dQ= X-Google-Smtp-Source: AK7set+F/aOFpmaZE9qLZOqMbAjlGGLVn+LpNJieuu8MaDNbJSgH61WrRKzD27wKNkzK4q/kjj6ytw== X-Received: by 2002:a17:906:b03:b0:8b1:7eb7:d53d with SMTP id u3-20020a1709060b0300b008b17eb7d53dmr15129098ejg.49.1676974068370; Tue, 21 Feb 2023 02:07:48 -0800 (PST) Received: from smtpclient.apple ([176.41.28.141]) by smtp.gmail.com with ESMTPSA id a14-20020a170906684e00b008b1815e30e3sm5807882ejs.117.2023.02.21.02.07.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Feb 2023 02:07:47 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: [PATCH v3 1/2] net/gve: fix Rx no mbufs stats counter update From: Levend Sayar In-Reply-To: <520d2dcd-ab57-7097-3218-5965d7399843@amd.com> Date: Tue, 21 Feb 2023 13:07:36 +0300 Cc: "Guo, Junfeng" , dev@dpdk.org, Stephen Hemminger Content-Transfer-Encoding: quoted-printable Message-Id: <7CF131BC-3A75-4967-80FB-2787237FF0AC@gmail.com> References: <20230220151936.2716-1-levendsayar@gmail.com> <20230220211103.8282-1-levendsayar@gmail.com> <520d2dcd-ab57-7097-3218-5965d7399843@amd.com> To: Ferruh Yigit X-Mailer: Apple Mail (2.3731.300.101.1.3) 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 Not only this if, there can be many places to add such branch prediction = helpers On the gve pmd code.=20 I preferred to patch only the bug here and not used unlikely to minimize = noise. Imho, adding likely/unlikely to all gve pmd code can be topic of another = patch maybe. Levend > On 21 Feb 2023, at 01:57, Ferruh Yigit wrote: >=20 > On 2/20/2023 9:11 PM, Levend Sayar wrote: >> rx no_mbufs stats counter update is added for another error case. >>=20 >> Fixes: 4f6b1dd8240c ("net/gve: support basic statistics") >> Cc: junfeng.guo@intel.com >>=20 >> Signed-off-by: Levend Sayar >> --- >> drivers/net/gve/gve_rx.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >>=20 >> diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c >> index 66fbcf3930..d346efa57c 100644 >> --- a/drivers/net/gve/gve_rx.c >> +++ b/drivers/net/gve/gve_rx.c >> @@ -61,7 +61,10 @@ gve_rx_refill(struct gve_rx_queue *rxq) >> break; >> rxq->sw_ring[idx + i] =3D nmb; >> } >> - nb_alloc =3D i; >> + if (i !=3D nb_alloc) { >> + rxq->no_mbufs +=3D nb_alloc - i; >> + nb_alloc =3D i; >> + } >> } >> rxq->nb_avail -=3D nb_alloc; >> next_avail +=3D nb_alloc; >=20 > Looks good to me, > there was a comment from Stephen to add 'unlikely()', is that issue > resolved?