From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 72706209589F4 for ; Thu, 3 Aug 2017 01:36:09 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2017 01:38:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,315,1498546800"; d="scan'208";a="134885875" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 03 Aug 2017 01:38:20 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 3 Aug 2017 01:38:20 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 3 Aug 2017 01:38:20 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.188]) with mapi id 14.03.0319.002; Thu, 3 Aug 2017 16:38:18 +0800 From: "Fu, Siyuan" To: "Ye, Ting" , "edk2-devel@lists.01.org" CC: "Wu, Jiaxin" Thread-Topic: [edk2] [Patch] NetworkPkg: iSCSI should allow to set 6 or 12 length of ISID keyword. Thread-Index: AQHTDCNxSwkA4EqeZ0ax7T/8PATcb6JxyQyAgACGTxA= Date: Thu, 3 Aug 2017 08:38:17 +0000 Message-ID: References: <20170803064037.13216-1-siyuan.fu@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg: iSCSI should allow to set 6 or 12 length of ISID keyword. 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: Thu, 03 Aug 2017 08:36:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ting,=20 Thanks, I will update it when commit the patch. Siyuan -----Original Message----- From: Ye, Ting=20 Sent: Thursday, August 3, 2017 4:37 PM To: Fu, Siyuan ; edk2-devel@lists.01.org Cc: Wu, Jiaxin Subject: RE: [edk2] [Patch] NetworkPkg: iSCSI should allow to set 6 or 12 l= ength of ISID keyword. Hi Siyuan, I would suggest to add more info to below error message, such as below: Error! Only last 3 bytes are configurable, please input 6 hex numbers for = last 3 bytes only or 12 hex numbers for full SSID! + L"Error! Only last 3 bytes are configurable, please input 6 or 12 he= x numbers!\n" Others are good to me. Reviewed-by: Ye Ting =20 Thanks, Ting -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Fu S= iyuan Sent: Thursday, August 03, 2017 2:41 PM To: edk2-devel@lists.01.org Cc: Ye, Ting ; Wu, Jiaxin Subject: [edk2] [Patch] NetworkPkg: iSCSI should allow to set 6 or 12 lengt= h of ISID keyword. The last 3 bytes of ISID should be able to changed by setting the keyword w= ith a value with length 6 (only last 3 bytes) or 12 (full ISID) according t= o the keyword definition in UEFI configuration namespace website. Cc: Ye Ting Cc: Wu Jiaxin Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan --- NetworkPkg/IScsiDxe/IScsiConfig.c | 8 ++++++-- NetworkPkg/IScsiDxe/IScsiConfigStrings.uni | 1 + NetworkPkg/IScsiDxe/IScsiMisc.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiC= onfig.c index a588403..4bc9b8f 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c @@ -205,11 +205,11 @@ IScsiParseIsIdFromString ( =20 IsIdStr =3D (CHAR16 *) String; =20 - if (StrLen (IsIdStr) !=3D 6) { + if (StrLen (IsIdStr) !=3D 6 && StrLen (IsIdStr) !=3D 12) { UnicodeSPrint ( PortString, (UINTN) ISCSI_NAME_IFR_MAX_SIZE, - L"Error! Input is incorrect, please input 6 hex numbers!\n" + L"Error! Only last 3 bytes are configurable, please input 6 or 12 he= x numbers!\n" ); =20 CreatePopUp ( @@ -222,6 +222,10 @@ IScsiParseIsIdFromString ( return EFI_INVALID_PARAMETER; } =20 + if (StrLen (IsIdStr) =3D=3D 12) { + IsIdStr +=3D 6; + } + for (Index =3D 3; Index < 6; Index++) { CopyMem (TempStr, IsIdStr, sizeof (TempStr)); TempStr[2] =3D L'\0'; diff --git a/NetworkPkg/IScsiDxe/IScsiConfigStrings.uni b/NetworkPkg/IScsiD= xe/IScsiConfigStrings.uni index 7952258..10583f8 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfigStrings.uni +++ b/NetworkPkg/IScsiDxe/IScsiConfigStrings.uni @@ -99,3 +99,4 @@ #language x-UEFI-ns "iSCSIDisplayA= ttemptList" #string STR_ISCSI_ATTEMPT_ORDER #language en-US "New Attempt Order= " #language x-UEFI-ns "iSCSIAttemptO= rder" +#string STR_ISCSI_ISID_HELP #language en-US "The iSCSI ISID. D= efault value are derived from MAC address. Only last 3 bytes are configurab= le." diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMis= c.c index 2c93590..e20fe91 100644 --- a/NetworkPkg/IScsiDxe/IScsiMisc.c +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c @@ -952,7 +952,7 @@ IScsiCreateKeywords ( CONFIGURATION_VARSTORE_ID, (UINT16) (ATTEMPT_ISID_VAR_OFFSET + sizeof (KEYWORD_STR) * (Index - = 1)), StringToken, - StringToken, + STRING_TOKEN (STR_ISCSI_ISID_HELP), 0, 0, ISID_CONFIGURABLE_MIN_LEN, -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel