[edk2-devel] [PATCH] RedfishPkg/HostInterfaceBmcUsbNic: Set default Redfish service port

Chang, Abner via groups.io posted 1 patch 5 months ago
Failed in applying to current master (apply log)
RedfishPkg/RedfishPkg.dec                                 | 8 ++++++--
.../PlatformHostInterfaceBmcUsbNicLib.inf                 | 1 +
.../PlatformHostInterfaceBmcUsbNicLib.c                   | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
[edk2-devel] [PATCH] RedfishPkg/HostInterfaceBmcUsbNic: Set default Redfish service port
Posted by Chang, Abner via groups.io 5 months ago
From: Abner Chang <abner.chang@amd.com>

BZ #4607
Create a PCD for the default Redfish service port.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishPkg/RedfishPkg.dec                                 | 8 ++++++--
 .../PlatformHostInterfaceBmcUsbNicLib.inf                 | 1 +
 .../PlatformHostInterfaceBmcUsbNicLib.c                   | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index e40538247c2..3ea9ff3ef7f 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -141,12 +141,16 @@
   # specification for that.
   #
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid|L"00000000-0000-0000-0000-000000000000"|VOID*|0x00001006
+  # Use PCD to declare the Redfish service port, default set to port 443.
+  # Platform can overide this value in platform DSC file.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServicePort|443|UINT16|0x00001007
   #
   # This PCD indicates that if BMC bootstrap credential service will be disabled by BIOS or not.
   #
-  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDisableBootstrapCredentialService|FALSE|BOOLEAN|0x00001007
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDisableBootstrapCredentialService|FALSE|BOOLEAN|0x00001008
   #
   # The EFI_REST_EX_HTTP_CONFIG_DATA.SendReceiveTimeout value that RedfishDiscoverDxe driver
   # set to EFI_REST_EX_PROTOCOL.
   #
-  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x00001008
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x00001009
diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
index f2c7d7fec89..838a1721a7a 100644
--- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
+++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
@@ -43,6 +43,7 @@
 [Pcd]
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName     ## CONSUMED
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid  ## CONSUMED
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServicePort  ## CONSUMED
 
 [Depex]
   gIpmiProtocolGuid
diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
index 2938d54da65..7f295fe7f1c 100644
--- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
+++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
@@ -244,7 +244,7 @@ RedfishPlatformHostInterfaceProtocolData (
         );
 
       // RedfishServiceIpPort
-      RedfishOverIpData->RedfishServiceIpPort = 0;
+      RedfishOverIpData->RedfishServiceIpPort = PcdGet16 (PcdRedfishServicePort);
 
       // RedfishServiceVlanId
       RedfishOverIpData->RedfishServiceVlanId = ThisInstance->VLanId;
-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111796): https://edk2.groups.io/g/devel/message/111796
Mute This Topic: https://groups.io/mt/102845949/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] RedfishPkg/HostInterfaceBmcUsbNic: Set default Redfish service port
Posted by Mike Maslenkin 5 months ago
On Tue, Nov 28, 2023 at 8:27 AM Chang, Abner via groups.io
<abner.chang=amd.com@groups.io> wrote:
>
> From: Abner Chang <abner.chang@amd.com>
>
> BZ #4607
> Create a PCD for the default Redfish service port.
>
> Signed-off-by: Abner Chang <abner.chang@amd.com>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  RedfishPkg/RedfishPkg.dec                                 | 8 ++++++--
>  .../PlatformHostInterfaceBmcUsbNicLib.inf                 | 1 +
>  .../PlatformHostInterfaceBmcUsbNicLib.c                   | 2 +-
>  3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
> index e40538247c2..3ea9ff3ef7f 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -141,12 +141,16 @@
>    # specification for that.
>    #
>    gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid|L"00000000-0000-0000-0000-000000000000"|VOID*|0x00001006
> +  # Use PCD to declare the Redfish service port, default set to port 443.
> +  # Platform can overide this value in platform DSC file.
> +  #
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServicePort|443|UINT16|0x00001007
>    #
>    # This PCD indicates that if BMC bootstrap credential service will be disabled by BIOS or not.
>    #
> -  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDisableBootstrapCredentialService|FALSE|BOOLEAN|0x00001007
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDisableBootstrapCredentialService|FALSE|BOOLEAN|0x00001008
>    #
>    # The EFI_REST_EX_HTTP_CONFIG_DATA.SendReceiveTimeout value that RedfishDiscoverDxe driver
>    # set to EFI_REST_EX_PROTOCOL.
>    #
> -  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x00001008
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x00001009
> diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
> index f2c7d7fec89..838a1721a7a 100644
> --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
> +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
> @@ -43,6 +43,7 @@
>  [Pcd]
>    gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName     ## CONSUMED
>    gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid  ## CONSUMED
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServicePort  ## CONSUMED
>
>  [Depex]
>    gIpmiProtocolGuid
> diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
> index 2938d54da65..7f295fe7f1c 100644
> --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
> +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
> @@ -244,7 +244,7 @@ RedfishPlatformHostInterfaceProtocolData (
>          );
>
>        // RedfishServiceIpPort
> -      RedfishOverIpData->RedfishServiceIpPort = 0;
> +      RedfishOverIpData->RedfishServiceIpPort = PcdGet16 (PcdRedfishServicePort);
>
>        // RedfishServiceVlanId
>        RedfishOverIpData->RedfishServiceVlanId = ThisInstance->VLanId;
> --
> 2.37.1.windows.1

Looks good to me. Thank you!

Regards,
MIke.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111799): https://edk2.groups.io/g/devel/message/111799
Mute This Topic: https://groups.io/mt/102845949/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-