From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on072a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::72a]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 141A41A1E30 for ; Mon, 15 Aug 2016 07:10:41 -0700 (PDT) Received: from AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM (10.162.138.25) by AT5PR84MB0292.NAMPRD84.PROD.OUTLOOK.COM (10.162.138.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Mon, 15 Aug 2016 14:10:36 +0000 Received: from AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM ([10.162.138.25]) by AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM ([10.162.138.25]) with mapi id 15.01.0549.027; Mon, 15 Aug 2016 14:10:36 +0000 From: "Cohen, Eugene" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" Thread-Topic: IP4 Config Troubles with DHCP Thread-Index: AdHzLtnEw2gfDCBbQ1OtxXknLLKMhQAabX6gANlk4IA= Date: Mon, 15 Aug 2016 14:10:36 +0000 Message-ID: References: <895558F6EA4E3B41AC93A00D163B7274137C5EF1@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <895558F6EA4E3B41AC93A00D163B7274137C5EF1@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=eugene@hp.com; x-originating-ip: [15.65.254.4] x-ms-office365-filtering-correlation-id: 658fa52f-aa66-4eac-7e6c-08d3c515ee07 x-microsoft-exchange-diagnostics: 1; AT5PR84MB0292; 6:6LigrGF6B54Y+7C8ZE9jFKe7kKwkJQybOFAEh2BBSHEHRChzOGJ0kkRu5lTJbCxAw6hAvsA6dpldFCMGJfmWYDjWcu744Raagi847nTNRauv8TXNqMgnLiYGwLu5XGI1A5Opiih/RYZ0c6Ye+tEhKh58MQZ7H/cxZliBoQAw6h4CiafeJRDvmGsMl6Bn/DDndsPPfmqMHpo+aYqGg3qmOWJvx5nrvQgiHfwYyFA1eWxe9QC2MX7doq/AtvckWrrQGilh9fWGCsSnLB0FtUoGgEQic3b5LwnY0EXNu1cCu24=; 5:+EQlvgYCugjck4FtR+7K6W05+a/8IGFG5cLNoGeU0XrlWnRq3Kg4xBwdQmGEzx6Vj9IGNVG6gruA7K8rxwmSr/H2S3QXVWTepXOj8/uDWrH1OJoUFdM26m7QjN9oo3QrN3D3IbfAwvJN4PRX9InOVw==; 24:4q9fyZqG33ZI/F8QmdpGaZGcWbvk8U+NMqVjVMUtWaJHnUW3/26exRJ3iVRFp7aVaBGoIIp3k5gLf2SCFxSEUqEVNYESulU5hy30phlnYg4=; 7:Qp95bQfaHNGPy0ukOVoRBRSFHFsILigO2RWM3lLl/BTwW+w3KhnJpPSU84ozABVBo4cF/pZgMbB6o4GnNdVjoBXrZGrNhqRFcETshte8WIh/r3z6yJemiIpLzq9H/c6Ch9gbJdSDvsBLpb5wOxNjjN4hSDMS/rjNEkuznarteiCIwS/6kdaM4IfTMq+cxXCUqrwNRBHMdaKHRHkQOMRiGwQrupNxxolDR/o2gM671H3sMWMFIXPAEhzYwRjIIpCo x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AT5PR84MB0292; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:AT5PR84MB0292; BCL:0; PCL:0; RULEID:; SRVR:AT5PR84MB0292; x-forefront-prvs: 0035B15214 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(199003)(189002)(6602003)(50986999)(54356999)(76176999)(3280700002)(87936001)(33656002)(105586002)(11100500001)(102836003)(86362001)(10400500002)(6116002)(101416001)(5002640100001)(106356001)(8676002)(99286002)(92566002)(2501003)(3846002)(9686002)(97736004)(68736007)(5001770100001)(81166006)(586003)(66066001)(189998001)(107886002)(2906002)(3660700001)(8936002)(81156014)(77096005)(2900100001)(74316002)(122556002)(7696003)(7846002)(7736002)(2950100001)(305945005)(19627235001); DIR:OUT; SFP:1102; SCL:1; SRVR:AT5PR84MB0292; H:AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: hp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Aug 2016 14:10:36.6033 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: ca7981a2-785a-463d-b82a-3db87dfc3ce6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR84MB0292 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: Mon, 15 Aug 2016 14:10:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Jiaxin, =20 > 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: >=20 > For example: > Status =3D Nlc->Udp4->Configure(Nlc->Udp4, &Nlc->UdpConfig); > if (EFI_ERROR (Status) && (Status !=3D EFI_NO_MAPPING)) { > return Status; > } > if (Status =3D=3D EFI_NO_MAPPING && !UdpGetMapping (Nlc->Udp4)) { > return Status; > } >=20 > In UdpGetMapping () function, create one timer to check > Ip4Mode.IsConfigured: >=20 > For example: > UdpGetMapping () { > IsMapDone =3D FALSE; > gBS->CreateEvent (EVT_TIMER, TPL_CALLBACK, NULL, NULL, > &TimeoutEvent); > gBS->SetTimer (TimeoutEvent, TimerRelative, AnyValue); > while (EFI_ERROR (gBS->CheckEvent (TimeoutEvent))) { > Udp4->Poll (Udp4); > Udp4->GetModeData (Udp4, &Udp4Mode, & Ip4Mode, NULL, > NULL); > if (Ip4Mode.IsConfigured) { > IsMapDone =3D TRUE; > break; > } > } > return IsMapDone; > } >=20 > If DHCP process succeed, Ip4Mode.IsConfigured should be updated. If > not, any bug may be existed. In testing the new patch (removing RECONFIG=3DTRUE) I see that the statemen= t you made above is not accurate when the protocol is TCP. When Configure = is called the first time it returns EFI_NO_MAPPING. This seems to be remem= bered in the socket state: ((Sock)->ConfigureState =3D=3D SO_NO_MAPPING) so= that any attempt to use the instance after Ip4Mode.IsConfigured goes TRUE = fails (like for a TCP4 Listen). So for TCP we must issue another Configure request to clean up this state s= o it's not as simple as just polling the GetModeData result, at least for T= CP. Do you believe this is expected behavior? Thanks, Eugene