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 31C8D41D47; Thu, 23 Feb 2023 07:29:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 203EA4301F; Thu, 23 Feb 2023 07:29:18 +0100 (CET) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by mails.dpdk.org (Postfix) with ESMTP id 94BDD4021F for ; Thu, 23 Feb 2023 07:29:16 +0100 (CET) Received: by mail-ed1-f41.google.com with SMTP id ee7so23773244edb.2 for ; Wed, 22 Feb 2023 22:29:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=XrBjGdw29E/sutlidqg0rQCYSYnueT7t3616LfCzgMo=; b=Ml1Nc3McQBVUH+mM/GWhzaavrK+cUQthZroEVQBL6qhQ7LVDz0Pxt+VSRMD3IiQFZS NEeb76W6X1QZs06FivZZXteNJDRWyp+3FeKk+nUdT5IUCxUw5oIwlJI7AQiUk3lg1Hth Qhwf0k80REml8NU/g6frqXFWUkm934SD/BTQDJGydy6Qo1ktxjOgViccHU6pahbN1hTj roPZ0+BreMmRoyMc3wh686RPOefUUwcjf4K2HrO9/yhzYb62hu/7LlAxRRlGAQlbPmbH RHDSvpTQ1uea/dF5CMn3bZ1pi16NnLej9ayFRm/K2Noj8EwIYgpPHZsr6BcDN6z3APRY Ma0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XrBjGdw29E/sutlidqg0rQCYSYnueT7t3616LfCzgMo=; b=e0KreHTbXdNObcmvDGgMGIScVXpxsRa+JES3JUjb3QlhiXyIu1fSDDJIQVJuu/j/ua DQtnFFKwTxFfggbFJw4icHvsxytdfJZWrFgP7HMK1n1jA8WHmIzGmmzeugShDtuzeLq9 OOVG0rOZpkPDR3GnLUOtqIQf6KekLIqWy9dZbleNcP30ATm8kdzw8ZP+XrLqlOPLS9ZW uSXW0KsvscyoRgHOCts6SvaCjVi9vPZiI1vjBTmZWGJRxxHYScqncy8hfFFKUkIxXStf 2/LZBzhDo3P9P4vgfssIvOj/8n9MTLBhShJORngPJ5jl59LF5Y7uA1u59vLNxw9CyPHZ mlow== X-Gm-Message-State: AO0yUKVq75X3IE/oX+n11RGmf7iSO/M5ly0cClgZltl21V8xB7XMCbdq Vz8YV8sszgorIouIChWvAZB0C5r1wCA= X-Google-Smtp-Source: AK7set/puyQKlcpCsAu/sO7hMCqRD2cFi79KTzpges9H1gAOkt93RKFGGzgsDdJRYOcq1eddWdU7Jw== X-Received: by 2002:a05:6402:896:b0:4af:69b8:52ba with SMTP id e22-20020a056402089600b004af69b852bamr2215611edy.25.1677133756071; Wed, 22 Feb 2023 22:29:16 -0800 (PST) Received: from smtpclient.apple ([176.41.30.17]) by smtp.gmail.com with ESMTPSA id u23-20020a50d517000000b004acdf09027esm4561780edi.4.2023.02.22.22.29.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Feb 2023 22:29:15 -0800 (PST) From: Levend Sayar Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_75F8D6B4-9970-4774-ADFC-50DED7A99160" 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 Date: Thu, 23 Feb 2023 09:29:05 +0300 In-Reply-To: Cc: Ferruh Yigit , "dev@dpdk.org" , Stephen Hemminger To: "Guo, Junfeng" References: <20230220151936.2716-1-levendsayar@gmail.com> <20230220211103.8282-1-levendsayar@gmail.com> <520d2dcd-ab57-7097-3218-5965d7399843@amd.com> <7CF131BC-3A75-4967-80FB-2787237FF0AC@gmail.com> <8a2168ed-ba42-b551-b376-889d6a5e20ac@amd.com> 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 --Apple-Mail=_75F8D6B4-9970-4774-ADFC-50DED7A99160 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Thanks Junfeng for acknowledging. > On 23 Feb 2023, at 07:34, Guo, Junfeng wrote: >=20 > Acked-by: Junfeng Guo > >=20 >> -----Original Message----- >> From: Ferruh Yigit > >> Sent: Tuesday, February 21, 2023 18:31 >> To: Levend Sayar > >> Cc: Guo, Junfeng >; dev@dpdk.org ; = Stephen >> Hemminger > >> Subject: Re: [PATCH v3 1/2] net/gve: fix Rx no mbufs stats counter = update >>=20 >> On 2/21/2023 10:07 AM, Levend Sayar wrote: >>> 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. >>>=20 >>> Imho, adding likely/unlikely to all gve pmd code can be topic of = another >> patch maybe. >=20 > Agreed.=20 > Adding likely/unlikely is more related to the performance with = compiler. > This can be an optimization for performance. Thanks! >=20 >>>=20 >>=20 >> ack, sounds reasonable to me >>=20 >>> Levend >>>=20 >>>> 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? --Apple-Mail=_75F8D6B4-9970-4774-ADFC-50DED7A99160 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Thanks Junfeng = for acknowledging.

On 23 Feb = 2023, at 07:34, Guo, Junfeng <junfeng.guo@intel.com> = wrote:

Acked-by: Junfeng Guo = <junfeng.guo@intel.com>

-----Original = Message-----
From: Ferruh Yigit <ferruh.yigit@amd.com>
Sent:= Tuesday, February 21, 2023 18:31
To: Levend Sayar <levendsayar@gmail.com>
Cc:= Guo, Junfeng <junfeng.guo@intel.com>; dev@dpdk.org; Stephen
Hemminger = <stephen@networkplumber.org&= gt;
Subject: Re: [PATCH v3 1/2] net/gve: fix Rx no mbufs stats = counter update

On 2/21/2023 10:07 AM, Levend Sayar = wrote:
Not only this if, there can be many = places to add such branch = prediction
helpers
On the = gve pmd code.

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.

Agreed. 
Adding likely/unlikely is more related to = the performance with compiler.
This = can be an optimization for performance. Thanks!



ack, sounds reasonable to = me

Levend

On 21 Feb 2023, at 01:57, Ferruh Yigit = <ferruh.yigit@amd.com> wrote:

On 2/20/2023 9:11 PM, Levend = Sayar wrote:
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 = <levendsayar@gmail.com>
---
drivers/net/gve/gve_rx.c | 5 = ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

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;

Looks good to me,
there was a comment = from Stephen to add 'unlikely()', is that = issue
resolved?

= --Apple-Mail=_75F8D6B4-9970-4774-ADFC-50DED7A99160--