public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg: Fixed system hang issue when executing ping6 command cross network segment in EFI Shell.
@ 2023-03-30 10:31 kanagavels
  2023-06-22  5:03 ` [edk2-devel] " Kanagavel S
  0 siblings, 1 reply; 2+ messages in thread
From: kanagavels @ 2023-03-30 10:31 UTC (permalink / raw)
  To: devel@edk2.groups.io, Kanagavel S
  Cc: gaoliming@byosoft.com.cn, Srinivasan Mani, Sundaresan S,
	Prarthana Sagar V, Sivaraman Nainar, Santhosh Kumar V

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4376

While shell is polling to send/receive ICMP packets, Private ->status is not updated for below scenario,
Considering 10 packets are transferred and it's RTT time is between 1764-1812 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 hence ,private ->status is not
updated with either success or EFI_TIMEOUT.
Counted Fail count of Ping communication ,when private->Txinfo list is empty and sum of failcount and receive
count equals to the total packets private->status has been updated to timeout.

Signed-off-by: Kanagavel S <kanagavels@ami.com>
---
 ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c b/ShellPkg/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.<BR>

+  Copyright (c) 1985 - 2023, American Megatrends International LLC.<BR>



   SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -92,7 +93,7 @@ SHELL_PARAM_ITEM  Ping6ParamList[] = {
 CONST CHAR16           *mIp6DstString;

 CONST CHAR16           *mIp6SrcString;

 EFI_CPU_ARCH_PROTOCOL  *Cpu = NULL;

-

+UINT32                  gFailCount = 0;

 /**

   RTT timer tick routine.



@@ -457,6 +458,9 @@ Ping6OnEchoReplyReceived6 (
 ON_EXIT:



   if (Private->RxCount < Private->SendNum) {

+      if (IsListEmpty (&Private->TxList) && ((Private->RxCount + gFailCount) == Private->SendNum)){

+          Private->Status = 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), gShellNetwork2HiiHandle, TxInfo->SequenceNum);

-

+      gFailCount++;

       RemoveEntryList (&TxInfo->Link);

       Ping6DestroyTxInfo (TxInfo);



@@ -1048,6 +1052,7 @@ ShellPing6 (
   SHELL_STATUS         ShellStatus;



   ShellStatus = SHELL_SUCCESS;

+  gFailCount = 0;

   Private     = AllocateZeroPool (sizeof (PING6_PRIVATE_DATA));



   if (Private == NULL) {

--
2.35.1.windows.2
-The information contained in this message may be confidential and proprietary 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 designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. 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.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-devel] [PATCH] ShellPkg: Fixed system hang issue when executing ping6 command cross network segment in EFI Shell.
  2023-03-30 10:31 [PATCH] ShellPkg: Fixed system hang issue when executing ping6 command cross network segment in EFI Shell kanagavels
@ 2023-06-22  5:03 ` Kanagavel S
  0 siblings, 0 replies; 2+ messages in thread
From: Kanagavel S @ 2023-06-22  5:03 UTC (permalink / raw)
  To: Kanagavel S, devel

[-- Attachment #1: Type: text/plain, Size: 35 bytes --]

Please help to review this patch.

[-- Attachment #2: Type: text/html, Size: 35 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-22  5:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-30 10:31 [PATCH] ShellPkg: Fixed system hang issue when executing ping6 command cross network segment in EFI Shell kanagavels
2023-06-22  5:03 ` [edk2-devel] " Kanagavel S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox