From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.4503.1644564579586401444 for ; Thu, 10 Feb 2022 23:29:40 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=b6Ljt8g/; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644564579; x=1676100579; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NBIFUwCvTYy4x9hvpp0Fmjuj8BZ9JI/gDAVy1QG1ydU=; b=b6Ljt8g/mrng45RsKRcHugIyPWV5wDRumpEg9cKl4QYTO3lne2LrC6N+ JVAhaAdzkDKhJyrUm11/WBoeeLu7H0tysj+0zUZD2IOFHY4Zygv1WhGvS F5lc9soCP9oWu9CG3XD4u2dlF9vQ3ez0Zv8UafVQPoBFviV5po5VZYURF 3hvGqPjKPQq17C13Fz6wKVUeCZwSECfC2FDdjUkgwG75lOqdGN/DvPgAK TM36CBMDWSxQ1YoPoJu6vNSds3ZCWFWgfIjA2cwjIuWO255SRSv4iE152 cGlpgKZ2kt490AiniZFB5awXQMLyM619SLqZZARMGMIO955BuorgMprsU g==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="233235409" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="233235409" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 23:28:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="702005242" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga005.jf.intel.com with ESMTP; 10 Feb 2022 23:28:55 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 10 Feb 2022 23:28:55 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 10 Feb 2022 23:28:54 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 10 Feb 2022 23:28:54 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 10 Feb 2022 23:28:54 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCt/sVlxDp/KfMN0Jm+z5B0EG6ATxjwFjrhGhbvl2qJS78GZXt32zV9/OYFVXeChywlef523nlUeOzAeHrDv9LgmCBP+6MWHzF4ztvm+K8p3K9m0r1kAtCmb17OYzRtGBgdhay5lriWJ8C4ojTG1JZKKxpoWogu4/3aOy1xbxCN39g4anaMTUMi1bXasTUDQegxY3V3XvG1BNq5RVd2XueXjD2pUNvSFKuvtmvuh/qVdbzC+86MEh61ZaXIIuWz72ckYDjjg1X9DIlBxASNjHdgFKrLMK7b6verycSRi/i2DkQC/IPWupghB4OcX+JUdbqIp714JLZuHc5kibQKRDg== 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=+SVw6Etog8fPIc8k1e6p+zLm6AgNW6r80fM+Smayk2M=; b=mx4fzND3WagKpCP4l9bS86Kuj4HI+LIiu/YzKKkvQLcWM3qeKg6Iy5/ohoabMZmV3EN3D11x6xhyxe6bZOFDF5YWEe4Kv3hRBYEq1bUNx3kxLedfwpklWp1M7mJZUaAcxTzTxwytFGqorZM5wC4n2H4dk0xTmYWAvO6le8tmE5Uh/ozg9pH7dDTOXiVbSLdYmDsmT84Ys8koAs9NnJ6zpMWvlbhhIJWrWUmw+tfcWwMx8iVELua3W6oPZD1lQa4G1MZTTZLtkrIG41hK6htLuaWRywwjWhmXAvUiJOvFGpH/ynrx/s69YZhb23s6xQnYPBWheB8ogEgLdOvY7Jl9gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by BL0PR11MB3234.namprd11.prod.outlook.com (2603:10b6:208:65::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.14; Fri, 11 Feb 2022 07:28:51 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::e0fb:ec1d:4e67:375f]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::e0fb:ec1d:4e67:375f%8]) with mapi id 15.20.4951.019; Fri, 11 Feb 2022 07:28:50 +0000 From: "Ni, Ray" To: "Rehan, MohammedX" , "devel@edk2.groups.io" , "Esakkithevar, Kathappan" , "Gao, Zhichao" , "Pethaiyan, Madhan" CC: "Thirupugal, MadhaviX" Subject: Re: [PATCH V2 1/1] ShellPkg: Fix Ping GetTimerPeriod API failure Thread-Topic: [PATCH V2 1/1] ShellPkg: Fix Ping GetTimerPeriod API failure Thread-Index: AQHYHkqjlSJ5uOc5Hk2CL5RgN9QLy6yN9WNw Date: Fri, 11 Feb 2022 07:28:50 +0000 Message-ID: References: <12a69cc925bcd95320cf9a62c88f961b13203bf2.1644475548.git.mohammedx.rehan@intel.com> In-Reply-To: <12a69cc925bcd95320cf9a62c88f961b13203bf2.1644475548.git.mohammedx.rehan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d45a9ed-f121-4832-853b-08d9ed302636 x-ms-traffictypediagnostic: BL0PR11MB3234:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:541; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZZISTD4Aus4itfWlMMV2bOPawtT7Sr7xBaRCnWQA3h5KqZ9bbRmGPnqZogrJk1iVHlFcoE48gAjbuCSQfIAVmk1vZc0/xCDA/Yc6EMxwsyD0ppGtuB+VmzAMhEbfkqb/AFDc2D7lC3VRnDRBR9KbX3MI2JxCMBy/zdt3XEDpMAtwvIUOc9xla65y/42I1Y4ihl2NqsXRTxpQslDiI5+EXMUV5TOb3R9ak0i6eHq5U1hC7VDdg1C4ZR1j8EjT80nlc8yuhy0KDJC9OmyZ5iW9tCbGKjcyyA2pkmJJCUl7eLnxbM5ZcUPQCUMd6d38ItysAoWPiYMWnxAHfyr91+m5/wK+4Okz8DXxp9AMSHadr6OEceUnARr1Z9HZK//ix3F+WK40WJ0/0kJ3aREq+OJNBIquDEtxPoawyKRGIYvb94ZbbrCuQC4Ewf8uTvRcVSZYhBYkpX08vKNb70QgZ7it6craGD+5TAWawrfhAmziJKlxH4URlAcFzgbAwXjbKI48PS4OcQn+3H9BMxGQ3BOy/sRfpP8qZxdn55cZtXWNyt3gjOruFkiacNuTn1E6Yr5UaEmbuaNg3wCcw40wfVgvdIs48stdmmC/rq+9UsCe/2PMvH6KmWsC0CEcQxiL/K9AOMzdDsDkOabp+dQix3V6fFHYYnGYEV73H6V5QaTs7UeCsecgZvtIyKhiYMze5c1egx5ALE/F8xD7Dd3u91iKvv+NmyEaVM4y0qUyMees4xnIMp2JDnYQHEOP+PHWs9SFYoe8uYpXx9skVGPcWzw6vgBbUhkIWnVHKpUkXvCZva4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(26005)(71200400001)(82960400001)(86362001)(966005)(122000001)(110136005)(8936002)(53546011)(508600001)(5660300002)(186003)(38100700002)(66476007)(33656002)(2906002)(8676002)(83380400001)(76116006)(66946007)(4326008)(107886003)(66556008)(9686003)(55016003)(38070700005)(6506007)(7696005)(52536014)(6636002)(66446008)(64756008)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?RrKnL4EA8UpUwiZ7VjMWS5oeX93n2wnEcKVFxnpImcEZ6sUVgQqtG6LM4zbA?= =?us-ascii?Q?j/6MOEZEGzLt3c37q6xtPcI4DZ9qepbRXAMEg5gTebk5EnxkJA9HTctZ4PlC?= =?us-ascii?Q?d1Wo8cbqFaeP1gPkQqE5VErN1+XV3iwU/2YJxqfRcB+CQQ4x+vv6qRxolse+?= =?us-ascii?Q?uOcXS/NghOQ0C2Z0m4oT41SgUoQusrsCxh8nq851ev3MP3XtECVHN56x6A2T?= =?us-ascii?Q?Z3ZLqjrUOM/r4yKlmzVghWN7vzKSM1CMhbuuJ5IVxCT4OGQuiV2P1uoWBcL6?= =?us-ascii?Q?rWz5Q6GYX7AhGYFjad+6ydg/jYerYJycsc2ddQItscX6sTs+1FRHFfWssk4T?= =?us-ascii?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0fmB9EwLg48zC/BgFF7A8y6VM?= =?us-ascii?Q?eFDkWII3Ez7UVtSQTD6CvsPIsrruDu4T8IfNR6PDBCMTSFvOyvnufBPI7/x5?= =?us-ascii?Q?r+TKTpsY7LuW2YvEqp9H5b01B0M1XcHcM2yjyntLp6o1v23RYiXDpRkIfjSY?= =?us-ascii?Q?B3iVIwuadCtVQcjG4TFbHnwcIfj6GYdvpraaz5+TNMkryZ+GJX6QBmhOddX5?= =?us-ascii?Q?z3IUEGj7AXv5xo9zG7ig+yhFSlB4KbqbG5OXBGbXH0mDMiR6K+O1BpC2l8S1?= =?us-ascii?Q?osj8o1QgLOOIpomEUi1QrHMOGxANTw9y7BfQ4co9W/JVGkz6YbiDLpx3COCN?= =?us-ascii?Q?9VCIU1TPBWZRXN7SWwOI7w2kH6wuCcs7jCnW0C80Y0AxtWZbi1JEYp3olwz4?= =?us-ascii?Q?Bg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d45a9ed-f121-4832-853b-08d9ed302636 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2022 07:28:50.3706 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uUQ9qILXKWurbO5aO2/VSA/bKibKHQegH5bUZR9/IrTogjNc/oRJ5+MxbzxCmCyffyi8wTFpgfoVPqompTbsYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3234 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni -----Original Message----- From: Rehan, MohammedX =20 Sent: Thursday, February 10, 2022 2:51 PM To: devel@edk2.groups.io; Esakkithevar, Kathappan ; Gao, Zhichao ; Ni, Ray = ; Pethaiyan, Madhan Cc: Thirupugal, MadhaviX ; Rehan, MohammedX = Subject: [PATCH V2 1/1] ShellPkg: Fix Ping GetTimerPeriod API failure [edk2-devel] [Patch V2 1/1] REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3819 Ping GetTimerPeriod API returns sometime zero value when StallCounter has smaller value than RttTimerTick (divide by zero) which results some failure at ping UEFI shell command Signed-off-by: MohammedX Rehan Change-Id: I4458577c921b3748102da385d2f48a21680f5687 Signed-off-by: MohammedX Rehan --- ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPk= g/Library/UefiShellNetwork1CommandsLib/Ping.c index ec1e0a188b..6a002b15e5 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c @@ -259,9 +259,11 @@ GetTimerPeriod ( EFI_EVENT TimerEvent; UINT32 StallCounter; EFI_TPL OldTpl; + UINT32 TimerPeriod; =20 RttTimerTick =3D 0; StallCounter =3D 0; + TimerPeriod =3D 0; =20 Status =3D gBS->CreateEvent ( EVT_TIMER | EVT_NOTIFY_SIGNAL, @@ -295,7 +297,12 @@ GetTimerPeriod ( gBS->SetTimer (TimerEvent, TimerCancel, 0); gBS->CloseEvent (TimerEvent); =20 - return StallCounter / RttTimerTick; + TimerPeriod =3D StallCounter / RttTimerTick; + if (TimerPeriod !=3D 0) { + return TimerPeriod; + } else { + return 1; + } } =20 /** --=20 2.30.0.windows.2