From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web08.6343.1648782932820329050 for ; Thu, 31 Mar 2022 20:15:33 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ftr51RNy; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: heng.luo@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648782932; x=1680318932; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6XDsNW/xtkmFn2nXJBBaaUaIIOX3YWSpF9buUbZZ9Ek=; b=ftr51RNywXUwBMdME7F5HxKHUZ5S3cfPpxC1i3Z2yrvPfXdz0Wmb94VB Qi3e/GAAGcxk1AH5UiaTPNOozs/LiYxs9zo6uqv4OkldnWumGLJZHC/HC oIoAOk0mGqmlDzqUjjRDy1YABoti7tVAXkOrNKOLuS3JmAvlFN2jFv72d 1Ld0D9ZLGtEW48AeHgumR6y2e5dhw4bYTs8vYrV1NBFOy11PQXHZ5bOmk I9fPgD+R0v9IIdZysvn/y01VfYBzqQZ6Wnz/WV0gXXNlfC8TiFg6+oXj2 HoRYJf3qap+K5DgjLxqls84HJMM6BdXNdvhTZ2+26FawE7Nza+FBeuvpt A==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="260210785" X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="260210785" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 20:15:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="720722848" Received: from hengluo-dev.ccr.corp.intel.com ([10.239.153.141]) by orsmga005.jf.intel.com with ESMTP; 31 Mar 2022 20:15:22 -0700 From: "Heng Luo" To: devel@edk2.groups.io Cc: Maciej Rabeda , Fu Siyuan , Wu Jiaxin Subject: [Patch V2] NetworkPkg: Add PCDs for HTTP DNS RetryCount and RetryInterval Date: Fri, 1 Apr 2022 11:15:14 +0800 Message-Id: <20220401031514.1195-1-heng.luo@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3889 Currently the HTTP DNS Retry Interval is 2 second and no retry attempt. If DNS response can't arrive in 2 second, the DNS request is failed, and then HTTP boot is failed. In order to resolve this issue, Add PCDs to support RetryCount and RetryInterval configurated in Platform. Cc: Maciej Rabeda Cc: Fu Siyuan Cc: Wu Jiaxin Signed-off-by: Heng Luo --- NetworkPkg/HttpDxe/HttpDns.c | 4 ++++ NetworkPkg/HttpDxe/HttpDxe.inf | 2 ++ NetworkPkg/NetworkPkg.dec | 9 +++++++++ NetworkPkg/NetworkPkg.uni | 11 +++++++++++ 4 files changed, 26 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpDns.c b/NetworkPkg/HttpDxe/HttpDns.c index 59a2784e6a..e609aba519 100644 --- a/NetworkPkg/HttpDxe/HttpDns.c +++ b/NetworkPkg/HttpDxe/HttpDns.c @@ -108,6 +108,8 @@ HttpDns4 ( Dns4CfgData.DnsServerListCount = DnsServerListCount; Dns4CfgData.DnsServerList = DnsServerList; Dns4CfgData.UseDefaultSetting = HttpInstance->IPv4Node.UseDefaultAddress; + Dns4CfgData.RetryInterval = PcdGet32 (PcdHttpDnsRetryInterval); + Dns4CfgData.RetryCount = PcdGet32 (PcdHttpDnsRetryCount); if (!Dns4CfgData.UseDefaultSetting) { IP4_COPY_ADDRESS (&Dns4CfgData.StationIp, &HttpInstance->IPv4Node.LocalAddress); IP4_COPY_ADDRESS (&Dns4CfgData.SubnetMask, &HttpInstance->IPv4Node.LocalSubnet); @@ -316,6 +318,8 @@ HttpDns6 ( Dns6ConfigData.EnableDnsCache = TRUE; Dns6ConfigData.Protocol = EFI_IP_PROTO_UDP; IP6_COPY_ADDRESS (&Dns6ConfigData.StationIp, &HttpInstance->Ipv6Node.LocalAddress); + Dns6ConfigData.RetryInterval = PcdGet32 (PcdHttpDnsRetryInterval); + Dns6ConfigData.RetryCount = PcdGet32 (PcdHttpDnsRetryCount); Status = Dns6->Configure ( Dns6, &Dns6ConfigData diff --git a/NetworkPkg/HttpDxe/HttpDxe.inf b/NetworkPkg/HttpDxe/HttpDxe.inf index af681c0184..c9502d0bb6 100644 --- a/NetworkPkg/HttpDxe/HttpDxe.inf +++ b/NetworkPkg/HttpDxe/HttpDxe.inf @@ -75,6 +75,8 @@ [Pcd] gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES gEfiNetworkPkgTokenSpaceGuid.PcdHttpIoTimeout ## CONSUMES + gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryInterval ## CONSUMES + gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryCount ## CONSUMES [UserExtensions.TianoCore."ExtraFiles"] HttpDxeExtra.uni diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec index 928e84fec4..5e43ebf8c5 100644 --- a/NetworkPkg/NetworkPkg.dec +++ b/NetworkPkg/NetworkPkg.dec @@ -163,5 +163,14 @@ # @Prompt The Timeout value of HTTP Io. Default value is 5000. gEfiNetworkPkgTokenSpaceGuid.PcdHttpIoTimeout|5000|UINT32|0x0000000F + ## The Retry Interval of HTTP DNS in seconds. If the Retry Interval is less than + # DNS_DEFAULT_TIMEOUT, then use the DNS_DEFAULT_TIMEOUT. + # @Prompt The value of Retry Interval. Default value is 0 + gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryInterval|0|UINT32|0x00000010 + + ## The Retry Count of HTTP DNS if no DNS response received after Retry Interval. + # @Prompt The value of Retry Count, Default value is 0. + gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryCount|0|UINT32|0x00000011 + [UserExtensions.TianoCore."ExtraFiles"] NetworkPkgExtra.uni diff --git a/NetworkPkg/NetworkPkg.uni b/NetworkPkg/NetworkPkg.uni index 6d0fa67c6f..c0bbbd3ee1 100644 --- a/NetworkPkg/NetworkPkg.uni +++ b/NetworkPkg/NetworkPkg.uni @@ -111,3 +111,14 @@ #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpIoTimeout_HELP #language en-US "This value is used to configure the request and response timeout when getting " "the recovery image from the remote source during an HTTP recovery boot." "The default value set is 5 seconds." + +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpDnsRetryInterval_PROMPT #language en-US "Retry Interval of HTTP DNS" + +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpDnsRetryInterval_HELP #language en-US "This value is used to configure the retry Interval of HTTP DNS." + "The default value set is 0 second. If the value is less than" + "DNS_DEFAULT_TIMEOUT, then use the DNS_DEFAULT_TIMEOUT." + +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpDnsRetryCount_PROMPT #language en-US "Retry Count of HTTP DNS" + +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpDnsRetryCount_HELP #language en-US "This value is used to configure the Retry Count of HTTP DNS if " + "no DNS response received after Retry Interval. The default value set is 0." -- 2.31.1.windows.1