From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c00::242; helo=mail-pf0-x242.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C34312218E921 for ; Wed, 6 Dec 2017 20:02:45 -0800 (PST) Received: by mail-pf0-x242.google.com with SMTP id u25so3729188pfg.5 for ; Wed, 06 Dec 2017 20:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=72158Jdvg/3/EGzlfkR42WTr65hYxfpy2/yvfLK19HY=; b=cWKMbg/3nC0E4IKsAXBhjGdcZA+6ABiU45VzYJKVdUG3rvJxLftR8DUvWKuWfUikOD wnsgvP5wQrx3G0f9OmmKpNHrwr6bPeg9tJSTKZBAoTXB5SWp/1IZWVkQcxQHvLE8Dywg fo7kqqOvsTKH0le4v1NyH/urpX4/F0tqFCu/c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=72158Jdvg/3/EGzlfkR42WTr65hYxfpy2/yvfLK19HY=; b=DW3c/1RWLdD+QBEYfRGNp7gBCJGaWbTB80ZWTNZE+nsdekK1cv2mX6gwuOYI7jbP1S J7OE7g9i3pnlnuuChHnBmtp+YwEZnhiLHrw8qZXNG7+oxubLMRvepLhv1FW9YCBTKrZz O+c9ITQiRZ3TCulVE1+NDvzMUgNw0zJ/PfRbdcu4wDlEFJ+vvbPZNbzCqjHxciYI4z5c 5xnfodiu5aQJuED5KBHdYWmA6OI5h9shlkt3IiY608b/jsFRDNA8CScAucfcB81O85wO /140dG1UxlZjSy/bx+K3Q/GS0Jeo/WZkzaaWmuy0U3xMo2/spONAfq3CEwpAurEvVxLK 39Qg== X-Gm-Message-State: AJaThX4ONoVxFjWAfPSmeupG3rnBcBV5+3c7WdilBViQLirfNQCGoqAW INf9n3SWe72s/4Cw6A4WcYsq4ReHXLA= X-Google-Smtp-Source: AGs4zMZ7IDFmfZDziFSiKopBL3fps4j3TABV24pUiAau7gL4dH5QbtPcmTFaXL/v9PCIjfLU2y8NqA== X-Received: by 10.159.247.198 with SMTP id v6mr23701795plz.265.1512619637760; Wed, 06 Dec 2017 20:07:17 -0800 (PST) Received: from SZX1000114654 ([45.56.155.36]) by smtp.gmail.com with ESMTPSA id 67sm5457892pgg.50.2017.12.06.20.07.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 20:07:17 -0800 (PST) Date: Thu, 7 Dec 2017 12:06:50 +0800 From: Guo Heyi To: "edk2-devel@lists.01.org" Cc: Star Zeng , Eric Dong , Ruiyu Ni , Siyuan Fu , Jiaxin Wu Message-ID: <20171207040650.GA62959@SZX1000114654> MIME-Version: 1.0 User-Agent: Mutt/1.5.24 (2015-08-30) Subject: 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 04:02:45 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi folks, 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? The background of this question is that when we flush the network with deprecated ICMP packets (type 15, 16, ...), RxData will not be recycled and 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: 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 += CopiedLen; } - goto Resume; - CleanUp: gBS->SignalEvent (RxData->RecycleSignal); We tested and it worked, but we are still not sure whether it will impact other code in the network stack. Please let me know your comments. Thanks, Gary (Heyi Guo)