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 A07A741CFC; Tue, 21 Feb 2023 11:31:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CEC8431B9; Tue, 21 Feb 2023 11:31:27 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2057.outbound.protection.outlook.com [40.107.94.57]) by mails.dpdk.org (Postfix) with ESMTP id 2C61F406A2 for ; Tue, 21 Feb 2023 11:31:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NkjS4ODGQnVqYo5T9K3vC/a2YSdmKZ2FD9c9qoFOl0rw//5KlGK1IR0AquvgcvmjlPXGl+RK85x7Xr5jdXaHKYZJ53FtA6yMzqOvr3IyzBcXXQXw9Nl0h2aduT1/fmuhMb7DbXHHm9ctEoLkABDiLhvzSEIA/YGCmmjsG1ITbAhCe0Kan/YnSGC81HYZBOstWwiXVcQxKDFqho0CE+QeSbBC09Elv+wfAhLSANYUVm8RjQgo2zjUzfXBrhdmrUG4ag+lmMM22ya/f2QX+M3aP8zKyc/VteKlYPlrK5r5evWfeVqlD1C0TktNMqEioEzB1uWa3gQTC3Spr3ARDNxHEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+3xJUUVjnTq1w7+McFOj49Xp+2kPhViBUzOiCeEBJi4=; b=L1+m7KbEPPf1IyR5PicbzMPGr41SoSh+oLQPy3wLzd7XlceMX+BoduummjM5FTzYcImG4qyC14Acd9CquHKMag3GQ7lDLg8FGOLqlpwv9HMFKnp5/rVX2f+OXKoaRo7RrxmUNJOtZqKh/FE7W7dN4CoYuBhNLQwT/ddh8tUpcfa1TlUQcnBDFD/7/1wIfF8Lmd+fYcveQqMf3EE9quoFiJ/xR39/LGKVoylBzzPLQlKNnEuvn0e7TrFK8u3v0jDyds0jAmjUDY0+cczZmCerG18HVtV18KIyczhlQt+4JmrZbRqbmEAYRQ4hXkmUbf/nQLTksuq9542zxjSkjIRLkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+3xJUUVjnTq1w7+McFOj49Xp+2kPhViBUzOiCeEBJi4=; b=WbXUcKB9wRTFcAMy/sEbAz4q0vBD0ta182TiK7kGghFGxlX8ivq3PquzzdBaeE4VwsMivDPh4knyocm+SyGR8odoN/YtPzIB4+siCzl1CoB7WRyJfPxTBORUS7UvB8wb/b56lE/D4kzvsws2C/tKnUv0ozloGSfIa/W4jmDsHoA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DM6PR12MB4561.namprd12.prod.outlook.com (2603:10b6:5:2ac::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20; Tue, 21 Feb 2023 10:31:24 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%8]) with mapi id 15.20.6111.020; Tue, 21 Feb 2023 10:31:24 +0000 Message-ID: <8a2168ed-ba42-b551-b376-889d6a5e20ac@amd.com> Date: Tue, 21 Feb 2023 10:30:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v3 1/2] net/gve: fix Rx no mbufs stats counter update Content-Language: en-US To: Levend Sayar Cc: "Guo, Junfeng" , dev@dpdk.org, Stephen Hemminger 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> From: Ferruh Yigit In-Reply-To: <7CF131BC-3A75-4967-80FB-2787237FF0AC@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0269.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::17) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM6PR12MB4561:EE_ X-MS-Office365-Filtering-Correlation-Id: 357ab447-f54c-47b0-9a7d-08db13f6c7a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rw8uuVDVQda2Cgoit+zZQTu4zvMtJPih3bKQJhM8FxuP0EcmjRp4DgOXWSKtOBYFQgZnhDYKk3YD7nvGy6KHXwhecJ/kG2HSqsy6fpgxQ/tmlYJnGST4rIrC9FP6ClaDg9mNL34RMkgwQFVOnxPFYIY+oLUa0S37kxKKK4hAZmdTG1Qd1IPVh39Myywp5hJSEz0pDwaaxTWwdgclN/ruSEnCDIj2M2dxGBAjFgc6fhakni4GDFRp6BwU8coRdKeL4wEJj28/Syl07tU1DsyLdUjtdZN7IO1QJ7ta2rTphNeWic2ffNuedXz6iF8LCb5EPyXtcpN0ndYKO89wIJ0Urru4OliKyPqC+R9afkrte0RR4ytFPgNXg9T/TODQE+4wJr0Y1hQkm4YXtp9pgjOXXfxqHi6ChfuW56lQ2pIy5yM9YYNUcMGAafSafwsEUf/OaP5890e7vnR+7RSF5hjbS7TexXlpXLghBXwnaoCxiLQrafz/C4kWWiyVAK9mdnoY6KFBF1TWBMl38xb0yqvmo4P66udGyTLoKwm8Y6gANHMS8SeiO8fkVNHw2+YhZEDrK/c6RyFxC+sliZBcQgh5wTOEzZ1sislPbP9sK6RJg7y8APEPUQ90ozbZuvgUltCojv5N3ymlkZ+T41I5/xp6RHF8vRt/6oVG8b+X826hzRR+nZLlvdf2dpVFZttqZVYQg9DoS1voLFwqtEciZAkpLSkcR6Wx5eS1z5E+0Q66x2w= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(396003)(346002)(376002)(136003)(366004)(451199018)(5660300002)(8936002)(83380400001)(36756003)(86362001)(6512007)(6486002)(38100700002)(31696002)(478600001)(54906003)(41300700001)(8676002)(4326008)(316002)(66556008)(6916009)(66476007)(2616005)(186003)(26005)(53546011)(6506007)(6666004)(66946007)(31686004)(2906002)(44832011)(15650500001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WjRTbE01NWZ6SnFkZi85ZklZUjh0YjRadnNtQnNhWTNGRnN4VmhjNkxLNlB2?= =?utf-8?B?V0xhWTA4UWNsNDhvUFlWZUVabHR0R1hIdG1WazNYMkZMTHY2T0pQeGZKdDNn?= =?utf-8?B?M3NKcUgvc1Nvd01LdVExMDQwZzU4ZysycEdCTXVJYWI4QVB0ZnFrZm9kTk5P?= =?utf-8?B?TkxtcjdBYnZKd29tcmFzaU9sakVsaWZ5MytoNnFpSlBKT1NZeWk3aj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Ry9DakhZL0VDTm43QkE0NjEzNTdYajJUYVpnRDNicGda?= =?utf-8?B?UDA5cmtjdUxPMkhwSjBOWUw1SHlncTBNWStPZkNGZGVKaGJNamJHcVNocHYr?= =?utf-8?Q?YNaXrQlIDFP0Xd1UTsYeC1S0t?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 357ab447-f54c-47b0-9a7d-08db13f6c7a4 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 10:31:23.7892 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uhx7S8nK1pGzyUCqyEWWfq60CyE1eThzCUYgiRFRgReufeIclac2mOaKuKhjDYb+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4561 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 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. > ack, sounds reasonable to me > Levend > >> On 21 Feb 2023, at 01:57, Ferruh Yigit 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 >>> --- >>> 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] = 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; >> >> Looks good to me, >> there was a comment from Stephen to add 'unlikely()', is that issue >> resolved? >