From nobody Fri May 17 05:26:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+88316+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+88316+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1648781668; cv=none; d=zohomail.com; s=zohoarc; b=gejWwO7RJv6HRVLY4cd1BdYsfPjrDHEoGpw5OQh8GReY0+2GWhDrX0R12D1HPLoRKRzxYeFcNkJCF/oYhTlnCoi9L70oIzm243ObcfSmGv3iYGNm90u//4rnByHhRt+YMpzuk0ln4BKAMUdKQ76ZRV95JVc6r5h4jiB5lZ+/q4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648781668; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=af7qH3snuMNyvaAm7J4CWNkI39ImlS+Praf+NfpwOmk=; b=fW2QYNPs7OlocxMPQzxM9+VLKtfha37wP+IRrxGPsKHNmA0Rz+zX0i2rcRhCwoO/JLyUWYTTwp5zGH9sHqSgBlznG/eLS+CM47K+FRuJczPHL4zubW3Yg9VDDk2vKfD3kFli/Boe4RABSfImnNMRG1+5TAyDBbb/Gx2OnYpPiKs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+88316+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1648781668946454.86615056226583; Thu, 31 Mar 2022 19:54:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0NoeYY1788612xhZ4Hj2sMW9; Thu, 31 Mar 2022 19:54:28 -0700 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.6139.1648781666244486609 for ; Thu, 31 Mar 2022 19:54:26 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="239965132" X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="239965132" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 19:54:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="522609130" X-Received: from hengluo-dev.ccr.corp.intel.com ([10.239.153.141]) by orsmga006.jf.intel.com with ESMTP; 31 Mar 2022 19:54:23 -0700 From: "Heng Luo" To: devel@edk2.groups.io Cc: Maciej Rabeda , Fu Siyuan , Wu Jiaxin Subject: [edk2-devel] [PATCH] NetworkPkg: Add PCDs for HTTP DNS RetryCount and RetryInterval Date: Fri, 1 Apr 2022 10:54:21 +0800 Message-Id: <20220401025421.653-1-heng.luo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,heng.luo@intel.com X-Gm-Message-State: Zj9lg2nrRG0A80WrdfHmJ6NVx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1648781668; bh=y0qy3lSkKWzBDSctb6ttWrc5qezZNpyF5kXocMtxWqw=; h=Cc:Date:From:Reply-To:Subject:To; b=vrZ8zhCML3GNAFKV3/BENKErOCT5c06b6X0k803939s4C03jQVAOl9NUPg85UB1z1JF v7/0xsxJ2yUz+segSR8NxBwEhBqRDFXJyEX+mxbFwaLcgMiaO9QIEHQU38cVttZ+EGUS3 yLTokvcKuTUK2SzTKPkqNilwWhMM1F0jv2Y= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1648781670069100002 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3889 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/HttpBootDxe/HttpBootDxe.inf | 2 ++ NetworkPkg/HttpDxe/HttpDns.c | 4 ++++ NetworkPkg/HttpDxe/HttpDxe.inf | 2 ++ NetworkPkg/NetworkPkg.dec | 9 +++++++++ NetworkPkg/NetworkPkg.uni | 11 +++++++++++ 5 files changed, 28 insertions(+) diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.inf b/NetworkPkg/HttpBootDx= e/HttpBootDxe.inf index cffa642a4b..d860bff277 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootDxe.inf +++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.inf @@ -97,6 +97,8 @@ [Pcd] gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES gEfiNetworkPkgTokenSpaceGuid.PcdHttpIoTimeout ## CONSUMES + gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryInterval ## CONSUMES + gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryCount ## CONSUMES =20 [UserExtensions.TianoCore."ExtraFiles"] HttpBootDxeExtra.uni 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 =3D DnsServerListCount; Dns4CfgData.DnsServerList =3D DnsServerList; Dns4CfgData.UseDefaultSetting =3D HttpInstance->IPv4Node.UseDefaultAddr= ess; + Dns4CfgData.RetryInterval =3D PcdGet32 (PcdHttpDnsRetryInterval); + Dns4CfgData.RetryCount =3D PcdGet32 (PcdHttpDnsRetryCount); if (!Dns4CfgData.UseDefaultSetting) { IP4_COPY_ADDRESS (&Dns4CfgData.StationIp, &HttpInstance->IPv4Node.Loca= lAddress); IP4_COPY_ADDRESS (&Dns4CfgData.SubnetMask, &HttpInstance->IPv4Node.Loc= alSubnet); @@ -316,6 +318,8 @@ HttpDns6 ( Dns6ConfigData.EnableDnsCache =3D TRUE; Dns6ConfigData.Protocol =3D EFI_IP_PROTO_UDP; IP6_COPY_ADDRESS (&Dns6ConfigData.StationIp, &HttpInstance->Ipv6Node.Loc= alAddress); + Dns6ConfigData.RetryInterval =3D PcdGet32 (PcdHttpDnsRetryInterval); + Dns6ConfigData.RetryCount =3D PcdGet32 (PcdHttpDnsRetryCount); Status =3D 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 =20 [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 =20 + ## The Retry Interval of HTTP DNS in seconds. If the Retry Interval is l= ess 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 I= nterval. + # @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 whe= n getting " = "the recovery image from the remote source during an HTTP recovery boo= t." = "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 #la= nguage en-US "This value is used to configure the retry Interval of HTTP DN= S." + = "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 #lan= guage en-US "Retry Count of HTTP DNS" + +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpDnsRetryCount_HELP #langu= age 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." --=20 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88316): https://edk2.groups.io/g/devel/message/88316 Mute This Topic: https://groups.io/mt/90170013/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-