[edk2-devel] [PATCH 3/4] ArmVirtPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

Laszlo Ersek lersek at redhat.com
Tue May 14 14:22:03 UTC 2019


On 05/14/19 09:39, Zhang, Shenglei wrote:
> This patch updates the platform DSC/FDF files to use the include fragment
> files provided by NetworkPkg.
> The feature enabling flags in [Defines] section have been updated to use
> the NetworkPkg's terms, and the value has been overridden with the original
> default value on this platform.
> 
> Cc: Laszlo Ersek <lersek at redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> Cc: Julien Grall <julien.grall at linaro.org>
> Signed-off-by: Shenglei Zhang <shenglei.zhang at intel.com>
> ---
>  ArmVirtPkg/ArmVirt.dsc.inc           | 10 ++-----
>  ArmVirtPkg/ArmVirtQemu.dsc           | 43 +++++++++-------------------
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 25 ++--------------
>  ArmVirtPkg/ArmVirtQemuKernel.dsc     | 43 +++++++++-------------------
>  4 files changed, 30 insertions(+), 91 deletions(-)
> 
> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> index 1848d20531..20bf011617 100644
> --- a/ArmVirtPkg/ArmVirt.dsc.inc
> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> @@ -70,14 +70,8 @@
>    BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
>  
>    # Networking Requirements
> -  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
> -  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
> -  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> -  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> -  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
> -!if $(HTTP_BOOT_ENABLE) == TRUE
> -  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
> -!endif
> +!include NetworkPkg/NetworkLibs.dsc.inc
> +
>  
>    #
>    # It is not possible to prevent the ARM compiler from inserting calls to intrinsic functions.

This looks OK.


> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 28c8fd5513..54fd069c75 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -27,10 +27,14 @@
>    # Defines for default states.  These can be changed on the command line.
>    # -D FLAG=VALUE
>    #
> -  DEFINE TTY_TERMINAL            = FALSE
> -  DEFINE SECURE_BOOT_ENABLE      = FALSE
> -  DEFINE NETWORK_IP6_ENABLE      = FALSE
> -  DEFINE HTTP_BOOT_ENABLE        = FALSE
> +  DEFINE TTY_TERMINAL                    = FALSE
> +  DEFINE SECURE_BOOT_ENABLE              = FALSE

(1) This change is not consistent with the OvmfPkg change. Please use the same approach in both patches: either re-align the DEFINEs that are not related to NetworkPkg in both patches, or re-align those DEFINEs in neither patch.

Pesonally I like the style that you used in OvmfPkg better -- keep the network DEFINEs in a separate group.


> +  DEFINE NETWORK_IP6_ENABLE              = FALSE
> +  DEFINE NETWORK_HTTP_BOOT_ENABLE        = FALSE
> +  DEFINE NETWORK_SNP_ENABLE              = FALSE
> +  DEFINE NETWORK_TLS_ENABLE              = FALSE
> +

(2) You forgot:

  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE


(3) The above change (with the introduction of NETWORK_SNP_ENABLE to this DSC file) suggests that NETWORK_SNP_ENABLE=TRUE is a valid end-user setting. It is not; SnpDxe is IA32, X64, and EBC only. Therefore, please add an !if check, and invoke !error, if the user sets NETWORK_SNP_ENABLE to TRUE on the "build" command line.


(4) A similar comment applies to NETWORK_TLS_ENABLE. The above change suggests that it is enough for a user to set NETWORK_TLS_ENABLE=TRUE in order to get the intended functionality. This is not the case. We have a separate BZ about that: <https://bugzilla.tianocore.org/show_bug.cgi?id=1009>.

Therefore, please add an !if check against NETWORK_TLS_ENABLE=TRUE (from the "build" command line), and use !error to abort the build, if the user attempts to request TLS. The error message should make a reference to <https://bugzilla.tianocore.org/show_bug.cgi?id=1009>.


> +!include NetworkPkg/NetworkDefines.dsc.inc
>  
>  !include ArmVirtPkg/ArmVirt.dsc.inc
>  
> @@ -122,9 +126,10 @@
>    #
>    gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|0
>  
> -!if $(HTTP_BOOT_ENABLE) == TRUE
> -  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
> -!endif
> +  #
> +  # Network Pcds
> +  #
> +!include NetworkPkg/NetworkPcds.dsc.inc
>  
>    # System Memory Base -- fixed at 0x4000_0000
>    gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000

(5) Please add comments to the !include directives uniformly -- either comment on all of them, or none of them.


> @@ -353,29 +358,7 @@
>    #
>    # Networking stack
>    #
> -  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
> -  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
> -  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
> -  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
> -  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
> -  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
> -  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
> -  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
> -  NetworkPkg/TcpDxe/TcpDxe.inf
> -  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
> -  NetworkPkg/IScsiDxe/IScsiDxe.inf
> -!if $(NETWORK_IP6_ENABLE) == TRUE
> -  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
> -  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
> -  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
> -  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
> -!endif
> -!if $(HTTP_BOOT_ENABLE) == TRUE
> -  NetworkPkg/DnsDxe/DnsDxe.inf
> -  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
> -  NetworkPkg/HttpDxe/HttpDxe.inf
> -  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
> -!endif
> +!include NetworkPkg/NetworkComponents.dsc.inc
>  
>    #
>    # SCSI Bus and Disk Driver

Looks good.


> diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> index a9a980aefc..31f615a9d0 100644
> --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> @@ -117,29 +117,8 @@ READ_LOCK_STATUS   = TRUE
>    #
>    # Networking stack
>    #
> -  INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
> -  INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
> -  INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
> -  INF MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
> -  INF MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
> -  INF MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
> -  INF MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
> -  INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
> -  INF NetworkPkg/TcpDxe/TcpDxe.inf
> -  INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
> -  INF NetworkPkg/IScsiDxe/IScsiDxe.inf
> -!if $(NETWORK_IP6_ENABLE) == TRUE
> -  INF NetworkPkg/Ip6Dxe/Ip6Dxe.inf
> -  INF NetworkPkg/Udp6Dxe/Udp6Dxe.inf
> -  INF NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
> -  INF NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
> -!endif
> -!if $(HTTP_BOOT_ENABLE) == TRUE
> -  INF NetworkPkg/DnsDxe/DnsDxe.inf
> -  INF NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
> -  INF NetworkPkg/HttpDxe/HttpDxe.inf
> -  INF NetworkPkg/HttpBootDxe/HttpBootDxe.inf
> -!endif
> +!include NetworkPkg/Network.fdf.inc
> +
>  
>    #
>    # SCSI Bus and Disk Driver

This seems fine as well.


> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 2a83c74694..320b4d5024 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc

(6) Please refresh "ArmVirtQemuKernel.dsc", after updating "ArmVirtQemu.dsc" like requested above.

Thank you!
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40602): https://edk2.groups.io/g/devel/message/40602
Mute This Topic: https://groups.io/mt/31616138/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list