From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=203.199.198.232; helo=imsva.in.megatrends.com; envelope-from=karunakarp@amiindia.co.in; receiver=edk2-devel@lists.01.org Received: from IMSVA.IN.MEGATRENDS.COM (Webmail.amiindia.co.in [203.199.198.232]) (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 635B1220D4C1E for ; Thu, 30 Nov 2017 22:01:05 -0800 (PST) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA16482055; Fri, 1 Dec 2017 11:38:38 +0530 (IST) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 927918204A; Fri, 1 Dec 2017 11:38:38 +0530 (IST) Received: from webmail.amiindia.co.in (venus2.in.megatrends.com [10.0.0.7]) by IMSVA.IN.MEGATRENDS.COM (Postfix) with ESMTPS; Fri, 1 Dec 2017 11:38:38 +0530 (IST) Received: from VENUS1.in.megatrends.com ([fe80::951:7975:6ecf:eae5]) by Venus2.in.megatrends.com ([fe80::2002:4a07:4f17:c09b%14]) with mapi id 14.03.0248.002; Fri, 1 Dec 2017 11:35:27 +0530 From: Karunakar P To: "'Wu, Jiaxin'" , "'Richardson, Brian'" , "'Fu, Siyuan'" , "'Ye, Ting'" , "'edk2-devel@lists.01.org'" Thread-Topic: DHCP Process Starts Even there is NO Media Connected Thread-Index: AdNkNPJlNii6MXEqST2sZcqbh3p1FwDG32fwAELhS7AAH1I1YAAyTPpQABG0g5AAGg9/MAAE4ZbAAAB6MxA= Date: Fri, 1 Dec 2017 06:05:26 +0000 Message-ID: References: <895558F6EA4E3B41AC93A00D163B72741634DAB3@SHSMSX103.ccr.corp.intel.com> <80AC2BAA3152784F98F581129E5CF5AFA464ACA2@ORSMSX114.amr.corp.intel.com> <895558F6EA4E3B41AC93A00D163B72741634EB13@SHSMSX103.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.84.111] MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-ERS: 10.0.0.7-127.5.254.15 X-TM-AS-Product-Ver: IMSVA-9.1.0.1600-8.1.0.1062-23502.005 X-TM-AS-Result: No--33.971-5.0-31-10 X-imss-scan-details: No--33.971-5.0-31-10;No--33.971-5.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1600-8.1.1062-23502.005 X-TMASE-Result: 10--33.970800-10.000000 X-TMASE-MatchedRID: gTucSmrmRMNjDV//SvkH3sWUKBjERoYTIbjEuSzHeHEuw3l/UI9XFIzR Exx/TfU2l9TnxG8reCrbRWL1TLGss6ZY4PxfRMWEq32frrMnhEg0/29w5F8SIuNefxb6LkkE4+n 0olV+QL8xcSfgz4Zxa1xBgG7mg/Dl7K35r0y1/55IRA38P/dwbri8G4TZfQeVSO2IbIklM8yJ3W zA/yW2VZ3rxLdqdhQhAH/xyJs7whjAMc4DG+NLU5mug812qIbzU+A7YkpDJ1g/UMyEuSqBgatYX NbyT8atQJNXO57v1xSDd0ZJAeWFIKNIk/buktXgY1bQMCMvmn5XLUapz6y7gdKBqnreoHKhcg0M pz1WffR10vM1jY23Ym2FsO0giCTzQKbqzl//zc0S7luGt6tlhl3KZkFy4YZEmHy7uaiMrL7qZZd BO51ZFwzW4ChLfVzz/a72mfy2ZDtdInhzedP5B5VIEKhlTKpsjoRIaAJe+CjC9DxHKrnk8hzXue N0Y75lkEESJwdDJ59HHNzY0StLUNzH3tllVlwyQpxiLlDD9FUhauGyjTkf9TnKpbGL4ChVu4tTC 8CkIPL19jxu4zCbWw3C3rAw9WJhbboYgHrsZfKyntSjDrb64S6GDroi1vrlT73OZsJR5UUMfL25 j9g990EOolQot58QaNh2+fJNcd9/joQtSekNLJ4CIKY/Hg3ANmydw0+ZpaSm8jxRk5/juBzhYvk mN3zwjaPj0W1qn0SQZS2ujCtcuA== X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0,39:0-0 Subject: Re: DHCP Process Starts Even there is NO Media Connected 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: Fri, 01 Dec 2017 06:01:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please review the patch [Patch] MdeModulePkg/Universal/Network/Dhcp4Dxe: Implantation of handling E= FI_NO_MEDIA status code for DHCP4/6.Start() NetworkPkg/Dhcp6Dxe : Implantation of handling EFI_NO_MEDIA status code fo= r DHCP4/6.Start() MdeModulePkg/Universal/Network/Dhcp4Dxe/ Dhcp4Impl.c | 11 NetworkPkg/Dhcp6Dxe/ Dhcp6Impl.c | 11 2 files changed, 22 insertions(+) a. MdeModulePkg/Universal/Network/Dhcp4Dxe/ Dhcp4Impl.c b. NetworkPkg/Dhcp6Dxe/ Dhcp6Impl.c a@ EfiDhcp4Start ( IN EFI_DHCP4_PROTOCOL *This, IN EFI_EVENT CompletionEvent OPTIONAL ) { DHCP_PROTOCOL *Instance; DHCP_SERVICE *DhcpSb; EFI_STATUS Status; EFI_TPL OldTpl; + BOOLEAN MediaPresent; . . . OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); DhcpSb =3D Instance->Service; =20 + // + // Check media status before DHCP Start. + // + MediaPresent =3D TRUE; + NetLibDetectMedia (DhcpSb->Controller, &MediaPresent); + if (!MediaPresent) { + Status =3D EFI_NO_MEDIA; + DEBUG((DEBUG_ERROR,"\nIn EfiDhcp4Start MediaPresent Status =3D %r\n",Sta= tus)); + goto ON_ERROR; + } if (DhcpSb->DhcpState =3D=3D Dhcp4Stopped) { Status =3D EFI_NOT_STARTED; goto ON_ERROR; } . . . } b @ EfiDhcp6Start ( IN EFI_DHCP6_PROTOCOL *This ) { EFI_STATUS Status; EFI_TPL OldTpl; DHCP6_INSTANCE *Instance; DHCP6_SERVICE *Service; + BOOLEAN MediaPresent; . . . OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); Instance->UdpSts =3D EFI_ALREADY_STARTED; + // + // Check media status before DHCP Start. + // + MediaPresent =3D TRUE; + NetLibDetectMedia (Service->Controller, &MediaPresent); + if (!MediaPresent) { + Status =3D EFI_NO_MEDIA; + DEBUG((DEBUG_ERROR,"\nIn EfiDhcp6Start MediaPresent Status =3D %r\n",= Status)); + goto ON_ERROR; + } =20 // // Send the solicit message to start S.A.R.R process. // Status =3D Dhcp6SendSolicitMsg (Instance); . . . } Thanks, Karunakar -----Original Message----- From: Karunakar P=20 Sent: Friday, December 01, 2017 11:10 AM To: 'Wu, Jiaxin'; Richardson, Brian; Fu, Siyuan; Ye, Ting; 'edk2-devel@list= s.01.org' Subject: RE: DHCP Process Starts Even there is NO Media Connected Hi Jiaxin, I've updated the patch changes for Dhcp6Dxe driver also and attached the sa= me for review. Filed a tracker in TianoCore Bugzilla for this issue and attached the chang= es for review, https://bugzilla.tianocore.org/show_bug.cgi?id=3D804 Thanks, Karunakar -----Original Message----- From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com] Sent: Friday, December 01, 2017 9:15 AM To: Richardson, Brian; Karunakar P; Fu, Siyuan; Ye, Ting; 'edk2-devel@lists= .01.org' Subject: RE: DHCP Process Starts Even there is NO Media Connected Hi Karunakar, Per your question #3.c, I think it's *unreasonable* to check Media Status f= or EFI_IP4_CONFIG2_SET_DATA.=20 Even there is no media connected, we still need to set the data instead of = return directly. If the EFI_IP4_CONFIG2_SET_DATA.SetData() is to set the DH= CP policy, the SetData() interface will try to do the DHCP process to get o= ne valid default address, but if there is any failure happen in DHCP proces= s (e.g. no media connected), we should continue change the policy to DHCP a= nd return EFI_SUCCESS, which align with static policy. So, I don't prefer t= o check the Media Status in EFI_IP4_CONFIG2_SET_DATA.SetData().=20 I have reviewed your patch, the Dhcp4Dxe update is good to me. Can you send= out the formal patch to the EDK2 community for the review or need us do to= that? Note: don't forget to update the Dhcp6Dxe driver.=20 Also thanks Brain's reminder, please file a tracker in TianoCore Bugzilla f= or this issue. Thanks, Jiaxin > -----Original Message----- > From: Richardson, Brian > Sent: Thursday, November 30, 2017 11:02 PM > To: Karunakar P ; Wu, Jiaxin=20 > ; Fu, Siyuan ; Ye, Ting=20 > ; 'edk2-devel@lists.01.org' > > Subject: RE: DHCP Process Starts Even there is NO Media Connected >=20 > We saw some problems running Linux UEFI Validation (LUV) at the last=20 > UEFI Plugfest that are probably related to this issue. At the time we=20 > asked the LUV team to investigate it as a test issue, but it may=20 > actually be a stack problem based on this information. >=20 > Have you filed a tracker in TianoCore Bugzilla for this issue? >=20 > Thanks ... br > --- > Brian Richardson, Senior Technical Marketing Engineer, Intel Software=20 > brian.richardson@intel.com -- @intel_brian (Twitter & WeChat)=20 > https://software.intel.com/en-us/meet-the-developers/evangelists/team/ > brian- > richardson >=20 > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of=20 > Karunakar P > Sent: Thursday, November 30, 2017 3:59 AM > To: Wu, Jiaxin ; Fu, Siyuan=20 > ; Ye, Ting ;=20 > 'edk2-devel@lists.01.org' > Subject: Re: [edk2] DHCP Process Starts Even there is NO Media=20 > Connected >=20 > Hi Jiaxin, >=20 > Please find my below comments/suggestions. >=20 >=20 > 1. Yes, Current DHCP4/6 Start() implementation doesn't check for Me= dia > Status. It will be better to implement it in order to sync with UEFI spec= . >=20 > 2. DHCP process may be initiated by HTTP/PXE/ISCSI or Assigning IP > (SetData) from Shell or using BIOS setup page. >=20 > HTTP,PXE and ISCSI is already Checking Media Presence before DHCP=20 > Start, So it will have NO effect if we do implementation in DHCP4/6 Start= (). >=20 > 3. Current implementation of EFI_IP4_CONFIG2_SET_DATA, also NOT > handling checking Media Status. >=20 > a. UEFI Spec NOT defines EFI_NO_MEDIA status code for > EFI_IP4_CONFIG2_SET_DATA, I'm NOT sure what's reason behind it or=20 > might be missing. >=20 > b. UEFI Spec defines EFI_DEVICE_ERROR status code for > EFI_IP4_CONFIG2_SET_DATA, If we can use the same status for Media=20 > presence then no issues. >=20 > c. When there is No Media connected and if we try to assign IP over > DHCP(SetData), I guess there is no need to proceed further in=20 > EfiIp4Config2SetData and we can return with EFI_DEVICE_ERROR. >=20 > Based on above points(1 & 3.c ), I've updated the suggested changes=20 > and attached the same (CheckMediaStatus_V2.rar) >=20 > Could you please review and provide your comments. > Please correct if anything wrong. >=20 > Thank You, > Karunakar >=20 > From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com] > Sent: Wednesday, November 29, 2017 11:57 AM > To: Karunakar P; Fu, Siyuan; Ye, Ting > Subject: RE: DHCP Process Starts Even there is NO Media Connected >=20 > Hi Karunakar, >=20 > After talk with Siyuan, we agree it's reasonable to check the Media=20 > status before starting DHCP process, but we'd better check it in DHCP=20 > layer since the UEFI spec defines EFI_NO_MEDIA status code for=20 > DHCP4/6.Start(), but our current implementation doesn't check it. >=20 > What do you think? >=20 > Thanks, > Jiaxin >=20 >=20 >=20 > From: Karunakar P [mailto:karunakarp@amiindia.co.in] > Sent: Tuesday, November 28, 2017 11:18 PM > To: Wu, Jiaxin >; Fu,=20 > Siyuan >; Ye, Ting=20 > > > Subject: RE: DHCP Process Starts Even there is NO Media Connected >=20 > Could you please review the attachment changes for this support. >=20 > Thanks, > Karunakar >=20 > From: Karunakar P > Sent: Monday, November 27, 2017 12:53 PM > To: 'Wu, Jiaxin'; 'Fu, Siyuan'; 'Ye, Ting' > Subject: RE: DHCP Process Starts Even there is NO Media Connected >=20 > Could you please provide your comments... >=20 > Thank You, > Karunakar >=20 > From: Karunakar P > Sent: Thursday, November 23, 2017 2:05 PM > To: 'Wu, Jiaxin'; Fu, Siyuan; Ye, Ting > Subject: DHCP Process Starts Even there is NO Media Connected >=20 > Hello All, >=20 > When we try to Assign IP to SUT using ifconfig command from Shell or > IPv4 Network Configuration BIOS setup page DHCP process start even=20 > there is no LAN cable connected to specific port. >=20 > Can we add a Media presence condition check before starting DHCP service? >=20 > Could you please correct if anything is wrong. >=20 > Thanks, > Karunakar > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel