From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 4BA75220D4C1E for ; Fri, 1 Dec 2017 00:33:33 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2017 00:37:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,344,1508828400"; d="scan'208,223";a="182334243" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 01 Dec 2017 00:37:59 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 1 Dec 2017 00:37:59 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 1 Dec 2017 00:37:59 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Fri, 1 Dec 2017 16:37:56 +0800 From: "Wu, Jiaxin" To: Karunakar P , "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/MAAE4ZbAAAB6MxAABgkDMA== Date: Fri, 1 Dec 2017 08:37:57 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B72741634EC46@SHSMSX103.ccr.corp.intel.com> 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-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTVmYTI0NjAtM2E0MS00OWRlLThlMWQtNjg2YjVhMmZkYTIzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InNGbm56ZUJwalIrRXVaVnd5d1NzRFl6MWJQTlRIOVNVVHdOZmVjTUk5cmc9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 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: 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 08:33:34 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Karunakar, we suggest you create the patches as attached files. Then= you can send it to 'edk2-devel@lists.01.org' directly with GIT command:): git send-email xxx.patch xxx.patch xxx.patch --to=3Dedk2-devel@lists.01.or= g --force Thanks, Jiaxin > -----Original Message----- > From: Karunakar P [mailto:karunakarp@amiindia.co.in] > Sent: Friday, December 1, 2017 2:05 PM > To: Wu, Jiaxin ; Richardson, Brian > ; Fu, Siyuan ; Ye, Ting > ; 'edk2-devel@lists.01.org' > Subject: RE: DHCP Process Starts Even there is NO Media Connected >=20 > Please review the patch >=20 > [Patch] MdeModulePkg/Universal/Network/Dhcp4Dxe: Implantation of > handling EFI_NO_MEDIA status code for DHCP4/6.Start() > NetworkPkg/Dhcp6Dxe : Implantation of handling EFI_NO_MEDIA status > code for DHCP4/6.Start() >=20 > MdeModulePkg/Universal/Network/Dhcp4Dxe/ Dhcp4Impl.c | 11 > NetworkPkg/Dhcp6Dxe/ Dhcp6Impl.c | 11 > 2 files changed, 22 insertions(+) >=20 > a. MdeModulePkg/Universal/Network/Dhcp4Dxe/ Dhcp4Impl.c > b. NetworkPkg/Dhcp6Dxe/ Dhcp6Impl.c >=20 >=20 > 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",Status)); > + goto ON_ERROR; > + } >=20 > if (DhcpSb->DhcpState =3D=3D Dhcp4Stopped) { > Status =3D EFI_NOT_STARTED; > goto ON_ERROR; > } > . > . > . > } >=20 >=20 > 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; >=20 > + // > + // 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); > . > . > . > } >=20 >=20 > Thanks, > Karunakar >=20 > -----Original Message----- > From: Karunakar P > Sent: Friday, December 01, 2017 11:10 AM > To: 'Wu, Jiaxin'; Richardson, Brian; Fu, Siyuan; Ye, Ting; 'edk2- > devel@lists.01.org' > Subject: RE: DHCP Process Starts Even there is NO Media Connected >=20 > Hi Jiaxin, >=20 > I've updated the patch changes for Dhcp6Dxe driver also and attached the > same for review. >=20 > Filed a tracker in TianoCore Bugzilla for this issue and attached the cha= nges > for review, > https://bugzilla.tianocore.org/show_bug.cgi?id=3D804 >=20 > Thanks, > Karunakar >=20 > -----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 >=20 > Hi Karunakar, >=20 > Per your question #3.c, I think it's *unreasonable* to check Media Status= for > EFI_IP4_CONFIG2_SET_DATA. >=20 > Even there is no media connected, we still need to set the data instead o= f > return directly. If the EFI_IP4_CONFIG2_SET_DATA.SetData() is to set the > DHCP policy, the SetData() interface will try to do the DHCP process to g= et > one valid default address, but if there is any failure happen in DHCP pro= cess > (e.g. no media connected), we should continue change the policy to DHCP > and return EFI_SUCCESS, which align with static policy. So, I don't prefe= r to > 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= for > this issue. >=20 > Thanks, > Jiaxin >=20 > > -----Original Message----- > > From: Richardson, Brian > > Sent: Thursday, November 30, 2017 11:02 PM > > To: Karunakar P ; Wu, Jiaxin > > ; Fu, Siyuan ; Ye, Ting > > ; 'edk2-devel@lists.01.org' > > > > Subject: RE: DHCP Process Starts Even there is NO Media Connected > > > > We saw some problems running Linux UEFI Validation (LUV) at the last > > UEFI Plugfest that are probably related to this issue. At the time we > > asked the LUV team to investigate it as a test issue, but it may > > actually be a stack problem based on this information. > > > > Have you filed a tracker in TianoCore Bugzilla for this issue? > > > > Thanks ... br > > --- > > Brian Richardson, Senior Technical Marketing Engineer, Intel Software > > brian.richardson@intel.com -- @intel_brian (Twitter & WeChat) > > https://software.intel.com/en-us/meet-the- > developers/evangelists/team/ > > brian- > > richardson > > > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Karunakar P > > Sent: Thursday, November 30, 2017 3:59 AM > > To: Wu, Jiaxin ; Fu, Siyuan > > ; Ye, Ting ; > > 'edk2-devel@lists.01.org' > > Subject: Re: [edk2] DHCP Process Starts Even there is NO Media > > Connected > > > > Hi Jiaxin, > > > > Please find my below comments/suggestions. > > > > > > 1. Yes, Current DHCP4/6 Start() implementation doesn't check for = Media > > Status. It will be better to implement it in order to sync with UEFI sp= ec. > > > > 2. DHCP process may be initiated by HTTP/PXE/ISCSI or Assigning I= P > > (SetData) from Shell or using BIOS setup page. > > > > HTTP,PXE and ISCSI is already Checking Media Presence before DHCP > > Start, So it will have NO effect if we do implementation in DHCP4/6 Sta= rt(). > > > > 3. Current implementation of EFI_IP4_CONFIG2_SET_DATA, also NOT > > handling checking Media Status. > > > > 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 > > might be missing. > > > > b. UEFI Spec defines EFI_DEVICE_ERROR status code for > > EFI_IP4_CONFIG2_SET_DATA, If we can use the same status for Media > > presence then no issues. > > > > c. When there is No Media connected and if we try to assign IP ov= er > > DHCP(SetData), I guess there is no need to proceed further in > > EfiIp4Config2SetData and we can return with EFI_DEVICE_ERROR. > > > > Based on above points(1 & 3.c ), I've updated the suggested changes > > and attached the same (CheckMediaStatus_V2.rar) > > > > Could you please review and provide your comments. > > Please correct if anything wrong. > > > > Thank You, > > Karunakar > > > > 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 > > > > Hi Karunakar, > > > > After talk with Siyuan, we agree it's reasonable to check the Media > > status before starting DHCP process, but we'd better check it in DHCP > > layer since the UEFI spec defines EFI_NO_MEDIA status code for > > DHCP4/6.Start(), but our current implementation doesn't check it. > > > > What do you think? > > > > Thanks, > > Jiaxin > > > > > > > > From: Karunakar P [mailto:karunakarp@amiindia.co.in] > > Sent: Tuesday, November 28, 2017 11:18 PM > > To: Wu, Jiaxin >; Fu, > > Siyuan >; Ye, Ting > > > > > Subject: RE: DHCP Process Starts Even there is NO Media Connected > > > > Could you please review the attachment changes for this support. > > > > Thanks, > > Karunakar > > > > 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 > > > > Could you please provide your comments... > > > > Thank You, > > Karunakar > > > > 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 > > > > Hello All, > > > > When we try to Assign IP to SUT using ifconfig command from Shell or > > IPv4 Network Configuration BIOS setup page DHCP process start even > > there is no LAN cable connected to specific port. > > > > Can we add a Media presence condition check before starting DHCP servic= e? > > > > Could you please correct if anything is wrong. > > > > Thanks, > > Karunakar > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel