From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Mon, 06 May 2019 07:28:22 -0700 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E051A85F; Mon, 6 May 2019 14:28:21 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-124-221.rdu2.redhat.com [10.10.124.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10F1A5D969; Mon, 6 May 2019 14:28:19 +0000 (UTC) Subject: Re: [edk2-devel] [Patch v4 3/3] NetworkPkg: Add package level include DSC file To: devel@edk2.groups.io, liming.gao@intel.com, Jiaxin Wu References: <20190429145012.14852-1-liming.gao@intel.com> <20190429145012.14852-4-liming.gao@intel.com> <96079230-6932-811a-dc06-9a4c5a25f03c@redhat.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E441687@SHSMSX104.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E441DCC@SHSMSX104.ccr.corp.intel.com> From: "Laszlo Ersek" Message-ID: <0df78b22-af7b-d878-7ee5-35a54594b88b@redhat.com> Date: Mon, 6 May 2019 16:28:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E441DCC@SHSMSX104.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 06 May 2019 14:28:21 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 05/06/19 15:24, Liming Gao wrote: >> -----Original Message----- >> From: Laszlo Ersek [mailto:lersek@redhat.com] >> Sent: Monday, May 6, 2019 7:54 PM >> To: Gao, Liming ; devel@edk2.groups.io >> Subject: Re: [edk2-devel] [Patch v4 3/3] NetworkPkg: Add package level include DSC file >> >> On 05/05/19 16:53, Gao, Liming wrote: >>>> -----Original Message----- >>>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Laszlo Ersek >>>> Sent: Tuesday, April 30, 2019 10:42 PM >>>> To: devel@edk2.groups.io; Gao, Liming >>>> Subject: Re: [edk2-devel] [Patch v4 3/3] NetworkPkg: Add package level include DSC file >>>> >>>> Hi Liming, >>>> >>>> please read my email until my signature below: >>>> >>>> On 04/29/19 16:50, Liming Gao wrote: >>>>> Platform DSC can include Network.dsc.inc to enable network features. >>>>> >>>>> Signed-off-by: Liming Gao >>>>> --- >>>>> NetworkPkg/Network.dsc.inc | 40 ++++++++++++++++++++++++++++++++++++++++ >>>>> NetworkPkg/NetworkPkg.dsc | 22 +--------------------- >>>>> 2 files changed, 41 insertions(+), 21 deletions(-) >>>>> create mode 100644 NetworkPkg/Network.dsc.inc >>>>> >>>>> diff --git a/NetworkPkg/Network.dsc.inc b/NetworkPkg/Network.dsc.inc >>>>> new file mode 100644 >>>>> index 0000000000..d51ee1b040 >>>>> --- /dev/null >>>>> +++ b/NetworkPkg/Network.dsc.inc >>>>> @@ -0,0 +1,40 @@ >>>>> +## @file >>>>> +# Network DSC include file for Platform DSC >>>>> +# >>>>> +# This file includes all required information to enable Network features. >>>>> +# It can be included to a platform DSC file by using "!include NetworkPkg/Network.dsc.inc". >>>>> +# >>>>> +# This file defines one build flag PLATFORMX64_ENABLE to support >>>>> +# IA32 PEI and X64 DXE platform. Its default value is FALSE. >>>>> +# >>>>> +# Copyright (c) 2019, Intel Corporation. All rights reserved.
>>>>> +# >>>>> +# SPDX-License-Identifier: BSD-2-Clause-Patent >>>>> +# >>>>> +## >>>>> + >>>>> +[Defines] >>>>> +!include NetworkPkg/NetworkDefines.dsc.inc >>>>> + >>>>> +!ifndef PLATFORMX64_ENABLE >>>>> + # >>>>> + # PLATFORMX64_ENABLE is set to TRUE when PEI is IA32 and DXE is X64 platform >>>>> + # >>>>> + DEFINE PLATFORMX64_ENABLE = FALSE >>>>> +!endif >>>>> + >>>>> +[PcdsFixedAtBuild] >>>>> +!include NetworkPkg/NetworkPcds.dsc.inc >>>>> + >>>>> +[LibraryClasses] >>>>> +!include NetworkPkg/NetworkLibs.dsc.inc >>>>> + >>>>> +!if $(PLATFORMX64_ENABLE) == TRUE >>>>> +[Components.X64] >>>>> +!include NetworkPkg/NetworkComponents.dsc.inc >>>>> + >>>>> +!else >>>>> +[Components.IA32, Components.X64, Components.ARM, Components.AARCH64] >>>>> +!include NetworkPkg/NetworkComponents.dsc.inc >>>>> + >>>>> +!endif >>>> >>>> My point (9) in was >>>> PLATFORMX64_ENABLE should be dropped completely, and we should use the >>>> following instead: >>>> >>>> !if ("X64" in $(ARCH)) >>>> [Components.X64] >>>> !include NetworkPkg/NetworkComponents.dsc.inc >>>> !else >>>> [Components.IA32, Components.ARM, Components.AARCH64] >>>> !include NetworkPkg/NetworkComponents.dsc.inc >>>> !endif >>>> >>>> I don't feel strongly about this patch, but I'd still like to hear your >>>> opinion on this approach. >>> This solution can't handle NetworkPkg.dsc. NetworkPkg.dsc includes IA32, X64, ARM and AARCH64. >>> With this solution, NetworkPkg.dsc will only build drivers for X64 arch. >> >> How so? If you run "build -a ARM -p NetworkPkg/NetworkPkg.dsc ...", then >> the second branch will be selected (the "in" operator will evaluate to >> false), and the second branch !includes "NetworkComponents.dsc.inc" in >> [Components.ARM]. >> >> Can you provide an example command line where the above would break? >> >> Do you mean "build -a ARM -a X64 -p NetworkPkg/NetworkPkg.dsc ..."? > > Yes. I usually build -p NetworkPkg/NetworkPkg.dsc -a IA32 -a X64 and make sure the modules are built both for IA32 and X64. OK, that certainly makes sense. A multi-arch build such as "-a IA32 -a X64" may have a different meaning dependent on the presence of an FDF file reference in the DSC file. I agree a separate flag is useful for distinguishing IA32 PEI + X64 DXE special case from the rest of the multi-arch builds. Other than that: as I suggested under patch v3 2/3, point (11), I think we should include TlsLib in "NetworkLibs.dsc.inc", and then we can remove the TlsLib resolution too, from "NetworkPkg.dsc". I guess we should await Jiaxin's and Siyuan's feedback on that. Either way, for this patch: Acked-by: Laszlo Ersek Thanks! Laszlo >> >> Thanks >> Laszlo >> >>> But, we expect NetworkPkg.dsc >>> build the drivers for each ARCH. >>>> >>>> Thanks, >>>> Laszlo >>>> >>>>> diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc >>>>> index be9d9248e4..fe2fcf7b3c 100644 >>>>> --- a/NetworkPkg/NetworkPkg.dsc >>>>> +++ b/NetworkPkg/NetworkPkg.dsc >>>>> @@ -41,12 +41,6 @@ >>>>> DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf >>>>> SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf >>>>> >>>>> - DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf >>>>> - NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf >>>>> - IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf >>>>> - UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf >>>>> - TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf >>>>> - HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf >>>>> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf >>>>> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf >>>>> IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf >>>>> @@ -103,24 +97,10 @@ >>>>> ################################################################################################### >>>>> >>>>> [Components] >>>>> - NetworkPkg/Ip6Dxe/Ip6Dxe.inf >>>>> - NetworkPkg/TcpDxe/TcpDxe.inf >>>>> - NetworkPkg/Udp6Dxe/Udp6Dxe.inf >>>>> - NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf >>>>> - NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf >>>>> - NetworkPkg/DnsDxe/DnsDxe.inf >>>>> - NetworkPkg/HttpDxe/HttpDxe.inf >>>>> - NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf >>>>> - NetworkPkg/HttpBootDxe/HttpBootDxe.inf >>>>> NetworkPkg/WifiConnectionManagerDxe/WifiConnectionManagerDxe.inf >>>>> - >>>>> NetworkPkg/Application/VConfig/VConfig.inf >>>>> >>>>> -[Components.IA32, Components.X64, Components.ARM, Components.AARCH64] >>>>> - NetworkPkg/IScsiDxe/IScsiDxe.inf >>>>> - NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf >>>>> - NetworkPkg/TlsDxe/TlsDxe.inf >>>>> - NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf >>>>> + !include NetworkPkg/Network.dsc.inc >>>>> >>>>> [BuildOptions] >>>>> *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES >>>>> >>>> >>>> >>>> >>> > > > >