From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 C5F2E21B02830 for ; Wed, 6 Dec 2017 23:43:53 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2017 23:48:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,371,1508828400"; d="scan'208";a="16196088" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 06 Dec 2017 23:48:26 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 6 Dec 2017 23:48:26 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 6 Dec 2017 23:48:25 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Thu, 7 Dec 2017 15:48:24 +0800 From: "Wu, Jiaxin" To: Guo Heyi , "edk2-devel@lists.01.org" CC: "Zeng, Star" , "Dong, Eric" , "Ni, Ruiyu" , "Fu, Siyuan" Thread-Topic: MdeModulePkg/UefiPxeBcDxe: Question about IcmpErrorListenHandler in PxeBcImpl.c Thread-Index: AQHTbxDvv14ZM1CRqUuMZmeQsd3GwaM3e1bA Date: Thu, 7 Dec 2017 07:48:24 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B727416350F0E@SHSMSX103.ccr.corp.intel.com> References: <20171207040650.GA62959@SZX1000114654> In-Reply-To: <20171207040650.GA62959@SZX1000114654> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzUzZTJhOGUtNjI1My00ODAxLWE1OTgtZmY0NmYyYWQ1MzNmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNi41LjkuMyIsIlRydXN0ZWRMYWJlbEhhc2giOiJXcGZBT2s5ZUN1eDZ0aUkreVVmc2szWEQyQ3oybTZTXC9zVm44ckk5VHFsRT0ifQ== x-ctpclassification: CTP_PUBLIC 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: MdeModulePkg/UefiPxeBcDxe: Question about IcmpErrorListenHandler in PxeBcImpl.c X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Dec 2017 07:43:53 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Gary,=20 IcmpErrorRcvToken is only used to get ICMP error from IP layer, and the dat= a will be copied to Mode->IcmpError. So, I think the RxData should be recyc= led.=20 Besides, EFI_IP_PROTO_ICMP should be also checked in the call function but = currently it's not: if (!EFI_IP4_EQUAL (&RxData->Header->DestinationAddress, &Mode->StationIp= .v4)) { // // The dest address is not equal to Station Ip address, discard it. // goto CleanUp; } +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. +// +goto CleanUp; +} Thanks the report. Thanks, Jiaxin > -----Original Message----- > From: Guo Heyi [mailto:heyi.guo@linaro.org] > Sent: Thursday, December 7, 2017 12:07 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Dong, Eric ; N= i, > Ruiyu ; Fu, Siyuan ; Wu, Jiaxin > > Subject: MdeModulePkg/UefiPxeBcDxe: Question about > IcmpErrorListenHandler in PxeBcImpl.c >=20 > Hi folks, >=20 > In PxeBcImpl.c, we have IcmpErrorListenHandler which seems to process > ICMP errors. But in EfiPxeBcStart function, we can see Private- > >IcmpErrorRcvToken.Event is only a common event and Ip4->Receive is > called to receive IP4 packets. So will IcmpErrorListenHandler receive all= IP4 > packets belonging to this network interface, or will it only receive ICMP= error > packets? If it is the latter situation, how do we make it? >=20 > The background of this question is that when we flush the network with > deprecated ICMP packets (type 15, 16, ...), RxData will not be recycled a= nd > the list of UEFI events becomes longer and longer, which finally impacts > system performance a lot. If only error ICMP will be received by > IcmpErrorListenHandler, we'd like to patch it as below: >=20 > diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c > b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c > index 6d4f33f..f74b264 100644 > --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c > +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c > @@ -216,8 +216,6 @@ IcmpErrorListenHandlerDpc ( > CopiedPointer +=3D CopiedLen; > } >=20 > - goto Resume; > - > CleanUp: > gBS->SignalEvent (RxData->RecycleSignal); >=20 > We tested and it worked, but we are still not sure whether it will impact > other code in the network stack. >=20 > Please let me know your comments. >=20 > Thanks, >=20 > Gary (Heyi Guo)