From: Karunakar P <karunakarp@amiindia.co.in>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: The network interface configuration is taking some delay to update in DHCP case
Date: Wed, 19 Apr 2017 04:35:53 +0000 [thread overview]
Message-ID: <A885E3F3F1F22B44AF7CC779C062228E7C2877B5@Venus2.in.megatrends.com> (raw)
In-Reply-To: 895558F6EA4E3B41AC93A00D163B7274162C1211@SHSMSX103.ccr.corp.intel.com
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 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 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 statements.
EFI_STATUS
Ip4Config2ConvertConfigNvDataToIfrNvData (
IN IP4_CONFIG2_INSTANCE *Instance,
IN OUT IP4_CONFIG2_IFR_NVDATA *IfrNvData
)
{
...
IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
+Print value of IpSb->DefaultInterface->Configured (Printed value is
+IpSb->DefaultInterface->Configured = 0)
if (IpSb->DefaultInterface->Configured) {
IfrNvData->Configure = 1;
} else {
IfrNvData->Configure = 0;
goto Exit;
}
+ Print value of IpSb->DefaultInterface->Configured (Printed value is
+ IpSb->DefaultInterface->Configured = 0)
...
Exit:
+Print value of IpSb->DefaultInterface->Configured (Printed value is
+IpSb->DefaultInterface->Configured = 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 = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
+ Add some delay
+Print value of IpSb->DefaultInterface->Configured (Printed value is
+IpSb->DefaultInterface->Configured = 1)
if (IpSb->DefaultInterface->Configured) {
IfrNvData->Configure = 1;
} else {
IfrNvData->Configure = 0;
goto Exit;
}
+ Print value of IpSb->DefaultInterface->Configured (Printed value is
+ IpSb->DefaultInterface->Configured = 1)
...
Exit:
+Print value of IpSb->DefaultInterface->Configured (Printed value is
+IpSb->DefaultInterface->Configured = 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 = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
if (IpSb->DefaultInterface->Configured) {
IfrNvData->Configure = 1;
} else {
IfrNvData->Configure = 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 = 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 giving 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
next prev parent reply other threads:[~2017-04-19 4:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 7:03 The network interface configuration is taking some delay to update in DHCP case Karunakar P
2017-04-18 8:13 ` Wu, Jiaxin
2017-04-19 4:35 ` Karunakar P [this message]
2017-04-19 8:49 ` Wu, Jiaxin
2017-04-19 9:07 ` Karunakar P
2017-04-20 0:52 ` Wu, Jiaxin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A885E3F3F1F22B44AF7CC779C062228E7C2877B5@Venus2.in.megatrends.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox