From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 833E321954098 for ; Wed, 19 Apr 2017 17:52:41 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2017 17:52:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,222,1488873600"; d="scan'208,217";a="958958217" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 19 Apr 2017 17:52:40 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 19 Apr 2017 17:52:40 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 19 Apr 2017 17:52:39 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Thu, 20 Apr 2017 08:52:37 +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+AAAJIRrQAAA1JBAAIVv8gA== Date: Thu, 20 Apr 2017 00:52:36 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162C1A6F@SHSMSX103.ccr.corp.intel.com> References: <895558F6EA4E3B41AC93A00D163B7274162C1211@SHSMSX103.ccr.corp.intel.com> <895558F6EA4E3B41AC93A00D163B7274162C180F@SHSMSX103.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTA1YzJkMjYtMTg3Zi00ZDk4LWE0OWYtNTIwYjg4ZGU2YTlmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlwvUlJ3SFQrNGN3RWtWRHdSNUROcXVFZHBtdWJlYXFuR044KzBQOU9nWWJVPSJ9 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 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 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: Thu, 20 Apr 2017 00:52:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Karunakar, Extractconfig is used to request the current configuration and update it to= the IFR data. It reflects the current configuration status. we can't assum= e the default interface must be configured. Thanks, Jiaxin > -----Original Message----- > From: Karunakar P [mailto:karunakarp@amiindia.co.in] > Sent: Wednesday, April 19, 2017 5:08 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 > > Hi Jiaxin, > > In the case of Ip4FormExtractConfig() we are using 'IpSb->DefaultInterfac= e- > >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] > 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 de= lay > to update in DHCP case > > Hi Karunakar, > > May I ask why you want to signal dhcp event before ExtractConfig? In my > opinion, it doesn't matter to call ExtractConfig even dhcp is not finishe= d. > > 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 > > delay to update in DHCP case > > > > 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, subnetmask and gateway address for the default interfa= ce. > > 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 functi= on we > are getting as 0. > > > > Could you please suggest anything that we can overcome this delay or > > we can Signal this event before ExtractConfig called. > > > > Thanks, > > Karunakar. > > > > -----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 > > delay to update in DHCP case > > > > Hi Jiaxin, > > > > Thank you very much for your instant reply. I changed the print stateme= nts. > > > > 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 > > +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 > > + IpSb->DefaultInterface->Configured =3D 0) > > > > ... > > Exit: > > +Print value of IpSb->DefaultInterface->Configured (Printed value is > > +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 Ip4Config2ConvertConfigNvDataToIfrNvData ( > > 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 > > +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 > > + IpSb->DefaultInterface->Configured =3D 1) > > > > ... > > Exit: > > +Print value of IpSb->DefaultInterface->Configured (Printed value is > > +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 > > delay to update in DHCP case > > > > Hi Karunakar, > > > > 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. > > > > So, before DHCP finished, Ip and SubnetMask should be always zero. > > Your observed 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 > > finished. > > > > Thanks, > > Jiaxin > > > > > > > -----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 a= nd > > > SubnetMask values are 0. > > > > > > 2. If add some delay before printing those values , then gettin= g 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 gi= ving 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