From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 B6DAE2195409E for ; Wed, 19 Apr 2017 01:50:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2017 01:50:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,220,1488873600"; d="scan'208";a="76163349" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 19 Apr 2017 01:50:00 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 19 Apr 2017 01:50:00 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.217]) with mapi id 14.03.0319.002; Wed, 19 Apr 2017 16:49:58 +0800 From: "Wu, Jiaxin" To: Karunakar P , "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+AAAJIRrQ Date: Wed, 19 Apr 2017 08:49:58 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162C180F@SHSMSX103.ccr.corp.intel.com> References: <895558F6EA4E3B41AC93A00D163B7274162C1211@SHSMSX103.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2RiMmMyNWYtMWUzZi00Mzg2LTgzMjUtNzVlNjRlOTNlZTNkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InFvQTY5bUlSNjU2a2ZTUysxRjJKaWFCbDJhNmdIK3RLd3BsS1ZhN2M1Uzg9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.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 08:50:02 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 de= lay > 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 retrieved = IP > configure parameter from DHCP to the NVRam. Set the station address, > subnetmask and gateway address for the default interface. > And this function is taking some delay to Set the Address. If we add some > delay by that time Ip4Config2OnDhcp4Complete() was done and printing the > values are correct. If print the values before this function we are getti= ng 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. >=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 de= lay > 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 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 de= lay > to update in DHCP case >=20 > Hi Karunakar, >=20 > With your reproduction Step 2, DHCP process will be triggered. Ip and > SubnetMask in IP service default interface will also be updated once the > DHCP process finished. For detailed, you can check the > Ip4Config2OnDhcp4Complete -> Ip4Config2SetDefaultIf -> > Ip4Config2SetDefaultAddr -> Ip4SetAddress. >=20 > So, before DHCP finished, Ip and SubnetMask should be always zero. 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 > finished. >=20 > Thanks, > Jiaxin >=20 >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 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 > > 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 values > > in DHCP case. > > > > Thanks, > > Karunakar. > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel