From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from IMSVA.IN.MEGATRENDS.COM (Webmail.amiindia.co.in [203.199.198.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D304621A6F106 for ; Tue, 18 Apr 2017 21:35:57 -0700 (PDT) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67F7382059; Wed, 19 Apr 2017 10:07:40 +0530 (IST) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5B78B82055; Wed, 19 Apr 2017 10:07:40 +0530 (IST) Received: from webmail.amiindia.co.in (venus1.in.megatrends.com [10.0.0.5]) by IMSVA.IN.MEGATRENDS.COM (Postfix) with ESMTPS; Wed, 19 Apr 2017 10:07:40 +0530 (IST) Received: from VENUS2.in.megatrends.com ([fe80::2002:4a07:4f17:c09b]) by VENUS1.in.megatrends.com ([fe80::951:7975:6ecf:eae5%14]) with mapi id 14.01.0438.000; Wed, 19 Apr 2017 10:05:54 +0530 From: Karunakar P To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] The network interface configuration is taking some delay to update in DHCP case Thread-Index: AdK4EbWxBpH5aAwCSxaCzj+JcZmxZAAByw3QAADpbyAAKhe+AA== Date: Wed, 19 Apr 2017 04:35:53 +0000 Message-ID: References: <895558F6EA4E3B41AC93A00D163B7274162C1211@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.84.164] MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1600-8.1.0.1062-23016.004 X-TM-AS-Result: No--20.918-5.0-31-10 X-imss-scan-details: No--20.918-5.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1600-8.1.1062-23016.004 X-TMASE-Result: 10--20.917700-10.000000 X-TMASE-MatchedRID: WMT2WRIkHPNf8szgSbttgkKcYi5Qw/RVMC4zO7d4kaP2KCFTZqwm/X4z 9jl2IgzvmyB0x8nJDKRZs4umC/0LtmiMXUkD7gZJ6rBZUF8y6+g6En2bnefhoMUdzAovpQT/S8F RhpoGD34xcSfgz4Zxa88MTEiM2S2G+dVjQNaxOrfFlCgYxEaGE9SqEluSYtV7nQqircTOm4d8yt 0Pc0hS+ymqJY7+QFbXUTNVBwIZ65sAzT8btdR14xHuQ9dDJbS2C/ExpXrHizzkGrGxzfsrbNAOO SAF0cTNIE7/Wr/mmYZzAhyVRq3nWLhhaFskSWDqr51gSC67hpUlBKvI9NWIXyiT4IuvbLIcZrNu 8rd6KO4kR9XRb7ZZ+7HuOogakDW5WVPX4wLpoVjNQJf7KDMgm+3+iQEtoSj4ydovWuL+KVdT1rr N8sUDVrfqHaErmu92fyYDewMOrQBnmnsWZqGtoLHlqZYrZqdI+gtHj7OwNO0gIa2uM5uk8uFVTs N+dd1uXQ2a9aaOSpz7x4VX7IzWG5lHKNPVl7mf0uohXnUaQew= X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0,39:0-0 Subject: Re: The network interface configuration is taking some delay to update in DHCP case 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: Wed, 19 Apr 2017 04:35:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Jiaxin, I've found something related to this. Ip4Config2OnDhcp4Complete() Callback function when DHCP process finished. It will save the retrieved IP= configure parameter from DHCP to the NVRam. Set the station address, subne= tmask and gateway address for the default interface. And this function is taking some delay to Set the Address. If we add some d= elay by that time Ip4Config2OnDhcp4Complete() was done and printing the val= ues are correct. If print the values before this function we are getting as= 0.=20 Could you please suggest anything that we can overcome this delay or we can= Signal this event before ExtractConfig called. =20 Thanks, Karunakar. -----Original Message----- From: Karunakar P=20 Sent: Tuesday, April 18, 2017 2:22 PM To: 'Wu, Jiaxin' Subject: RE: [edk2] The network interface configuration is taking some dela= y to update in DHCP case Hi Jiaxin, Thank you very much for your instant reply. I changed the print statements. EFI_STATUS Ip4Config2ConvertConfigNvDataToIfrNvData ( IN IP4_CONFIG2_INSTANCE *Instance, IN OUT IP4_CONFIG2_IFR_NVDATA *IfrNvData ) { ... IpSb =3D IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance); +Print value of IpSb->DefaultInterface->Configured (Printed value is=20 +IpSb->DefaultInterface->Configured =3D 0) if (IpSb->DefaultInterface->Configured) { IfrNvData->Configure =3D 1; } else { IfrNvData->Configure =3D 0; goto Exit; } + Print value of IpSb->DefaultInterface->Configured (Printed value is=20 + IpSb->DefaultInterface->Configured =3D 0) ... Exit: +Print value of IpSb->DefaultInterface->Configured (Printed value is=20 +IpSb->DefaultInterface->Configured =3D 0) } [Observation] 1. IpSb->DefaultInterface->Configured itself getting as 0. 2. If add some delay before print, then it is printing as 1 EFI_STATUS Ip4= Config2ConvertConfigNvDataToIfrNvData ( IN IP4_CONFIG2_INSTANCE *Instance, IN OUT IP4_CONFIG2_IFR_NVDATA *IfrNvData ) { ... IpSb =3D IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance); + Add some delay +Print value of IpSb->DefaultInterface->Configured (Printed value is=20 +IpSb->DefaultInterface->Configured =3D 1) if (IpSb->DefaultInterface->Configured) { IfrNvData->Configure =3D 1; } else { IfrNvData->Configure =3D 0; goto Exit; } + Print value of IpSb->DefaultInterface->Configured (Printed value is=20 + IpSb->DefaultInterface->Configured =3D 1) ... Exit: +Print value of IpSb->DefaultInterface->Configured (Printed value is=20 +IpSb->DefaultInterface->Configured =3D 1) } > Could you please help in where it is taking time to update the values. Thanks, Karunakar. -----Original Message----- From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com] Sent: Tuesday, April 18, 2017 1:44 PM To: Karunakar P; edk2-devel@lists.01.org Subject: RE: [edk2] The network interface configuration is taking some dela= y to update in DHCP case Hi Karunakar, With your reproduction Step 2, DHCP process will be triggered. Ip and Subn= etMask in IP service default interface will also be updated once the DHCP p= rocess finished. For detailed, you can check the Ip4Config2OnDhcp4Complete = -> Ip4Config2SetDefaultIf -> Ip4Config2SetDefaultAddr -> Ip4SetAddress.=20 So, before DHCP finished, Ip and SubnetMask should be always zero. Your o= bserved value may be printed during DHCP process. I suggest you change your print code as below: EFI_STATUS Ip4Config2ConvertConfigNvDataToIfrNvData ( IN IP4_CONFIG2_INSTANCE *Instance, IN OUT IP4_CONFIG2_IFR_NVDATA *IfrNvData ) { ... IpSb =3D IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance); if (IpSb->DefaultInterface->Configured) { IfrNvData->Configure =3D 1; } else { IfrNvData->Configure =3D 0; goto Exit; } + Print value of IpSb->DefaultInterface->Ip Print value of + IpSb->DefaultInterface->SubnetMask ... } Above print can ensure the Ip and SubnetMask is printed after DHCP finishe= d. Thanks, Jiaxin > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of=20 > Karunakar P > Sent: Tuesday, April 18, 2017 3:04 PM > To: edk2-devel@lists.01.org > Subject: [edk2] The network interface configuration is taking some=20 > delay to update in DHCP case >=20 > Hi All, >=20 > I've been facing an issue with IP4 SERVICE Default interface value. >=20 >=20 >=20 > [Reproduction Steps] > 1.Add trace messages to print the values of ip and SubnetMask in > Ip4FormExtractConfig() -> Ip4Config2ConvertConfigNvDataToIfrNvData() >=20 > EFI_STATUS > Ip4Config2ConvertConfigNvDataToIfrNvData ( > IN IP4_CONFIG2_INSTANCE *Instance, > IN OUT IP4_CONFIG2_IFR_NVDATA *IfrNvData > ) > { > ... > IpSb =3D IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance); >=20 > + Print value of IpSb->DefaultInterface->Ip Print value of=20 > + IpSb->DefaultInterface->SubnetMask >=20 > ... > } > 2. Assign ip to SUT using IPv4 Network Configuration page. > ( Enable Configured and Enable DHCP and Save Changes and Exit ) 3.=20 > reset the SUT once IP assigns >=20 > [Observation] >=20 > 1. On restart, Ip4FormExtractConfig() gets call and prints Ip and > SubnetMask values are 0. >=20 > 2. If add some delay before printing those values , then getting th= e proper > values > + add Delay some delay > + Print value of IpSb->DefaultInterface->Ip >=20 > + Print value of IpSb->DefaultInterface->SubnetMask >=20 > 3. In the case of Static Ip , printing proper values without giving= any delay. >=20 >=20 > Could you please help in where it is taking time to update the values=20 > in DHCP case. >=20 > Thanks, > Karunakar. > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel