From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ml01.01.org (Postfix) with ESMTP id 0E2FC1A1DFE for ; Fri, 12 Aug 2016 01:27:51 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 12 Aug 2016 01:27:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,509,1464678000"; d="scan'208";a="154698399" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 12 Aug 2016 01:27:48 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 12 Aug 2016 01:27:46 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 12 Aug 2016 01:27:46 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by shsmsx102.ccr.corp.intel.com ([169.254.2.147]) with mapi id 14.03.0248.002; Fri, 12 Aug 2016 16:27:44 +0800 From: "Wu, Jiaxin" To: "Cohen, Eugene" , "edk2-devel@lists.01.org" Thread-Topic: IP4 Config Troubles with DHCP Thread-Index: AdHzLtnEw2gfDCBbQ1OtxXknLLKMhQAabX6gABD3ncAAFJsNEAAP+m4g Date: Fri, 12 Aug 2016 08:27:43 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274137C65C5@SHSMSX103.ccr.corp.intel.com> References: <895558F6EA4E3B41AC93A00D163B7274137C5EF1@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjM1ZjVhM2QtMDcyYS00OGViLTllYjEtZGY5Mzk2MDBhMGZjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlNJVFpmYzJzcG9PKzV2YVh2V2Y0eTZYeFJSNSs5OEVPU1hhOWQ1U0c4MlU9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: IP4 Config Troubles with DHCP X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2016 08:27:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Eugene, I can reproduce the issue now. And root cause as below: #1. Set policy to DHCP. =20 #2. If DHCP process is not complete yet, then run one App to invoke the UDP= 4 Configure with "UseDefaultAddress =3D TRUE" (loop to keep calling Udp4->C= onfigure until Ip4Mode.IsConfigured changes to TRUE) #3. Even DHCP succeed but Ip4Mode.IsConfigured flag never set to TRUE -= --- failure here!!! In step1, the policy will be set to DHCP, and then Ip4Config2OnPolicyChange= d() will be called. In this function, "IpSb->Reconfig" flag will be set to = TRUE before Ip4StartAutoConfig() called. That means the original "IpSb->Def= aultInterface" will be abandoned/freed once this DHCP process finished. Det= ailed see Ip4Config2SetDefaultAddr() function.=20 In step2, UDP4 Configure with "UseDefaultAddress =3D TRUE" is called, that = means the default interface (IpSb->DefaultInterface) will be selected as cu= rrent instance's interface. Detailed see Ip4ConfigProtocol() function. In step3, When DHCP process finished, as I said in step1, the original "IpS= b->DefaultInterface" will be abandoned/freed because "IpSb->Reconfig" flag = is true. Meanwhile, one new interface is assigned to "IpSb->DefaultInterfac= e". This "IpSb->DefaultInterface" is different to the original one assigned= to the UDP4 Configured instance. So, even DHCP process succeed, the up cal= ler will never have the chance to get it's truly status.=20 I will send one patch to fix this issue later. Thanks your reporting. Best Regards! Jiaxin=20 > -----Original Message----- > From: Wu, Jiaxin > Sent: Friday, August 12, 2016 8:20 AM > To: Cohen, Eugene ; edk2-devel@lists.01.org > Subject: RE: IP4 Config Troubles with DHCP >=20 > Thanks Eugene, I will try to reproduce the issue and dig it out. Any proc= ess will > inform you. >=20 > Best Regards! > Jiaxin >=20 > > -----Original Message----- > > From: Cohen, Eugene [mailto:eugene@hp.com] > > Sent: Thursday, August 11, 2016 10:31 PM > > To: Wu, Jiaxin ; edk2-devel@lists.01.org > > Subject: RE: IP4 Config Troubles with DHCP > > > > Jianxin, > > > > > I want to confirm with you the steps to reproduce the issue: > > > > > > 1. Set policy to DHCP. > > > 2. If DHCP process is not complete yet, then run one App to invoke > > > the > > > UDP4 Configure with "UseDefaultAddress =3D TRUE" (loop to keep callin= g > > > Udp4->Configure until Ip4Mode.IsConfigured changes to TRUE) > > > 3. Even DHCP succeed but Ip4Mode.IsConfigured flag never set to > > > TRUE ---- failure here!!! > > > > > > Above steps right? > > > > Yes, that summarizes it well. > > > > > Actually, you don't need to retry the UDP configuration loop > > > according the Ip4Mode.IsConfigured flag. You are only recommended to > > > set a timer to check the mapping status after the configuration: > > > > This is exactly what we used to do. Recently it stopped working which > > is why we now have to re-do service binding creation and configuration. > > > > > If DHCP process succeed, Ip4Mode.IsConfigured should be updated. If > > > not, any bug may be existed. > > > > From the traces I've looked at I can clearly see that the DHCP process > > as finished (lease acquired) and that Ip4Mode.IsConfigured is still > > FALSE. I'll send you a detailed trace of this separately. > > > > So yes, I think there is a bug that crept in. > > > > Eugene