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=jiaxin.wu@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 F1C32222CB302 for ; Thu, 21 Dec 2017 23:28:15 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2017 23:33:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,439,1508828400"; d="scan'208";a="189206986" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 21 Dec 2017 23:33:04 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Dec 2017 23:33:04 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Dec 2017 23:33:04 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Fri, 22 Dec 2017 15:33:01 +0800 From: "Wu, Jiaxin" To: "Fu, Siyuan" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Wang, Fan" Thread-Topic: [edk2] [Patch] NetworkPkg: Recycle the ICMP error message in PXE driver. Thread-Index: AQHTei/gf2BtCGDn5kOy1buAW3W4ZqNO+bSw Date: Fri, 22 Dec 2017 07:33:01 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B727416355FDD@SHSMSX103.ccr.corp.intel.com> References: <20171221074626.372-1-siyuan.fu@intel.com> In-Reply-To: <20171221074626.372-1-siyuan.fu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDBhMmYwZGUtNGE3Yy00MzJiLWJjNjgtMmIxNDI4MzMzNmZlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InFQVE5Mem9BNTk4NUJSMTVSU3AweW1Xb1VSNGZuQlk2OVc0WDNqeUVFK2M9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg: Recycle the ICMP error message in PXE driver. 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, 22 Dec 2017 07:28:16 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiaxin Wu > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Fu= , > Siyuan > Sent: Thursday, December 21, 2017 3:46 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Wang, Fan ; Wu, > Jiaxin > Subject: [edk2] [Patch] NetworkPkg: Recycle the ICMP error message in PXE > driver. >=20 > This patch updates PxeBcIcmpErrorDpcHandle() and > PxeBcIcmp6ErrorDpcHandle() to > recycle the ICMP packet after copy it to PXE mode data. >=20 > Cc: Ye Ting > Cc: Wu Jiaxin > Cc: Wang Fan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Fu Siyuan > --- > NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c | 36 +++++++++++++++--------- > ---------- > 1 file changed, 16 insertions(+), 20 deletions(-) >=20 > diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c > b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c > index dfc79a067b..1e77929364 100644 > --- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c > +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c > @@ -257,8 +257,7 @@ PxeBcIcmpErrorDpcHandle ( > // > // The return status should be recognized as EFI_ICMP_ERROR. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > if (EFI_IP4 (RxData->Header->SourceAddress) !=3D 0 && > @@ -268,24 +267,21 @@ PxeBcIcmpErrorDpcHandle ( > // > // The source address of the received packet should be a valid unica= st > address. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > if (!EFI_IP4_EQUAL (&RxData->Header->DestinationAddress, &Mode- > >StationIp.v4)) { > // > // The destination address of the received packet should be equal to= the > host address. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > if (RxData->Header->Protocol !=3D EFI_IP_PROTO_ICMP) { > // > // The protocol value in the header of the receveid packet should be > EFI_IP_PROTO_ICMP. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > Type =3D *((UINT8 *) RxData->FragmentTable[0].FragmentBuffer); > @@ -298,8 +294,7 @@ PxeBcIcmpErrorDpcHandle ( > // > // The type of the receveid ICMP message should be > ICMP_ERROR_MESSAGE. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > // > @@ -326,6 +321,9 @@ PxeBcIcmpErrorDpcHandle ( > IcmpError +=3D CopiedLen; > } >=20 > +ON_RECYCLE: > + gBS->SignalEvent (RxData->RecycleSignal); > + > ON_EXIT: > Private->IcmpToken.Status =3D EFI_NOT_READY; > Ip4->Receive (Ip4, &Private->IcmpToken); > @@ -395,16 +393,14 @@ PxeBcIcmp6ErrorDpcHandle ( > // > // The return status should be recognized as EFI_ICMP_ERROR. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > if (!NetIp6IsValidUnicast (&RxData->Header->SourceAddress)) { > // > // The source address of the received packet should be a valid unica= st > address. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > if (!NetIp6IsUnspecifiedAddr (&Mode->StationIp.v6) && > @@ -412,16 +408,14 @@ PxeBcIcmp6ErrorDpcHandle ( > // > // The destination address of the received packet should be equal to= the > host address. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > if (RxData->Header->NextHeader !=3D IP6_ICMP) { > // > // The nextheader in the header of the receveid packet should be > IP6_ICMP. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > Type =3D *((UINT8 *) RxData->FragmentTable[0].FragmentBuffer); > @@ -433,8 +427,7 @@ PxeBcIcmp6ErrorDpcHandle ( > // > // The type of the receveid packet should be an ICMP6 error message. > // > - gBS->SignalEvent (RxData->RecycleSignal); > - goto ON_EXIT; > + goto ON_RECYCLE; > } >=20 > // > @@ -461,6 +454,9 @@ PxeBcIcmp6ErrorDpcHandle ( > Icmp6Error +=3D CopiedLen; > } >=20 > +ON_RECYCLE: > + gBS->SignalEvent (RxData->RecycleSignal); > + > ON_EXIT: > Private->Icmp6Token.Status =3D EFI_NOT_READY; > Ip6->Receive (Ip6, &Private->Icmp6Token); > -- > 2.13.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel