public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V3 0/5] Adding necessary changes for RedfishPkg
@ 2023-05-05  3:58 Minh Nguyen
  2023-05-05  3:58 ` [PATCH V3 1/5] RedfishPkg: Correct variable type to prevent memory corruption Minh Nguyen
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  3:58 UTC (permalink / raw)
  To: devel; +Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen,
	Minh Nguyen

This patchset adds necessary changes for RedfishPkg to avoid some unexpected cases and fix compilation.

Changes since v3:
 + Replaced __FUNCTION__ with __func__ to be more C11 compliant.
Changes since v2:
 + Added "Cc:" to maintainers in commit message.
 + Corrected patch format subject prefix.
Changes since v1:
 + Removed redundant change and change the commit message for more precise in PATCH 2/5.

Nhi Pham (1):
  RedfishPkg: Add missing newline character

Vu Nguyen (4):
  RedfishPkg: Correct variable type to prevent memory corruption
  RedfishPkg: Fix condition checking of error status
  RedfishPkg: Create RestEx child on selected interface
  RedfishPkg: Fix compile issue on Linux

 RedfishPkg/Include/Library/RestExLib.h                       |   3 +
 RedfishPkg/Include/Pcd/RestExServiceDevicePath.h             |   5 +-
 RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h            |   3 +-
 RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c               | 153 ++++++++------------
 RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c           |   4 +-
 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c |   3 +-
 6 files changed, 73 insertions(+), 98 deletions(-)

-- 
2.39.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH V3 1/5] RedfishPkg: Correct variable type to prevent memory corruption
  2023-05-05  3:58 [PATCH V3 0/5] Adding necessary changes for RedfishPkg Minh Nguyen
@ 2023-05-05  3:58 ` Minh Nguyen
  2023-05-05  3:58 ` [PATCH V3 2/5] RedfishPkg: Fix condition checking of error status Minh Nguyen
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  3:58 UTC (permalink / raw)
  To: devel
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen, Vu Nguyen,
	Minh Nguyen, Nick Ramirez

From: Vu Nguyen <vunguyen@os.amperecomputing.com>

Id will be casted by CoreOpenProtocol, declare this variable with a
wrong type might result in the corruption of other local variables.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
---
 RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h
index 4a9e9f7b81a4..6b94e5814c43 100644
--- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h
+++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h
@@ -3,6 +3,7 @@
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -84,7 +85,7 @@ struct _RESTEX_SERVICE {
   //
   EFI_HANDLE                      HttpChildHandle;
 
-  UINT32                          Id;
+  UINT32                          *Id;
 
   EFI_REST_EX_SERVICE_INFO        RestExServiceInfo;
 };
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH V3 2/5] RedfishPkg: Fix condition checking of error status
  2023-05-05  3:58 [PATCH V3 0/5] Adding necessary changes for RedfishPkg Minh Nguyen
  2023-05-05  3:58 ` [PATCH V3 1/5] RedfishPkg: Correct variable type to prevent memory corruption Minh Nguyen
@ 2023-05-05  3:58 ` Minh Nguyen
  2023-05-05  3:58 ` [PATCH V3 3/5] RedfishPkg: Create RestEx child on selected interface Minh Nguyen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  3:58 UTC (permalink / raw)
  To: devel
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen, Vu Nguyen,
	Minh Nguyen, Nick Ramirez

From: Vu Nguyen <vunguyen@os.amperecomputing.com>

This change fixes condition checking of error status, the condition
should be compared with TRUE status to be identical with an error message.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
---
 RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
index 583c6f78e19c..a247bfed9e34 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
@@ -5,6 +5,7 @@
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
   Copyright (c) 2022, AMD Incorporated. All rights reserved.
   Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -926,7 +927,7 @@ AddAndSignalNewRedfishService (
     }
 
     Status = gBS->SignalEvent (Instance->DiscoverToken->Event);
-    if (!EFI_ERROR (Status)) {
+    if (EFI_ERROR (Status)) {
       DEBUG ((DEBUG_ERROR, "%a:No event to signal!\n", __func__));
     }
   }
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH V3 3/5] RedfishPkg: Create RestEx child on selected interface
  2023-05-05  3:58 [PATCH V3 0/5] Adding necessary changes for RedfishPkg Minh Nguyen
  2023-05-05  3:58 ` [PATCH V3 1/5] RedfishPkg: Correct variable type to prevent memory corruption Minh Nguyen
  2023-05-05  3:58 ` [PATCH V3 2/5] RedfishPkg: Fix condition checking of error status Minh Nguyen
@ 2023-05-05  3:58 ` Minh Nguyen
  2023-05-05  3:58 ` [PATCH V3 4/5] RedfishPkg: Add missing newline character Minh Nguyen
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  3:58 UTC (permalink / raw)
  To: devel
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen, Vu Nguyen,
	Minh Nguyen, Nick Ramirez

From: Vu Nguyen <vunguyen@os.amperecomputing.com>

When a MAC address matching interface is found, a RestEx child will be
created to provide the Redfish communication on that interface.
Currently, It will try to locate all RestEx binding services and choose
the first satisfied instance without taking care about current selected
interface. This might raise an issue on the system with multiple network
devices that the RestEx child was installed on wrong interface.

Siigned-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
---
 RedfishPkg/Include/Library/RestExLib.h             |   3 +
 RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c     | 153 ++++++++------------
 RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c |   1 +
 3 files changed, 63 insertions(+), 94 deletions(-)

diff --git a/RedfishPkg/Include/Library/RestExLib.h b/RedfishPkg/Include/Library/RestExLib.h
index bc4e4ca6caa7..2c32c3684cf4 100644
--- a/RedfishPkg/Include/Library/RestExLib.h
+++ b/RedfishPkg/Include/Library/RestExLib.h
@@ -2,6 +2,7 @@
   This library provides help functions for REST EX Protocol.
 
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -20,6 +21,7 @@
   This function allows the caller to create child handle for specific
   REST server.
 
+  @param[in]  Controller           The controller handle used of selected interface.
   @param[in]  Image                The image handle used to open service.
   @param[in]  AccessMode           Access mode of REST server.
   @param[in]  ConfigType           Underlying configuration to communicate with REST server.
@@ -32,6 +34,7 @@
 **/
 EFI_STATUS
 RestExLibCreateChild (
+  IN EFI_HANDLE                       Controller,
   IN EFI_HANDLE                       Image,
   IN EFI_REST_EX_SERVICE_ACCESS_MODE  AccessMode,
   IN EFI_REST_EX_CONFIG_TYPE          ConfigType,
diff --git a/RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c b/RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c
index d9acad24dec1..0b3ae2755e86 100644
--- a/RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c
+++ b/RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c
@@ -2,6 +2,7 @@
   This library provides help functions for REST EX Protocol.
 
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -9,6 +10,7 @@
 
 #include <Uefi.h>
 #include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
 #include <Library/MemoryAllocationLib.h>
 #include <Library/NetLib.h>
 #include <Library/UefiBootServicesTableLib.h>
@@ -21,6 +23,7 @@
   This function allows the caller to create child handle for specific
   REST server.
 
+  @param[in]  Controller           The controller handle used of selected interface.
   @param[in]  Image                The image handle used to open service.
   @param[in]  AccessMode           Access mode of REST server.
   @param[in]  ConfigType           Underlying configuration to communicate with REST server.
@@ -33,6 +36,7 @@
 **/
 EFI_STATUS
 RestExLibCreateChild (
+  IN EFI_HANDLE                       Controller,
   IN EFI_HANDLE                       Image,
   IN EFI_REST_EX_SERVICE_ACCESS_MODE  AccessMode,
   IN EFI_REST_EX_CONFIG_TYPE          ConfigType,
@@ -41,8 +45,6 @@ RestExLibCreateChild (
   )
 {
   EFI_STATUS                Status;
-  UINTN                     NoBuffer;
-  EFI_HANDLE                *Handle;
   EFI_HANDLE                ChildHandle;
   EFI_REST_EX_PROTOCOL      *RestEx;
   EFI_REST_EX_SERVICE_INFO  *RestExServiceInfo;
@@ -59,116 +61,79 @@ RestExLibCreateChild (
   }
 
   *ChildInstanceHandle = NULL;
-  //
-  // Locate all REST EX binding service.
-  //
-  Handle   = NULL;
-  NoBuffer = 0;
-  Status   = gBS->LocateHandleBuffer (
-                    ByProtocol,
-                    &gEfiRestExServiceBindingProtocolGuid,
-                    NULL,
-                    &NoBuffer,
-                    &Handle
-                    );
-  if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) {
+
+  ChildHandle = NULL;
+  Status = NetLibCreateServiceChild (
+             Controller,
+             Image,
+             &gEfiRestExServiceBindingProtocolGuid,
+             &ChildHandle
+             );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((
+      DEBUG_ERROR,
+      "%a: Failed to create service child - %r \n",
+      __func__,
+      Status
+      ));
     return Status;
   }
-
-  Handle = (EFI_HANDLE *)AllocateZeroPool (sizeof (EFI_HANDLE) * NoBuffer);
-  if (Handle == NULL) {
-    return EFI_OUT_OF_RESOURCES;
-  }
-
-  Status = gBS->LocateHandleBuffer (
-                  ByProtocol,
-                  &gEfiRestExServiceBindingProtocolGuid,
+  Status = gBS->OpenProtocol (
+                  ChildHandle,
+                  &gEfiRestExProtocolGuid,
+                  (VOID **)&RestEx,
+                  Image,
                   NULL,
-                  &NoBuffer,
-                  &Handle
+                  EFI_OPEN_PROTOCOL_GET_PROTOCOL
                   );
   if (EFI_ERROR (Status)) {
-    FreePool (Handle);
-    return Status;
+    goto ON_ERROR;
   }
 
   //
-  // Search for the proper REST EX instance.
+  // Get the information of REST service provided by this EFI REST EX driver
   //
-  while (NoBuffer != 0) {
-    ChildHandle = NULL;
-    Status      = NetLibCreateServiceChild (
-                    *(Handle + (NoBuffer - 1)),
-                    Image,
-                    &gEfiRestExServiceBindingProtocolGuid,
-                    &ChildHandle
-                    );
-    if (!EFI_ERROR (Status)) {
-      Status = gBS->OpenProtocol (
-                      ChildHandle,
-                      &gEfiRestExProtocolGuid,
-                      (VOID **)&RestEx,
-                      Image,
-                      NULL,
-                      EFI_OPEN_PROTOCOL_GET_PROTOCOL
-                      );
-      if (EFI_ERROR (Status)) {
-        goto ON_ERROR;
-      }
-
-      //
-      // Get the information of REST service provided by this EFI REST EX driver
-      //
-      Status = RestEx->GetService (
-                         RestEx,
-                         &RestExServiceInfo
-                         );
-      if (EFI_ERROR (Status)) {
-        goto ON_ERROR;
-      }
-
-      //
-      // Check REST EX property.
-      //
-      switch (ConfigType) {
-        case EfiRestExConfigHttp:
-          LenOfConfig = sizeof (EFI_REST_EX_HTTP_CONFIG_DATA);
-          break;
-
-        case EfiRestExConfigUnspecific:
-          LenOfConfig = REST_EX_CONFIG_DATA_LEN_UNKNOWN;
-          break;
+  Status = RestEx->GetService (
+                     RestEx,
+                     &RestExServiceInfo
+                     );
+  if (EFI_ERROR (Status)) {
+    goto ON_ERROR;
+  }
+  //
+  // Check REST EX property.
+  //
+  switch (ConfigType) {
+  case EfiRestExConfigHttp:
+    LenOfConfig = sizeof (EFI_REST_EX_HTTP_CONFIG_DATA);
+    break;
 
-        default:
-          goto ON_ERROR;
-      }
+  case EfiRestExConfigUnspecific:
+    LenOfConfig = REST_EX_CONFIG_DATA_LEN_UNKNOWN;
+    break;
 
-      if ((RestExServiceInfo->EfiRestExServiceInfoV10.RestServiceAccessMode != AccessMode) ||
-          (RestExServiceInfo->EfiRestExServiceInfoV10.RestServiceType != ServiceType) ||
-          (RestExServiceInfo->EfiRestExServiceInfoV10.RestExConfigType != ConfigType) ||
-          ((LenOfConfig != REST_EX_CONFIG_DATA_LEN_UNKNOWN) && (RestExServiceInfo->EfiRestExServiceInfoV10.RestExConfigDataLength != LenOfConfig)))
-      {
-        goto ON_ERROR;
-      }
-    }
+  default:
+    goto ON_ERROR;
+  }
+  if (RestExServiceInfo->EfiRestExServiceInfoV10.RestServiceAccessMode != AccessMode ||
+      RestExServiceInfo->EfiRestExServiceInfoV10.RestServiceType != ServiceType ||
+      RestExServiceInfo->EfiRestExServiceInfoV10.RestExConfigType != ConfigType ||
+      ((LenOfConfig != REST_EX_CONFIG_DATA_LEN_UNKNOWN) && (RestExServiceInfo->EfiRestExServiceInfoV10.RestExConfigDataLength != LenOfConfig))) {
+    goto ON_ERROR;
+  }
 
-    //
-    // This is proper REST EX instance.
-    //
-    *ChildInstanceHandle = ChildHandle;
-    FreePool (Handle);
-    return EFI_SUCCESS;
+  //
+  // This is proper REST EX instance.
+  //
+  *ChildInstanceHandle = ChildHandle;
+  return EFI_SUCCESS;
 
 ON_ERROR:;
     NetLibDestroyServiceChild (
-      *(Handle + (NoBuffer - 1)),
+      Controller,
       Image,
       &gEfiRestExServiceBindingProtocolGuid,
       ChildHandle
       );
-    NoBuffer--;
-  }
-
-  FreePool (Handle);
   return EFI_NOT_FOUND;
 }
diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
index a247bfed9e34..dd5bdbb377e9 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
@@ -87,6 +87,7 @@ CreateRestExInstance (
   EFI_STATUS  Status;
 
   Status = RestExLibCreateChild (
+             Instance->NetworkInterface->OpenDriverControllerHandle,
              Instance->Owner,
              FixedPcdGetBool (PcdRedfishDiscoverAccessModeInBand) ? EfiRestExServiceInBandAccess : EfiRestExServiceOutOfBandAccess,
              EfiRestExConfigHttp,
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH V3 4/5] RedfishPkg: Add missing newline character
  2023-05-05  3:58 [PATCH V3 0/5] Adding necessary changes for RedfishPkg Minh Nguyen
                   ` (2 preceding siblings ...)
  2023-05-05  3:58 ` [PATCH V3 3/5] RedfishPkg: Create RestEx child on selected interface Minh Nguyen
@ 2023-05-05  3:58 ` Minh Nguyen
  2023-05-05  3:58 ` [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux Minh Nguyen
  2023-05-05  5:03 ` [PATCH V3 0/5] Adding necessary changes for RedfishPkg Chang, Abner
  5 siblings, 0 replies; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  3:58 UTC (permalink / raw)
  To: devel
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen,
	Minh Nguyen, Nick Ramirez

From: Nhi Pham <nhi@os.amperecomputing.com>

This adds a missing newline character to make the error log
readable in case the module is failed.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
---
 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
index 45fc6e2182bc..c4fa59193a2f 100644
--- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
+++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
@@ -8,6 +8,7 @@
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
   Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
   Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -59,7 +60,7 @@ RedfishCreateSmbiosTable42 (
   Status = RedfishPlatformHostInterfaceDeviceDescriptor (&DeviceType, &DeviceDescriptor);
   if (EFI_ERROR (Status)) {
     if (Status == EFI_NOT_FOUND) {
-      DEBUG ((DEBUG_ERROR, "%a: No Redfish host interface descriptor is provided on this platform.", __func__));
+      DEBUG ((DEBUG_ERROR, "%a: No Redfish host interface descriptor is provided on this platform.\n", __func__));
       return EFI_NOT_FOUND;
     }
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux
  2023-05-05  3:58 [PATCH V3 0/5] Adding necessary changes for RedfishPkg Minh Nguyen
                   ` (3 preceding siblings ...)
  2023-05-05  3:58 ` [PATCH V3 4/5] RedfishPkg: Add missing newline character Minh Nguyen
@ 2023-05-05  3:58 ` Minh Nguyen
  2023-05-05 22:57   ` [edk2-devel] " Pedro Falcato
  2023-05-05  5:03 ` [PATCH V3 0/5] Adding necessary changes for RedfishPkg Chang, Abner
  5 siblings, 1 reply; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  3:58 UTC (permalink / raw)
  To: devel
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen, Vu Nguyen,
	Minh Nguyen, Nick Ramirez, Abner Chang

From: Vu Nguyen <vunguyen@os.amperecomputing.com>

It requires a fixed size array to store the content of device path PCD.
Add the array size to solve this issue.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <Abner.Chang@amd.com>
---
 RedfishPkg/Include/Pcd/RestExServiceDevicePath.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
index 91b1198297c2..57fc199f61f2 100644
--- a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
+++ b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
@@ -4,6 +4,7 @@
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 
     SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -14,6 +15,8 @@
 
 #include <Protocol/DevicePath.h>
 
+#define MAX_DEVICE_PATH_NODE      40
+
 typedef enum {
   DEVICE_PATH_MATCH_MAC_NODE = 1,
   DEVICE_PATH_MATCH_PCI_NODE = 2,
@@ -32,7 +35,7 @@ typedef struct {
   //    0x03,0x0b,0x25,0x00,0x00,0x50,0x56,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
   //    0x7f,0xff,0x04,0x00}
   //
-  EFI_DEVICE_PATH_PROTOCOL    DevicePath[];
+  EFI_DEVICE_PATH_PROTOCOL      DevicePath[MAX_DEVICE_PATH_NODE];
 } REST_EX_SERVICE_DEVICE_PATH_DATA;
 
 #endif
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
  2023-05-05  3:58 [PATCH V3 0/5] Adding necessary changes for RedfishPkg Minh Nguyen
                   ` (4 preceding siblings ...)
  2023-05-05  3:58 ` [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux Minh Nguyen
@ 2023-05-05  5:03 ` Chang, Abner
  2023-05-05  5:35   ` Minh Nguyen
  5 siblings, 1 reply; 18+ messages in thread
From: Chang, Abner @ 2023-05-05  5:03 UTC (permalink / raw)
  To: Minh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, nicklew@nvidia.com, igork@ami.com,
	nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com

[AMD Official Use Only - General]

Hi Minh,
I don't know why however I can't see V3 patch set on group.io. Can you see those patches on group.io?

Abner

> -----Original Message-----
> From: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
> Sent: Friday, May 5, 2023 11:58 AM
> To: devel@edk2.groups.io
> Cc: patches@amperecomputing.com; Chang, Abner
> <Abner.Chang@amd.com>; nicklew@nvidia.com; igork@ami.com;
> nhi@os.amperecomputing.com; tinhnguyen@os.amperecomputing.com;
> Minh Nguyen <minhnguyen1@os.amperecomputing.com>
> Subject: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> This patchset adds necessary changes for RedfishPkg to avoid some
> unexpected cases and fix compilation.
> 
> Changes since v3:
>  + Replaced __FUNCTION__ with __func__ to be more C11 compliant.
> Changes since v2:
>  + Added "Cc:" to maintainers in commit message.
>  + Corrected patch format subject prefix.
> Changes since v1:
>  + Removed redundant change and change the commit message for more
> precise in PATCH 2/5.
> 
> Nhi Pham (1):
>   RedfishPkg: Add missing newline character
> 
> Vu Nguyen (4):
>   RedfishPkg: Correct variable type to prevent memory corruption
>   RedfishPkg: Fix condition checking of error status
>   RedfishPkg: Create RestEx child on selected interface
>   RedfishPkg: Fix compile issue on Linux
> 
>  RedfishPkg/Include/Library/RestExLib.h                       |   3 +
>  RedfishPkg/Include/Pcd/RestExServiceDevicePath.h             |   5 +-
>  RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h            |   3 +-
>  RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c               | 153 ++++++++----
> --------
>  RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c           |   4 +-
>  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c |   3 +-
>  6 files changed, 73 insertions(+), 98 deletions(-)
> 
> --
> 2.39.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
  2023-05-05  5:03 ` [PATCH V3 0/5] Adding necessary changes for RedfishPkg Chang, Abner
@ 2023-05-05  5:35   ` Minh Nguyen
  2023-05-05  5:45     ` Chang, Abner
  0 siblings, 1 reply; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  5:35 UTC (permalink / raw)
  To: Chang, Abner, Minh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, nicklew@nvidia.com, igork@ami.com,
	nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com

Hi Abner,

  Yes, me too. I have sent the email to miki.demeter@intel.com for 
checking it.

Thanks,

Minh Nguyen

On 5/5/2023 12:03 PM, Chang, Abner wrote:
> [AMD Official Use Only - General]
>
> Hi Minh,
> I don't know why however I can't see V3 patch set on group.io. Can you see those patches on group.io?
>
> Abner
>
>> -----Original Message-----
>> From: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
>> Sent: Friday, May 5, 2023 11:58 AM
>> To: devel@edk2.groups.io
>> Cc: patches@amperecomputing.com; Chang, Abner
>> <Abner.Chang@amd.com>; nicklew@nvidia.com; igork@ami.com;
>> nhi@os.amperecomputing.com; tinhnguyen@os.amperecomputing.com;
>> Minh Nguyen <minhnguyen1@os.amperecomputing.com>
>> Subject: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
>>
>> Caution: This message originated from an External Source. Use proper
>> caution when opening attachments, clicking links, or responding.
>>
>>
>> This patchset adds necessary changes for RedfishPkg to avoid some
>> unexpected cases and fix compilation.
>>
>> Changes since v3:
>>   + Replaced __FUNCTION__ with __func__ to be more C11 compliant.
>> Changes since v2:
>>   + Added "Cc:" to maintainers in commit message.
>>   + Corrected patch format subject prefix.
>> Changes since v1:
>>   + Removed redundant change and change the commit message for more
>> precise in PATCH 2/5.
>>
>> Nhi Pham (1):
>>    RedfishPkg: Add missing newline character
>>
>> Vu Nguyen (4):
>>    RedfishPkg: Correct variable type to prevent memory corruption
>>    RedfishPkg: Fix condition checking of error status
>>    RedfishPkg: Create RestEx child on selected interface
>>    RedfishPkg: Fix compile issue on Linux
>>
>>   RedfishPkg/Include/Library/RestExLib.h                       |   3 +
>>   RedfishPkg/Include/Pcd/RestExServiceDevicePath.h             |   5 +-
>>   RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h            |   3 +-
>>   RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c               | 153 ++++++++----
>> --------
>>   RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c           |   4 +-
>>   RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c |   3 +-
>>   6 files changed, 73 insertions(+), 98 deletions(-)
>>
>> --
>> 2.39.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
  2023-05-05  5:35   ` Minh Nguyen
@ 2023-05-05  5:45     ` Chang, Abner
  2023-05-05  6:01       ` Minh Nguyen
  0 siblings, 1 reply; 18+ messages in thread
From: Chang, Abner @ 2023-05-05  5:45 UTC (permalink / raw)
  To: Minh Nguyen, Minh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, nicklew@nvidia.com, igork@ami.com,
	nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com

[AMD Official Use Only - General]

Ok, because the patch in email always has format problem when apply the patch, plus I can't get the patch from group.io; could you please create a PR on your Github thus I can review patches from there.
Just let me know the PR # after you creating it.

Thanks
Abner

> -----Original Message-----
> From: Minh Nguyen <minhnguyen1@amperemail.onmicrosoft.com>
> Sent: Friday, May 5, 2023 1:35 PM
> To: Chang, Abner <Abner.Chang@amd.com>; Minh Nguyen
> <minhnguyen1@os.amperecomputing.com>; devel@edk2.groups.io
> Cc: patches@amperecomputing.com; nicklew@nvidia.com; igork@ami.com;
> nhi@os.amperecomputing.com; tinhnguyen@os.amperecomputing.com
> Subject: Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> 
>   Yes, me too. I have sent the email to miki.demeter@intel.com for checking
> it.
> 
> Thanks,
> 
> Minh Nguyen
> 
> On 5/5/2023 12:03 PM, Chang, Abner wrote:
> > [AMD Official Use Only - General]
> >
> > Hi Minh,
> > I don't know why however I can't see V3 patch set on group.io. Can you see
> those patches on group.io?
> >
> > Abner
> >
> >> -----Original Message-----
> >> From: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
> >> Sent: Friday, May 5, 2023 11:58 AM
> >> To: devel@edk2.groups.io
> >> Cc: patches@amperecomputing.com; Chang, Abner
> <Abner.Chang@amd.com>;
> >> nicklew@nvidia.com; igork@ami.com; nhi@os.amperecomputing.com;
> >> tinhnguyen@os.amperecomputing.com;
> >> Minh Nguyen <minhnguyen1@os.amperecomputing.com>
> >> Subject: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
> >>
> >> Caution: This message originated from an External Source. Use proper
> >> caution when opening attachments, clicking links, or responding.
> >>
> >>
> >> This patchset adds necessary changes for RedfishPkg to avoid some
> >> unexpected cases and fix compilation.
> >>
> >> Changes since v3:
> >>   + Replaced __FUNCTION__ with __func__ to be more C11 compliant.
> >> Changes since v2:
> >>   + Added "Cc:" to maintainers in commit message.
> >>   + Corrected patch format subject prefix.
> >> Changes since v1:
> >>   + Removed redundant change and change the commit message for more
> >> precise in PATCH 2/5.
> >>
> >> Nhi Pham (1):
> >>    RedfishPkg: Add missing newline character
> >>
> >> Vu Nguyen (4):
> >>    RedfishPkg: Correct variable type to prevent memory corruption
> >>    RedfishPkg: Fix condition checking of error status
> >>    RedfishPkg: Create RestEx child on selected interface
> >>    RedfishPkg: Fix compile issue on Linux
> >>
> >>   RedfishPkg/Include/Library/RestExLib.h                       |   3 +
> >>   RedfishPkg/Include/Pcd/RestExServiceDevicePath.h             |   5 +-
> >>   RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h            |   3 +-
> >>   RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c               | 153
> ++++++++----
> >> --------
> >>   RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c           |   4 +-
> >>   RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c |   3 +-
> >>   6 files changed, 73 insertions(+), 98 deletions(-)
> >>
> >> --
> >> 2.39.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
  2023-05-05  5:45     ` Chang, Abner
@ 2023-05-05  6:01       ` Minh Nguyen
  2023-05-05  6:50         ` Minh Nguyen
  0 siblings, 1 reply; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  6:01 UTC (permalink / raw)
  To: Chang, Abner, Minh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, nicklew@nvidia.com, igork@ami.com,
	nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com

[-- Attachment #1: Type: text/plain, Size: 3600 bytes --]

Hi Abner,

  Here you are: #4338 <https://github.com/tianocore/edk2/pull/4338>

Thanks,

Minh Nguyen

On 5/5/2023 12:45 PM, Chang, Abner wrote:
> [EXTERNAL EMAIL NOTICE: This email originated from an external sender. Please be mindful of safe email handling and proprietary information protection practices.]
>
>
> [AMD Official Use Only - General]
>
> Ok, because the patch in email always has format problem when apply the patch, plus I can't get the patch from group.io; could you please create a PR on your Github thus I can review patches from there.
> Just let me know the PR # after you creating it.
>
> Thanks
> Abner
>
>> -----Original Message-----
>> From: Minh Nguyen<minhnguyen1@amperemail.onmicrosoft.com>
>> Sent: Friday, May 5, 2023 1:35 PM
>> To: Chang, Abner<Abner.Chang@amd.com>; Minh Nguyen
>> <minhnguyen1@os.amperecomputing.com>;devel@edk2.groups.io
>> Cc:patches@amperecomputing.com;nicklew@nvidia.com;igork@ami.com;
>> nhi@os.amperecomputing.com;tinhnguyen@os.amperecomputing.com
>> Subject: Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
>>
>> Caution: This message originated from an External Source. Use proper
>> caution when opening attachments, clicking links, or responding.
>>
>>
>> Hi Abner,
>>
>>    Yes, me too. I have sent the email tomiki.demeter@intel.com  for checking
>> it.
>>
>> Thanks,
>>
>> Minh Nguyen
>>
>> On 5/5/2023 12:03 PM, Chang, Abner wrote:
>>> [AMD Official Use Only - General]
>>>
>>> Hi Minh,
>>> I don't know why however I can't see V3 patch set on group.io. Can you see
>> those patches on group.io?
>>> Abner
>>>
>>>> -----Original Message-----
>>>> From: Minh Nguyen<minhnguyen1@os.amperecomputing.com>
>>>> Sent: Friday, May 5, 2023 11:58 AM
>>>> To:devel@edk2.groups.io
>>>> Cc:patches@amperecomputing.com; Chang, Abner
>> <Abner.Chang@amd.com>;
>>>> nicklew@nvidia.com;igork@ami.com;nhi@os.amperecomputing.com;
>>>> tinhnguyen@os.amperecomputing.com;
>>>> Minh Nguyen<minhnguyen1@os.amperecomputing.com>
>>>> Subject: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
>>>>
>>>> Caution: This message originated from an External Source. Use proper
>>>> caution when opening attachments, clicking links, or responding.
>>>>
>>>>
>>>> This patchset adds necessary changes for RedfishPkg to avoid some
>>>> unexpected cases and fix compilation.
>>>>
>>>> Changes since v3:
>>>>    + Replaced __FUNCTION__ with __func__ to be more C11 compliant.
>>>> Changes since v2:
>>>>    + Added "Cc:" to maintainers in commit message.
>>>>    + Corrected patch format subject prefix.
>>>> Changes since v1:
>>>>    + Removed redundant change and change the commit message for more
>>>> precise in PATCH 2/5.
>>>>
>>>> Nhi Pham (1):
>>>>     RedfishPkg: Add missing newline character
>>>>
>>>> Vu Nguyen (4):
>>>>     RedfishPkg: Correct variable type to prevent memory corruption
>>>>     RedfishPkg: Fix condition checking of error status
>>>>     RedfishPkg: Create RestEx child on selected interface
>>>>     RedfishPkg: Fix compile issue on Linux
>>>>
>>>>    RedfishPkg/Include/Library/RestExLib.h                       |   3 +
>>>>    RedfishPkg/Include/Pcd/RestExServiceDevicePath.h             |   5 +-
>>>>    RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h            |   3 +-
>>>>    RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c               | 153
>> ++++++++----
>>>> --------
>>>>    RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c           |   4 +-
>>>>    RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c |   3 +-
>>>>    6 files changed, 73 insertions(+), 98 deletions(-)
>>>>
>>>> --
>>>> 2.39.0

[-- Attachment #2: Type: text/html, Size: 6170 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH V3 2/5] RedfishPkg: Fix condition checking of error status
  2023-05-05  6:45 minhnampere
@ 2023-05-05  6:45 ` minhnampere
  0 siblings, 0 replies; 18+ messages in thread
From: minhnampere @ 2023-05-05  6:45 UTC (permalink / raw)
  To: devel
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen, Vu Nguyen,
	Minh Nguyen, Nick Ramirez

From: Vu Nguyen <vunguyen@os.amperecomputing.com>

This change fixes condition checking of error status, the condition
should be compared with TRUE status to be identical with an error message.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
---
 RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
index 0900a2479e7b..14702748813b 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
@@ -5,6 +5,7 @@
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
   Copyright (c) 2022, AMD Incorporated. All rights reserved.
   Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -926,7 +927,7 @@ AddAndSignalNewRedfishService (
     }
 
     Status = gBS->SignalEvent (Instance->DiscoverToken->Event);
-    if (!EFI_ERROR (Status)) {
+    if (EFI_ERROR (Status)) {
       DEBUG ((DEBUG_ERROR, "%a:No event to signal!\n", __func__));
     }
   }
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
  2023-05-05  6:01       ` Minh Nguyen
@ 2023-05-05  6:50         ` Minh Nguyen
  2023-05-08 13:45           ` Chang, Abner
  0 siblings, 1 reply; 18+ messages in thread
From: Minh Nguyen @ 2023-05-05  6:50 UTC (permalink / raw)
  To: Chang, Abner, Minh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, nicklew@nvidia.com, igork@ami.com,
	nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com

[-- Attachment #1: Type: text/plain, Size: 3921 bytes --]

Hi Abner,

  While they're checking this issue, they recommend me to re-send v3 so 
I just sent it, you can also use the PR to review at the same time.

Thanks,

Minh Nguyen.

On 5/5/2023 1:01 PM, Minh Nguyen wrote:
>
> Hi Abner,
>
>  Here you are: #4338 <https://github.com/tianocore/edk2/pull/4338>
>
> Thanks,
>
> Minh Nguyen
>
> On 5/5/2023 12:45 PM, Chang, Abner wrote:
>> [EXTERNAL EMAIL NOTICE: This email originated from an external sender. Please be mindful of safe email handling and proprietary information protection practices.]
>>
>>
>> [AMD Official Use Only - General]
>>
>> Ok, because the patch in email always has format problem when apply the patch, plus I can't get the patch from group.io; could you please create a PR on your Github thus I can review patches from there.
>> Just let me know the PR # after you creating it.
>>
>> Thanks
>> Abner
>>
>>> -----Original Message-----
>>> From: Minh Nguyen<minhnguyen1@amperemail.onmicrosoft.com>
>>> Sent: Friday, May 5, 2023 1:35 PM
>>> To: Chang, Abner<Abner.Chang@amd.com>; Minh Nguyen
>>> <minhnguyen1@os.amperecomputing.com>;devel@edk2.groups.io
>>> Cc:patches@amperecomputing.com;nicklew@nvidia.com;igork@ami.com;
>>> nhi@os.amperecomputing.com;tinhnguyen@os.amperecomputing.com
>>> Subject: Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
>>>
>>> Caution: This message originated from an External Source. Use proper
>>> caution when opening attachments, clicking links, or responding.
>>>
>>>
>>> Hi Abner,
>>>
>>>    Yes, me too. I have sent the email tomiki.demeter@intel.com  for checking
>>> it.
>>>
>>> Thanks,
>>>
>>> Minh Nguyen
>>>
>>> On 5/5/2023 12:03 PM, Chang, Abner wrote:
>>>> [AMD Official Use Only - General]
>>>>
>>>> Hi Minh,
>>>> I don't know why however I can't see V3 patch set on group.io. Can you see
>>> those patches on group.io?
>>>> Abner
>>>>
>>>>> -----Original Message-----
>>>>> From: Minh Nguyen<minhnguyen1@os.amperecomputing.com>
>>>>> Sent: Friday, May 5, 2023 11:58 AM
>>>>> To:devel@edk2.groups.io
>>>>> Cc:patches@amperecomputing.com; Chang, Abner
>>> <Abner.Chang@amd.com>;
>>>>> nicklew@nvidia.com;igork@ami.com;nhi@os.amperecomputing.com;
>>>>> tinhnguyen@os.amperecomputing.com;
>>>>> Minh Nguyen<minhnguyen1@os.amperecomputing.com>
>>>>> Subject: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
>>>>>
>>>>> Caution: This message originated from an External Source. Use proper
>>>>> caution when opening attachments, clicking links, or responding.
>>>>>
>>>>>
>>>>> This patchset adds necessary changes for RedfishPkg to avoid some
>>>>> unexpected cases and fix compilation.
>>>>>
>>>>> Changes since v3:
>>>>>    + Replaced __FUNCTION__ with __func__ to be more C11 compliant.
>>>>> Changes since v2:
>>>>>    + Added "Cc:" to maintainers in commit message.
>>>>>    + Corrected patch format subject prefix.
>>>>> Changes since v1:
>>>>>    + Removed redundant change and change the commit message for more
>>>>> precise in PATCH 2/5.
>>>>>
>>>>> Nhi Pham (1):
>>>>>     RedfishPkg: Add missing newline character
>>>>>
>>>>> Vu Nguyen (4):
>>>>>     RedfishPkg: Correct variable type to prevent memory corruption
>>>>>     RedfishPkg: Fix condition checking of error status
>>>>>     RedfishPkg: Create RestEx child on selected interface
>>>>>     RedfishPkg: Fix compile issue on Linux
>>>>>
>>>>>    RedfishPkg/Include/Library/RestExLib.h                       |   3 +
>>>>>    RedfishPkg/Include/Pcd/RestExServiceDevicePath.h             |   5 +-
>>>>>    RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h            |   3 +-
>>>>>    RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c               | 153
>>> ++++++++----
>>>>> --------
>>>>>    RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c           |   4 +-
>>>>>    RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c |   3 +-
>>>>>    6 files changed, 73 insertions(+), 98 deletions(-)
>>>>>
>>>>> --
>>>>> 2.39.0

[-- Attachment #2: Type: text/html, Size: 7421 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux
  2023-05-05  3:58 ` [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux Minh Nguyen
@ 2023-05-05 22:57   ` Pedro Falcato
  2023-05-05 23:32     ` Michael D Kinney
  2023-05-07  5:39     ` Minh Nguyen
  0 siblings, 2 replies; 18+ messages in thread
From: Pedro Falcato @ 2023-05-05 22:57 UTC (permalink / raw)
  To: devel, minhnguyen1
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen, Vu Nguyen,
	Nick Ramirez

On Fri, May 5, 2023 at 6:12 PM Minh Nguyen via groups.io
<minhnguyen1=os.amperecomputing.com@groups.io> wrote:
>
> From: Vu Nguyen <vunguyen@os.amperecomputing.com>
>
> It requires a fixed size array to store the content of device path PCD.
> Add the array size to solve this issue.
>
> Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nick Ramirez <nramirez@nvidia.com>
> Reviewed-by: Abner Chang <Abner.Chang@amd.com>
> ---
>  RedfishPkg/Include/Pcd/RestExServiceDevicePath.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> index 91b1198297c2..57fc199f61f2 100644
> --- a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> +++ b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> @@ -4,6 +4,7 @@
>
>    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> +  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>
>      SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -14,6 +15,8 @@
>
>  #include <Protocol/DevicePath.h>
>
> +#define MAX_DEVICE_PATH_NODE      40
> +
>  typedef enum {
>    DEVICE_PATH_MATCH_MAC_NODE = 1,
>    DEVICE_PATH_MATCH_PCI_NODE = 2,
> @@ -32,7 +35,7 @@ typedef struct {
>    //    0x03,0x0b,0x25,0x00,0x00,0x50,0x56,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
>    //    0x7f,0xff,0x04,0x00}
>    //
> -  EFI_DEVICE_PATH_PROTOCOL    DevicePath[];
> +  EFI_DEVICE_PATH_PROTOCOL      DevicePath[MAX_DEVICE_PATH_NODE];
>  } REST_EX_SERVICE_DEVICE_PATH_DATA;

This doesn't work (changes the meaning) and may possibly break ABI.

What error do you get? What compiler?

C99 flexible array members have been well defined and well supported
for maybe 20 years in GCC (https://godbolt.org/z/9qxKar4f6)

-- 
Pedro

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux
  2023-05-05 22:57   ` [edk2-devel] " Pedro Falcato
@ 2023-05-05 23:32     ` Michael D Kinney
  2023-05-07  5:39     ` Minh Nguyen
  1 sibling, 0 replies; 18+ messages in thread
From: Michael D Kinney @ 2023-05-05 23:32 UTC (permalink / raw)
  To: devel@edk2.groups.io, pedro.falcato@gmail.com,
	minhnguyen1@os.amperecomputing.com
  Cc: patches@amperecomputing.com, abner.chang@amd.com,
	nicklew@nvidia.com, igork@ami.com, nhi@os.amperecomputing.com,
	tinhnguyen@os.amperecomputing.com, Vu Nguyen, Nick Ramirez,
	Kinney, Michael D

I agree that flexible array members are a good way to define this.

The consumer needs to allocate extra space for the flexible array member.

If the size of the device path is known, then the allocation can be the exact size needed.

sizeof(REST_EX_SERVICE_DEVICE_PATH_DATA) + DevicePathSize(DevicePath)

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Pedro
> Falcato
> Sent: Friday, May 5, 2023 3:57 PM
> To: devel@edk2.groups.io; minhnguyen1@os.amperecomputing.com
> Cc: patches@amperecomputing.com; abner.chang@amd.com;
> nicklew@nvidia.com; igork@ami.com; nhi@os.amperecomputing.com;
> tinhnguyen@os.amperecomputing.com; Vu Nguyen
> <vunguyen@os.amperecomputing.com>; Nick Ramirez
> <nramirez@nvidia.com>
> Subject: Re: [edk2-devel] [PATCH V3 5/5] RedfishPkg: Fix compile issue on
> Linux
> 
> On Fri, May 5, 2023 at 6:12 PM Minh Nguyen via groups.io
> <minhnguyen1=os.amperecomputing.com@groups.io> wrote:
> >
> > From: Vu Nguyen <vunguyen@os.amperecomputing.com>
> >
> > It requires a fixed size array to store the content of device path PCD.
> > Add the array size to solve this issue.
> >
> > Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
> > Cc: Abner Chang <abner.chang@amd.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>
> > Cc: Nick Ramirez <nramirez@nvidia.com>
> > Reviewed-by: Abner Chang <Abner.Chang@amd.com>
> > ---
> >  RedfishPkg/Include/Pcd/RestExServiceDevicePath.h | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> > index 91b1198297c2..57fc199f61f2 100644
> > --- a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> > +++ b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> > @@ -4,6 +4,7 @@
> >
> >    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> >    (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> > +  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
> >
> >      SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -14,6 +15,8 @@
> >
> >  #include <Protocol/DevicePath.h>
> >
> > +#define MAX_DEVICE_PATH_NODE      40
> > +
> >  typedef enum {
> >    DEVICE_PATH_MATCH_MAC_NODE = 1,
> >    DEVICE_PATH_MATCH_PCI_NODE = 2,
> > @@ -32,7 +35,7 @@ typedef struct {
> >    //
> 0x03,0x0b,0x25,0x00,0x00,0x50,0x56,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x00
> ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0
> 0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
> >    //    0x7f,0xff,0x04,0x00}
> >    //
> > -  EFI_DEVICE_PATH_PROTOCOL    DevicePath[];
> > +  EFI_DEVICE_PATH_PROTOCOL      DevicePath[MAX_DEVICE_PATH_NODE];
> >  } REST_EX_SERVICE_DEVICE_PATH_DATA;
> 
> This doesn't work (changes the meaning) and may possibly break ABI.
> 
> What error do you get? What compiler?
> 
> C99 flexible array members have been well defined and well supported
> for maybe 20 years in GCC (https://godbolt.org/z/9qxKar4f6)
> 
> --
> Pedro
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux
  2023-05-05 22:57   ` [edk2-devel] " Pedro Falcato
  2023-05-05 23:32     ` Michael D Kinney
@ 2023-05-07  5:39     ` Minh Nguyen
  2023-05-07  6:22       ` Minh Nguyen
  1 sibling, 1 reply; 18+ messages in thread
From: Minh Nguyen @ 2023-05-07  5:39 UTC (permalink / raw)
  To: Pedro Falcato, devel, minhnguyen1
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen, Vu Nguyen,
	Nick Ramirez

[-- Attachment #1: Type: text/plain, Size: 5069 bytes --]

Hi Pedro,

Firstly, thanks for your comments, let me explain.

- "C99 flexible array members have been well defined and well supported
for maybe 20 years in GCC (https://godbolt.org/z/9qxKar4f6)" => *Yes, I 
agree and there's no**
**comment from my side* *but this is completely different with current 
issue, why? Please see the bellow**
**explanation.*
- When we define the PCD to map with any structure in .dec file, 
BaseTools will gen /*PcdValueInit.c*/.
In this file, there're a lot of using 
"/*__FIELD_SIZE(REST_EX_SERVICE_DEVICE_PATH_DATA, DevicePath);*/"
and this is the definiton of this macro "/*#define __FIELD_SIZE(TYPE, 
Field) (sizeof((TYPE *)0)->Field)*/".
When using 
"/*__STATIC_ASSERT((__FIELD_SIZE(REST_EX_SERVICE_DEVICE_PATH_DATA, 
DevicePath) >= 3) || *//*
*//*(__FIELD_SIZE(REST_EX_SERVICE_DEVICE_PATH_DATA, DevicePath) == 0), 
"Input buffer exceeds the buffer array");*/",
"/*(sizeof((TYPE *)0)->Field*/" will be an error (_*error: invalid 
application of ‘sizeof’ to incomplete type *__*
*__*EFI_DEVICE_PATH_PROTOCOL[]*_) => will cause error on 
"__STATIC_ASSERT" because _Static_assert requires its first parameter
to be a constant expression => the error message when compile this code 
is "_*Line 257 Value {0x03,0x0b,0x25,0x00,0x00,0x1b,*__*
*__*0x21,0xdc,0x35,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,*__*
*__*0x00,0x00,0x00,0x00,0x00,0x01,0x7f,0xff,0x04,0x00}:293:19: error: 
expression in static assertion is not an integer*_"

- An other demonstation on other platforms in this behavior: you can 
check at 
*edk2-platforms/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec*.
/*gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation|{0x0}|SMBIOS_TABLE_TYPE0|0xD0000001 
{*//*
*//*    <HeaderFiles>*//*
*//*      IndustryStandard/SmBios.h*//*
*//*    <Packages>*//*
*//*      MdePkg/MdePkg.dec*//*
*//*SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec*//*
*//*  }*/
/*gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BIOSCharacteristicsExtensionBytes[0]|0x33*//*
*//*gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BIOSCharacteristicsExtensionBytes[1]|0x0F*/
This is the declaration to map PcdSmbiosType0BiosInformation with 
SMBIOS_TABLE_TYPE0 structure and
the declaration of BIOSCharacteristicsExtensionBytes is "*UINT8 
BIOSCharacteristicsExtensionBytes[2];*". If
we remove the number of elements (2) to flexible array, we will see the 
same error like "_*Index of BIOSCharacteristicsExtensionBytes[0]:361:19: 
*__*
*__*error: expression in static assertion is not an integer*_".

=> Conclusion: This is not problem on compiler, it just comes from the 
way BasTools gen PcdValueInit.c
and define macros for this case (map PCD structure to any structure). I 
hope it satisfy your concerns.


Thanks,

Minh Nguyen.

On 5/6/2023 5:57 AM, Pedro Falcato wrote:
> On Fri, May 5, 2023 at 6:12 PM Minh Nguyen via groups.io
> <minhnguyen1=os.amperecomputing.com@groups.io>  wrote:
>> From: Vu Nguyen<vunguyen@os.amperecomputing.com>
>>
>> It requires a fixed size array to store the content of device path PCD.
>> Add the array size to solve this issue.
>>
>> Signed-off-by: Minh Nguyen<minhnguyen1@os.amperecomputing.com>
>> Cc: Abner Chang<abner.chang@amd.com>
>> Cc: Igor Kulchytskyy<igork@ami.com>
>> Cc: Nick Ramirez<nramirez@nvidia.com>
>> Reviewed-by: Abner Chang<Abner.Chang@amd.com>
>> ---
>>   RedfishPkg/Include/Pcd/RestExServiceDevicePath.h | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
>> index 91b1198297c2..57fc199f61f2 100644
>> --- a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
>> +++ b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
>> @@ -4,6 +4,7 @@
>>
>>     Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>>     (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
>> +  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>>
>>       SPDX-License-Identifier: BSD-2-Clause-Patent
>>
>> @@ -14,6 +15,8 @@
>>
>>   #include <Protocol/DevicePath.h>
>>
>> +#define MAX_DEVICE_PATH_NODE      40
>> +
>>   typedef enum {
>>     DEVICE_PATH_MATCH_MAC_NODE = 1,
>>     DEVICE_PATH_MATCH_PCI_NODE = 2,
>> @@ -32,7 +35,7 @@ typedef struct {
>>     //    0x03,0x0b,0x25,0x00,0x00,0x50,0x56,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
>>     //    0x7f,0xff,0x04,0x00}
>>     //
>> -  EFI_DEVICE_PATH_PROTOCOL    DevicePath[];
>> +  EFI_DEVICE_PATH_PROTOCOL      DevicePath[MAX_DEVICE_PATH_NODE];
>>   } REST_EX_SERVICE_DEVICE_PATH_DATA;
> This doesn't work (changes the meaning) and may possibly break ABI.
>
> What error do you get? What compiler?
>
> C99 flexible array members have been well defined and well supported
> for maybe 20 years in GCC (https://godbolt.org/z/9qxKar4f6)
>

[-- Attachment #2: Type: text/html, Size: 7403 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux
  2023-05-07  5:39     ` Minh Nguyen
@ 2023-05-07  6:22       ` Minh Nguyen
  0 siblings, 0 replies; 18+ messages in thread
From: Minh Nguyen @ 2023-05-07  6:22 UTC (permalink / raw)
  To: Pedro Falcato, devel, minhnguyen1
  Cc: patches, abner.chang, nicklew, igork, nhi, tinhnguyen, Vu Nguyen,
	Nick Ramirez

[-- Attachment #1: Type: text/plain, Size: 5206 bytes --]

Hi Pedro,
  I just re-sent in readable format.

Thanks,
Minh Nguyen

On 5/7/2023 12:39 PM, Minh Nguyen wrote:
> Hi Pedro,
>   Firstly, thanks for your comments, let me explain.
>     - "C99 flexible array members have been well defined and well
>       supported for maybe 20 years in GCC (https://godbolt.org/z/9qxKar4f6)"
>       =>*Yes, I agree and there's no****comment from my side*  *but this is completely different with current issue, why? Please see 
> the bellow****explanation.*
>     - When we define the PCD to map with any structure in .dec file, BaseTools will gen/*PcdValueInit.c*/.
>       In this file, there're a lot of using "/*__FIELD_SIZE(REST_EX_SERVICE_DEVICE_PATH_DATA, DevicePath);*/"
>       and this is the definiton of this macro "/*#define __FIELD_SIZE(TYPE, Field) (sizeof((TYPE *)0)->Field)*/".
>       When using "/*__STATIC_ASSERT((__FIELD_SIZE(REST_EX_SERVICE_DEVICE_PATH_DATA, 
> DevicePath) >= 3) || *//**//*(__FIELD_SIZE(REST_EX_SERVICE_DEVICE_PATH_DATA, DevicePath) == 0), 
> "Input buffer exceeds the buffer array");*/",
>        "/*(sizeof((TYPE *)0)->Field*/" will be an error (*error: invalid application of ‘sizeof’ to incomplete type **EFI_DEVICE_PATH_PROTOCOL[]*)
>       => cause error on "__STATIC_ASSERT" because _Static_assert requires its first parameter to be a constant expression => the error message when compile
>       this code is "*Line 257 Value {0x03,0x0b,0x25,0x00,0x00,0x1b,****0x21,0xdc,0x35,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,****0x00,0x00,0x00,0x00,0x00,0x01,0x7f,0xff,0x04,0x00}:293:19: error: 
> expression in static assertion is not an integer*".

     - An other demonstation on other platforms in this behavior: You can check at*edk2-platforms/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec*  and I try it in my platform.

>   
> gAmpereTokenSpaceGuid.PcdSmbiosType0BiosInformation|{0x0}|SMBIOS_TABLE_TYPE0|0xB000000C{
>     <HeaderFiles>
> IndustryStandard/SmBios.h
>     <Packages>
>       MdePkg/MdePkg.dec
>       Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec
>   }
>   gAmpereTokenSpaceGuid.PcdSmbiosType0BiosInformation.Vendor|0x1
>   
> gAmpereTokenSpaceGuid.PcdSmbiosType0BiosInformation.BIOSCharacteristicsExtensionBytes[0]|0x33 
>

      This is the declaration to map PcdSmbiosType0BiosInformation with SMBIOS_TABLE_TYPE0 structure and
      the declaration BIOSCharacteristicsExtensionBytes is "*UINT8 BIOSCharacteristicsExtensionBytes[2];*".
      If we remove the number of elements (2) to flexible array, we will see the same error like
      "*Index of BIOSCharacteristicsExtensionBytes[0]:361:19: error: expression 
in static assertion is not an integer."*
      
  => CONCLUSION: This is not problem of compiler, it just comes from the way BaseTools gen
/*PcdValueInit.c*/  and definition of macros. I hope above explanation satisfy your concern.

Thanks,
Minh Nguyen

> On 5/6/2023 5:57 AM, Pedro Falcato wrote:
>> On Fri, May 5, 2023 at 6:12 PM Minh Nguyen via groups.io
>> <minhnguyen1=os.amperecomputing.com@groups.io>  wrote:
>>> From: Vu Nguyen<vunguyen@os.amperecomputing.com>
>>>
>>> It requires a fixed size array to store the content of device path PCD.
>>> Add the array size to solve this issue.
>>>
>>> Signed-off-by: Minh Nguyen<minhnguyen1@os.amperecomputing.com>
>>> Cc: Abner Chang<abner.chang@amd.com>
>>> Cc: Igor Kulchytskyy<igork@ami.com>
>>> Cc: Nick Ramirez<nramirez@nvidia.com>
>>> Reviewed-by: Abner Chang<Abner.Chang@amd.com>
>>> ---
>>>   RedfishPkg/Include/Pcd/RestExServiceDevicePath.h | 5 ++++-
>>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
>>> index 91b1198297c2..57fc199f61f2 100644
>>> --- a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
>>> +++ b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
>>> @@ -4,6 +4,7 @@
>>>
>>>     Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>>>     (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
>>> +  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>>>
>>>       SPDX-License-Identifier: BSD-2-Clause-Patent
>>>
>>> @@ -14,6 +15,8 @@
>>>
>>>   #include <Protocol/DevicePath.h>
>>>
>>> +#define MAX_DEVICE_PATH_NODE      40
>>> +
>>>   typedef enum {
>>>     DEVICE_PATH_MATCH_MAC_NODE = 1,
>>>     DEVICE_PATH_MATCH_PCI_NODE = 2,
>>> @@ -32,7 +35,7 @@ typedef struct {
>>>     //    0x03,0x0b,0x25,0x00,0x00,0x50,0x56,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
>>>     //    0x7f,0xff,0x04,0x00}
>>>     //
>>> -  EFI_DEVICE_PATH_PROTOCOL    DevicePath[];
>>> +  EFI_DEVICE_PATH_PROTOCOL      DevicePath[MAX_DEVICE_PATH_NODE];
>>>   } REST_EX_SERVICE_DEVICE_PATH_DATA;
>> This doesn't work (changes the meaning) and may possibly break ABI.
>>
>> What error do you get? What compiler?
>>
>> C99 flexible array members have been well defined and well supported
>> for maybe 20 years in GCC (https://godbolt.org/z/9qxKar4f6)
>>

[-- Attachment #2: Type: text/html, Size: 8529 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
  2023-05-05  6:50         ` Minh Nguyen
@ 2023-05-08 13:45           ` Chang, Abner
  2023-05-09  0:46             ` Minh Nguyen
  0 siblings, 1 reply; 18+ messages in thread
From: Chang, Abner @ 2023-05-08 13:45 UTC (permalink / raw)
  To: Minh Nguyen, Minh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, nicklew@nvidia.com, igork@ami.com,
	nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com

[-- Attachment #1: Type: text/plain, Size: 5058 bytes --]

[AMD Official Use Only - General]

Hi Minh,
Just let you know your PR is just merged.
Thanks
Abner

From: Minh Nguyen <minhnguyen1@amperemail.onmicrosoft.com>
Sent: Friday, May 5, 2023 2:50 PM
To: Chang, Abner <Abner.Chang@amd.com>; Minh Nguyen <minhnguyen1@os.amperecomputing.com>; devel@edk2.groups.io
Cc: patches@amperecomputing.com; nicklew@nvidia.com; igork@ami.com; nhi@os.amperecomputing.com; tinhnguyen@os.amperecomputing.com
Subject: Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


Hi Abner,

 While they're checking this issue, they recommend me to re-send v3 so I just sent it, you can also use the PR to review at the same time.

Thanks,

Minh Nguyen.
On 5/5/2023 1:01 PM, Minh Nguyen wrote:

Hi Abner,

 Here you are: #4338<https://github.com/tianocore/edk2/pull/4338>

Thanks,

Minh Nguyen
On 5/5/2023 12:45 PM, Chang, Abner wrote:

[EXTERNAL EMAIL NOTICE: This email originated from an external sender. Please be mindful of safe email handling and proprietary information protection practices.]





[AMD Official Use Only - General]



Ok, because the patch in email always has format problem when apply the patch, plus I can't get the patch from group.io; could you please create a PR on your Github thus I can review patches from there.

Just let me know the PR # after you creating it.



Thanks

Abner



-----Original Message-----

From: Minh Nguyen <minhnguyen1@amperemail.onmicrosoft.com><mailto:minhnguyen1@amperemail.onmicrosoft.com>

Sent: Friday, May 5, 2023 1:35 PM

To: Chang, Abner <Abner.Chang@amd.com><mailto:Abner.Chang@amd.com>; Minh Nguyen

<minhnguyen1@os.amperecomputing.com><mailto:minhnguyen1@os.amperecomputing.com>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>

Cc: patches@amperecomputing.com<mailto:patches@amperecomputing.com>; nicklew@nvidia.com<mailto:nicklew@nvidia.com>; igork@ami.com<mailto:igork@ami.com>;

nhi@os.amperecomputing.com<mailto:nhi@os.amperecomputing.com>; tinhnguyen@os.amperecomputing.com<mailto:tinhnguyen@os.amperecomputing.com>

Subject: Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg



Caution: This message originated from an External Source. Use proper

caution when opening attachments, clicking links, or responding.





Hi Abner,



  Yes, me too. I have sent the email to miki.demeter@intel.com<mailto:miki.demeter@intel.com> for checking

it.



Thanks,



Minh Nguyen



On 5/5/2023 12:03 PM, Chang, Abner wrote:

[AMD Official Use Only - General]



Hi Minh,

I don't know why however I can't see V3 patch set on group.io. Can you see

those patches on group.io?

Abner



-----Original Message-----

From: Minh Nguyen <minhnguyen1@os.amperecomputing.com><mailto:minhnguyen1@os.amperecomputing.com>

Sent: Friday, May 5, 2023 11:58 AM

To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>

Cc: patches@amperecomputing.com<mailto:patches@amperecomputing.com>; Chang, Abner

<Abner.Chang@amd.com><mailto:Abner.Chang@amd.com>;

nicklew@nvidia.com<mailto:nicklew@nvidia.com>; igork@ami.com<mailto:igork@ami.com>; nhi@os.amperecomputing.com<mailto:nhi@os.amperecomputing.com>;

tinhnguyen@os.amperecomputing.com<mailto:tinhnguyen@os.amperecomputing.com>;

Minh Nguyen <minhnguyen1@os.amperecomputing.com><mailto:minhnguyen1@os.amperecomputing.com>

Subject: [PATCH V3 0/5] Adding necessary changes for RedfishPkg



Caution: This message originated from an External Source. Use proper

caution when opening attachments, clicking links, or responding.





This patchset adds necessary changes for RedfishPkg to avoid some

unexpected cases and fix compilation.



Changes since v3:

  + Replaced __FUNCTION__ with __func__ to be more C11 compliant.

Changes since v2:

  + Added "Cc:" to maintainers in commit message.

  + Corrected patch format subject prefix.

Changes since v1:

  + Removed redundant change and change the commit message for more

precise in PATCH 2/5.



Nhi Pham (1):

   RedfishPkg: Add missing newline character



Vu Nguyen (4):

   RedfishPkg: Correct variable type to prevent memory corruption

   RedfishPkg: Fix condition checking of error status

   RedfishPkg: Create RestEx child on selected interface

   RedfishPkg: Fix compile issue on Linux



  RedfishPkg/Include/Library/RestExLib.h                       |   3 +

  RedfishPkg/Include/Pcd/RestExServiceDevicePath.h             |   5 +-

  RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h            |   3 +-

  RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c               | 153

++++++++----

--------

  RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c           |   4 +-

  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c |   3 +-

  6 files changed, 73 insertions(+), 98 deletions(-)



--

2.39.0

[-- Attachment #2: Type: text/html, Size: 12446 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
  2023-05-08 13:45           ` Chang, Abner
@ 2023-05-09  0:46             ` Minh Nguyen
  0 siblings, 0 replies; 18+ messages in thread
From: Minh Nguyen @ 2023-05-09  0:46 UTC (permalink / raw)
  To: Chang, Abner, Minh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, nicklew@nvidia.com, igork@ami.com,
	nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com

[-- Attachment #1: Type: text/plain, Size: 6206 bytes --]

Hi Abner,

  Thanks for your information.

Thanks,

Minh Nguyen

On 5/8/2023 8:45 PM, Chang, Abner wrote:
> [EXTERNAL EMAIL NOTICE: This email originated from an external sender. 
> Please be mindful of safe email handling and proprietary information 
> protection practices.]
>
> [AMD Official Use Only - General]
>
> Hi Minh,
>
> Just let you know your PR is just merged.
>
> Thanks
>
> Abner
>
> *From:* Minh Nguyen <minhnguyen1@amperemail.onmicrosoft.com>
> *Sent:* Friday, May 5, 2023 2:50 PM
> *To:* Chang, Abner <Abner.Chang@amd.com>; Minh Nguyen 
> <minhnguyen1@os.amperecomputing.com>; devel@edk2.groups.io
> *Cc:* patches@amperecomputing.com; nicklew@nvidia.com; igork@ami.com; 
> nhi@os.amperecomputing.com; tinhnguyen@os.amperecomputing.com
> *Subject:* Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
>
>
> 	
>
> *Caution:*This message originated from an External Source. Use proper 
> caution when opening attachments, clicking links, or responding.
>
> Hi Abner,
>
>  While they're checking this issue, they recommend me to re-send v3 so 
> I just sent it, you can also use the PR to review at the same time.
>
> Thanks,
>
> Minh Nguyen.
>
> On 5/5/2023 1:01 PM, Minh Nguyen wrote:
>
>     Hi Abner,
>
>      Here you are: #4338 <https://github.com/tianocore/edk2/pull/4338>
>
>     Thanks,
>
>     Minh Nguyen
>
>     On 5/5/2023 12:45 PM, Chang, Abner wrote:
>
>         [EXTERNAL EMAIL NOTICE: This email originated from an external sender. Please be mindful of safe email handling and proprietary information protection practices.]
>
>         [AMD Official Use Only - General]
>
>         Ok, because the patch in email always has format problem when apply the patch, plus I can't get the patch from group.io; could you please create a PR on your Github thus I can review patches from there.
>
>         Just let me know the PR # after you creating it.
>
>         Thanks
>
>         Abner
>
>             -----Original Message-----
>
>             From: Minh Nguyen<minhnguyen1@amperemail.onmicrosoft.com>  <mailto:minhnguyen1@amperemail.onmicrosoft.com>
>
>             Sent: Friday, May 5, 2023 1:35 PM
>
>             To: Chang, Abner<Abner.Chang@amd.com>  <mailto:Abner.Chang@amd.com>; Minh Nguyen
>
>             <minhnguyen1@os.amperecomputing.com>  <mailto:minhnguyen1@os.amperecomputing.com>;devel@edk2.groups.io
>
>             Cc:patches@amperecomputing.com;nicklew@nvidia.com;igork@ami.com;
>
>             nhi@os.amperecomputing.com;tinhnguyen@os.amperecomputing.com
>
>             Subject: Re: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
>
>             Caution: This message originated from an External Source. Use proper
>
>             caution when opening attachments, clicking links, or responding.
>
>             Hi Abner,
>
>                Yes, me too. I have sent the email tomiki.demeter@intel.com  for checking
>
>             it.
>
>             Thanks,
>
>             Minh Nguyen
>
>             On 5/5/2023 12:03 PM, Chang, Abner wrote:
>
>                 [AMD Official Use Only - General]
>
>                 Hi Minh,
>
>                 I don't know why however I can't see V3 patch set on group.io. Can you see
>
>             those patches on group.io?
>
>                 Abner
>
>                     -----Original Message-----
>
>                     From: Minh Nguyen<minhnguyen1@os.amperecomputing.com>  <mailto:minhnguyen1@os.amperecomputing.com>
>
>                     Sent: Friday, May 5, 2023 11:58 AM
>
>                     To:devel@edk2.groups.io
>
>                     Cc:patches@amperecomputing.com; Chang, Abner
>
>             <Abner.Chang@amd.com>  <mailto:Abner.Chang@amd.com>;
>
>                     nicklew@nvidia.com;igork@ami.com;nhi@os.amperecomputing.com;
>
>                     tinhnguyen@os.amperecomputing.com;
>
>                     Minh Nguyen<minhnguyen1@os.amperecomputing.com>  <mailto:minhnguyen1@os.amperecomputing.com>
>
>                     Subject: [PATCH V3 0/5] Adding necessary changes for RedfishPkg
>
>                     Caution: This message originated from an External Source. Use proper
>
>                     caution when opening attachments, clicking links, or responding.
>
>                     This patchset adds necessary changes for RedfishPkg to avoid some
>
>                     unexpected cases and fix compilation.
>
>                     Changes since v3:
>
>                        + Replaced __FUNCTION__ with __func__ to be more C11 compliant.
>
>                     Changes since v2:
>
>                        + Added "Cc:" to maintainers in commit message.
>
>                        + Corrected patch format subject prefix.
>
>                     Changes since v1:
>
>                        + Removed redundant change and change the commit message for more
>
>                     precise in PATCH 2/5.
>
>                     Nhi Pham (1):
>
>                         RedfishPkg: Add missing newline character
>
>                     Vu Nguyen (4):
>
>                         RedfishPkg: Correct variable type to prevent memory corruption
>
>                         RedfishPkg: Fix condition checking of error status
>
>                         RedfishPkg: Create RestEx child on selected interface
>
>                         RedfishPkg: Fix compile issue on Linux
>
>                        RedfishPkg/Include/Library/RestExLib.h                       |   3 +
>
>                        RedfishPkg/Include/Pcd/RestExServiceDevicePath.h             |   5 +-
>
>                        RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h            |   3 +-
>
>                        RedfishPkg/Library/DxeRestExLib/DxeRestExLib.c               | 153
>
>             ++++++++----
>
>                     --------
>
>                        RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c           |   4 +-
>
>                        RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c |   3 +-
>
>                        6 files changed, 73 insertions(+), 98 deletions(-)
>
>                     --
>
>                     2.39.0
>

[-- Attachment #2: Type: text/html, Size: 17546 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-05-09  0:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05  3:58 [PATCH V3 0/5] Adding necessary changes for RedfishPkg Minh Nguyen
2023-05-05  3:58 ` [PATCH V3 1/5] RedfishPkg: Correct variable type to prevent memory corruption Minh Nguyen
2023-05-05  3:58 ` [PATCH V3 2/5] RedfishPkg: Fix condition checking of error status Minh Nguyen
2023-05-05  3:58 ` [PATCH V3 3/5] RedfishPkg: Create RestEx child on selected interface Minh Nguyen
2023-05-05  3:58 ` [PATCH V3 4/5] RedfishPkg: Add missing newline character Minh Nguyen
2023-05-05  3:58 ` [PATCH V3 5/5] RedfishPkg: Fix compile issue on Linux Minh Nguyen
2023-05-05 22:57   ` [edk2-devel] " Pedro Falcato
2023-05-05 23:32     ` Michael D Kinney
2023-05-07  5:39     ` Minh Nguyen
2023-05-07  6:22       ` Minh Nguyen
2023-05-05  5:03 ` [PATCH V3 0/5] Adding necessary changes for RedfishPkg Chang, Abner
2023-05-05  5:35   ` Minh Nguyen
2023-05-05  5:45     ` Chang, Abner
2023-05-05  6:01       ` Minh Nguyen
2023-05-05  6:50         ` Minh Nguyen
2023-05-08 13:45           ` Chang, Abner
2023-05-09  0:46             ` Minh Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2023-05-05  6:45 minhnampere
2023-05-05  6:45 ` [PATCH V3 2/5] RedfishPkg: Fix condition checking of error status minhnampere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox