From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A4139223230CE for ; Fri, 16 Feb 2018 07:14:42 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Feb 2018 07:20:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,519,1511856000"; d="scan'208";a="27817502" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 16 Feb 2018 07:20:35 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 16 Feb 2018 07:20:35 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.47]) by FMSMSX119.amr.corp.intel.com ([169.254.14.78]) with mapi id 14.03.0319.002; Fri, 16 Feb 2018 07:20:34 -0800 From: "Carsey, Jaben" To: Meenakshi , "Ni, Ruiyu" , "edk2-devel@lists.01.org" , "lersek@redhat.com" Thread-Topic: [edk2] [RFC] ShellPkg/Ping: fix loss of first packet Thread-Index: AQHTpwKk9HFXd/ewmUm1eXzCcVepT6OnJUgQ Date: Fri, 16 Feb 2018 15:20:33 +0000 Message-ID: References: <1518770711-6331-1-git-send-email-meenakshi.aggarwal@nxp.com> In-Reply-To: <1518770711-6331-1-git-send-email-meenakshi.aggarwal@nxp.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2Q0MzVkYTgtYWRkYy00NWI5LTk0OTMtMzZlOWQwYzNiNGM3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjAwM3ZScHFUWE1Jcmh0QlNaanZFNUVua2xpR3ZpWk1NbXhKSkR5bVd1M289In0= x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: [RFC] ShellPkg/Ping: fix loss of first packet X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:14:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Seems good to me. I will let Ray review also. Reviewed-by: Jaben Carsey > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Meenakshi > Sent: Friday, February 16, 2018 12:45 AM > To: Ni, Ruiyu ; Carsey, Jaben > ; edk2-devel@lists.01.org; lersek@redhat.com > Subject: [edk2] [RFC] ShellPkg/Ping: fix loss of first packet > Importance: High >=20 > From: Meenakshi Aggarwal >=20 > Issue: > Reply for first ping packet was getting dropped. >=20 > Cause: > Sometimes reply message comes even before trasmit > function returns, hence missing 1st reply >=20 > Fix: > Prepare the TxList before calling Transmit function. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Meenakshi Aggarwal > --- > ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c > b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c > index bec9535..46ba701 100644 > --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c > +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c > @@ -784,14 +784,17 @@ PingSendEchoRequest ( > } >=20 > ASSERT(Private->ProtocolPointers.Transmit !=3D NULL); > + > + InsertTailList (&Private->TxList, &TxInfo->Link); > + > Status =3D Private->ProtocolPointers.Transmit (Private->IpProtocol, Tx= Info- > >Token); >=20 > if (EFI_ERROR (Status)) { > + RemoveEntryList (&TxInfo->Link); > PingDestroyTxInfo (TxInfo, Private->IpChoice); > return Status; > } >=20 > - InsertTailList (&Private->TxList, &TxInfo->Link); > Private->TxCount++; >=20 > return EFI_SUCCESS; > -- > 1.9.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel