Re: [edk2-devel] [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification

2022-12-20 Thread Igor Kulchytskyy via groups.io
Reviewed-by: Igor Kulchytskyy 

-Original Message-
From: abner.ch...@amd.com 
Sent: Monday, December 19, 2022 9:51 AM
To: devel@edk2.groups.io
Cc: Nickle Wang ; Igor Kulchytskyy 
Subject: [EXTERNAL] [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform 
Redfish HI notification


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

From: Abner Chang 

For some use cases, Redfish host interface table relies on the certain EFI 
protocols installation at the driver connection.
Redfish host interface DXE driver is not able to build the SMBIOS type 42h 
record at driver entry point. This patch adds the mechanism in Redfish host 
interface DXE driver to listen to EFI protocol installed by platform library 
that indicates the necessary information is ready for building SMBIOS 42h 
record.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../Include/Library/RedfishHostInterfaceLib.h | 27 ++-
 .../PlatformHostInterfaceLibNull.c| 26 ++-
 .../RedfishHostInterfaceDxe.c | 71 ++-
 3 files changed, 118 insertions(+), 6 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h 
b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
index 8d8389b9647..fa9f2d64eea 100644
--- a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
+++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
@@ -2,6 +2,7 @@
   Definitinos of RedfishHostInterfaceDxe driver.

   (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
+ reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -19,7 +20,7 @@
 /**
   Get platform Redfish host interface device descriptor.

-  @param[in] DeviceType Pointer to retrieve device type.
+  @param[out] DeviceTypePointer to retrieve device type.
   @param[out] DeviceDescriptor  Pointer to retrieve REDFISH_INTERFACE_DATA, 
caller has to free
 this memory using FreePool().
   @retval EFI_SUCCESS Device descriptor is returned successfully in 
DeviceDescriptor.
@@ -28,7 +29,7 @@
 **/
 EFI_STATUS
 RedfishPlatformHostInterfaceDeviceDescriptor (
-  IN UINT8*DeviceType,
+  OUT UINT8*DeviceType,
   OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor
   );

@@ -40,7 +41,7 @@ RedfishPlatformHostInterfaceDeviceDescriptor (
   @param[in, out] ProtocolRecord  Pointer to retrieve the first or the next 
protocol record.
   caller has to free the new protocol record 
returned from
   this function using FreePool().
-  param[in] IndexOfProtocolData   The index of protocol data.
+  @param[in] IndexOfProtocolData  The index of protocol data.

   @retval EFI_SUCCESS Protocol records are all returned.
   @retval EFI_NOT_FOUND   No more protocol records.
@@ -52,4 +53,24 @@ RedfishPlatformHostInterfaceProtocolData (
   IN UINT8  IndexOfProtocolData
   );

+/**
+  Get the EFI protocol GUID installed by platform library which
+  indicates the necessary information is ready for building
+  SMBIOS 42h record.
+
+  @param[out] InformationReadinessGuid  Pointer to retrive the protocol
+GUID.
+
+  @retval EFI_SUCCESS  Notification is required for building up
+   SMBIOS type 42h record.
+  @retval EFI_UNSUPPORTED  Notification is not required for building up
+   SMBIOS type 42h record.
+  @retval EFI_ALREADY_STARTED  Platform host information is already ready.
+  @retval Others   Other errors.
+**/
+
+EFI_STATUS
+RedfishPlatformHostInterfaceNotification (
+  OUT EFI_GUID **InformationReadinessGuid
+  );
 #endif
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
 
b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
index b30f9e37a4d..f83f5418d47 100644
--- 
a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterf
+++ aceLibNull.c
@@ -2,6 +2,7 @@
   NULL instace of RedfishPlatformHostInterfaceLib

   (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
+ reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -23,7 +24,7 @@
 **/
 EFI_STATUS
 RedfishPlatformHostInterfaceDeviceDescriptor (
-  IN UINT8*DeviceType,
+  OUT UINT8*DeviceType,
   OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor
   )
 {
@@ -51,3 +52,26 @@ RedfishPlatformHostInterfaceProtocolData (  {
   return EFI_NOT_FOUND;
 }
+
+/**
+  Get the EFI protocol GUID installed by platform library which
+  indicates the necessary informat

Re: [edk2-devel] [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification

2022-12-19 Thread Nickle Wang via groups.io
Hi Abner,

I found another bug as below.

+  if (Status == EFI_UNSUPPORTED || EFI_ALREADY_STARTED) {
+Status = RedfishCreateSmbiosTable42 ();  

Second condition check miss "Status ==" and RedfishCreateSmbiosTable42() is 
always called in driver entry.

Thanks,
Nickle

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Nickle Wang via 
groups.io
Sent: Monday, December 19, 2022 11:11 PM
To: abner.ch...@amd.com; devel@edk2.groups.io
Cc: Igor Kulchytskyy 
Subject: Re: [edk2-devel] [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: 
Platform Redfish HI notification

External email: Use caution opening links or attachments


Thanks for addressing my comment.

Reviewed-by: Nickle Wang

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com 
Sent: Monday, December 19, 2022 10:51 PM
To: devel@edk2.groups.io
Cc: Nickle Wang ; Igor Kulchytskyy 
Subject: [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI 
notification

External email: Use caution opening links or attachments


From: Abner Chang 

For some use cases, Redfish host interface table relies on the certain EFI 
protocols installation at the driver connection.
Redfish host interface DXE driver is not able to build the SMBIOS type 42h 
record at driver entry point. This patch adds the mechanism in Redfish host 
interface DXE driver to listen to EFI protocol installed by platform library 
that indicates the necessary information is ready for building SMBIOS 42h 
record.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../Include/Library/RedfishHostInterfaceLib.h | 27 ++-
 .../PlatformHostInterfaceLibNull.c| 26 ++-
 .../RedfishHostInterfaceDxe.c | 71 ++-
 3 files changed, 118 insertions(+), 6 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h 
b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
index 8d8389b9647..fa9f2d64eea 100644
--- a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
+++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
@@ -2,6 +2,7 @@
   Definitinos of RedfishHostInterfaceDxe driver.

   (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights 
+ reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -19,7 +20,7 @@
 /**
   Get platform Redfish host interface device descriptor.

-  @param[in] DeviceType Pointer to retrieve device type.
+  @param[out] DeviceTypePointer to retrieve device type.
   @param[out] DeviceDescriptor  Pointer to retrieve REDFISH_INTERFACE_DATA, 
caller has to free
 this memory using FreePool().
   @retval EFI_SUCCESS Device descriptor is returned successfully in 
DeviceDescriptor.
@@ -28,7 +29,7 @@
 **/
 EFI_STATUS
 RedfishPlatformHostInterfaceDeviceDescriptor (
-  IN UINT8*DeviceType,
+  OUT UINT8*DeviceType,
   OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor
   );

@@ -40,7 +41,7 @@ RedfishPlatformHostInterfaceDeviceDescriptor (
   @param[in, out] ProtocolRecord  Pointer to retrieve the first or the next 
protocol record.
   caller has to free the new protocol record 
returned from
   this function using FreePool().
-  param[in] IndexOfProtocolData   The index of protocol data.
+  @param[in] IndexOfProtocolData  The index of protocol data.

   @retval EFI_SUCCESS Protocol records are all returned.
   @retval EFI_NOT_FOUND   No more protocol records.
@@ -52,4 +53,24 @@ RedfishPlatformHostInterfaceProtocolData (
   IN UINT8  IndexOfProtocolData
   );

+/**
+  Get the EFI protocol GUID installed by platform library which
+  indicates the necessary information is ready for building
+  SMBIOS 42h record.
+
+  @param[out] InformationReadinessGuid  Pointer to retrive the protocol
+GUID.
+
+  @retval EFI_SUCCESS  Notification is required for building up
+   SMBIOS type 42h record.
+  @retval EFI_UNSUPPORTED  Notification is not required for building up
+   SMBIOS type 42h record.
+  @retval EFI_ALREADY_STARTED  Platform host information is already ready.
+  @retval Others   Other errors.
+**/
+
+EFI_STATUS
+RedfishPlatformHostInterfaceNotification (
+  OUT EFI_GUID **InformationReadinessGuid
+  );
 #endif
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
 
b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
index b30f9e37a4d..f83f5418d47 100644
--- 
a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterf
+++ aceLibNull.c
@@ -2,6 +2,7 @@
   NULL instace of RedfishPlatformHostInterfaceLib

   (C) Copy

Re: [edk2-devel] [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification

2022-12-19 Thread Nickle Wang via groups.io
Thanks for addressing my comment.

Reviewed-by: Nickle Wang

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Monday, December 19, 2022 10:51 PM
To: devel@edk2.groups.io
Cc: Nickle Wang ; Igor Kulchytskyy 
Subject: [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI 
notification

External email: Use caution opening links or attachments


From: Abner Chang 

For some use cases, Redfish host interface table relies on the certain EFI 
protocols installation at the driver connection.
Redfish host interface DXE driver is not able to build the SMBIOS type 42h 
record at driver entry point. This patch adds the mechanism in Redfish host 
interface DXE driver to listen to EFI protocol installed by platform library 
that indicates the necessary information is ready for building SMBIOS 42h 
record.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../Include/Library/RedfishHostInterfaceLib.h | 27 ++-
 .../PlatformHostInterfaceLibNull.c| 26 ++-
 .../RedfishHostInterfaceDxe.c | 71 ++-
 3 files changed, 118 insertions(+), 6 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h 
b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
index 8d8389b9647..fa9f2d64eea 100644
--- a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
+++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
@@ -2,6 +2,7 @@
   Definitinos of RedfishHostInterfaceDxe driver.

   (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights 
+ reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -19,7 +20,7 @@
 /**
   Get platform Redfish host interface device descriptor.

-  @param[in] DeviceType Pointer to retrieve device type.
+  @param[out] DeviceTypePointer to retrieve device type.
   @param[out] DeviceDescriptor  Pointer to retrieve REDFISH_INTERFACE_DATA, 
caller has to free
 this memory using FreePool().
   @retval EFI_SUCCESS Device descriptor is returned successfully in 
DeviceDescriptor.
@@ -28,7 +29,7 @@
 **/
 EFI_STATUS
 RedfishPlatformHostInterfaceDeviceDescriptor (
-  IN UINT8*DeviceType,
+  OUT UINT8*DeviceType,
   OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor
   );

@@ -40,7 +41,7 @@ RedfishPlatformHostInterfaceDeviceDescriptor (
   @param[in, out] ProtocolRecord  Pointer to retrieve the first or the next 
protocol record.
   caller has to free the new protocol record 
returned from
   this function using FreePool().
-  param[in] IndexOfProtocolData   The index of protocol data.
+  @param[in] IndexOfProtocolData  The index of protocol data.

   @retval EFI_SUCCESS Protocol records are all returned.
   @retval EFI_NOT_FOUND   No more protocol records.
@@ -52,4 +53,24 @@ RedfishPlatformHostInterfaceProtocolData (
   IN UINT8  IndexOfProtocolData
   );

+/**
+  Get the EFI protocol GUID installed by platform library which
+  indicates the necessary information is ready for building
+  SMBIOS 42h record.
+
+  @param[out] InformationReadinessGuid  Pointer to retrive the protocol
+GUID.
+
+  @retval EFI_SUCCESS  Notification is required for building up
+   SMBIOS type 42h record.
+  @retval EFI_UNSUPPORTED  Notification is not required for building up
+   SMBIOS type 42h record.
+  @retval EFI_ALREADY_STARTED  Platform host information is already ready.
+  @retval Others   Other errors.
+**/
+
+EFI_STATUS
+RedfishPlatformHostInterfaceNotification (
+  OUT EFI_GUID **InformationReadinessGuid
+  );
 #endif
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
 
b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
index b30f9e37a4d..f83f5418d47 100644
--- 
a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterf
+++ aceLibNull.c
@@ -2,6 +2,7 @@
   NULL instace of RedfishPlatformHostInterfaceLib

   (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights 
+ reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -23,7 +24,7 @@
 **/
 EFI_STATUS
 RedfishPlatformHostInterfaceDeviceDescriptor (
-  IN UINT8*DeviceType,
+  OUT UINT8*DeviceType,
   OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor
   )
 {
@@ -51,3 +52,26 @@ RedfishPlatformHostInterfaceProtocolData (  {
   return EFI_NOT_FOUND;
 }
+
+/**
+  Get the EFI protocol GUID installed by platform library which
+  indicates the necessary information is ready for building
+  SMBIOS 42h record.
+
+  @

[edk2-devel] [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification

2022-12-19 Thread Chang, Abner via groups.io
From: Abner Chang 

For some use cases, Redfish host interface table relies on
the certain EFI protocols installation at the driver connection.
Redfish host interface DXE driver is not able to build the
SMBIOS type 42h record at driver entry point. This patch adds
the mechanism in Redfish host interface DXE driver to listen
to EFI protocol installed by platform library that indicates
the necessary information is ready for building SMBIOS 42h
record.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../Include/Library/RedfishHostInterfaceLib.h | 27 ++-
 .../PlatformHostInterfaceLibNull.c| 26 ++-
 .../RedfishHostInterfaceDxe.c | 71 ++-
 3 files changed, 118 insertions(+), 6 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h 
b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
index 8d8389b9647..fa9f2d64eea 100644
--- a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
+++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
@@ -2,6 +2,7 @@
   Definitinos of RedfishHostInterfaceDxe driver.
 
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -19,7 +20,7 @@
 /**
   Get platform Redfish host interface device descriptor.
 
-  @param[in] DeviceType Pointer to retrieve device type.
+  @param[out] DeviceTypePointer to retrieve device type.
   @param[out] DeviceDescriptor  Pointer to retrieve REDFISH_INTERFACE_DATA, 
caller has to free
 this memory using FreePool().
   @retval EFI_SUCCESS Device descriptor is returned successfully in 
DeviceDescriptor.
@@ -28,7 +29,7 @@
 **/
 EFI_STATUS
 RedfishPlatformHostInterfaceDeviceDescriptor (
-  IN UINT8*DeviceType,
+  OUT UINT8*DeviceType,
   OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor
   );
 
@@ -40,7 +41,7 @@ RedfishPlatformHostInterfaceDeviceDescriptor (
   @param[in, out] ProtocolRecord  Pointer to retrieve the first or the next 
protocol record.
   caller has to free the new protocol record 
returned from
   this function using FreePool().
-  param[in] IndexOfProtocolData   The index of protocol data.
+  @param[in] IndexOfProtocolData  The index of protocol data.
 
   @retval EFI_SUCCESS Protocol records are all returned.
   @retval EFI_NOT_FOUND   No more protocol records.
@@ -52,4 +53,24 @@ RedfishPlatformHostInterfaceProtocolData (
   IN UINT8  IndexOfProtocolData
   );
 
+/**
+  Get the EFI protocol GUID installed by platform library which
+  indicates the necessary information is ready for building
+  SMBIOS 42h record.
+
+  @param[out] InformationReadinessGuid  Pointer to retrive the protocol
+GUID.
+
+  @retval EFI_SUCCESS  Notification is required for building up
+   SMBIOS type 42h record.
+  @retval EFI_UNSUPPORTED  Notification is not required for building up
+   SMBIOS type 42h record.
+  @retval EFI_ALREADY_STARTED  Platform host information is already ready.
+  @retval Others   Other errors.
+**/
+
+EFI_STATUS
+RedfishPlatformHostInterfaceNotification (
+  OUT EFI_GUID **InformationReadinessGuid
+  );
 #endif
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
 
b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
index b30f9e37a4d..f83f5418d47 100644
--- 
a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
+++ 
b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
@@ -2,6 +2,7 @@
   NULL instace of RedfishPlatformHostInterfaceLib
 
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -23,7 +24,7 @@
 **/
 EFI_STATUS
 RedfishPlatformHostInterfaceDeviceDescriptor (
-  IN UINT8*DeviceType,
+  OUT UINT8*DeviceType,
   OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor
   )
 {
@@ -51,3 +52,26 @@ RedfishPlatformHostInterfaceProtocolData (
 {
   return EFI_NOT_FOUND;
 }
+
+/**
+  Get the EFI protocol GUID installed by platform library which
+  indicates the necessary information is ready for building
+  SMBIOS 42h record.
+
+  @param[out] InformationReadinessGuid  Pointer to retrive the protocol
+GUID.
+
+  @retval EFI_SUCCESS  Notification is required for building up
+   SMBIOS type 42h record.
+  @retval EFI_UNSUPPORTED  Notification is not required for building up
+   SMBIOS type 42h record.
+  @retval