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 6B3BA21DFA7AF for ; Wed, 19 Apr 2017 02:07:49 -0700 (PDT) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6BED782059; Wed, 19 Apr 2017 14:39:32 +0530 (IST) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55DB782055; Wed, 19 Apr 2017 14:39:32 +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 14:39:32 +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 14:37:46 +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+AAAJIRrQAAA1JBA= Date: Wed, 19 Apr 2017 09:07:45 +0000 Message-ID: References: <895558F6EA4E3B41AC93A00D163B7274162C1211@SHSMSX103.ccr.corp.intel.com> <895558F6EA4E3B41AC93A00D163B7274162C180F@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <895558F6EA4E3B41AC93A00D163B7274162C180F@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.006 X-TM-AS-Result: No--30.570-5.0-31-10 X-imss-scan-details: No--30.570-5.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1600-8.1.1062-23016.006 X-TMASE-Result: 10--30.570300-10.000000 X-TMASE-MatchedRID: 9d2LtCNB3NKajZkb8TuLcxHuQ9dDJbS2QPCWRE0Lo8K0rcU5V/oSexnH 32sG9jpsUe3h/Cx3s+EQw9gsnchuvSk9yXybJEtFlVHM/F6YkvSWesyrtKuK7U+9zmbCUeVF678 QLKEvGo6wZQgwnE6abwBPGSODgIkD6ouyw1YVSq+VSBCoZUyqbAvxMaV6x4s8Blt4RZwvTdUV2x 7wm0mP+lejryG5cgGj0cHShno1A0DR/1qlpYxoUlz+axQLnAVB7yWPaQc4INQv+dQaUS/A8hFlw JhVcSVOKaoljv5AVtdRM1UHAhnrmwDNPxu11HXjmlaAItiONP1GmTfcXy71qN9zZd3pUn7KUEAl sX5jhz9gJsS09yWFkVDdCtjs8+8sqApcv3Cmni9T46Ow+EhYONaXm/w1hfBOu/jTz8Y/keqXBZ/ v/hLIO5HrUF5JbA+7eqkB5HWl/Q8FCdq0JvYbZZ1U1lojafr/dZPoD9V2prSbKItl61J/yc8943 oc3p3sfPD5cPWJ9NcLbigRnpKlKT4yqD4LKu3A 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 09:07:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Jiaxin, In the case of Ip4FormExtractConfig() we are using 'IpSb->DefaultInterface-= >Configured' ,which is updated in Ip4Config2OnDhcp4Complete(). So if we call Extractconfig before this event getting Configured value as 0= and in setup Configured is disabled which is false. Thanks, karunakar -----Original Message----- From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com]=20 Sent: Wednesday, April 19, 2017 2:20 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, May I ask why you want to signal dhcp event before ExtractConfig? In my opi= nion, it doesn't matter to call ExtractConfig even dhcp is not finished. You know the dhcp MAY be failure, then event will never be called. Thanks, Jiaxin > -----Original Message----- > From: Karunakar P [mailto:karunakarp@amiindia.co.in] > Sent: Wednesday, April 19, 2017 12:36 PM > To: Wu, Jiaxin ; edk2-devel@lists.01.org > Subject: RE: [edk2] The network interface configuration is taking some=20 > delay to update in DHCP case >=20 > Hi Jiaxin, >=20 > I've found something related to this. >=20 > Ip4Config2OnDhcp4Complete() > Callback function when DHCP process finished. It will save the=20 > retrieved IP configure parameter from DHCP to the NVRam. Set the=20 > station address, subnetmask and gateway address for the default interface= . > And this function is taking some delay to Set the Address. If we add=20 > some delay by that time Ip4Config2OnDhcp4Complete() was done and=20 > printing the values 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=20 > we can Signal this event before ExtractConfig called. >=20 > Thanks, > Karunakar. >=20 > -----Original Message----- > From: Karunakar P > Sent: Tuesday, April 18, 2017 2:22 PM > To: 'Wu, Jiaxin' > Subject: RE: [edk2] The network interface configuration is taking some=20 > delay to update in DHCP case >=20 > Hi Jiaxin, >=20 > Thank you very much for your instant reply. I changed the print statement= s. >=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->Configured (Printed value is > +IpSb->DefaultInterface->Configured =3D 0) >=20 > if (IpSb->DefaultInterface->Configured) { > IfrNvData->Configure =3D 1; > } else { > IfrNvData->Configure =3D 0; > goto Exit; > } > + Print value of IpSb->DefaultInterface->Configured (Printed value is > + IpSb->DefaultInterface->Configured =3D 0) >=20 > ... > Exit: > +Print value of IpSb->DefaultInterface->Configured (Printed value is > +IpSb->DefaultInterface->Configured =3D 0) > } >=20 > [Observation] > 1. IpSb->DefaultInterface->Configured itself getting as 0. > 2. If add some delay before print, then it is printing as 1=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 > + Add some delay > +Print value of IpSb->DefaultInterface->Configured (Printed value is > +IpSb->DefaultInterface->Configured =3D 1) >=20 > if (IpSb->DefaultInterface->Configured) { > IfrNvData->Configure =3D 1; > } else { > IfrNvData->Configure =3D 0; > goto Exit; > } > + Print value of IpSb->DefaultInterface->Configured (Printed value is > + IpSb->DefaultInterface->Configured =3D 1) >=20 > ... > Exit: > +Print value of IpSb->DefaultInterface->Configured (Printed value is > +IpSb->DefaultInterface->Configured =3D 1) > } >=20 > > Could you please help in where it is taking time to update the values. >=20 > Thanks, > Karunakar. >=20 > -----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=20 > delay to update in DHCP case >=20 > Hi Karunakar, >=20 > With your reproduction Step 2, DHCP process will be triggered. Ip and=20 > SubnetMask in IP service default interface will also be updated once=20 > the DHCP process finished. For detailed, you can check the=20 > Ip4Config2OnDhcp4Complete -> Ip4Config2SetDefaultIf ->=20 > Ip4Config2SetDefaultAddr -> Ip4SetAddress. >=20 > So, before DHCP finished, Ip and SubnetMask should be always zero. =20 > Your observed value may be printed during DHCP process. >=20 > I suggest you change your print code as below: >=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 > if (IpSb->DefaultInterface->Configured) { > IfrNvData->Configure =3D 1; > } else { > IfrNvData->Configure =3D 0; > goto Exit; > } >=20 > + Print value of IpSb->DefaultInterface->Ip Print value of > + IpSb->DefaultInterface->SubnetMask >=20 > ... > } >=20 > Above print can ensure the Ip and SubnetMask is printed after DHCP=20 > finished. >=20 > Thanks, > Jiaxin >=20 >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf=20 > > Of 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 > > > > Hi All, > > > > I've been facing an issue with IP4 SERVICE Default interface value. > > > > > > > > [Reproduction Steps] > > 1.Add trace messages to print the values of ip and SubnetMask in > > Ip4FormExtractConfig() -> Ip4Config2ConvertConfigNvDataToIfrNvData() > > > > 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->Ip Print value of > > + IpSb->DefaultInterface->SubnetMask > > > > ... > > } > > 2. Assign ip to SUT using IPv4 Network Configuration page. > > ( Enable Configured and Enable DHCP and Save Changes and Exit ) 3. > > reset the SUT once IP assigns > > > > [Observation] > > > > 1. On restart, Ip4FormExtractConfig() gets call and prints Ip and > > SubnetMask values are 0. > > > > 2. If add some delay before printing those values , then getting = the > proper > > values > > + add Delay some delay > > + Print value of IpSb->DefaultInterface->Ip > > > > + Print value of IpSb->DefaultInterface->SubnetMask > > > > 3. In the case of Static Ip , printing proper values without givi= ng any delay. > > > > > > Could you please help in where it is taking time to update the=20 > > values in DHCP case. > > > > Thanks, > > Karunakar. > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel