From nobody Fri May 17 14:49:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+102178+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102178+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1680181524610698.8820220960779; Thu, 30 Mar 2023 06:05:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0pSPYY1788612xxdVvwxiYHB; Thu, 30 Mar 2023 06:05:24 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.81]) by mx.groups.io with SMTP id smtpd.web11.21745.1680172322873287640 for ; Thu, 30 Mar 2023 03:32:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WInv7fCgvhH32nb2LswBtKlgMnPJS4h1lprAwwht5QItDZgiZ3Aoi1G7wOPYvI6oq+fcHbkbSvFSREeRfqiE6NACcsSJ4uCP1+4CZ0rCWc+K3AEUixtJbXsetBh328g9iYxfcBJ08GPy3cojP73d1obqQXj/QhywGxqNx1FTLdK0g4tft+zCAQC7PhuLoiNmpsf2AJOfb0iLW+SRTOen64wEEc6260iQyhkkq7YaoDQ5NGjJh5heCstXIkXc6JnjyHGcXaHOqB1CQDT7Lrp1HqKFzculD5xHJqzLUgM9H4tnk6EJlHXqVpo/tVJHpHSBcijwBsl5PEqye8K0/a50ig== 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=rJOefAySwWG+XX9MqgYUFKPqlBQZ21fmnQ5nrOEOmxM=; b=TFFL8do0RbqulVPZpvDuHY7soX0uSUITapbOAec9OQVIcmGYBPbeJde/w3hLQhT/Es5fu54MtQV6wAyKha285/fttsWnAaP8beszC3Nvd1SNXSlM1ee2/cfGziMUqMWDDZPg0XVAU6uCPMwWQtPDjP+te2guQYPNhj1PkX0uL+e11aUZ7dUL9SKwKf9wMxSOVLVnwa+MVomB+t55mV+dqLSJJ2XWiEWRuE4quOYAid9O8L+2dzrsdpFaaYZv5K9DxO76GBlV30QIGVB5uTEcuoxs9Os6xlHZdYy1Lk7/LseQArH1i5rsCMOrWlcdZLkRVJbQ7x9NBQqBAhwR0noIFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none X-Received: from SJ0PR10MB5535.namprd10.prod.outlook.com (2603:10b6:a03:3fe::21) by SJ0PR10MB5786.namprd10.prod.outlook.com (2603:10b6:a03:3d7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22; Thu, 30 Mar 2023 10:31:57 +0000 X-Received: from SJ0PR10MB5535.namprd10.prod.outlook.com ([fe80::f40c:626e:4674:9c7d]) by SJ0PR10MB5535.namprd10.prod.outlook.com ([fe80::f40c:626e:4674:9c7d%5]) with mapi id 15.20.6254.020; Thu, 30 Mar 2023 10:31:57 +0000 From: "Kanagavel S via groups.io" To: "devel@edk2.groups.io" , Kanagavel S CC: "gaoliming@byosoft.com.cn" , Srinivasan Mani , Sundaresan S , Prarthana Sagar V , Sivaraman Nainar , Santhosh Kumar V Subject: [edk2-devel] [PATCH] ShellPkg: Fixed system hang issue when executing ping6 command cross network segment in EFI Shell. Thread-Topic: [PATCH] ShellPkg: Fixed system hang issue when executing ping6 command cross network segment in EFI Shell. Thread-Index: AQHZYvLah8LDCXahX0Cte0bciJhD0g== Date: Thu, 30 Mar 2023 10:31:57 +0000 Message-ID: <20230330103140.992-1-kanagavels@ami.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5535:EE_|SJ0PR10MB5786:EE_ x-ms-office365-filtering-correlation-id: 81790e46-4894-4bcb-21e3-08db3109fce7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: zd/ADHlUr2vGxp52U9aG+XxhT018wyhIcFabd4i511reX4iGpMnhfx+fpSS6HwH8hSfUwfcvLgK43jJqOlajQkEgYdCf7131Vo+TFB+ml4104zH6573hPwmT+Byjmwm1DFf1djoMtiUtqOKN7qUuRD5oAgmn1XRiKS81+VkkGmXbB+m5/B7BCvW3fXXQfPTywRxip0SVvI5MbyQJftLcT7ux4XKm2+LIjYM9mygbgEkCsyqTPcOEZE+rg3KHQbNY5bJ0MlYz6OZRmKPe3/+j88ra56fuLf7vLl8nNFE61U5WHgER0RHdt7LAkD/toFujBGkYBt+4atCHlV/HV3qTwcxuWG5LOC42rOi94k3V8q3XbRV+93JyWZMEkQkSXoeB4zQYGyjQnyGE7R7aaouIY0evGNiaolm/6nRrYTJzVdaikeNYNG27lR33zZsGplOHRscO4wSjIThzDaEV4Q1vbHSqi4MEJDC89jz89gLUicwUqOsi2qTQL1igoAkCetYgyXey36QHdUsxsG5JS1za/nT5QY2rGejYXaH9y4AJiQ3+1oL+G0QJsd6RlHmik7mlnv/uWFtckLDKExl0ucivHyJSdw+Ssz1B+7CJXrIDMUk= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?4reLA5RScmtCCZhYXLqR6XKuPg4RPEcYhs6ERaKN54ASF4qWzUPxxXqHzY?= =?iso-8859-1?Q?Ca/QmUvB1QThD126yEstP+kgh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8859-1?Q?UcZYDXMMbWjnhFIP5YZQgSAb/JgXQU/F6/nqha/3jsZlBqU5ZucFHZf+La?= =?iso-8859-1?Q?FFHOQ/kodCOPXu7ulS59G3Dke45yUG2nh0OuPQO+Lseu/yBl2Opm3Cq37d?= =?iso-8859-1?Q?jWUXbvx29ZSyGZw56x5GxCAZEyR1C9ml5N+oXE08WH63VFTh5hnzFAiZUQ?= =?iso-8859-1?Q?CxxjKKnhulMLowdjOWy0E56NvGE+5jfKNK9kUTmKOajguD4IbeGOrjGJd5?= =?iso-8859-1?Q?gVuxBKuBcr0Uaxb6j+oOdveU+4OykHcsaxwfWJtXeUB9RsdK9gIgg2FazA?= =?iso-8859-1?Q?HS4tVHRpmmeT9IbNgMTbnOdS7LiBz74AKB2peHpp5G3EIlZfFFVpeIQuuk?= =?iso-8859-1?Q?wYgdoW/hXMIulH0cXMBfYu5jJPN7MfxWEfXPbk30maWqIkuZo8h2Eb6AgI?= =?iso-8859-1?Q?V/YMJQDoiKtH3/mQI7XuHgGAeKKkTJDQzkuC+OfHVuLqjnF9mI8rV9XBSp?= =?iso-8859-1?Q?j7mxgQd3kyT5Zs167XRw36P2ECUGkSFPruTIra/aRTeOIDROg00uhE1EVh?= =?iso-8859-1?Q?rfwEPkxBuWOYd7d2QB3nZCFi1dI0e2rdW7YdBe+2wnUgdstPREcUF4aKTX?= =?iso-8859-1?Q?tsjN3dZ5mehyVXsgRRFhkL6b0o2U7m0sw5Ri/ShNlDTf0zXVueYkpArLDz?= =?iso-8859-1?Q?b3FGE+tObQHFdKdWy942qPq3pdvun3wJqV?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5535.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81790e46-4894-4bcb-21e3-08db3109fce7 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2023 10:31:57.0309 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: x6jTxmiwT5OqLlfWQCaCRaNOpzQAvCgGd286YwSWrFEY+OaeVEqaAzyXCQVO0AKrVJ8z7McqmfJ8m73z1d5pdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5786 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kanagavels@ami.com X-Gm-Message-State: 11bneMJFauXG9QZ0O8CzmQ8qx1787277AA= Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1680181524; bh=oKXRhTt98SeESmI83dNZkhkxbZElhGYKzDkKL0ukM1o=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=YMrc4KDOY9nb4zoBNX47e6ZxFr+LeJX6oVliUmdPNiL2LIAUamQR1WgxO3yN1ESIIeE 8/WPoSN4a4Mzm20/GWGYe8rEi1RE4ElbiTYAMsAJYWQ1SqoBtE+j9cMxjgoDK6u644V6o TLY1Z/J6zTMBDWi0VSmle23+vUXwDF9ARJQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1680181524997100002 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4376 While shell is polling to send/receive ICMP packets, Private ->status is no= t updated for below scenario, Considering 10 packets are transferred and it's RTT time is between 1764-18= 12 ms .In this 10 packets 2 or 3 packets are lost in between ping communication and reported timeout issue and last = one is successful packet. In this case failed packet is reported before the last successful packet he= nce ,private ->status is not updated with either success or EFI_TIMEOUT. Counted Fail count of Ping communication ,when private->Txinfo list is empt= y and sum of failcount and receive count equals to the total packets private->status has been updated to timeo= ut. Signed-off-by: Kanagavel S --- ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c b/ShellP= kg/Library/UefiShellNetwork2CommandsLib/Ping6.c index e0b58d4b85..50d1bb6e1d 100644 --- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c +++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c @@ -2,6 +2,7 @@ The implementation for Ping6 application. Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 1985 - 2023, American Megatrends International LLC.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -92,7 +93,7 @@ SHELL_PARAM_ITEM Ping6ParamList[] =3D { CONST CHAR16 *mIp6DstString; CONST CHAR16 *mIp6SrcString; EFI_CPU_ARCH_PROTOCOL *Cpu =3D NULL; - +UINT32 gFailCount =3D 0; /** RTT timer tick routine. @@ -457,6 +458,9 @@ Ping6OnEchoReplyReceived6 ( ON_EXIT: if (Private->RxCount < Private->SendNum) { + if (IsListEmpty (&Private->TxList) && ((Private->RxCount + gFailCoun= t) =3D=3D Private->SendNum)){ + Private->Status =3D EFI_TIMEOUT; + } // // Continue to receive icmp6 echo reply packets. // @@ -715,7 +719,7 @@ Ping6OnTimerRoutine6 ( // Remove the timeout icmp6 echo request from list. // ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_TIMEOUT), gSh= ellNetwork2HiiHandle, TxInfo->SequenceNum); - + gFailCount++; RemoveEntryList (&TxInfo->Link); Ping6DestroyTxInfo (TxInfo); @@ -1048,6 +1052,7 @@ ShellPing6 ( SHELL_STATUS ShellStatus; ShellStatus =3D SHELL_SUCCESS; + gFailCount =3D 0; Private =3D AllocateZeroPool (sizeof (PING6_PRIVATE_DATA)); if (Private =3D=3D NULL) { -- 2.35.1.windows.2 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#102178): https://edk2.groups.io/g/devel/message/102178 Mute This Topic: https://groups.io/mt/97949969/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-