From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=ting.ye@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 00FD02214E322 for ; Tue, 12 Dec 2017 22:27:47 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2017 22:32:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,397,1508828400"; d="scan'208";a="15562348" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 12 Dec 2017 22:32:18 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Dec 2017 22:31:39 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Dec 2017 22:31:39 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Wed, 13 Dec 2017 14:30:38 +0800 From: "Ye, Ting" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" , Karunakar P Thread-Topic: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status before starting DHCP process. Thread-Index: AQHTan/dwm2TUsWlqUGQsGbkg8LtqqNAr+GA//+YAwCAAJkvgA== Date: Wed, 13 Dec 2017 06:30:38 +0000 Message-ID: References: <1512117526-11308-1-git-send-email-jiaxin.wu@intel.com> <1512117526-11308-2-git-send-email-jiaxin.wu@intel.com> <895558F6EA4E3B41AC93A00D163B727416353308@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <895558F6EA4E3B41AC93A00D163B727416353308@SHSMSX103.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status before starting DHCP process. 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: Wed, 13 Dec 2017 06:27:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Jiaxin, Thanks for the clarification. I agree with your solution to try DHCP proces= s when upper layer don't know the media status. However, we might need add = some comments there to indicate such case, that MediaPresent is TRUE does n= ot mean media is available.=20 Others are good to me. Reviewed-by: Ye Ting =20 Thanks, Ting -----Original Message----- From: Wu, Jiaxin=20 Sent: Wednesday, December 13, 2017 1:16 PM To: Ye, Ting ; edk2-devel@lists.01.org Cc: Fu, Siyuan ; Karunakar P Subject: RE: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status before s= tarting DHCP process. Hi Ting, In such a case, DHCP process should also be trigged since DHCP doesn't have= the knowledge of media status. We can't return directly since the media ma= y be available. what do you think? Thanks, Jiaxin > -----Original Message----- > From: Ye, Ting > Sent: Wednesday, December 13, 2017 11:33 AM > To: Wu, Jiaxin ; edk2-devel@lists.01.org > Cc: Fu, Siyuan ; Karunakar P=20 > > Subject: RE: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status=20 > before starting DHCP process. >=20 > Hi Jiaxin, >=20 > I think the patch need be revised since it does not check the returned=20 > status of NetLibDetectMedia. If NetLibDetectMedia failed to detect=20 > the media status due to some error conditions, MediaPresent is still=20 > TRUE and DHCP will be trigged later even no media is available. >=20 > Thanks, > Ting >=20 >=20 > -----Original Message----- > From: Wu, Jiaxin > Sent: Friday, December 1, 2017 4:39 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ;=20 > Karunakar P ; Wu, Jiaxin=20 > > Subject: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status before=20 > starting DHCP process. >=20 > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Karunakar P > Signed-off-by: Wu Jiaxin > --- > MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c | 13 > ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > index 1db4c66..8780414 100644 > --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > @@ -1,9 +1,9 @@ > /** @file > This file implement the EFI_DHCP4_PROTOCOL interface. >=20 > -Copyright (c) 2006 - 2016, Intel Corporation. All rights=20 > reserved.
> +Copyright (c) 2006 - 2017, Intel Corporation. All rights=20 > +reserved.
> This program and the accompanying materials are licensed and made=20 > available under the terms and conditions of the BSD License which=20 > accompanies this distribution. The full text of the license may be=20 > found at http://opensource.org/licenses/bsd-license.php >=20 > @@ -778,10 +778,11 @@ EfiDhcp4Start ( > IN EFI_EVENT CompletionEvent OPTIONAL > ) > { > DHCP_PROTOCOL *Instance; > DHCP_SERVICE *DhcpSb; > + BOOLEAN MediaPresent; > EFI_STATUS Status; > EFI_TPL OldTpl; >=20 > // > // First validate the parameters > @@ -807,10 +808,20 @@ EfiDhcp4Start ( > if ((DhcpSb->DhcpState !=3D Dhcp4Init) && (DhcpSb->DhcpState !=3D > Dhcp4InitReboot)) { > Status =3D EFI_ALREADY_STARTED; > goto ON_ERROR; > } >=20 > + // > + // Check Media Satus. > + // > + MediaPresent =3D TRUE; > + NetLibDetectMedia (DhcpSb->Controller, &MediaPresent); if > + (!MediaPresent) { > + Status =3D EFI_NO_MEDIA; > + goto ON_ERROR; > + } > + > DhcpSb->IoStatus =3D EFI_ALREADY_STARTED; >=20 > if (EFI_ERROR (Status =3D DhcpInitRequest (DhcpSb))) { > goto ON_ERROR; > } > -- > 1.9.5.msysgit.1