From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id 2C3B81A1DF2 for ; Thu, 11 Aug 2016 00:18:24 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 11 Aug 2016 00:18:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,503,1464678000"; d="scan'208,223";a="863537315" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 11 Aug 2016 00:17:58 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 11 Aug 2016 00:17:56 -0700 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.248.2; Thu, 11 Aug 2016 00:17:56 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.8]) with mapi id 14.03.0248.002; Thu, 11 Aug 2016 15:17:54 +0800 From: "Zhang, Lubo" To: "Ye, Ting" CC: "Fu, Siyuan" , "edk2-devel@lists.01.org" , "Dong, Eric" Thread-Topic: [patch] NetworkPkg: Refine codes of iSCSI driver Thread-Index: AQHR83fsIRk123XVyU+9I7DMVqBUWqBDR+yggAACkBCAAAxrgIAAAsJg Date: Thu, 11 Aug 2016 07:17:53 +0000 Message-ID: <7619447B08B8F74DA4FF2A813B79803B01A4EDE2@shsmsx102.ccr.corp.intel.com> References: <1470882425-41952-1-git-send-email-lubo.zhang@intel.com> <7619447B08B8F74DA4FF2A813B79803B01A4EDB3@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] NetworkPkg: Refine codes of iSCSI driver 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: Thu, 11 Aug 2016 07:18:24 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ok, I will update the log. Thanks Lubo=20 -----Original Message----- From: Ye, Ting=20 Sent: Thursday, August 11, 2016 3:11 PM To: Zhang, Lubo ; Dong, Eric Cc: Fu, Siyuan ; edk2-devel@lists.01.org Subject: RE: [patch] NetworkPkg: Refine codes of iSCSI driver So how about adding your below sentences to the log message when you check = in? I think it is more clear why we introduce the change to iSCSI.=20 Others are good to me. Reviewed-by: Ye Ting =20 -----Original Message----- From: Zhang, Lubo Sent: Thursday, August 11, 2016 3:01 PM To: Ye, Ting ; Dong, Eric Cc: Fu, Siyuan ; edk2-devel@lists.01.org Subject: RE: [patch] NetworkPkg: Refine codes of iSCSI driver From my understanding, the default PcdAcpiExposedTableVersions is 0x3= E, it can support ACPI table above version 1.0.but when changing the PCD to= 0x3C, table 1.0 will not be installed and supported . However the origina= l code=20 Rsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress=20 ...... IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId); always assume the Rsdt is not NULL which is used for table 1.0. So w= e should distinguish which table version we find. If table version above 1.= 0, we use the Rsdp->XsdtAddress instead of Rsdp->RsdtAddress. Best Regards Lubo=20 -----Original Message----- From: Ye, Ting Sent: Thursday, August 11, 2016 2:14 PM To: Zhang, Lubo ; edk2-devel@lists.01.org Cc: Dong, Eric ; Fu, Siyuan Subject: RE: [patch] NetworkPkg: Refine codes of iSCSI driver Hi Lubo, Could you please describe the changes introduced by this patch in your log = message? Thanks, Ting -----Original Message----- From: Zhang, Lubo Sent: Thursday, August 11, 2016 10:27 AM To: edk2-devel@lists.01.org Cc: Dong, Eric ; Ye, Ting ; Fu, Siy= uan Subject: [patch] NetworkPkg: Refine codes of iSCSI driver The RSDT is only used when the bios need to support ACPI 1.0 version. When = change PcdAcpiExposedTableVersions to 0x3C, it will not support ACPI 1.0. T= he default is 0x3E. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Eric Dong Cc: Ye Ting Cc: Fu Siyuan --- NetworkPkg/IScsiDxe/IScsiIbft.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiIbft.c b/NetworkPkg/IScsiDxe/IScsiIbf= t.c index 3c179bf..27d098d 100644 --- a/NetworkPkg/IScsiDxe/IScsiIbft.c +++ b/NetworkPkg/IScsiDxe/IScsiIbft.c @@ -454,42 +454,42 @@ IScsiPublishIbft ( EFI_STATUS Status; EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol; EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Table; EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; EFI_ACPI_DESCRIPTION_HEADER *Rsdt; + EFI_ACPI_DESCRIPTION_HEADER *Xsdt; UINT8 *Heap; UINT8 Checksum; - UINTN Index; =20 + Rsdt =3D NULL; + Xsdt =3D NULL; =20 Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID = **) &AcpiTableProtocol); if (EFI_ERROR (Status)) { return ; } =20 // // Find ACPI table RSD_PTR from the system table. // - for (Index =3D 0, Rsdp =3D NULL; Index < gST->NumberOfTableEntries; Inde= x++) { - if (CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAc= pi20TableGuid) || - CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi= 10TableGuid) || - CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi= TableGuid) - ) { - // - // A match was found. - // - Rsdp =3D (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) gST->Confi= gurationTable[Index].VendorTable; - break; - } + Status =3D EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, (VOID + **) &Rsdp); if (EFI_ERROR (Status)) { + Status =3D EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid,=20 + (VOID **) &Rsdp); } =20 - if (Rsdp =3D=3D NULL) { + if (EFI_ERROR (Status) || (Rsdp =3D=3D NULL)) { return ; - } else { + } else if (Rsdp->Revision >=3D EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POIN= TER_REVISION && Rsdp->XsdtAddress !=3D 0) { + Xsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->XsdtAddress; }= =20 + else if (Rsdp->RsdtAddress !=3D 0) { Rsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress; } =20 + if ((Xsdt =3D=3D NULL) && (Rsdt =3D=3D NULL)) { + return ; + } + if (mIbftInstalled) { Status =3D AcpiTableProtocol->UninstallAcpiTable ( AcpiTableProtocol, mTableKey ); @@ -518,11 +518,16 @@ IScsiPublishIbft ( Heap =3D (UINT8 *) Table + IBFT_HEAP_OFFSET; =20 // // Fill in the various section of the iSCSI Boot Firmware Table. // - IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId); + if (Rsdp->Revision >=3D EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REV= ISION) { + IScsiInitIbfTableHeader (Table, Xsdt->OemId, &Xsdt->OemTableId); }=20 + else { + IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId); } + IScsiInitControlSection (Table); IScsiFillInitiatorSection (Table, &Heap); IScsiFillNICAndTargetSections (Table, &Heap); =20 Checksum =3D CalculateCheckSum8((UINT8 *)Table, Table->Length); -- 1.9.5.msysgit.1