Re: [edk2-devel] RedfishPlatformConfigDxe needs Depex on gEfiRegularExpressionProtocolGuid?

2024-07-10 Thread Nickle Wang via groups.io
Hi @Rebecca Cran,



I create pull request here to downgrade the message level to DEBUG_INFO: 
https://github.com/tianocore/edk2/pull/5897



Regards,

Nickle



> -Original Message-

> From: Rebecca Cran 

> Sent: Wednesday, July 10, 2024 2:48 AM

> To: Nickle Wang ; Abner Chang ;

> Igor Kulchytskyy 

> Cc: devel@edk2.groups.io

> Subject: Re: RedfishPlatformConfigDxe needs Depex on

> gEfiRegularExpressionProtocolGuid?

>

> External email: Use caution opening links or attachments

>

>

> I'm ok keeping the current behavior as long as the DEBUG_ERROR message is

> removed or downgraded to DEBUG_INFO. As it is, it makes it look as though the

> driver has failed when error messages are highlighted during the boot.

>

> --

> Rebecca Cran

>

> On 7/8/24 21:53, Nickle Wang wrote:

> >> Should the following change be made to make sure RegularExpressionDxe

> >> is loaded before RedfishPlatformConfigDxe?

> >

> > It is ok that RegularExpressionDxe is loaded after RedfishPlatformConfigDxe

> because EfiCreateProtocolNotifyEvent() is used to get Regular expression

> protocol. And I don't have objection to add the dependency as you suggested to

> eliminate the false alarm.

> >

> > Regards,

> > Nickle

> >

> >> -Original Message-

> >> From: Rebecca Cran mailto:rebe...@bsdio.com>>

> >> Sent: Tuesday, July 9, 2024 4:25 AM

> >> To: Abner Chang mailto:abner.ch...@amd.com>>; Nickle 
> >> Wang

> >> mailto:nick...@nvidia.com>>; Igor Kulchytskyy 
> >> mailto:ig...@ami.com>>

> >> Cc: devel@edk2.groups.io

> >> Subject: RedfishPlatformConfigDxe needs Depex on

> >> gEfiRegularExpressionProtocolGuid?

> >>

> >> External email: Use caution opening links or attachments

> >>

> >>

> >> I noticed that RedfishPlatformConfigDxe prints an error message that

> >> it can't find EFI_REGULAR_EXPRESSION_PROTOCOL.

> >>

> >> Should the following change be made to make sure RegularExpressionDxe

> >> is loaded before RedfishPlatformConfigDxe?

> >>

> >> diff --git

> >> a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf

> >> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf

> >> index 2db47c2cf..7490d89be 100644

> >> ---

> >> a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf

> >> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.in

> >> +++ f

> >> @@ -60,4 +60,4 @@

> >>

> >> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty

> >>

> >>[Depex]

> >> -  TRUE

> >> +  gEfiRegularExpressionProtocolGuid^M

> >>

> >> --

> >> Rebecca Cran




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119861): https://edk2.groups.io/g/devel/message/119861
Mute This Topic: https://groups.io/mt/107110826/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] RedfishPlatformConfigDxe needs Depex on gEfiRegularExpressionProtocolGuid?

2024-07-08 Thread Nickle Wang via groups.io
> Should the following change be made to make sure RegularExpressionDxe is
> loaded before RedfishPlatformConfigDxe?

It is ok that RegularExpressionDxe is loaded after RedfishPlatformConfigDxe 
because EfiCreateProtocolNotifyEvent() is used to get Regular expression 
protocol. And I don't have objection to add the dependency as you suggested to 
eliminate the false alarm.

Regards,
Nickle

> -Original Message-
> From: Rebecca Cran 
> Sent: Tuesday, July 9, 2024 4:25 AM
> To: Abner Chang ; Nickle Wang ;
> Igor Kulchytskyy 
> Cc: devel@edk2.groups.io
> Subject: RedfishPlatformConfigDxe needs Depex on
> gEfiRegularExpressionProtocolGuid?
> 
> External email: Use caution opening links or attachments
> 
> 
> I noticed that RedfishPlatformConfigDxe prints an error message that it can't 
> find
> EFI_REGULAR_EXPRESSION_PROTOCOL.
> 
> Should the following change be made to make sure RegularExpressionDxe is
> loaded before RedfishPlatformConfigDxe?
> 
> diff --git
> a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> index 2db47c2cf..7490d89be 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> @@ -60,4 +60,4 @@
>gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty
> 
>   [Depex]
> -  TRUE
> +  gEfiRegularExpressionProtocolGuid^M
> 
> --
> Rebecca Cran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119825): https://edk2.groups.io/g/devel/message/119825
Mute This Topic: https://groups.io/mt/107110826/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

2024-05-17 Thread Nickle Wang via groups.io
Hi Igor,

Thanks for your idea. This sounds feasible to me. Let me try to test it on my 
system.

Regards,
Nickle

> -Original Message-
> From: Igor Kulchytskyy 
> Sent: Thursday, May 16, 2024 7:34 PM
> To: Nickle Wang ; Chang, Abner
> ; devel@edk2.groups.io
> Cc: Nick Ramirez 
> Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> 
> External email: Use caution opening links or attachments
> 
> 
> We can have some protocol where all Redfish clients register saying that they 
> are
> using the bootstrap credentials.
> And when they finish their job they notify RedfishBootstrapAccountDxe driver 
> and
> when all of registered modules finish their job RedfishBootstrapAccountDxe 
> driver
> delete the account.
> Thank you,
> Igor
> 
> -Original Message-
> From: Nickle Wang 
> Sent: Wednesday, May 15, 2024 11:10 PM
> To: Chang, Abner ; Igor Kulchytskyy ;
> devel@edk2.groups.io
> Cc: Nick Ramirez 
> Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> 
> > RedfishFeatureCore could be one of the Redfish clients, delete the
> > credential from Redfish account service in RedfishFeatureCore
> > lifecycle may impact other Redfish clients that still need the communication
> with Redfish service, right?
> 
> When all Redfish clients are managed by RedfishFeatureCore, I think we don't
> have such case. And this may be a good reason to keep it in RedfishClientPkg. 
> This
> driver offers a way for BIOS to delete bootstrapping account at BMC after
> everything is done. Platform owner can decide to include this driver or not
> depending on the Redfish design in system.
> 
> Regards,
> Nickle
> 
> > -Original Message-
> > From: Chang, Abner 
> > Sent: Thursday, May 16, 2024 10:41 AM
> > To: Nickle Wang ; Igor Kulchytskyy
> > ; devel@edk2.groups.io
> > Cc: Nick Ramirez 
> > Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> >
> > External email: Use caution opening links or attachments
> >
> >
> > [AMD Official Use Only - General]
> >
> > I think we probably overlook some use cases. Multiple edk2 Redfish
> > applications running simultaneously is allowed from the design
> > perspective. However, we centralized GetAuthInfo in
> > RedfishPlatformCredentialLib for all of edk2 Redfish client entities
> > to leverage the same credential stored in EFI variable. This way we
> > can limit the process of acquiring credential to only one time Redfish IPMI
> bootstrap command sent to BMC.
> > RedfishFeatureCore could be one of the Redfish clients, delete the
> > credential from Redfish account service in RedfishFeatureCore
> > lifecycle may impact other Redfish clients that still need the communication
> with Redfish service, right?
> >
> > Thanks
> > Abner
> >
> > > -Original Message-
> > > From: Nickle Wang 
> > > Sent: Thursday, May 16, 2024 9:38 AM
> > > To: Chang, Abner ; Igor Kulchytskyy
> > > ; devel@edk2.groups.io
> > > Cc: Nick Ramirez 
> > > Subject: RE: [EXTERNAL] RE: [edk2-devel]
> > > [edk2-redfish-client][PATCH]
> > > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> > >
> > > [AMD Official Use Only - General]
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Hi Igor, Abner,
> > >
> > > > Maybe we should consider moving RedfishBootstrapAccountDxe driver
> > > > to
> > > RedfishPkg and have some register mechanism which will be used by
> > > interested drivers to notify that they finished their job and after
> > > that RedfishBootstrapAccountDxe driver would delete an account.
> > >
> > > You are saying the mechanism in runtime, right? In current design,
> > > RedfishFeatureCore driver will send "after provisioning" signal to
> > > notify this driver to delete bootstrapping account. This makes sure
> > > that all feature drivers are done with their jobs, so this driver is
> > > safe to delete bootstrapping account at BMC.
> > >
> > > If we move it to RedfishPkg, there is no such centralized Redfish
> > > driver managing Redfish stuff. How does a particular driver know
> > > that there is no other driver running Redfish stuff after it? The
> > > way I can think of now is to rely on EDK2 ready-to-boot event as the
> > > signal to do the notification, since there is not supposed to have
> > > Redfish driver running
> > jobs after this event...
> > >
> > > Regards,
> > > Nickle
> > >
> > > > -Original Message-
> > > > From: Chang, Abner 
> > > > Sent: Thursday, May 16, 2024 9:06 AM
> > > > To: Igor Kulchytskyy ; Nickle Wang
> > > > ; devel@edk2.groups.io
> > > > Cc: Nick Ramirez 
> > > > Subject: RE: [EXTERNAL] RE: [edk2-devel]
> > > > [edk2-redfish-client][PATCH]
> > > > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> > > >

Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

2024-05-15 Thread Nickle Wang via groups.io
> RedfishFeatureCore could be one of the Redfish clients, delete the credential 
> from
> Redfish account service in RedfishFeatureCore lifecycle may impact other 
> Redfish
> clients that still need the communication with Redfish service, right?

When all Redfish clients are managed by RedfishFeatureCore, I think we don't 
have such case. And this may be a good reason to keep it in RedfishClientPkg. 
This driver offers a way for BIOS to delete bootstrapping account at BMC after 
everything is done. Platform owner can decide to include this driver or not 
depending on the Redfish design in system. 

Regards,
Nickle

> -Original Message-
> From: Chang, Abner 
> Sent: Thursday, May 16, 2024 10:41 AM
> To: Nickle Wang ; Igor Kulchytskyy ;
> devel@edk2.groups.io
> Cc: Nick Ramirez 
> Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> I think we probably overlook some use cases. Multiple edk2 Redfish 
> applications
> running simultaneously is allowed from the design perspective. However, we
> centralized GetAuthInfo in RedfishPlatformCredentialLib for all of edk2 
> Redfish
> client entities to leverage the same credential stored in EFI variable. This 
> way we
> can limit the process of acquiring credential to only one time Redfish IPMI
> bootstrap command sent to BMC.
> RedfishFeatureCore could be one of the Redfish clients, delete the credential 
> from
> Redfish account service in RedfishFeatureCore lifecycle may impact other 
> Redfish
> clients that still need the communication with Redfish service, right?
> 
> Thanks
> Abner
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Thursday, May 16, 2024 9:38 AM
> > To: Chang, Abner ; Igor Kulchytskyy
> > ; devel@edk2.groups.io
> > Cc: Nick Ramirez 
> > Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> >
> > [AMD Official Use Only - General]
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Hi Igor, Abner,
> >
> > > Maybe we should consider moving RedfishBootstrapAccountDxe driver to
> > RedfishPkg and have some register mechanism which will be used by
> > interested drivers to notify that they finished their job and after
> > that RedfishBootstrapAccountDxe driver would delete an account.
> >
> > You are saying the mechanism in runtime, right? In current design,
> > RedfishFeatureCore driver will send "after provisioning" signal to
> > notify this driver to delete bootstrapping account. This makes sure
> > that all feature drivers are done with their jobs, so this driver is
> > safe to delete bootstrapping account at BMC.
> >
> > If we move it to RedfishPkg, there is no such centralized Redfish
> > driver managing Redfish stuff. How does a particular driver know that
> > there is no other driver running Redfish stuff after it? The way I can
> > think of now is to rely on EDK2 ready-to-boot event as the signal to
> > do the notification, since there is not supposed to have Redfish driver 
> > running
> jobs after this event...
> >
> > Regards,
> > Nickle
> >
> > > -Original Message-
> > > From: Chang, Abner 
> > > Sent: Thursday, May 16, 2024 9:06 AM
> > > To: Igor Kulchytskyy ; Nickle Wang
> > > ; devel@edk2.groups.io
> > > Cc: Nick Ramirez 
> > > Subject: RE: [EXTERNAL] RE: [edk2-devel]
> > > [edk2-redfish-client][PATCH]
> > > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > [AMD Official Use Only - General]
> > >
> > > HI Igor,
> > > This sounds to me reasonable to me. As you mentioned, RedfishPkg was
> > designed
> > > to support multiple Redfish applications and RedfishClientPkg is
> > > just one of
> > them. I
> > > think we can review the implementation of acquiring/deleting credential.
> > >
> > > Thanks
> > > Abner
> > >
> > >
> > > > -Original Message-
> > > > From: Igor Kulchytskyy 
> > > > Sent: Wednesday, May 15, 2024 11:02 PM
> > > > To: Nickle Wang ; devel@edk2.groups.io; Chang,
> > > > Abner 
> > > > Cc: Nick Ramirez 
> > > > Subject: RE: [EXTERNAL] RE: [edk2-devel]
> > > > [edk2-redfish-client][PATCH]
> > > > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> > > >
> > > > [AMD Official Use Only - General]
> > > >
> > > > Caution: This message originated from an External Source. Use
> > > > proper caution when opening attachments, clicking links, or responding.
> > > >
> > > >
> > > > Hi Nickle,
> > > > I have one more question to discuss regarding this driver.
> > > > We have a bootstrap account and creation of this account
> > > > controlled by RedfishCredentialDxe driver in RedfishPkg.
> > > > But deletion of that bootstrap account is 

Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

2024-05-15 Thread Nickle Wang via groups.io
Hi Igor, Abner,

> Maybe we should consider moving RedfishBootstrapAccountDxe driver to 
> RedfishPkg and have some register mechanism which will be used by interested 
> drivers to notify that they finished their job and after that 
> RedfishBootstrapAccountDxe driver would delete an account.

You are saying the mechanism in runtime, right? In current design, 
RedfishFeatureCore driver will send "after provisioning" signal to notify this 
driver to delete bootstrapping account. This makes sure that all feature 
drivers are done with their jobs, so this driver is safe to delete 
bootstrapping account at BMC.

If we move it to RedfishPkg, there is no such centralized Redfish driver 
managing Redfish stuff. How does a particular driver know that there is no 
other driver running Redfish stuff after it? The way I can think of now is to 
rely on EDK2 ready-to-boot event as the signal to do the notification, since 
there is not supposed to have Redfish driver running jobs after this event...

Regards,
Nickle

> -Original Message-
> From: Chang, Abner 
> Sent: Thursday, May 16, 2024 9:06 AM
> To: Igor Kulchytskyy ; Nickle Wang ;
> devel@edk2.groups.io
> Cc: Nick Ramirez 
> Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> HI Igor,
> This sounds to me reasonable to me. As you mentioned, RedfishPkg was designed
> to support multiple Redfish applications and RedfishClientPkg is just one of 
> them. I
> think we can review the implementation of acquiring/deleting credential.
> 
> Thanks
> Abner
> 
> 
> > -Original Message-
> > From: Igor Kulchytskyy 
> > Sent: Wednesday, May 15, 2024 11:02 PM
> > To: Nickle Wang ; devel@edk2.groups.io; Chang,
> > Abner 
> > Cc: Nick Ramirez 
> > Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> >
> > [AMD Official Use Only - General]
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Hi Nickle,
> > I have one more question to discuss regarding this driver.
> > We have a bootstrap account and creation of this account controlled by
> > RedfishCredentialDxe driver in RedfishPkg.
> > But deletion of that bootstrap account is moved to RedfishClientPkg.
> > What if we have another Redfish Client or some customer service which
> > uses RedfishPkg for the communication.
> > Architecturally it is allowed.
> > But then RedfishBootstrapAccountDxe module would delete account just
> > based on the RedfishClientPkg needs.
> > Maybe we should consider moving RedfishBootstrapAccountDxe driver to
> > RedfishPkg and have some register mechanism which will be used by
> > interested drivers to notify that they finished their job and after
> > that RedfishBootstrapAccountDxe driver would delete an account.
> > What do you think?
> > Thank you,
> > Igor
> >
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Tuesday, May 14, 2024 8:40 AM
> > To: devel@edk2.groups.io; abner.ch...@amd.com; Igor Kulchytskyy
> > 
> > Cc: Nick Ramirez 
> > Subject: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> >
> >
> > **CAUTION: The e-mail below is from an external source. Please
> > exercise caution before opening attachments, clicking links, or
> > following guidance.**
> >
> > Hi Abner,
> >
> > > Ok, then I don't have the problem with invoking GetAuthInfo again.
> > However, I
> > > will suggest to add more description in GetAuthInfo function header,
> > mention that
> > > we will keep the auth info in EFI variable until exist boot service.
> > > Also, give some more descriptions on the code you invoke to GetAuthInfo.
> >
> > Thanks for your comment. I add descriptions to explain above before
> > calling GetAuthInfo(). Version 2 path is here:
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2
> > .groups.io%2Fg%2Fdevel%2Fmessage%2F118889=05%7C02%7Cnicklew
> %40nvi
> >
> dia.com%7C10ec4812a68a434b806008dc75445994%7C43083d15727340c1b7db
> 39efd
> >
> 9ccc17a%7C0%7C0%7C638514183674607956%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiM
> >
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7
> C%7C
> >
> =GNlisCnBmVQRhCLTxICGDsArv%2B64lC%2BkktUMi8Yg%2BJM%3D
> rved=0
> >
> > Regards,
> > Nickle
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of
> > > Chang,
> > Abner
> > > via groups.io
> > > Sent: Tuesday, April 23, 2024 3:42 PM
> > > To: Nickle Wang ; Igor Kulchytskyy
> > > ; devel@edk2.groups.io
> > > Cc: Nick Ramirez 
> > > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg:
> > > introduce RedfishBootstrapAccountDxe
> > >
> > > External email: Use caution opening links or 

Re: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file for OEM net function

2024-05-15 Thread Nickle Wang via groups.io
Yes, this is pull request: https://github.com/tianocore/edk2/pull/5660

Thanks,
Nickle

> -Original Message-
> From: Chang, Abner 
> Sent: Thursday, May 16, 2024 9:01 AM
> To: devel@edk2.groups.io; Nickle Wang 
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Nick
> Ramirez 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file for
> OEM net function
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - AMD Internal Distribution Only]
> 
> Reviewed-by: Abner Chang 
> 
> Hi Nickle,
> Do you have the corresponding PR for this? I will merge it after hard freeze.
> Thanks
> Abner
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io  On Behalf Of Nickle
> > Wang via groups.io
> > Sent: Wednesday, May 15, 2024 4:50 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Attar, AbdulLateef (Abdul
> > Lateef) ; Nick Ramirez
> > 
> > Subject: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file
> > for OEM net function
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Add net function definitions for OEM/Non-IPMI group request and
> > response
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Abdul Lateef Attar 
> > Cc: Nick Ramirez 
> > ---
> >  MdePkg/Include/IndustryStandard/IpmiNetFnOem.h | 18
> > ++
> >  1 file changed, 18 insertions(+)
> >  create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> >
> > diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> > b/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> > new file mode 100644
> > index 00..48c5dbd803
> > --- /dev/null
> > +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> > @@ -0,0 +1,18 @@
> > +/** @file
> > +  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 
> > 1.1.
> > +
> > +  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > +
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > +
> > +#ifndef IPMI_NET_FN_OEM_H_
> > +#define IPMI_NET_FN_OEM_H_
> > +
> > +//
> > +// Net function definition for OEM/Group command //
> > +#define IPMI_NETFN_OEM0x2E
> > +#define IPMI_NETFN_OEM_GROUP  0x2F
> > +
> > +#endif
> > --
> > 2.34.1
> >
> >
> >
> > 
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118935): https://edk2.groups.io/g/devel/message/118935
Mute This Topic: https://groups.io/mt/106110708/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: add support for the phosphor ipmi blob transfer protocol

2024-05-15 Thread Nickle Wang via groups.io
Hi Nhi,

Version 2 patch files are sent for review here: 
https://edk2.groups.io/g/devel/message/118914 and 
https://edk2.groups.io/g/devel/message/118922

For your convenience, below are two pull requests if you would like to test 
them.

1) https://github.com/tianocore/edk2/pull/5660
2) https://github.com/tianocore/edk2-platforms/pull/76

I had tried to address review comments as much as I can. Please feel free to 
let me know if you see any issue in this version of patch set.

Thanks,
Nickle

> -Original Message-
> From: Nhi Pham 
> Sent: Tuesday, May 14, 2024 10:26 AM
> To: Nickle Wang ; devel@edk2.groups.io;
> abner.ch...@amd.com; Rebecca Cran 
> Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef)
> ; Tinh Nguyen
> 
> Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: add
> support for the phosphor ipmi blob transfer protocol
> 
> External email: Use caution opening links or attachments
> 
> 
> Thanks Nickle. I will help review and verify your patch.
> 
> On 5/14/2024 8:56 AM, Nickle Wang wrote:
> > Hi Nhi,
> >
> > This task is on my list but with lower priority. I will try to provide 
> > version 2 patch
> for review here by the end of this week.
> >
> > Thanks,
> > Nickle
> >
> >> -Original Message-
> >> From: Nhi Pham 
> >> Sent: Monday, May 13, 2024 5:02 PM
> >> To: devel@edk2.groups.io; abner.ch...@amd.com; Nickle Wang
> >> ; Rebecca Cran 
> >> Cc: Isaac Oram ; Attar, AbdulLateef (Abdul
> >> Lateef) ; Tinh Nguyen
> >> 
> >> Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg:
> >> add support for the phosphor ipmi blob transfer protocol
> >>
> >> External email: Use caution opening links or attachments
> >>
> >>
> >> On 2/9/2024 11:37 PM, Chang, Abner via groups.io wrote:
> >>> [AMD Official Use Only - General]
> >>>
> >>> Yeah, I forget this patch set and seems we don't have any follow up
> >>> conversation
> >> after below feedbacks from community.
> >>>
> >>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fed
> >>>
> k2%2F=05%7C02%7Cnicklew%40nvidia.com%7Cdc53be8f0cf24ccfd35108d
> c
> >>>
> 73bd2d45%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C6385125035
> 6068
> >>>
> 8708%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIi
> LCJ
> >>>
> BTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=%2BCkaU%2FcdG1v
> r6uPsA
> >>> 7fqrvhvxg%2FX5FqcmJ6fizaa9fA%3D=0
> >>> .groups.io%2Fg%2Fdevel%2Fmessage%2F103116=05%7C02%7Cnickle
> w
> >> %40nvi
> >>>
> >>
> dia.com%7C8b9e1a8a8d044208f8d608dc732b678d%7C43083d15727340c1b7db
> >> 39efd
> >>>
> >>
> 9ccc17a%7C0%7C0%7C638511877469561600%7CUnknown%7CTWFpbGZsb3d8
> >> eyJWIjoiM
> >>>
> >>
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7
> >> C%7C
> >>> =N4eDH668lBSFxq9r81QrhMgpULvht8isrrEI9lipVKc%3D=0
> >>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fed
> >>>
> k2%2F=05%7C02%7Cnicklew%40nvidia.com%7Cdc53be8f0cf24ccfd35108d
> c
> >>>
> 73bd2d45%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C6385125035
> 6070
> >>>
> 0897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIi
> LCJ
> >>>
> BTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=KFd86NhmrQeGqEB
> 8%2FJy
> >>> 0qnbMkb%2Furpo8YCsVbVsOxNk%3D=0
> >>> .groups.io%2Fg%2Fdevel%2Fmessage%2F103087=05%7C02%7Cnickle
> w
> >> %40nvi
> >>>
> >>
> dia.com%7C8b9e1a8a8d044208f8d608dc732b678d%7C43083d15727340c1b7db
> >> 39efd
> >>>
> >>
> 9ccc17a%7C0%7C0%7C638511877469569817%7CUnknown%7CTWFpbGZsb3d8
> >> eyJWIjoiM
> >>>
> >>
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7
> >> C%7C
> >>>
> >>
> =7p0BHb8RFRapFyygr35u0hQBK2bQwKPSypBaUi6cMIQ%3D=0
> >>>
> >>> So Nickle, does NV still has the plan to upstream IPMI blob edk2
> >> implementation? We should keep driving upstream the implementation as
> >> industry needs it to incorporate with OpenBMC.
> >>>
> >>> Hi Rebessa,
> >>> As we are on Chinese New Year holidays now, please expect the delay
> response.
> >>> Thanks
> >>> Abner
> >>>
> >>
> >> Hi Nickle and Abner,
> >>
> >> May I know the status of upstreaming the IPMI Blob Transfer Protocol?
> >> I'm planning to upstream the SMBIOS transfer to OpenBMC by leveraging
> >> this protocol.
> >>
> >> Thanks,
> >> Nhi


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118923): https://edk2.groups.io/g/devel/message/118923
Mute This Topic: https://groups.io/mt/98212643/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms][PATCH v2] ManageabilityPkg: add support for the phosphor ipmi blob transfer protocol

2024-05-15 Thread Nickle Wang via groups.io
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4773

This change implements the blob transfer protocol used in OpenBmc
documented here: https://github.com/openbmc/phosphor-ipmi-blobs

Signed-off-by: Nick Ramirez 
Co-authored-by: Nickle Wang 
Cc: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Tinh Nguyen 
Cc: Nhi Pham 
Cc: Thang Nguyen OS 
Cc: Mike Maslenkin 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |3 +
 .../Include/Manageability.dsc |2 +
 .../IpmiBlobTransferDxe.inf   |   39 +
 .../IpmiBlobTransferTestUnitTestsHost.inf |   40 +
 .../Include/Protocol/IpmiBlobTransfer.h   |  253 
 .../InternalIpmiBlobTransfer.h|  407 ++
 .../IpmiBlobTransferDxe/IpmiBlobTransferDxe.c |  872 +
 .../UnitTest/IpmiBlobTransferTestUnitTests.c  | 1113 +
 .../Universal/IpmiBlobTransferDxe/Readme.md   |   24 +
 9 files changed, 2753 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/IpmiBlobTransferDxe.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/UnitTest/IpmiBlobTransferTestUnitTestsHost.inf
 create mode 100644 
Features/ManageabilityPkg/Include/Protocol/IpmiBlobTransfer.h
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/InternalIpmiBlobTransfer.h
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/IpmiBlobTransferDxe.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/UnitTest/IpmiBlobTransferTestUnitTests.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/Readme.md

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index eb0ee67cba..dc1d00162c 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -4,6 +4,7 @@
 # those are related to the platform management.
 #
 # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -58,6 +59,8 @@
   gEdkiiPldmProtocolGuid= { 0x60997616, 0xDB70, 0x4B5F, { 
0x86, 0xA4, 0x09, 0x58, 0xA3, 0x71, 0x47, 0xB4 } }
   gEdkiiPldmSmbiosTransferProtocolGuid  = { 0xFA431C3C, 0x816B, 0x4B32, { 
0xA3, 0xE0, 0xAD, 0x9B, 0x7F, 0x64, 0x27, 0x2E } }
   gEdkiiMctpProtocolGuid= { 0xE93465C1, 0x9A31, 0x4C96, { 
0x92, 0x56, 0x22, 0x0A, 0xE1, 0x80, 0xB4, 0x1B } }
+  ## Include/Protocol/IpmiBlobTransfer.h
+  gEdkiiIpmiBlobTransferProtocolGuid= { 0x05837c75, 0x1d65, 0x468b, { 
0xb1, 0xc2, 0x81, 0xaf, 0x9a, 0x31, 0x5b, 0x2c } }
 
 [PcdsFixedAtBuild]
   ## This value is the MCTP Interface source and destination endpoint ID for 
transmiting MCTP message.
diff --git a/Features/ManageabilityPkg/Include/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Manageability.dsc
index 2e410df9ba..aae343a733 100644
--- a/Features/ManageabilityPkg/Include/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Manageability.dsc
@@ -2,6 +2,7 @@
 # Common libraries for Manageabilty Package
 #
 # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -37,6 +38,7 @@
 [Components.X64, Components.AARCH64]
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiEnable == TRUE
   ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
+  ManageabilityPkg/Universal/IpmiBlobTransferDxe/IpmiBlobTransferDxe.inf
 !endif
 
 [Components.X64]
diff --git 
a/Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/IpmiBlobTransferDxe.inf
 
b/Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/IpmiBlobTransferDxe.inf
new file mode 100644
index 00..108f4bb5f8
--- /dev/null
+++ 
b/Features/ManageabilityPkg/Universal/IpmiBlobTransferDxe/IpmiBlobTransferDxe.inf
@@ -0,0 +1,39 @@
+## @file
+# IPMI Blob Transfer Protocol DXE Driver.
+#
+#  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = IpmiBlobTransferDxe
+  FILE_GUID  = 6357c804-78bb-4b0c-abdf-c75df942f319
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= IpmiBlobTransferDxeDriverEntryPoint
+
+[Sources.common]
+  IpmiBlobTransferDxe.c
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  DebugLib
+  IpmiLib
+  MemoryAllocationLib
+  PcdLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  ManageabilityPkg/ManageabilityPkg.dec
+
+[Protocols]
+  gEdkiiIpmiBlobTransferProtocolGuid
+
+[Depex]
+  TRUE
diff --git 

[edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file for OEM net function

2024-05-15 Thread Nickle Wang via groups.io
Add net function definitions for OEM/Non-IPMI group
request and response

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Nick Ramirez 
---
 MdePkg/Include/IndustryStandard/IpmiNetFnOem.h | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnOem.h

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
new file mode 100644
index 00..48c5dbd803
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
@@ -0,0 +1,18 @@
+/** @file
+  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
+
+  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef IPMI_NET_FN_OEM_H_
+#define IPMI_NET_FN_OEM_H_
+
+//
+// Net function definition for OEM/Group command
+//
+#define IPMI_NETFN_OEM0x2E
+#define IPMI_NETFN_OEM_GROUP  0x2F
+
+#endif
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118914): https://edk2.groups.io/g/devel/message/118914
Mute This Topic: https://groups.io/mt/106110708/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

2024-05-14 Thread Nickle Wang via groups.io
Hi Abner,

> Ok, then I don't have the problem with invoking GetAuthInfo again. However, I
> will suggest to add more description in GetAuthInfo function header, mention 
> that
> we will keep the auth info in EFI variable until exist boot service.
> Also, give some more descriptions on the code you invoke to GetAuthInfo.

Thanks for your comment. I add descriptions to explain above before calling 
GetAuthInfo(). Version 2 path is here: 
https://edk2.groups.io/g/devel/message/118889

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner
> via groups.io
> Sent: Tuesday, April 23, 2024 3:42 PM
> To: Nickle Wang ; Igor Kulchytskyy ;
> devel@edk2.groups.io
> Cc: Nick Ramirez 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg:
> introduce RedfishBootstrapAccountDxe
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Tuesday, April 23, 2024 3:09 PM
> > To: Igor Kulchytskyy ; Chang, Abner
> > ; devel@edk2.groups.io
> > Cc: Nick Ramirez 
> > Subject: RE: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg:
> > introduce RedfishBootstrapAccountDxe
> >
> > [AMD Official Use Only - General]
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Hi Igor, Abner,
> >
> > Thanks for your review. Please allow me to answer your questions together.
> >
> > > 1. We suppose acquire the credential before we start to communicate
> > > with
> > Redfish. Will Redfish credential driver create another bootstrap
> > account here after provisioning?
> > No, according to the RedfishPlatformCredentialIpmiLib implementation,
> > Redfish credential driver requests credential from BMC and will keep
> > it for later use. So only one credential is requested for BIOS Redfish
> > feature drivers during POST time.
> Ok, then I don't have the problem with invoking GetAuthInfo again. However, I
> will suggest to add more description in GetAuthInfo function header, mention 
> that
> we will keep the auth info in EFI variable until exist boot service.
> Also, give some more descriptions on the code you invoke to GetAuthInfo.
> 
> >
> > > 2. And why do we delete the credential after provisioning? How about
> > > the
> > later Redfish property updating process?
> > In this driver, we listen to "AfterProvisioning" event. And this is
> > the event triggered after Redfish feature driver finish all jobs.
> > There is no feature driver which gets executed after this event. And
> > since we finished all Redfish operations, we remove this account on BMC.
> Then this makes sense to me now.
> 
> >
> > > Why do we need to delete those credentials? According to spec BMC
> > > should
> > delete the bootstrap credentials automatically on host or service reset.
> > Yes, bootstrap credentials get deleted on host reset. In practice,
> > server in datacenter usually takes long time running under OS before it gets
> rebooted.
> > The bootstrap credentials are exposed to end user at
> > "/redfish/v1/AccountService/Accounts". I got report that there is
> > concern for end user to see this unused account.
> This sounds to me reasonable as we will give bootstrap credential a high 
> privilege
> to update Redfish resource. Leave this information in Account service seems 
> not a
> good idea.
> 
> Thanks
> Abner
> 
> >
> > So, I create this driver to allows us to remove bootstrap account at
> > BMC after we finish Redfish jobs. And this also release the BMC
> > account resource since this account won't be used for a long period of time.
> >
> > Regards,
> > Nickle
> >
> > > -Original Message-
> > > From: Igor Kulchytskyy 
> > > Sent: Monday, April 22, 2024 11:03 PM
> > > To: Chang, Abner ; Nickle Wang
> > > ; devel@edk2.groups.io
> > > Cc: Nick Ramirez 
> > > Subject: RE: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg:
> > > introduce RedfishBootstrapAccountDxe
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > Hi Nickle and Abner,
> > > I also have the same question as Abner.
> > > Why do we need to delete those credentials?
> > > According to spec BMC should delete the bootstrap credentials
> > > automatically
> > on
> > > host or service reset.
> > > Thank you,
> > > Igor
> > >
> > > -Original Message-
> > > From: Chang, Abner 
> > > Sent: Sunday, April 21, 2024 10:25 PM
> > > To: Nickle Wang ; devel@edk2.groups.io
> > > Cc: Igor Kulchytskyy ; Nick Ramirez
> > 
> > > Subject: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg:
> > > introduce RedfishBootstrapAccountDxe
> > >
> > >
> > > **CAUTION: The e-mail below is from an external source. Please
> > > exercise caution before opening attachments, clicking links, or
> > > following guidance.**
> > >
> > > [AMD Official Use Only - General]
> > >
> 

[edk2-devel] [edk2-redfish-client][PATCH v2] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

2024-05-14 Thread Nickle Wang via groups.io
-Introduce RedfishBootstrapAccountDxe to delete bootstrap
account from /redfish/v1/AccountService/Accounts after BIOS
finished all Redfish jobs. The bootstrap account won't be
available to other application. So deleting bootstrap account
helps to release resource at BMC.
- After bootstrap account is deleted at BMC, the Redfish service
instance is no longer usable. Close Redfish service instance to
release the HTTP connection between BIOS and BMC.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../RedfishClientComponents.dsc.inc   |   1 +
 .../RedfishBootstrapAccountDxe.inf|  53 +++
 .../RedfishBootstrapAccountDxe.h  |  58 +++
 .../RedfishBootstrapAccountDxe.c  | 337 ++
 RedfishClientPkg/RedfishClient.fdf.inc|   1 +
 5 files changed, 450 insertions(+)
 create mode 100644 
RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
 create mode 100644 
RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
 create mode 100644 
RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.c

diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc 
b/RedfishClientPkg/RedfishClientComponents.dsc.inc
index 42fc0c299..fe5248b62 100644
--- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
+++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
@@ -20,6 +20,7 @@
   RedfishClientPkg/HiiToRedfishMemoryDxe/HiiToRedfishMemoryDxe.inf
   RedfishClientPkg/HiiToRedfishBootDxe/HiiToRedfishBootDxe.inf
   RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosDxe.inf
+  RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
 !endif
   #
   # Below two modules should be pulled in by build tool.
diff --git 
a/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf 
b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
new file mode 100644
index 0..4073e95f4
--- /dev/null
+++ b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
@@ -0,0 +1,53 @@
+## @file
+#  This driver deletes bootstrap account in BMC after BIOS Redfish finished
+#  all jobs
+#
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION   = 0x0001000b
+  BASE_NAME = RedfishBootstrapAccountDxe
+  FILE_GUID = 87555253-2F7E-45FC-B469-FD35B2E51210
+  MODULE_TYPE   = DXE_DRIVER
+  VERSION_STRING= 1.0
+  ENTRY_POINT   = RedfishBootstrapAccountEntryPoint
+  UNLOAD_IMAGE  = RedfishBootstrapAccountUnload
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+  RedfishClientPkg/RedfishClientPkg.dec
+
+[Sources]
+  RedfishBootstrapAccountDxe.h
+  RedfishBootstrapAccountDxe.c
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  DebugLib
+  MemoryAllocationLib
+  PrintLib
+  RedfishEventLib
+  RedfishFeatureUtilityLib
+  RedfishDebugLib
+  RedfishVersionLib
+  RedfishHttpLib
+  UefiLib
+  UefiBootServicesTableLib
+  UefiRuntimeServicesTableLib
+  UefiDriverEntryPoint
+
+[Protocols]
+  gEdkIIRedfishConfigHandlerProtocolGuid  ## CONSUMES ##
+  gEdkIIRedfishCredentialProtocolGuid ## CONSUMES ##
+  gEfiRestExProtocolGuid  ## CONSUMES ##
+
+[Depex]
+  gEdkIIRedfishCredentialProtocolGuid
diff --git 
a/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h 
b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
new file mode 100644
index 0..5262f1e6b
--- /dev/null
+++ b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
@@ -0,0 +1,58 @@
+/** @file
+  Common header file for RedfishBootstrapAccountDxe driver.
+
+  (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef REDFISH_BOOTSTRAP_ACCOUNT_DXE_H_
+#define REDFISH_BOOTSTRAP_ACCOUNT_DXE_H_
+
+#include 
+#include 
+
+//
+// Libraries
+//
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define REDFISH_BOOTSTRAP_ACCOUNT_DEBUG DEBUG_VERBOSE
+#define REDFISH_MANAGER_ACCOUNT_COLLECTION_URI  L"AccountService/Accounts"
+#define REDFISH_URI_LENGTH  128
+
+//
+// Definitions of REDFISH_BOOTSTRAP_ACCOUNT_PRIVATE
+//
+typedef struct {
+  EFI_HANDLE   ImageHandle;
+  EFI_HANDLE   RestExHandle;
+  REDFISH_SERVICE  RedfishService;
+  EFI_EVENTRedfishEvent;
+  

Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: add support for the phosphor ipmi blob transfer protocol

2024-05-13 Thread Nickle Wang via groups.io
Hi Nhi,

This task is on my list but with lower priority. I will try to provide version 
2 patch for review here by the end of this week. 

Thanks,
Nickle

> -Original Message-
> From: Nhi Pham 
> Sent: Monday, May 13, 2024 5:02 PM
> To: devel@edk2.groups.io; abner.ch...@amd.com; Nickle Wang
> ; Rebecca Cran 
> Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef)
> ; Tinh Nguyen
> 
> Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: add
> support for the phosphor ipmi blob transfer protocol
> 
> External email: Use caution opening links or attachments
> 
> 
> On 2/9/2024 11:37 PM, Chang, Abner via groups.io wrote:
> > [AMD Official Use Only - General]
> >
> > Yeah, I forget this patch set and seems we don't have any follow up 
> > conversation
> after below feedbacks from community.
> >
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2
> > .groups.io%2Fg%2Fdevel%2Fmessage%2F103116=05%7C02%7Cnicklew
> %40nvi
> >
> dia.com%7C8b9e1a8a8d044208f8d608dc732b678d%7C43083d15727340c1b7db
> 39efd
> >
> 9ccc17a%7C0%7C0%7C638511877469561600%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiM
> >
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7
> C%7C
> > =N4eDH668lBSFxq9r81QrhMgpULvht8isrrEI9lipVKc%3D=0
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2
> > .groups.io%2Fg%2Fdevel%2Fmessage%2F103087=05%7C02%7Cnicklew
> %40nvi
> >
> dia.com%7C8b9e1a8a8d044208f8d608dc732b678d%7C43083d15727340c1b7db
> 39efd
> >
> 9ccc17a%7C0%7C0%7C638511877469569817%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiM
> >
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7
> C%7C
> >
> =7p0BHb8RFRapFyygr35u0hQBK2bQwKPSypBaUi6cMIQ%3D=0
> >
> > So Nickle, does NV still has the plan to upstream IPMI blob edk2
> implementation? We should keep driving upstream the implementation as
> industry needs it to incorporate with OpenBMC.
> >
> > Hi Rebessa,
> > As we are on Chinese New Year holidays now, please expect the delay 
> > response.
> > Thanks
> > Abner
> >
> 
> Hi Nickle and Abner,
> 
> May I know the status of upstreaming the IPMI Blob Transfer Protocol?
> I'm planning to upstream the SMBIOS transfer to OpenBMC by leveraging this
> protocol.
> 
> Thanks,
> Nhi


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118878): https://edk2.groups.io/g/devel/message/118878
Mute This Topic: https://groups.io/mt/98212643/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH] Tool/Redfish-Profile-Simulator: fix Werkzeug security issue

2024-05-08 Thread Nickle Wang via groups.io
Upgrade Werkzeug to version 3.0.3 to address CVE-2024-34069

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py | 7 ---
 Tools/Redfish-Profile-Simulator/requirements.txt   | 6 ++
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py 
b/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py
index 91c792a2b..58697328a 100644
--- a/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py
+++ b/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py
@@ -1,6 +1,7 @@
 # Copyright Notice:
 #
 # Copyright (c) 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 # Copyright Notice:
@@ -89,8 +90,8 @@ class PreconditionRequired(werkzeug.exceptions.HTTPException):
 
 def main(argv):
 #Monkey patch the set_etag() method for conditional request.
-_old_set_etag = werkzeug.ETagResponseMixin.set_etag
-@functools.wraps(werkzeug.ETagResponseMixin.set_etag)
+_old_set_etag = werkzeug.wrappers.Response.set_etag
+@functools.wraps(werkzeug.wrappers.Response.set_etag)
 def _new_set_etag(self, etag, weak=False):
 # only check the first time through; when called twice
 # we're modifying
@@ -107,7 +108,7 @@ def main(argv):
 raise NotModified
 flask.g.condtnl_etags_start = False
 _old_set_etag(self, etag, weak)
-werkzeug.ETagResponseMixin.set_etag = _new_set_etag
+werkzeug.wrappers.Response.set_etag = _new_set_etag
 
 # set default option args
 rf_profile_path = os.path.abspath("./MockupData/SimpleOcpServerV1")
diff --git a/Tools/Redfish-Profile-Simulator/requirements.txt 
b/Tools/Redfish-Profile-Simulator/requirements.txt
index 359a81446..83d2d8130 100644
--- a/Tools/Redfish-Profile-Simulator/requirements.txt
+++ b/Tools/Redfish-Profile-Simulator/requirements.txt
@@ -1,5 +1,3 @@
-Werkzeug==0.16
-Jinja2==3.0.3
-itsdangerous==2.0.1
-flask==1.1.1
+Werkzeug>=3.0.3
+flask==3.0.0
 pyOpenSSL
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118664): https://edk2.groups.io/g/devel/message/118664
Mute This Topic: https://groups.io/mt/105977266/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: rename x-uefi-redfish to x-UEFI-redfish

2024-05-02 Thread Nickle Wang via groups.io
Rename x-uefi-redfish to x-UEFI-redfish to match the format of
UEFI configuration namespace prefix.

RFC: https://edk2.groups.io/g/rfc/message/849

Signed-off-by: Jeff Brasen 
Co-authored-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../Features/Bios/v1_0_9/Common/BiosCommon.h  |  2 +-
 .../v1_0_4/Common/BootOptionCommon.h  |  2 +-
 .../v1_13_0/Common/ComputerSystemCommon.h |  2 +-
 .../v1_5_0/Common/ComputerSystemCommon.h  |  2 +-
 .../Memory/V1_7_1/Common/MemoryCommon.h   |  2 +-
 .../HiiToRedfishBootDxe/HiiToRedfishBootDxe.h |  2 +-
 .../EdkIIRedfishResourceConfigInternal.h  |  2 +-
 .../RedfishFeatureUtilityInternal.h   |  2 +-
 .../HiiToRedfishBootDxe/HiiToRedfishBootDxe.c |  4 +-
 .../Media/RedfishClientDriverStack.svg|  2 +-
 .../HiiToRedfishBiosDxeMap.uni| 16 +++---
 .../HiiToRedfishBootDxeMap.uni| 32 +--
 .../HiiToRedfishMemoryDxeMap.uni  | 56 +--
 RedfishClientPkg/Readme.md| 41 +++---
 14 files changed, 84 insertions(+), 83 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h
index 9a6f9684b..50772d5da 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h
@@ -24,7 +24,7 @@
 #define RESOURCE_SCHEMA_VERSION  "v1_0_9"
 #define REDPATH_ARRAY_PATTERNL"/Bios/.*"
 #define REDPATH_ARRAY_PREFIX L"/Bios/"
-#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-Bios.v1_0_9"
+#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-Bios.v1_0_9"
 #define REDFISH_SCHEMA_NAME  "ComputerSystem"
 
 #endif
diff --git 
a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.h 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.h
index 83babf16f..9293d22cd 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.h
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.h
@@ -27,7 +27,7 @@
 #define RESOURCE_SCHEMA_VERSION  "v1_0_4"
 #define REDPATH_ARRAY_PATTERNL"/BootOptions/\\{.*\\}/"
 #define REDPATH_ARRAY_PREFIX L"/BootOptions/"
-#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-BootOption.v1_0_4"
+#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-BootOption.v1_0_4"
 #define REDFISH_BOOT_OPTION_PARAMETERL"?name="
 #define REDFISH_BOOT_OPTION_DEBUG_TRACE  DEBUG_INFO
 #endif
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
index 7b83d2939..b5e3fa919 100644
--- 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
@@ -24,6 +24,6 @@
 #define RESOURCE_SCHEMA_VERSION  "v1_13_0"
 #define REDPATH_ARRAY_PATTERNL"/Systems/\\{.*\\}/"
 #define REDPATH_ARRAY_PREFIX L"/Systems/"
-#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-ComputerSystem.v1_13_0"
+#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-ComputerSystem.v1_13_0"
 
 #endif
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.h 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.h
index a0eb41b8b..24a484d18 100644
--- 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.h
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.h
@@ -22,6 +22,6 @@
 #define RESOURCE_SCHEMA_VERSION  "v1_5_0"
 #define REDPATH_ARRAY_PATTERNL"/Systems/\\{.*\\}/"
 #define REDPATH_ARRAY_PREFIX L"/Systems/"
-#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-ComputerSystem.v1_5_0"
+#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-ComputerSystem.v1_5_0"
 
 #endif
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.h 
b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.h
index c857868ea..2120dc0e4 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.h
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.h
@@ -22,6 +22,6 @@
 #define RESOURCE_SCHEMA_VERSION  "v1_7_1"
 #define REDPATH_ARRAY_PATTERNL"/Memory/\\{.*\\}/"
 #define REDPATH_ARRAY_PREFIX L"/Memory/"
-#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-Memory.v1_7_1"
+#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-Memory.v1_7_1"
 
 #endif
diff --git a/RedfishClientPkg/HiiToRedfishBootDxe/HiiToRedfishBootDxe.h 
b/RedfishClientPkg/HiiToRedfishBootDxe/HiiToRedfishBootDxe.h
index 40a41d01b..455140536 100644
--- a/RedfishClientPkg/HiiToRedfishBootDxe/HiiToRedfishBootDxe.h
+++ b/RedfishClientPkg/HiiToRedfishBootDxe/HiiToRedfishBootDxe.h
@@ -36,7 +36,7 @@
 
 extern UINT8  HiiToRedfishBootVfrBin[];
 
-#define COMPUTER_SYSTEM_SCHEMA_VERSION  

[edk2-devel] [PATCH] RedfishPkg: Rename x-uefi-redfish to x-UEFI-redfish

2024-05-02 Thread Nickle Wang via groups.io
Rename x-uefi-redfish to x-UEFI-redfish to match the format of
UEFI configuration namespace prefix.

RFC: https://edk2.groups.io/g/rfc/message/849

Signed-off-by: Jeff Brasen 
Co-authored-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishPkg/RedfishPkg.dec |  6 +-
 .../Library/RedfishPlatformConfigLib.h|  4 +-
 .../Protocol/EdkIIRedfishPlatformConfig.h |  4 +-
 .../RedfishPlatformConfigDxe.h|  2 +-
 .../RedfishPlatformConfigImpl.h   | 16 ++--
 .../RedfishPlatformConfigLib.c|  4 +-
 .../RedfishPlatformConfigDxe.c|  4 +-
 .../RedfishPlatformConfigImpl.c   | 86 +--
 8 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index c048e43f53..54318527fe 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -195,10 +195,10 @@
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
   #
   # Redfish RedfishPlatformConfigDxe Debug Properties
-  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0001  x-UEFI-redfish string database message enabled
   #   0x0002  Debug Message for dumping formset
-  #   0x0004  Debug Message for x-uefi-redfish searching result
-  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  #   0x0004  Debug Message for x-UEFI-redfish searching result
+  #   0x0008  Debug Message for x-UEFI-redfish Regular Expression 
searching result
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0|UINT32|0x1013
   #
diff --git a/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h 
b/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h
index 51a1861639..b6e60635ea 100644
--- a/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h
+++ b/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h
@@ -2,7 +2,7 @@
   Definitions of RedfishPlatformConfigLib
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -82,7 +82,7 @@ RedfishPlatformConfigGetConfigureLang (
   Get the list of supported Redfish schema from platform configuration.
 
   @param[out]  SupportedSchema The supported schema list which is 
separated by ';'.
-   For example: 
"x-uefi-redfish-Memory.v1_7_1;x-uefi-redfish-Boot.v1_0_1"
+   For example: 
"x-UEFI-redfish-Memory.v1_7_1;x-UEFI-redfish-Boot.v1_0_1"
The SupportedSchema is allocated by the 
callee. It's caller's
responsibility to free this buffer using 
FreePool().
 
diff --git a/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h 
b/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h
index d20b2c980e..a1d5592c7e 100644
--- a/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h
+++ b/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h
@@ -2,7 +2,7 @@
   This file defines the EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL interface.
 
   (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -227,7 +227,7 @@ EFI_STATUS
 
   @param[in]   ThisPointer to 
EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL instance.
   @param[out]  SupportedSchema The supported schema list which is 
separated by ';'.
-   For example: 
"x-uefi-redfish-Memory.v1_7_1;x-uefi-redfish-Boot.v1_0_1"
+   For example: 
"x-UEFI-redfish-Memory.v1_7_1;x-UEFI-redfish-Boot.v1_0_1"
The SupportedSchema is allocated by the 
callee. It's caller's
responsibility to free this buffer using 
FreePool().
 
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 8eb7b0dc2a..e3e185a03b 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -111,7 +111,7 @@ typedef struct {
 
 #define REDFISH_PLATFORM_CONFIG_PRIVATE_FROM_THIS(a)  BASE_CR (a, 
REDFISH_PLATFORM_CONFIG_PRIVATE, Protocol)
 #define REGULAR_EXPRESSION_INCLUDE_ALL   L".*"
-#define CONFIGURE_LANGUAGE_PREFIX"x-uefi-redfish-"
+#define CONFIGURE_LANGUAGE_PREFIX"x-UEFI-redfish-"
 #define REDFISH_PLATFORM_CONFIG_VERSION  0x0001
 
 #define REDFISH_MENU_PATH_SIZE  8
diff --git 

Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

2024-04-23 Thread Nickle Wang via groups.io
Hi Igor, Abner,

Thanks for your review. Please allow me to answer your questions together.

> 1. We suppose acquire the credential before we start to communicate with 
> Redfish. Will Redfish credential driver create another bootstrap account here 
> after provisioning?
No, according to the RedfishPlatformCredentialIpmiLib implementation, Redfish 
credential driver requests credential from BMC and will keep it for later use. 
So only one credential is requested for BIOS Redfish feature drivers during 
POST time.

> 2. And why do we delete the credential after provisioning? How about the 
> later Redfish property updating process?
In this driver, we listen to "AfterProvisioning" event. And this is the event 
triggered after Redfish feature driver finish all jobs. There is no feature 
driver which gets executed after this event. And since we finished all Redfish 
operations, we remove this account on BMC.

> Why do we need to delete those credentials? According to spec BMC should 
> delete the bootstrap credentials automatically on host or service reset.
Yes, bootstrap credentials get deleted on host reset. In practice, server in 
datacenter usually takes long time running under OS before it gets rebooted. 
The bootstrap credentials are exposed to end user at 
"/redfish/v1/AccountService/Accounts". I got report that there is concern for 
end user to see this unused account. 

So, I create this driver to allows us to remove bootstrap account at BMC after 
we finish Redfish jobs. And this also release the BMC account resource since 
this account won't be used for a long period of time.

Regards,
Nickle

> -Original Message-
> From: Igor Kulchytskyy 
> Sent: Monday, April 22, 2024 11:03 PM
> To: Chang, Abner ; Nickle Wang
> ; devel@edk2.groups.io
> Cc: Nick Ramirez 
> Subject: RE: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg:
> introduce RedfishBootstrapAccountDxe
> 
> External email: Use caution opening links or attachments
> 
> 
> Hi Nickle and Abner,
> I also have the same question as Abner.
> Why do we need to delete those credentials?
> According to spec BMC should delete the bootstrap credentials automatically on
> host or service reset.
> Thank you,
> Igor
> 
> -Original Message-
> From: Chang, Abner 
> Sent: Sunday, April 21, 2024 10:25 PM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg:
> introduce RedfishBootstrapAccountDxe
> 
> 
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
> 
> [AMD Official Use Only - General]
> 
> Hi Nickle,
> One comment and few questions,
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Thursday, April 18, 2024 8:28 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > ; Nick Ramirez 
> > Subject: [edk2-redfish-client][PATCH] RedfishClientPkg: introduce
> > RedfishBootstrapAccountDxe
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > -Introduce RedfishBootstrapAccountDxe to delete bootstrap account from
> > /redfish/v1/AccountService/Accounts after BIOS finished all Redfish
> > jobs. The bootstrap account won't be available to other application.
> > So deleting bootstrap account helps to release resource at BMC.
> > - After bootstrap account is deleted at BMC, the Redfish service
> > instance is no longer usable. Close Redfish service instance to
> > release the HTTP connection between BIOS and BMC.
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Cc: Nick Ramirez 
> > ---
> >  .../RedfishClientComponents.dsc.inc   |   1 +
> >  .../RedfishBootstrapAccountDxe.inf|  53 +++
> >  .../RedfishBootstrapAccountDxe.h  |  58 
> >  .../RedfishBootstrapAccountDxe.c  | 328 ++
> >  RedfishClientPkg/RedfishClient.fdf.inc|   1 +
> >  5 files changed, 441 insertions(+)
> >  create mode 100644
> > RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe
> > .inf
> >  create mode 100644
> > RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe
> > .h
> >  create mode 100644
> > RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe
> > .c
> >
> > diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > index 42fc0c299..fe5248b62 100644
> > --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > @@ -20,6 +20,7 @@
> >RedfishClientPkg/HiiToRedfishMemoryDxe/HiiToRedfishMemoryDxe.inf
> >RedfishClientPkg/HiiToRedfishBootDxe/HiiToRedfishBootDxe.inf
> >RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosDxe.inf
> > +
> > 

[edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

2024-04-18 Thread Nickle Wang via groups.io
-Introduce RedfishBootstrapAccountDxe to delete bootstrap
account from /redfish/v1/AccountService/Accounts after BIOS
finished all Redfish jobs. The bootstrap account won't be
available to other application. So deleting bootstrap account
helps to release resource at BMC.
- After bootstrap account is deleted at BMC, the Redfish service
instance is no longer usable. Close Redfish service instance to
release the HTTP connection between BIOS and BMC.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../RedfishClientComponents.dsc.inc   |   1 +
 .../RedfishBootstrapAccountDxe.inf|  53 +++
 .../RedfishBootstrapAccountDxe.h  |  58 
 .../RedfishBootstrapAccountDxe.c  | 328 ++
 RedfishClientPkg/RedfishClient.fdf.inc|   1 +
 5 files changed, 441 insertions(+)
 create mode 100644 
RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
 create mode 100644 
RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
 create mode 100644 
RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.c

diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc 
b/RedfishClientPkg/RedfishClientComponents.dsc.inc
index 42fc0c299..fe5248b62 100644
--- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
+++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
@@ -20,6 +20,7 @@
   RedfishClientPkg/HiiToRedfishMemoryDxe/HiiToRedfishMemoryDxe.inf
   RedfishClientPkg/HiiToRedfishBootDxe/HiiToRedfishBootDxe.inf
   RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosDxe.inf
+  RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
 !endif
   #
   # Below two modules should be pulled in by build tool.
diff --git 
a/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf 
b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
new file mode 100644
index 0..4073e95f4
--- /dev/null
+++ b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
@@ -0,0 +1,53 @@
+## @file
+#  This driver deletes bootstrap account in BMC after BIOS Redfish finished
+#  all jobs
+#
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION   = 0x0001000b
+  BASE_NAME = RedfishBootstrapAccountDxe
+  FILE_GUID = 87555253-2F7E-45FC-B469-FD35B2E51210
+  MODULE_TYPE   = DXE_DRIVER
+  VERSION_STRING= 1.0
+  ENTRY_POINT   = RedfishBootstrapAccountEntryPoint
+  UNLOAD_IMAGE  = RedfishBootstrapAccountUnload
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+  RedfishClientPkg/RedfishClientPkg.dec
+
+[Sources]
+  RedfishBootstrapAccountDxe.h
+  RedfishBootstrapAccountDxe.c
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  DebugLib
+  MemoryAllocationLib
+  PrintLib
+  RedfishEventLib
+  RedfishFeatureUtilityLib
+  RedfishDebugLib
+  RedfishVersionLib
+  RedfishHttpLib
+  UefiLib
+  UefiBootServicesTableLib
+  UefiRuntimeServicesTableLib
+  UefiDriverEntryPoint
+
+[Protocols]
+  gEdkIIRedfishConfigHandlerProtocolGuid  ## CONSUMES ##
+  gEdkIIRedfishCredentialProtocolGuid ## CONSUMES ##
+  gEfiRestExProtocolGuid  ## CONSUMES ##
+
+[Depex]
+  gEdkIIRedfishCredentialProtocolGuid
diff --git 
a/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h 
b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
new file mode 100644
index 0..5262f1e6b
--- /dev/null
+++ b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
@@ -0,0 +1,58 @@
+/** @file
+  Common header file for RedfishBootstrapAccountDxe driver.
+
+  (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef REDFISH_BOOTSTRAP_ACCOUNT_DXE_H_
+#define REDFISH_BOOTSTRAP_ACCOUNT_DXE_H_
+
+#include 
+#include 
+
+//
+// Libraries
+//
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define REDFISH_BOOTSTRAP_ACCOUNT_DEBUG DEBUG_VERBOSE
+#define REDFISH_MANAGER_ACCOUNT_COLLECTION_URI  L"AccountService/Accounts"
+#define REDFISH_URI_LENGTH  128
+
+//
+// Definitions of REDFISH_BOOTSTRAP_ACCOUNT_PRIVATE
+//
+typedef struct {
+  EFI_HANDLE   ImageHandle;
+  EFI_HANDLE   RestExHandle;
+  REDFISH_SERVICE  RedfishService;
+  EFI_EVENTRedfishEvent;
+  

Re: [edk2-devel] [edk2-redfish-client][PATCH v2 1/2] RedfishClientPkg/Features: support Redfish Secure Boot

2024-04-10 Thread Nickle Wang via groups.io
Thanks for your review, Abner!

The reason why I keep HPE copyright statement is because I create this feature 
driver by copying existing one and modifying it. Since I still leverage some 
functions contributed by HPE, I think I am supposed to keep HPE copyright 
statement.

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner
> via groups.io
> Sent: Wednesday, April 10, 2024 9:43 AM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 1/2]
> RedfishClientPkg/Features: support Redfish Secure Boot
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> Hi Nickle,
> I don't see the obvious coding error in this patch. However, I think we can 
> remove
> HPE copyright from Redfish secure boot feature driver, as this is a new 
> feature
> driver and HPE doesn't have contributions to these files, right? If so, then 
> please
> remove it.
> 
> Thanks
> 
> Reviewed-by: Abner Chang 
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Monday, April 1, 2024 10:18 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > ; Nick Ramirez 
> > Subject: [edk2-redfish-client][PATCH v2 1/2] RedfishClientPkg/Features:
> > support Redfish Secure Boot
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Introduce SecureBoot driver to support
> > /redfish/v1/Systems/SYS/SecureBoot resource.
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Cc: Nick Ramirez 
> > ---
> >  .../RedfishClientComponents.dsc.inc   |   2 +
> >  RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +
> >  .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf   |  60 ++
> >  .../v1_1_0/Common/SecureBootCommon.h  |  40 +
> >  .../v1_1_0/Common/SecureBootCommon.c  | 765 +
> >  .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.c | 809 ++
> >  RedfishClientPkg/RedfishClient.fdf.inc|   1 +
> >  7 files changed, 1681 insertions(+)
> >  create mode 100644
> > RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> >  create mode 100644
> > RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommo
> > n.h
> >  create mode 100644
> > RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommo
> > n.c
> >  create mode 100644
> > RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.c
> >
> > diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > index ae2a4b025..42fc0c299 100644
> > --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > @@ -34,6 +34,7 @@
> >RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
> >
> > RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.in
> > f
> >RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
> > +  RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> >
> >!include RedfishClientPkg/RedfishJsonStructureDxe.dsc.inc
> >
> > @@ -47,3 +48,4 @@
> >RedfishClientPkg/Converter/Bios/v1_0_9/RedfishBios_V1_0_9_Dxe.inf
> >
> > RedfishClientPkg/Converter/BootOptionCollection/RedfishBootOptionCollecti
> > on_Dxe.inf
> >
> > RedfishClientPkg/Converter/BootOption/v1_0_4/RedfishBootOption_V1_0_4_
> > Dxe.inf
> > +
> > RedfishClientPkg/Converter/SecureBoot/v1_1_0/RedfishSecureBoot_V1_1_0_
> > Dxe.inf
> > diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc
> > b/RedfishClientPkg/RedfishClientLibs.dsc.inc
> > index 6599926ab..9126465df 100644
> > --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
> > +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
> > @@ -25,6 +25,8 @@
> >
> > BiosV1_0_9Lib|RedfishClientPkg/ConverterLib/edk2library/Bios/v1_0_9/Lib.in
> > f
> >
> > BootOptionCollectionLib|RedfishClientPkg/ConverterLib/edk2library/BootOp
> > tionCollection/Lib.inf
> >
> > BootOptionV1_0_4Lib|RedfishClientPkg/ConverterLib/edk2library/BootOptio
> > n/v1_0_4/Lib.inf
> > +
> > SecureBootV1_1_0Lib|RedfishClientPkg/ConverterLib/edk2library/SecureBoot
> > /v1_1_0/Lib.inf
> > +
> >#
> ># Above modules should be pulled in by build tool.
> >#
> > @@ -42,3 +44,5 @@
> >
> > RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/Redfis
> > hAddendumLib.inf
> >RedfishDebugLib|RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
> >RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
> > +
> > SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBo
> > otVariableLib.inf
> > +
> > PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolic
> > y/PlatformPKProtectionLibVarPolicy.inf
> > diff --git
> > 

Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/Features: Variable used before being initialized

2024-04-02 Thread Nickle Wang via groups.io
Thanks for your review, Abner! I merged this change.

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner
> via groups.io
> Sent: Tuesday, April 2, 2024 1:04 PM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH]
> RedfishClientPkg/Features: Variable used before being initialized
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> Hi Nickle,
> Use Uri makes sense to me. Thanks! Please go ahead to merge it.
> Reviewed-by: Abner Chang .
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Monday, April 1, 2024 10:38 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > 
> > Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/Features:
> > Variable used before being initialized
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Private->Uri is initialized after calling
> > Private->SetRedfishSettingsObjectsUri()
> > but it is used in SetRedfishSettingsObjectsUri function. Use input
> > parameter "Uri" instead.
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > ---
> >  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 +-
> >  RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c | 2 +-
> >  .../Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c | 2 +-
> >  .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c  | 2 +-
> >  RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c | 2 +-
> >  5 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > index bb64ef862..ed7823a59 100644
> > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > @@ -141,7 +141,7 @@ RedfishResourceConsumeResource (
> >  );
> >if (!EFI_ERROR (Status)) {
> >  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> > __func__, PendingSettingUri));
> > -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> > +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
> >  Private->Uri = PendingSettingUri;
> >  ExpectedResponse = 
> >} else {
> > diff --git
> > a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> > b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> > index 5a66fe59e..fec3a0090 100644
> > --- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> > +++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> > @@ -130,7 +130,7 @@ RedfishResourceConsumeResource (
> >   );
> >if (!EFI_ERROR (Status)) {
> >  DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings
> > found: %s\n", __func__, PendingSettingUri));
> > -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> > +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
> >  Private->Uri = PendingSettingUri;
> >  ExpectedResponse = 
> >} else {
> > diff --git
> > a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyste
> > mDxe.c
> > b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyst
> > emDxe.c
> > index a0c71212b..d829a22d2 100644
> > ---
> > a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyste
> > mDxe.c
> > +++
> > b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyst
> > emDxe.c
> > @@ -133,7 +133,7 @@ RedfishResourceConsumeResource (
> >   );
> >if (!EFI_ERROR (Status)) {
> >  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> > __func__, PendingSettingUri));
> > -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> > +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
> >  Private->Uri = PendingSettingUri;
> >  ExpectedResponse = 
> >} else {
> > diff --git
> > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste
> > mDxe.c
> > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste
> > mDxe.c
> > index 494bf59df..de1691534 100644
> > ---
> > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste
> > mDxe.c
> > +++
> > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste
> > mDxe.c
> > @@ -134,7 +134,7 @@ RedfishResourceConsumeResource (
> >   );
> >if (!EFI_ERROR (Status)) {
> >  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> > __func__, PendingSettingUri));
> > -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> > +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
> >  Private->Uri = PendingSettingUri;
> > 

[edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/Features: Variable used before being initialized

2024-04-01 Thread Nickle Wang via groups.io
Private->Uri is initialized after calling SetRedfishSettingsObjectsUri()
but it is used in SetRedfishSettingsObjectsUri function. Use input
parameter "Uri" instead.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 +-
 RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c | 2 +-
 .../Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c | 2 +-
 .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c  | 2 +-
 RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index bb64ef862..ed7823a59 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -141,7 +141,7 @@ RedfishResourceConsumeResource (
 );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
-SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
+SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
index 5a66fe59e..fec3a0090 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
@@ -130,7 +130,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings found: 
%s\n", __func__, PendingSettingUri));
-SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
+SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
index a0c71212b..d829a22d2 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
@@ -133,7 +133,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
-SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
+SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
index 494bf59df..de1691534 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
@@ -134,7 +134,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
-SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
+SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c 
b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
index f2c0a7735..413b90c97 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
@@ -134,7 +134,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
-SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
+SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117295): https://edk2.groups.io/g/devel/message/117295
Mute This Topic: https://groups.io/mt/105265503/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH v2 2/2] RedfishClientPkg/Features: release resources

2024-04-01 Thread Nickle Wang via groups.io
-Release Etag and PendingSettingUri resources.
-Update function header for GetHttpResponseEtag() and
GetHttpResponseLocation(). Caller has to release returned
memory buffer from these two functions.
-Fix typo.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  2 +-
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.c| 20 --
 .../BootOption/v1_0_4/Dxe/BootOptionDxe.c | 33 -
 .../BootOptionCollectionDxe.c |  2 +-
 .../v1_13_0/Dxe/ComputerSystemDxe.c   | 33 -
 .../v1_5_0/Dxe/ComputerSystemDxe.c| 33 -
 .../ComputerSystemCollectionDxe.c |  2 +-
 .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c| 37 ++-
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  2 +-
 .../RedfishFeatureUtilityLib.c|  2 +
 10 files changed, 118 insertions(+), 48 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index f40fe215a..5dc97876c 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -815,7 +815,7 @@ HandleResource (
 
   //
   // Check and see if target property exist or not even when collection member 
exists.
-  // If not, we sill do provision.
+  // If not, we still do provision.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigCheck (, Uri, NULL);
diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index bb64ef862..5955917f2 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -158,8 +158,12 @@ RedfishResourceConsumeResource (
   //
   // Searching for etag in HTTP response header
   //
-  Etag = NULL;
-  GetHttpResponseEtag (ExpectedResponse, );
+  Etag   = NULL;
+  Status = GetHttpResponseEtag (ExpectedResponse, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", 
__func__));
+  }
+
   Status = RedfishConsumeResourceCommon (Private, Private->Json, Etag);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n", 
__func__, Private->Uri, Status));
@@ -338,8 +342,12 @@ RedfishResourceCheck (
   //
   // Find etag in HTTP response header
   //
-  Etag = NULL;
-  GetHttpResponseEtag (, );
+  Etag   = NULL;
+  Status = GetHttpResponseEtag (, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", 
__func__));
+  }
+
   Status = RedfishCheckResourceCommon (Private, Private->Json, Etag);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", 
__func__, Uri, Status));
@@ -348,6 +356,10 @@ RedfishResourceCheck (
   //
   // Release resource
   //
+  if (Etag != NULL) {
+FreePool (Etag);
+  }
+
   RedfishHttpFreeResponse ();
   Private->Payload = NULL;
 
diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
index 5a66fe59e..1a1262403 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
@@ -122,12 +122,13 @@ RedfishResourceConsumeResource (
   //
   // Check and see if "@Redfish.Settings" exist or not.
   //
-  Status = GetPendingSettings (
- Private->RedfishService,
- Response.Payload,
- ,
- 
- );
+  PendingSettingUri = NULL;
+  Status= GetPendingSettings (
+Private->RedfishService,
+Response.Payload,
+,
+
+);
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings found: 
%s\n", __func__, PendingSettingUri));
 SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
@@ -147,8 +148,12 @@ RedfishResourceConsumeResource (
   //
   // Find etag in HTTP response header
   //
-  Etag = NULL;
-  GetHttpResponseEtag (ExpectedResponse, );
+  Etag   = NULL;
+  Status = GetHttpResponseEtag (ExpectedResponse, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", 
__func__));
+  }
+
   Status = RedfishConsumeResourceCommon (Private, Private->Json, Etag);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n", 
__func__, Private->Uri, Status));
@@ -170,6 +175,10 @@ RedfishResourceConsumeResource (
 Private->Json = NULL;
   }
 
+  if (PendingSettingUri != NULL) {
+FreePool (PendingSettingUri);
+  }
+
   return Status;
 }
 
@@ -323,8 

[edk2-devel] [edk2-redfish-client][PATCH v2 1/2] RedfishClientPkg/Features: support Redfish Secure Boot

2024-04-01 Thread Nickle Wang via groups.io
Introduce SecureBoot driver to support
/redfish/v1/Systems/SYS/SecureBoot resource.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../RedfishClientComponents.dsc.inc   |   2 +
 RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +
 .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf   |  60 ++
 .../v1_1_0/Common/SecureBootCommon.h  |  40 +
 .../v1_1_0/Common/SecureBootCommon.c  | 765 +
 .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.c | 809 ++
 RedfishClientPkg/RedfishClient.fdf.inc|   1 +
 7 files changed, 1681 insertions(+)
 create mode 100644 
RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
 create mode 100644 
RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommon.h
 create mode 100644 
RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommon.c
 create mode 100644 
RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.c

diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc 
b/RedfishClientPkg/RedfishClientComponents.dsc.inc
index ae2a4b025..42fc0c299 100644
--- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
+++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
@@ -34,6 +34,7 @@
   RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
   RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf
   RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
+  RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
 
   !include RedfishClientPkg/RedfishJsonStructureDxe.dsc.inc
 
@@ -47,3 +48,4 @@
   RedfishClientPkg/Converter/Bios/v1_0_9/RedfishBios_V1_0_9_Dxe.inf
   
RedfishClientPkg/Converter/BootOptionCollection/RedfishBootOptionCollection_Dxe.inf
   RedfishClientPkg/Converter/BootOption/v1_0_4/RedfishBootOption_V1_0_4_Dxe.inf
+  RedfishClientPkg/Converter/SecureBoot/v1_1_0/RedfishSecureBoot_V1_1_0_Dxe.inf
diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc 
b/RedfishClientPkg/RedfishClientLibs.dsc.inc
index 6599926ab..9126465df 100644
--- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
+++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
@@ -25,6 +25,8 @@
   BiosV1_0_9Lib|RedfishClientPkg/ConverterLib/edk2library/Bios/v1_0_9/Lib.inf
   
BootOptionCollectionLib|RedfishClientPkg/ConverterLib/edk2library/BootOptionCollection/Lib.inf
   
BootOptionV1_0_4Lib|RedfishClientPkg/ConverterLib/edk2library/BootOption/v1_0_4/Lib.inf
+  
SecureBootV1_1_0Lib|RedfishClientPkg/ConverterLib/edk2library/SecureBoot/v1_1_0/Lib.inf
+
   #
   # Above modules should be pulled in by build tool.
   #
@@ -42,3 +44,5 @@
   
RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
   RedfishDebugLib|RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
   RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
+  
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
+  
PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf
diff --git a/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf 
b/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
new file mode 100644
index 0..1ad8c623f
--- /dev/null
+++ b/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
@@ -0,0 +1,60 @@
+## @file
+#
+#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+#  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = SecureBootDxe
+  FILE_GUID = 5E4025F8-DA42-468A-853E-6A1091D35052
+  MODULE_TYPE   = DXE_DRIVER
+  VERSION_STRING= 1.0
+  ENTRY_POINT   = RedfishResourceEntryPoint
+  UNLOAD_IMAGE  = RedfishResourceUnload
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  SecurityPkg/SecurityPkg.dec
+  RedfishPkg/RedfishPkg.dec
+  RedfishClientPkg/RedfishClientPkg.dec
+
+[Sources]
+  ../Common/SecureBootCommon.h
+  ../Common/SecureBootCommon.c
+  SecureBootDxe.c
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  EdkIIRedfishResourceConfigLib
+  RedfishFeatureUtilityLib
+  RedfishVersionLib
+  RedfishResourceIdentifyLib
+  SecureBootVariableLib
+  UefiLib
+  UefiDriverEntryPoint
+  RedfishAddendumLib
+  UefiRuntimeServicesTableLib
+
+[Protocols]
+  gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
+  gEfiRestJsonStructureProtocolGuid   ## CONSUMED
+  gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED
+  gEdkIIRedfishFeatureProtocolGuid## CONSUMED
+
+[Guids]
+  gEfiSecureBootEnableDisableGuid ## CONSUMED
+
+[Pcd]
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize
+  

Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()

2024-04-01 Thread Nickle Wang via groups.io
Thanks, Mike!

I merged this pull request.

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Wednesday, March 27, 2024 5:19 AM
> To: Nickle Wang 
> Cc: Chang, Abner ; devel@edk2.groups.io; Igor
> Kulchytskyy 
> Subject: Re: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix
> GetRedpathNodeByIndex()
>
> External email: Use caution opening links or attachments
>
>
> Hi,
>
> I have updated patches with R-b and pushed it to PR
> https://github.co/
> m%2Ftianocore%2Fedk2-redfish-
> client%2Fpull%2F85=05%7C02%7Cnicklew%40nvidia.com%7Cb629e25259
> 1746cf422108dc4dda60d8%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0
> %7C638470847554354719%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C
> data=%2BcHo1%2B%2F5kopSeQxXQjbiXLctLbqeg5tzevhIH%2Bg3hv8%3D
> ed=0
>
> Thank you for the review!
>
> Regards,
> Mike
>
> On Tue, Mar 26, 2024 at 4:41 PM Nickle Wang  wrote:
> >
> > Thanks for your reminder, Abner. I verify this patch series on my system, 
> > and I
> don't see any issue.
> >
> >
> >
> > Hi @Mike Maslenkin, please add Abner and my reviewed-by to the commit
> messages. And we can merge the pull request.
> >
> >
> >
> > Thanks,
> >
> > Nickle
> >
> >
> >
> > > -Original Message-
> >
> > > From: Chang, Abner 
> >
> > > Sent: Monday, March 25, 2024 10:13 AM
> >
> > > To: Mike Maslenkin ; devel@edk2.groups.io
> >
> > > Cc: Igor Kulchytskyy ; Nickle Wang 
> >
> > > Subject: RE: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix
> >
> > > GetRedpathNodeByIndex()
> >
> > >
> >
> > > External email: Use caution opening links or attachments
> >
> > >
> >
> > >
> >
> > > [AMD Official Use Only - General]
> >
> > >
> >
> > > For this patch set,  Reviewed-by: Abner Chang 
> >
> > >
> >
> > > Hi Nickle, please also take a look at this change. Thanks Abner
> >
> > >
> >
> > > > -Original Message-
> >
> > > > From: Mike Maslenkin 
> >
> > > > Sent: Saturday, March 23, 2024 8:01 PM
> >
> > > > To: devel@edk2.groups.io
> >
> > > > Cc: Chang, Abner ; Igor Kulchytskyy
> >
> > > > ; Nickle Wang ; Mike Maslenkin
> >
> > > > 
> >
> > > > Subject: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix
> >
> > > > GetRedpathNodeByIndex()
> >
> > > >
> >
> > > > Caution: This message originated from an External Source. Use proper
> >
> > > > caution when opening attachments, clicking links, or responding.
> >
> > > >
> >
> > > >
> >
> > > > This set contains fixes for proper nodes handling in
> GetRedpathNodeByIndex().
> >
> > > > It fixes handling of nodes with Index different from 0, it removes
> >
> > > > leading '/' returned for section with Index = 0, also it fixes return
> >
> > > > of the last section.
> >
> > >
> >
> > > This set does not have any impact to
> >
> > > > existing code,
> >
> > > > because in all places this function is used to obtain the end of the 
> > > > first
> section.
> >
> > > > And actually returned pointer to the requested section is not used.
> >
> > > > The current usages is:
> >
> > > >GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0,
> >
> > > > );
> >
> > > >
> >
> > > > and return of EndOfChar value is not affected by this set.
> >
> > > >
> >
> > > > Cc: Abner Chang 
> >
> > > > Cc: Igor Kulchytskyy 
> >
> > > > Cc: Nickle Wang 
> >
> > > > Signed-off-by: Mike Maslenkin 
> >
> > > >
> >
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117287): https://edk2.groups.io/g/devel/message/117287
Mute This Topic: https://groups.io/mt/105101990/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH V2 0/6] [PATCH V2 0/5] Config language searching algorithm enhancement and the bug fixes

2024-03-27 Thread Nickle Wang via groups.io
I have tested this patch series on my system and got a lot of performance 
improvements too. 

Great work, Abner!

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Tuesday, March 26, 2024 11:15 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH V2 0/6] [PATCH V2 0/5] Config language searching algorithm
> enhancement and the bug fixes
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> PR # 5491
> 
> In V2, add patch 6/6 contibuted by Nvidia for updating BIOS menu path
> implementation based on the performance improvement.
> 
> In this patch set,
> 1 We enhance the config language searching algorithm.
>   As the performance of searching config language using HII GetString is
>   pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
>   to build up the metadata required for Redfish BIOS resource. With this
>   improvement, it only takes 4 seconds.
> 
> 2.Introduce the Redfish debug framework, there are three edk2 Redfish
>   debug scopes.
>   a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug message
>  for edk2 Redfish.
>   b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
>  component. Currently we only support RedfishPlatformConfigDxe
>  module.
>   c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
>  scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.
> 
> 3 This patch set also fixes an issue that deletes HII string unexpectedly.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> 
> Abner Chang (4):
>   RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
>   RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
>   RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
> unexpectedly
>   EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs
> 
> Nickle Wang (1):
>   RedfishPkg/RedfishPlatformConfigDxe: support menu path report
> 
> abnchang (1):
>   RedfishPkg/RedfishPlatformConfigDxe: Config language searching
> optimization
> 
>  RedfishPkg/RedfishPkg.dec |  24 +
>  EmulatorPkg/EmulatorPkg.dsc   |  21 +
>  .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
>  .../RedfishPlatformConfigDxe.inf  |   8 +
>  RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
>  .../RedfishPlatformConfigDxe.h|  48 +-
>  .../RedfishPlatformConfigImpl.h   | 135 ++-
>  .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
>  .../RedfishPlatformConfigCapability.c |  58 ++
>  .../RedfishPlatformConfigDxe.c|  89 +-
>  .../RedfishPlatformConfigImpl.c   | 928 --
>  11 files changed, 1240 insertions(+), 173 deletions(-)  create mode 100644
> RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c
> 
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117157): https://edk2.groups.io/g/devel/message/117157
Mute This Topic: https://groups.io/mt/105159781/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH V2 6/6] RedfishPkg/RedfishPlatformConfigDxe: support menu path report

2024-03-27 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner
> via groups.io
> Sent: Tuesday, March 26, 2024 11:15 PM
> To: devel@edk2.groups.io
> Cc: Abner Chang ; Igor Kulchytskyy 
> Subject: [edk2-devel] [PATCH V2 6/6] RedfishPkg/RedfishPlatformConfigDxe:
> support menu path report
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Nickle Wang 
> 
> "MenuPath" is the attribute in BIOS attribute registry. To support reporting 
> this
> attribute, we need to include the formset without x-uefi-redfish support in
> database. So driver can find menu path to target attribute in BIOS menu.
> 
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Signed-off-by: Abner Chang 
> ---
>  .../RedfishPlatformConfigDxe.h|  8 +--
>  .../RedfishPlatformConfigDxe.c|  8 +--
>  .../RedfishPlatformConfigImpl.c   | 51 +++
>  3 files changed, 49 insertions(+), 18 deletions(-)
> 
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> index 688f2067bff..8eb7b0dc2aa 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> @@ -2,7 +2,7 @@
>This file defines the EDKII Redfish Platform Config Protocol interface.
> 
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> -  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
>Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent @@ -49,8 +49,8 @@  // 2
> RedfishPlatformConfigDxe debug enablement must be set in
>  //PcdRedfishDebugCategory (defined in RedfishPkg.dec)
>  //
> -// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
> -//must be set in PcdRedfishPlatformConfigDebugPropert (defined
> +// 3. The subordinate debug enablement for RedfishPlatformConfigDxe
> +//must be set in PcdRedfishPlatformConfigDebugProperty (defined
>  //in RedfishPkg.dec).
>  //
>  #define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \ @@ -116,7
> +116,7 @@ typedef struct {
> 
>  #define REDFISH_MENU_PATH_SIZE  8
> 
> -// Definitions of Redfish platform config capbility
> +// Definitions of Redfish platform config capability
>  #define REDFISH_PLATFORM_CONFIG_BUILD_MENU_PATH   0x1
>  #define REDFISH_PLATFORM_CONFIG_ALLOW_SUPPRESSED  0x2
> 
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> index d165799f9a1..7821146e901 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> @@ -2016,7 +2016,7 @@ RedfishPlatformConfigProtocolGetConfigureLang (
>UINTN   Index;
>CHAR8   *FullSchema;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Harvest config language of %a_%a (Regex:
> %s).\n", __func__, Schema, Version, RegexPattern));
> +  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Harvest config language
> + of %a_%a (Regex: %s).\n", __func__, Schema, Version, RegexPattern));
> 
>if ((This == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING
> (Version) || (Count == NULL) || (ConfigureLangList == NULL) ||
> IS_EMPTY_STRING (RegexPattern)) {
>  return EFI_INVALID_PARAMETER;
> @@ -2103,7 +2103,7 @@ RELEASE_RESOURCE:
>  ReleaseStatementList ();
>}
> 
> -  DEBUG ((DEBUG_INFO, "%a: exit.\n", __func__));
> +  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: exit.\n", __func__));
>return Status;
>  }
> 
> @@ -2318,7 +2318,7 @@ RedfishPlatformConfigProtocolGetAttribute (
>CHAR8  *FullSchema;
>CHAR8  *Buffer;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
> +  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Entry\n", __func__));
>if ((This == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING
> (Version) || IS_EMPTY_STRING (ConfigureLang) || (AttributeValue == NULL)) {
>  return EFI_INVALID_PARAMETER;
>}
> @@ -2395,7 +2395,7 @@ RELEASE_RESOURCE:
>  FreePool (FullSchema);
>}
> 
> -  DEBUG ((DEBUG_INFO, "%a: Exit\n", __func__));
> +  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Exit\n", __func__));
>return Status;
>  }
> 
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
> index 537ce09a2d3..86f3aa529c5 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
> +++ 

Re: [edk2-devel] [PATCH V2 5/6] EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

2024-03-27 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Tuesday, March 26, 2024 11:15 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang 
> Subject: [PATCH V2 5/6] EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> ---
>  EmulatorPkg/EmulatorPkg.dsc | 21 +
>  1 file changed, 21 insertions(+)
> 
> diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index
> 85134b07816..5fa1ed345a3 100644
> --- a/EmulatorPkg/EmulatorPkg.dsc
> +++ b/EmulatorPkg/EmulatorPkg.dsc
> @@ -278,6 +278,27 @@
> 
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePath|{
> DEVICE_PATH("MAC(,0x1)")}
> 
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand|Fals
> e
>gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|False
> +
> +
> + gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfSecureBootDisabled|F
> + alse
> + gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfExitbootService|Fals
> + e
> +
> +
> + gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishServiceEtagSupported|Fals
> + e
> +
> +  #
> +  # Redfish Debug enablement
> +  #
> +  # 0x0001  RedfishPlatformConfigDxe driver debug enabled.
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0
> +  #   0x0001  x-uefi-redfish string database message enabled
> +  #   0x0002  Debug Message for dumping formset
> +  #   0x0004  Debug Message for x-uefi-redfish searching result
> +  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
> searching
> result
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0
> +
> +  # Redfish Platform Configure DXE driver feature enablement
> +  #   0x0001  Enable building Redfish Attribute Registry menu path.
> +  #   0x0002  Allow supressed HII option to be exposed on Redfish.
> +
> + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0
>  !endif
> 
>  [PcdsDynamicDefault.common.DEFAULT]
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117155): https://edk2.groups.io/g/devel/message/117155
Mute This Topic: https://groups.io/mt/105159788/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH V2 4/6] RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted unexpectedly

2024-03-27 Thread Nickle Wang via groups.io
Thanks for addressing this issue.


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Tuesday, March 26, 2024 11:15 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH V2 4/6] RedfishPkg/RedfishPlatformConfigDxe: HII string is
> deleted unexpectedly
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Add the condition check when delete HII string.
> Only when the HiiStatement operand equal to "EFI_IFR_STRING_OP"
> and the statement value type = EFI_IFR_TYPE_STRING.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c| 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> index 8a02c839035..d165799f9a1 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> @@ -1873,8 +1873,11 @@ RedfishPlatformConfigSetStatementCommon (
>  DEBUG ((DEBUG_ERROR, "%a: failed to save question value: %r\n", __func__,
> Status));
>}
> 
> -  if (StatementValue->Value.string != 0) {
> -HiiDeleteString (StatementValue->Value.string, TargetStatement-
> >ParentForm->ParentFormset->HiiHandle);
> +  if ((TargetStatement->HiiStatement->Operand == EFI_IFR_STRING_OP) &&
> (StatementValue->Type == EFI_IFR_TYPE_STRING)) {
> +if (StatementValue->Value.string != 0) {
> +  // Delete HII string which was created for HII statement operand =
> EFI_IFR_STRING_OP and Type = EFI_IFR_TYPE_STRING.
> +  HiiDeleteString (StatementValue->Value.string, TargetStatement-
> >ParentForm->ParentFormset->HiiHandle);
> +}
>}
> 
>return Status;
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117154): https://edk2.groups.io/g/devel/message/117154
Mute This Topic: https://groups.io/mt/105159786/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH V2 3/6] RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support

2024-03-27 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Tuesday, March 26, 2024 11:15 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH V2 3/6] RedfishPkg/RedfishPlatformConfigDxe:Add
> RefishDebugLib support
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Add RedfishPlatformConfigDxe debug capability that aligns with edk2 Redfish
> debug mechanism.
> 
> - PcdRedfishPlatformConfigDebugProperty, add PCD to control
>   RedfishPlatformConfigDxe subordinate of Redfish debug
>   capabilities.
> - PcdRedfishPlatformConfigFeatureProperty, add PCD to
>   manage RedfishPlatformConfigDxe features.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  RedfishPkg/RedfishPkg.dec |  15 +++
>  .../RedfishPlatformConfigDxe.inf  |   8 ++
>  .../RedfishPlatformConfigDxe.h|  46 +++-
>  .../RedfishPlatformConfigImpl.h   |  28 +
>  .../RedfishPlatformConfigCapability.c |  58 ++
>  .../RedfishPlatformConfigDxe.c|  59 +++---
>  .../RedfishPlatformConfigImpl.c   | 107 +++---
>  7 files changed, 262 insertions(+), 59 deletions(-)  create mode 100644
> RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c
> 
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index
> a9665ff68ef..c048e43f53b 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -193,3 +193,18 @@
>#   0x0001  RedfishPlatformConfigDxe driver debug enabled.
>#
> 
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x101
> 2
> +  #
> +  # Redfish RedfishPlatformConfigDxe Debug Properties
> +  #   0x0001  x-uefi-redfish string database message enabled
> +  #   0x0002  Debug Message for dumping formset
> +  #   0x0004  Debug Message for x-uefi-redfish searching result
> +  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
> searching
> result
> +  #
> +
> + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0|U
> + INT32|0x1013
> +  #
> +  # RedfishPlatformConfigDxe feature enablement
> +  #   0x0001  Enable building Redfish Attribute Registry menu path.
> +  #   0x0002  Allow supressed HII option to be exposed on Redfish.
> +  #
> +  # Redfish RedfishPlatformConfigDxe feature Properties
> +
> + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0
> + |UINT32|0x1014
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> index 5a249c8c3bc..2db47c2cffc 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> @@ -3,6 +3,7 @@
>  #
>  #  (C) Copyright 2021 Hewlett Packard Enterprise Development LP  #
> Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> +reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -23,6 +24,7 @@
>RedfishPkg/RedfishPkg.dec
> 
>  [Sources]
> +  RedfishPlatformConfigCapability.c
>RedfishPlatformConfigDxe.h
>RedfishPlatformConfigDxe.c
>RedfishPlatformConfigImpl.h
> @@ -36,7 +38,9 @@
>HiiLib
>HiiUtilityLib
>MemoryAllocationLib
> +  PcdLib
>PrintLib
> +  RedfishDebugLib
>UefiLib
>UefiBootServicesTableLib
>UefiRuntimeServicesTableLib
> @@ -51,5 +55,9 @@
>  [Guids]
>gEfiRegexSyntaxTypePerlGuid ## CONSUMED
> 
> +[FixedPcd]
> + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty
> + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty
> +
>  [Depex]
>TRUE
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> index 38adea04c5b..688f2067bff 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> @@ -3,6 +3,7 @@
> 
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
>Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> + reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -20,7 +21,9 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include  @@ -37,6 +40,41 @@  //  #include
> 
> 
> +//
> +// Debug message in DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE
> scope.
> +// To enable the debug message for this module, below PCDs must be set.
> +//
> +// 1. DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
> +//
> +// 2  

Re: [edk2-devel] [PATCH V2 2/6] RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro

2024-03-27 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Tuesday, March 26, 2024 11:15 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH V2 2/6] RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG
> macro
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Introduce DEBUG_REDFISH macro for the debug message of edk2 Redfish
> components.
> DEBUG_REDFISH can be used in any edk2 Redfish component with Redfish
> DebugCatagory as the first parameter.
> Whether the debug message is output or not depends on the platform setting of
> PcdRedfishDebugCatagory.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  RedfishPkg/RedfishPkg.dec |  9 +++
>  .../RedfishDebugLib/RedfishDebugLib.inf   |  4 ++
>  RedfishPkg/Include/Library/RedfishDebugLib.h  | 43 +++
>   .../Library/RedfishDebugLib/RedfishDebugLib.c | 55 ---
>  4 files changed, 57 insertions(+), 54 deletions(-)
> 
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index
> 1a9c9ed7bc5..a9665ff68ef 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -5,6 +5,7 @@
>  # (C) Copyright 2021 Hewlett Packard Enterprise Development LP  #
> Copyright (c) 2023, American Megatrends International LLC.
>  # Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> +reserved.
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  ## @@ -184,3 +185,11 @@
> 
> gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x10
> 10
>## This is used to disable Redfish HTTP cache function and every request 
> will be
> sent to Redfish service.
> 
> gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x
> 1011
> +  #
> +  # Redfish debug catagories
> +  # To enable the debug message for the entire edk2 Redfish implementation,
> below PCDs must be set.
> +  # DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
> +  #
> +  #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
> +  #
> +
> +
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x10
> + 12
> diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
> b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
> index d468bb213b6..42ff321b48e 100644
> --- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
> +++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
> @@ -2,6 +2,7 @@
>  #  INF file for Redfish debug library.
>  #
>  #  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> +reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -35,5 +36,8 @@
>RedfishHttpLib
>UefiLib
> 
> +[FixedPcd]
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory
> +
>  [Depex]
>TRUE
> diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h
> b/RedfishPkg/Include/Library/RedfishDebugLib.h
> index ad7a6975867..19e5a895cc8 100644
> --- a/RedfishPkg/Include/Library/RedfishDebugLib.h
> +++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
> @@ -2,6 +2,7 @@
>This file defines the Redfish debug library interface.
> 
>Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> + reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -11,28 +12,48 @@
>  #define REDFISH_DEBUG_LIB_H_
> 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> 
>  #include 
> 
> -#define DEBUG_REDFISH_NETWORK DEBUG_MANAGEABILITY   ///< Debug
> error level for Redfish networking function
> -#define DEBUG_REDFISH_HOST_INTERFACE  DEBUG_MANAGEABILITY   ///<
> Debug error level for Redfish networking function
> +// Used with MdePKg DEBUG macro.
> +#define DEBUG_REDFISH_NETWORK  DEBUG_MANAGEABILITY  ///<
> Debug error level for Redfish networking function
> +#define DEBUG_REDFISH_HOST_INTERFACE   DEBUG_MANAGEABILITY
> ///< Debug error level for Redfish Host INterface
> +#define DEBUG_REDFISH_PLATFORM_CONFIG  DEBUG_MANAGEABILITY
> ///< Debug error level for Redfish Platform Configure Driver
> +
> +//
> +// Definitions of Redfish debug capability in Redfish component scope,
> +used with DEBUG_REDFISH macro // For example, Redfish Platform Config
> Driver
> +//   DEBUG_REDFISH(DEBUG_REDFISH_PLATFORM_CONFIG_DXE, ...)
> +//
> +#define DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE
> 0x0001
> +
> +#define DEBUG_REDFISH(DebugCategory, ...) \
> +do {\
> +  if (!DebugPrintEnabled()) {   \
> +break;  \
> +  } \
> 

Re: [edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

2024-03-27 Thread Nickle Wang via groups.io
Per offline discussion with Abner, this will be addressed by separated patch 
since there is no function impact to performance improvements.

Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Nickle Wang
> via groups.io
> Sent: Wednesday, March 27, 2024 10:40 AM
> To: abner.ch...@amd.com; devel@edk2.groups.io
> Cc: Igor Kulchytskyy 
> Subject: Re: [edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe:
> Config language searching optimization
> 
> External email: Use caution opening links or attachments
> 
> 
> Hi Abner,
> 
> Could we change "DescriptionStr" below to something like "XuefiString", so
> people don't think it is a regular English string of HII statement?
> 
> > +  EFI_STRING_ID Description;  // String 
> > token of this
> question.
> > +  CHAR16*DescriptionStr;  // String of 
> > this question.
> > +  EFI_STRING_ID Help; // String 
> > token of help message.
> 
> 
> Thanks,
> Nickle
> 
> > -Original Message-
> > From: abner.ch...@amd.com 
> > Sent: Tuesday, March 26, 2024 11:15 PM
> > To: devel@edk2.groups.io
> > Cc: Nickle Wang ; Igor Kulchytskyy 
> > Subject: [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language
> > searching optimization
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: abnchang 
> >
> > Build up the x-uefi-redfish string database for the Redfish confg language
> > searching, instead of using HII String protocol.
> > This can improve the time consumption lot on searching strings.
> >
> > Signed-off-by: Abner Chang 
> > Co-authored-by: Nickle Wang 
> > Cc: Igor Kulchytskyy 
> > ---
> >  .../RedfishPlatformConfigImpl.h   | 107 ++-
> >  .../RedfishPlatformConfigDxe.c|  23 +-
> >  .../RedfishPlatformConfigImpl.c   | 820 +-
> >  3 files changed, 878 insertions(+), 72 deletions(-)
> >
> > diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> > b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> > index 9f4312decf5..6e6c7fdb8a9 100644
> > --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> > +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> > @@ -2,7 +2,8 @@
> >This file defines the EDKII Redfish Platform Config Protocol private 
> > structure.
> >
> >(C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> > -  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > +  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> > + reserved.
> >
> >SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -30,6 +31,10 @@
> >  #define ENGLISH_LANGUAGE_CODE  "en-US"
> >  #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
> >
> > +#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in
> UCS.
> > +
> > +typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
> > +REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
> > +
> >  //
> >  // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
> >  //
> > @@ -46,17 +51,49 @@ typedef struct {
> >CHAR8**SchemaList;// Schema list
> >  } REDFISH_PLATFORM_CONFIG_SCHEMA;
> >
> > +// Defines the number of elements in array #define
> > +X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
> > +
> > +//
> > +// Definition of x-uefi-redfish string element.
> > +//
> > +typedef struct {
> > +  EFI_STRING_IDStringId;
> > +  CHAR16   *UcsString;
> > +} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
> > +
> > +//
> > +// Discrete string array buffer, each has
> > X_UEFI_REDFISH_STRING_ARRAY_NUMBER element.
> > +//
> > +typedef struct {
> > +  LIST_ENTRY  NextArray;
> > +  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
> > +} REDFISH_X_UEFI_STRINGS_ARRAY;
> > +
> > +//
> > +// x-uefi-redfish string database, x-uefi-redfish language based.
> > +//
> > +typedef struct {
> > +  LIST_ENTRYNextXuefiRedfishLanguage;  
> >// Link to the
> > next suppoted 

Re: [edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

2024-03-26 Thread Nickle Wang via groups.io
Hi Abner,

Could we change "DescriptionStr" below to something like "XuefiString", so 
people don't think it is a regular English string of HII statement?

> +  EFI_STRING_ID Description;  // String 
> token of this question.
> +  CHAR16*DescriptionStr;  // String of 
> this question.
> +  EFI_STRING_ID Help; // String 
> token of help message.


Thanks,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Tuesday, March 26, 2024 11:15 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language
> searching optimization
> 
> External email: Use caution opening links or attachments
> 
> 
> From: abnchang 
> 
> Build up the x-uefi-redfish string database for the Redfish confg language
> searching, instead of using HII String protocol.
> This can improve the time consumption lot on searching strings.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../RedfishPlatformConfigImpl.h   | 107 ++-
>  .../RedfishPlatformConfigDxe.c|  23 +-
>  .../RedfishPlatformConfigImpl.c   | 820 +-
>  3 files changed, 878 insertions(+), 72 deletions(-)
> 
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> index 9f4312decf5..6e6c7fdb8a9 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> @@ -2,7 +2,8 @@
>This file defines the EDKII Redfish Platform Config Protocol private 
> structure.
> 
>(C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> -  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> + reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -30,6 +31,10 @@
>  #define ENGLISH_LANGUAGE_CODE  "en-US"
>  #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
> 
> +#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in UCS.
> +
> +typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
> +REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
> +
>  //
>  // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
>  //
> @@ -46,17 +51,49 @@ typedef struct {
>CHAR8**SchemaList;// Schema list
>  } REDFISH_PLATFORM_CONFIG_SCHEMA;
> 
> +// Defines the number of elements in array #define
> +X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
> +
> +//
> +// Definition of x-uefi-redfish string element.
> +//
> +typedef struct {
> +  EFI_STRING_IDStringId;
> +  CHAR16   *UcsString;
> +} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
> +
> +//
> +// Discrete string array buffer, each has
> X_UEFI_REDFISH_STRING_ARRAY_NUMBER element.
> +//
> +typedef struct {
> +  LIST_ENTRY  NextArray;
> +  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
> +} REDFISH_X_UEFI_STRINGS_ARRAY;
> +
> +//
> +// x-uefi-redfish string database, x-uefi-redfish language based.
> +//
> +typedef struct {
> +  LIST_ENTRYNextXuefiRedfishLanguage;
>  // Link to the
> next suppoted x-uefi-Redfish language.
> +  CHAR8 *XuefiRedfishLanguage;   
>  // x-uefi-redfish
> language.
> +  UINTN StringsArrayBlocks;  
>  // Number of the array
> blocks that accommodate X_UEFI_REDFISH_STRING_ARRAY_NUMBER
> + 
>  // elements in each.
> +  LIST_ENTRYXuefiRedfishStringArrays;
>  // Link entry of x-
> uefi-redfish string array.
> +} REDFISH_X_UEFI_STRING_DATABASE;
> +
>  //
>  // Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE
>  //
>  typedef struct {
>LIST_ENTRYLink;
> -  HII_FORMSET   *HiiFormSet; // Pointer to HII 
> formset data.
> -  EFI_GUID  Guid;// Formset GUID.
> -  EFI_HII_HANDLEHiiHandle;   // Hii Handle of this 
> formset.
> -  LIST_ENTRYHiiFormList; // Form list that keep 
> form data under
> this formset.
> -  CHAR16*DevicePathStr;  // Device path of this 
> formset.
> -  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema; // Schema that is
> supported in this formset.
> +  HII_FORMSET   *HiiFormSet;// Pointer 
> to HII formset data.
> +  EFI_GUID  Guid;   // Formset 
> GUID.
> +  

Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()

2024-03-26 Thread Nickle Wang via groups.io
Thanks for your reminder, Abner. I verify this patch series on my system, and I 
don't see any issue.



Hi @Mike Maslenkin, please add Abner and my 
reviewed-by to the commit messages. And we can merge the pull request.



Thanks,

Nickle



> -Original Message-

> From: Chang, Abner 

> Sent: Monday, March 25, 2024 10:13 AM

> To: Mike Maslenkin ; devel@edk2.groups.io

> Cc: Igor Kulchytskyy ; Nickle Wang 

> Subject: RE: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix

> GetRedpathNodeByIndex()

>

> External email: Use caution opening links or attachments

>

>

> [AMD Official Use Only - General]

>

> For this patch set,  Reviewed-by: Abner Chang 
> mailto:abner.ch...@amd.com>>

>

> Hi Nickle, please also take a look at this change. Thanks Abner

>

> > -Original Message-

> > From: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>

> > Sent: Saturday, March 23, 2024 8:01 PM

> > To: devel@edk2.groups.io

> > Cc: Chang, Abner mailto:abner.ch...@amd.com>>; Igor 
> > Kulchytskyy

> > mailto:ig...@ami.com>>; Nickle Wang 
> > mailto:nick...@nvidia.com>>; Mike Maslenkin

> > mailto:mike.maslen...@gmail.com>>

> > Subject: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix

> > GetRedpathNodeByIndex()

> >

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

> > caution when opening attachments, clicking links, or responding.

> >

> >

> > This set contains fixes for proper nodes handling in 
> > GetRedpathNodeByIndex().

> > It fixes handling of nodes with Index different from 0, it removes

> > leading '/' returned for section with Index = 0, also it fixes return

> > of the last section.

>

> This set does not have any impact to

> > existing code,

> > because in all places this function is used to obtain the end of the first 
> > section.

> > And actually returned pointer to the requested section is not used.

> > The current usages is:

> >GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0,

> > );

> >

> > and return of EndOfChar value is not affected by this set.

> >

> > Cc: Abner Chang mailto:abner.ch...@amd.com>>

> > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> > Cc: Nickle Wang mailto:nick...@nvidia.com>>

> > Signed-off-by: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>

> >




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117118): https://edk2.groups.io/g/devel/message/117118
Mute This Topic: https://groups.io/mt/105101990/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first node processing in GetRedpathNodeByIndex()

2024-03-26 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first 
> node
> processing in GetRedpathNodeByIndex()
> 
> External email: Use caution opening links or attachments
> 
> 
> For node with index 0, the result of this function contains leading L'/'
> character. But for other nodes no such characters (separators) returned.
> Make processing of all fields consistent.
> 
> After this patch the debug output for specified URI is the following:
> 
>  @Redfish.Settings found:/redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes:6
>  GetRedpathNodeByIndex[0]:redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[3]:system/Bios/Settings
>  GetRedpathNodeByIndex[4]:Bios/Settings
>  GetRedpathNodeByIndex[5]:Settings
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index b0a3b20a40bd..c55dc2ee6d05 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> @@ -1304,7 +1304,7 @@ GetRedpathNodeByIndex (
>NumberNodes = 0;
> 
>StringLen   = StrLen (NodeString);
> 
>StringIndex = 1; // ConfigLang always starts with '/'.
> 
> -  NodeStart   = NodeString;
> 
> +  NodeStart   = NodeString + StringIndex;
> 
>if (EndOfNodePtr != NULL) {
> 
>  *EndOfNodePtr = NULL;
> 
>}
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117117): https://edk2.groups.io/g/devel/message/117117
Mute This Topic: https://groups.io/mt/105101993/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing in GetRedpathNodeByIndex()

2024-03-26 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last 
> field
> processing in GetRedpathNodeByIndex()
> 
> External email: Use caution opening links or attachments
> 
> 
> After processing of nodes was fixed it was revealed that this function is not
> handling the last node correctly. The problem is that the end of node 
> detected by
> comparing to L'/', but usually ConfigLang and other properties do not have
> terminating separator (i.e '/'). So, before this patch the situation was as 
> below:
> 
>  @Redfish.Settings found: /redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes: 6
>  GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[3]:system/Bios/Settings
>  GetRedpathNodeByIndex[4]:Bios/Settings
>  GetRedpathNodeByIndex[5]:
> 
> And after this patch the debug output is:
> 
>  @Redfish.Settings found: /redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes: 6
>  GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[3]:system/Bios/Settings
>  GetRedpathNodeByIndex[4]:Bios/Settings
>  GetRedpathNodeByIndex[5]:Settings
> 
> The section with Index=5 is found and returned correctly.
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c  | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index 3231ef883379..b0a3b20a40bd 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> +++ ilityLib.c
> @@ -1327,6 +1327,11 @@ GetRedpathNodeByIndex (
>  StringIndex++;
> 
>}
> 
> 
> 
> +  if (NumberNodes == Index) {
> 
> +*EndOfNodePtr = NodeString + StringIndex - 1;
> 
> +return NodeStart;
> 
> +  }
> 
> +
> 
>return (NULL);
> 
>  }
> 
> 
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117115): https://edk2.groups.io/g/devel/message/117115
Mute This Topic: https://groups.io/mt/105101992/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex()

2024-03-26 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes 
> count
> in GetRedpathNodeByIndex()
> 
> External email: Use caution opening links or attachments
> 
> 
> This patch fixes work of GetRedpathNodeByIndex() function with non zero Index
> argument. NumberNodes value was not changed after the new node found. This
> means that before this patch modified function worked only in case of Index = 
> 0.
> 
> Debug output for the initial case:
> 
>  @Redfish.Settings found:/redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes:6
>  GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:
>  GetRedpathNodeByIndex[2]:
>  GetRedpathNodeByIndex[3]:
>  GetRedpathNodeByIndex[4]:
>  GetRedpathNodeByIndex[5]:
> 
> After this patch the output is as following:
> 
>  @Redfish.Settings found:/redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes:6
>  GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[3]:system/Bios/Settings
>  GetRedpathNodeByIndex[4]:Bios/Settings
>  GetRedpathNodeByIndex[5]:
> 
> Note: it is supposed that caller will set terminating '\0' explicitly at the 
> next
> position pointed by returned EndOfNodePtr value.
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c  | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index cc2b37b79605..3231ef883379 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> +++ ilityLib.c
> @@ -1320,6 +1320,7 @@ GetRedpathNodeByIndex (
>  return NodeStart;
> 
>} else {
> 
>  NodeStart = NodeString + StringIndex + 1;
> 
> +NumberNodes++;
> 
>}
> 
>  }
> 
> 
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117114): https://edk2.groups.io/g/devel/message/117114
Mute This Topic: https://groups.io/mt/105101991/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH V5 2/2] RedfishClientPkg/FeatureDriver: Use SetRedfishSettingsObjectsUri

2024-03-26 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, March 22, 2024 10:41 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [edk2-redfish-client][PATCH V5 2/2] RedfishClientPkg/FeatureDriver:
> Use SetRedfishSettingsObjectsUri
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Use SetRedfishSettingsObjectsUri to set the config language for SettingsObject
> URI.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c  | 1 +
>  RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c  | 1 +
>  .../Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c  | 1 +
>  .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c   | 1 +
>  RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c  | 1 +
>  5 files changed, 5 insertions(+)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index 1ca920640a..bb64ef8625 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -141,6 +141,7 @@ RedfishResourceConsumeResource (
>  );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> index 7501c1a975..5a66fe59e0 100644
> --- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> +++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> @@ -130,6 +130,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings
> found: %s\n", __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.c
> index 1235760a18..a0c71212b3 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.c
> +++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyste
> +++ mDxe.c
> @@ -133,6 +133,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> index 5207362dac..494bf59dfc 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem
> +++ Dxe.c
> @@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> index c4a363cdf5..f2c0a7735b 100644
> --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> @@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117113): https://edk2.groups.io/g/devel/message/117113
Mute This Topic: https://groups.io/mt/105086470/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set SettingsObject URI as the config language

2024-03-26 Thread Nickle Wang via groups.io
Thanks for working on this, Abner.


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, March 22, 2024 10:41 PM
> To: devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nickle Wang 
> Subject: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set 
> SettingsObject
> URI as the config language
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Set SettingsObject URI in @Redfish.Settings resource as the config language
> which is the same as the config language of parent URI that mandates
> @Redfish.Settings.
> With this, we can find the config language of the properties in 
> SettingsObject URI.
> 
> Signed-off-by: Abner Chang 
> Cc: Igor Kulchytskyy 
> Co-authored-by: Nickle Wang 
> ---
>  .../Library/RedfishFeatureUtilityLib.h| 17 
>  .../RedfishFeatureUtilityLib.c| 89 ---
>  .../RedfishConfigLangMapDxe.c | 15 +++-
>  3 files changed, 104 insertions(+), 17 deletions(-)
> 
> diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> index ba9ea01501..3c5f248eb7 100644
> --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> @@ -369,6 +369,23 @@ RedfishSetRedfishUri (
>INEFI_STRING  Uri
>);
> 
> +/**
> +
> +  Save Redfish SettingsObject URI in database for further use.
> +
> +  @param[in]ParentUri Parent URI of @Redfish.Settings property.
> +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> +
> +  @retval  EFI_INVALID_PARAMETER  SystemId is NULL or EMPTY
> +  @retval  EFI_SUCCESSRedfish uri is saved
> +
> +**/
> +EFI_STATUS
> +SetRedfishSettingsObjectsUri (
> +  IN EFI_STRING  ParentUri,
> +  IN EFI_STRING  SettingObjectUri
> +  );
> +
>  /**
> 
>Get the property name by given Configure Language.
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index cc2b37b796..dda80c4608 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> +++ ilityLib.c
> @@ -2082,7 +2082,6 @@ GetConfigureLang (
>EFI_STRING  ResultStr;
>EFI_STRING  UnicodeUri;
>EFI_STATUS  Status;
> -  EFI_STRING  StrFound;
> 
>if (IS_EMPTY_STRING (Uri)) {
>  return NULL;
> @@ -2101,18 +2100,6 @@ GetConfigureLang (
>}
> 
>ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
> -  if (ConfigLang == NULL) {
> -//
> -// @Redfish.Settings share the same schema as its parent.
> -// Remove "Settings" and try again.
> -//
> -StrFound = StrStr (UnicodeUri, L"/Settings");
> -if (StrFound != NULL) {
> -  StrFound[0] = L'\0';
> -  DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI, try: 
> %s\n",
> __func__, UnicodeUri));
> -  ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
> -}
> -  }
> 
>FreePool (UnicodeUri);
> 
> @@ -2172,6 +2159,64 @@ RedfishSetRedfishUri (
>return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, ConfigLang,
> Uri);  }
> 
> +/**
> +
> +  Save Redfish SettingsObject URI in database for further use.
> +
> +  @param[in]ParentUri Parent URI of @Redfish.Settings property.
> +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> +
> +  @retval  EFI_INVALID_PARAMETER  ParentUri or SettingObjectUri is NULL.
> +  @retval  EFI_NOT_FOUND  Config language for ParentUri is not found.
> +  @retval  EFI_SUCCESSRedfish URI is saved with corresponding
> +  config language.
> +
> +**/
> +EFI_STATUS
> +SetRedfishSettingsObjectsUri (
> +  IN EFI_STRING  ParentUri,
> +  IN EFI_STRING  SettingObjectUri
> +  )
> +{
> +  EFI_STATUS  Status;
> +  EFI_STRING  ConfigLang;
> +
> +  if ((ParentUri == NULL) || (SettingObjectUri == NULL)) {
> +return EFI_INVALID_PARAMETER;
> +  }
> +
> +  //
> +  // Check if the SettingsObject URI already in the database.
> +  //
> +  Status = EFI_SUCCESS;
> +  ConfigLang = RedfishGetConfigLanguage (SettingObjectUri);  if
> + (ConfigLang == NULL) {
> +//
> +// No config language of SettingsObject URI is found.
> +// Get the config language of parent URI because the data model of
> +// SettingsObject URI resource is the same as the data model of parent 
> URI.
> +//
> +ConfigLang = RedfishGetConfigLanguage (ParentUri);
> +if (ConfigLang == NULL) {
> +  DEBUG ((DEBUG_ERROR, "%a: Failed to get the config language of parent
> URI that mandates SettingsObject - %s.\n", __func__, ParentUri));
> +  Status = EFI_NOT_FOUND;
> +} else {
> +
> +  // Set the config language of settings URI using parent's 

Re: [edk2-devel] [PATCH 0/5] [PATCH 0/5] Config language searching algorithm enhancement and the bug fixes

2024-03-26 Thread Nickle Wang via groups.io
Thanks for working on Redfish performance improvements, Abner. Per offline 
discussion, I have updated this patch series to support menu path reporting for 
BIOS attribute registry.

Please send version 2 patch series if you are ok with my modifications.

Thanks,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, March 22, 2024 5:43 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH 0/5] [PATCH 0/5] Config language searching algorithm
> enhancement and the bug fixes
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> PR # 5491
> 
> In this patch set,
> 1 We enhance the config language searching algorithm.
>   As the performance of searching config language using HII GetString is
>   pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
>   to build up the metadata required for Redfish BIOS resource. With this
>   improvement, it only takes 4 seconds.
> 
> 2.Introduce the Redfish debug framework, there are three edk2 Redfish
>   debug scopes.
>   a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug message
>  for edk2 Redfish.
>   b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
>  component. Currently we only support RedfishPlatformConfigDxe
>  module.
>   c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
>  scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.
> 
> 3 This patch set also fixes an issue that deletes HII string unexpectedly.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> 
> Abner Chang (4):
>   RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
>   RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
>   RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
> unexpectedly
>   EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs
> 
> abnchang (1):
>   RedfishPkg/RedfishPlatformConfigDxe: Config language searching
> optimization
> 
>  RedfishPkg/RedfishPkg.dec |  24 +
>  EmulatorPkg/EmulatorPkg.dsc   |  21 +
>  .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
>  .../RedfishPlatformConfigDxe.inf  |   8 +
>  RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
>  .../RedfishPlatformConfigDxe.h|  46 +-
>  .../RedfishPlatformConfigImpl.h   | 131 ++-
>  .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
>  .../RedfishPlatformConfigCapability.c |  52 +
>  .../RedfishPlatformConfigDxe.c|  89 +-
>  .../RedfishPlatformConfigImpl.c   | 894 --
>  11 files changed, 1196 insertions(+), 171 deletions(-)  create mode 100644
> RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c
> 
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117109): https://edk2.groups.io/g/devel/message/117109
Mute This Topic: https://groups.io/mt/105082172/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 1/2] RedfishClientPkg/Features: support Redfish Secure Boot

2024-03-14 Thread Nickle Wang via groups.io
Introduce SecureBoot driver to support
/redfish/v1/Systems/SYS/SecureBoot resource.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../RedfishClientComponents.dsc.inc   |   2 +
 RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +
 .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf   |  60 ++
 .../v1_1_0/Common/SecureBootCommon.h  |  40 +
 .../v1_1_0/Common/SecureBootCommon.c  | 756 
 .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.c | 808 ++
 RedfishClientPkg/RedfishClient.fdf.inc|   1 +
 7 files changed, 1671 insertions(+)
 create mode 100644 
RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
 create mode 100644 
RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommon.h
 create mode 100644 
RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommon.c
 create mode 100644 
RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.c

diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc 
b/RedfishClientPkg/RedfishClientComponents.dsc.inc
index ae2a4b025..42fc0c299 100644
--- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
+++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
@@ -34,6 +34,7 @@
   RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
   RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf
   RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
+  RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
 
   !include RedfishClientPkg/RedfishJsonStructureDxe.dsc.inc
 
@@ -47,3 +48,4 @@
   RedfishClientPkg/Converter/Bios/v1_0_9/RedfishBios_V1_0_9_Dxe.inf
   
RedfishClientPkg/Converter/BootOptionCollection/RedfishBootOptionCollection_Dxe.inf
   RedfishClientPkg/Converter/BootOption/v1_0_4/RedfishBootOption_V1_0_4_Dxe.inf
+  RedfishClientPkg/Converter/SecureBoot/v1_1_0/RedfishSecureBoot_V1_1_0_Dxe.inf
diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc 
b/RedfishClientPkg/RedfishClientLibs.dsc.inc
index 6599926ab..9126465df 100644
--- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
+++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
@@ -25,6 +25,8 @@
   BiosV1_0_9Lib|RedfishClientPkg/ConverterLib/edk2library/Bios/v1_0_9/Lib.inf
   
BootOptionCollectionLib|RedfishClientPkg/ConverterLib/edk2library/BootOptionCollection/Lib.inf
   
BootOptionV1_0_4Lib|RedfishClientPkg/ConverterLib/edk2library/BootOption/v1_0_4/Lib.inf
+  
SecureBootV1_1_0Lib|RedfishClientPkg/ConverterLib/edk2library/SecureBoot/v1_1_0/Lib.inf
+
   #
   # Above modules should be pulled in by build tool.
   #
@@ -42,3 +44,5 @@
   
RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
   RedfishDebugLib|RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
   RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
+  
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
+  
PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf
diff --git a/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf 
b/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
new file mode 100644
index 0..1ad8c623f
--- /dev/null
+++ b/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
@@ -0,0 +1,60 @@
+## @file
+#
+#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+#  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = SecureBootDxe
+  FILE_GUID = 5E4025F8-DA42-468A-853E-6A1091D35052
+  MODULE_TYPE   = DXE_DRIVER
+  VERSION_STRING= 1.0
+  ENTRY_POINT   = RedfishResourceEntryPoint
+  UNLOAD_IMAGE  = RedfishResourceUnload
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  SecurityPkg/SecurityPkg.dec
+  RedfishPkg/RedfishPkg.dec
+  RedfishClientPkg/RedfishClientPkg.dec
+
+[Sources]
+  ../Common/SecureBootCommon.h
+  ../Common/SecureBootCommon.c
+  SecureBootDxe.c
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  EdkIIRedfishResourceConfigLib
+  RedfishFeatureUtilityLib
+  RedfishVersionLib
+  RedfishResourceIdentifyLib
+  SecureBootVariableLib
+  UefiLib
+  UefiDriverEntryPoint
+  RedfishAddendumLib
+  UefiRuntimeServicesTableLib
+
+[Protocols]
+  gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
+  gEfiRestJsonStructureProtocolGuid   ## CONSUMED
+  gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED
+  gEdkIIRedfishFeatureProtocolGuid## CONSUMED
+
+[Guids]
+  gEfiSecureBootEnableDisableGuid ## CONSUMED
+
+[Pcd]
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize
+  

[edk2-devel] [edk2-redfish-client][PATCH 2/2] RedfishClientPkg/Features: release resources

2024-03-14 Thread Nickle Wang via groups.io
-Release Etag and PendingSettingUri resources.
-Update function header for GetHttpResponseEtag() and
GetHttpResponseLocation(). Caller has to release returned
memory buffer from these two functions.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.c| 20 --
 .../BootOption/v1_0_4/Dxe/BootOptionDxe.c | 33 -
 .../v1_13_0/Dxe/ComputerSystemDxe.c   | 33 -
 .../v1_5_0/Dxe/ComputerSystemDxe.c| 33 -
 .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c| 37 ++-
 .../RedfishFeatureUtilityLib.c|  2 +
 6 files changed, 114 insertions(+), 44 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index 1ca920640..0422d60ff 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -157,8 +157,12 @@ RedfishResourceConsumeResource (
   //
   // Searching for etag in HTTP response header
   //
-  Etag = NULL;
-  GetHttpResponseEtag (ExpectedResponse, );
+  Etag   = NULL;
+  Status = GetHttpResponseEtag (ExpectedResponse, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", 
__func__));
+  }
+
   Status = RedfishConsumeResourceCommon (Private, Private->Json, Etag);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n", 
__func__, Private->Uri, Status));
@@ -337,8 +341,12 @@ RedfishResourceCheck (
   //
   // Find etag in HTTP response header
   //
-  Etag = NULL;
-  GetHttpResponseEtag (, );
+  Etag   = NULL;
+  Status = GetHttpResponseEtag (, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", 
__func__));
+  }
+
   Status = RedfishCheckResourceCommon (Private, Private->Json, Etag);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", 
__func__, Uri, Status));
@@ -347,6 +355,10 @@ RedfishResourceCheck (
   //
   // Release resource
   //
+  if (Etag != NULL) {
+FreePool (Etag);
+  }
+
   RedfishHttpFreeResponse ();
   Private->Payload = NULL;
 
diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
index 7501c1a97..ae1fad0a0 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
@@ -122,12 +122,13 @@ RedfishResourceConsumeResource (
   //
   // Check and see if "@Redfish.Settings" exist or not.
   //
-  Status = GetPendingSettings (
- Private->RedfishService,
- Response.Payload,
- ,
- 
- );
+  PendingSettingUri = NULL;
+  Status= GetPendingSettings (
+Private->RedfishService,
+Response.Payload,
+,
+
+);
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings found: 
%s\n", __func__, PendingSettingUri));
 Private->Uri = PendingSettingUri;
@@ -146,8 +147,12 @@ RedfishResourceConsumeResource (
   //
   // Find etag in HTTP response header
   //
-  Etag = NULL;
-  GetHttpResponseEtag (ExpectedResponse, );
+  Etag   = NULL;
+  Status = GetHttpResponseEtag (ExpectedResponse, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", 
__func__));
+  }
+
   Status = RedfishConsumeResourceCommon (Private, Private->Json, Etag);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n", 
__func__, Private->Uri, Status));
@@ -169,6 +174,10 @@ RedfishResourceConsumeResource (
 Private->Json = NULL;
   }
 
+  if (PendingSettingUri != NULL) {
+FreePool (PendingSettingUri);
+  }
+
   return Status;
 }
 
@@ -322,8 +331,12 @@ RedfishResourceCheck (
   //
   // Find etag in HTTP response header
   //
-  Etag = NULL;
-  GetHttpResponseEtag (, );
+  Etag   = NULL;
+  Status = GetHttpResponseEtag (, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", 
__func__));
+  }
+
   Status = RedfishCheckResourceCommon (Private, Private->Json, Etag);
   if (EFI_ERROR (Status)) {
 DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: failed to check resource 
from: %s: %r\n", __func__, Uri, Status));
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
index 1235760a1..85dffd434 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
@@ -125,12 +125,13 

Re: [edk2-devel] [PATCH 4/4][edk2-redfish-client] RedfishClientPkg: fix memory leak

2024-03-11 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Mike
> Maslenkin via groups.io
> Sent: Sunday, March 10, 2024 6:42 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-devel] [PATCH 4/4][edk2-redfish-client] RedfishClientPkg: fix
> memory leak
> 
> External email: Use caution opening links or attachments
> 
> 
> The structure instance retunred by ToStructure() must be deallocated properly.
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../v1_5_0/RedfishResourceIdentifyLibComputerSystem.c| 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git
> a/RedfishClientPkg/Library/RedfishResourceIdentifyLibComputerSystem/v1_5_0/
> RedfishResourceIdentifyLibComputerSystem.c
> b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComputerSystem/v1_5_0/
> RedfishResourceIdentifyLibComputerSystem.c
> index 29b4f525d5ff..2f177b8032cc 100644
> ---
> a/RedfishClientPkg/Library/RedfishResourceIdentifyLibComputerSystem/v1_5_0/
> RedfishResourceIdentifyLibComputerSystem.c
> +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComputerSystem/
> +++ v1_5_0/RedfishResourceIdentifyLibComputerSystem.c
> @@ -70,19 +70,20 @@ RedfishIdentifyResource (
>ComputerSystemCs = ComputerSystem->ComputerSystem;
> 
> 
> 
>if (IS_EMPTY_STRING (ComputerSystemCs->UUID)) {
> 
> -return FALSE;
> 
> +Status = EFI_NOT_FOUND;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>Status = AsciiStrToGuid (ComputerSystemCs->UUID, );
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a, fail to get resource UUID: %r\n", __func__,
> Status));
> 
> -return FALSE;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>Status = NetLibGetSystemGuid ();
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a, fail to get system UUID from SMBIOS: %r\n",
> __func__, Status));
> 
> -return FALSE;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>DEBUG ((REDFISH_DEBUG_TRACE, "%a, Identify: System: %g Resource: %g\n",
> __func__, , ));
> 
> @@ -92,6 +93,8 @@ RedfishIdentifyResource (
>  Status = EFI_UNSUPPORTED;
> 
>}
> 
> 
> 
> +ON_RELEASE:
> 
> +
> 
>mJsonStructProtocol->DestoryStructure (
> 
>   mJsonStructProtocol,
> 
>   (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem
> 
> --
> 2.32.0 (Apple Git-132)
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#116568): https://edk2.groups.io/g/devel/message/116568
> Mute This Topic: https://groups.io/mt/104841896/7129762
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [nick...@nvidia.com] -=-=-
> =-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116627): https://edk2.groups.io/g/devel/message/116627
Mute This Topic: https://groups.io/mt/104841896/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 3/4][edk2-redfish-client] RedfishClientPkg: fix leak in provisioning properties functions

2024-03-11 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Mike
> Maslenkin via groups.io
> Sent: Sunday, March 10, 2024 6:42 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-devel] [PATCH 3/4][edk2-redfish-client] RedfishClientPkg: fix 
> leak
> in provisioning properties functions
> 
> External email: Use caution opening links or attachments
> 
> 
> The structure instance retunred by ToStructure() must be deallocated properly.
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../v1_13_0/Common/ComputerSystemCommon.c | 25 +--
>  .../v1_5_0/Common/ComputerSystemCommon.c  | 25 +--
>  2 files changed, 36 insertions(+), 14 deletions(-)
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.c
> index df22a1c90c46..4795e4d6c6eb 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSy
> +++ stemCommon.c
> @@ -263,7 +263,7 @@ ProvisioningComputerSystemProperties (
>);
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a: ToStructure failure: %r\n", __func__, Status));
> 
> -return Status;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>ComputerSystemCs = ComputerSystem->ComputerSystem;
> 
> @@ -365,7 +365,7 @@ ProvisioningComputerSystemProperties (
>   );
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a: ToJson() failed: %r\n", __func__, Status));
> 
> -return Status;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>if (PropertyChanged) {
> 
> @@ -374,10 +374,14 @@ ProvisioningComputerSystemProperties (
>  if (EFI_ERROR (Status)) {
> 
>DEBUG ((DEBUG_ERROR, "%a: Fail to remove Redfish unchangeable
> properties from ResultJson.\n", __func__));
> 
>*ResultJson = NULL;
> 
> -  return Status;
> 
> +  goto ON_RELEASE;
> 
>  }
> 
>}
> 
> 
> 
> +  Status = EFI_SUCCESS;
> 
> +
> 
> +ON_RELEASE:
> 
> +
> 
>//
> 
>// Release resource.
> 
>//
> 
> @@ -393,10 +397,17 @@ ProvisioningComputerSystemProperties (
>  DestoryRedfishCharArray (ComputerSystemCsEmpty->Boot->BootOrder,
> ArraySize);
> 
>}
> 
> 
> 
> -  JsonStructProtocol->DestoryStructure (
> 
> -JsonStructProtocol,
> 
> -(EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystemEmpty
> 
> -);
> 
> +  if (ComputerSystemEmpty != NULL) {
> 
> +JsonStructProtocol->DestoryStructure (
> 
> +  JsonStructProtocol,
> 
> +  (EFI_REST_JSON_STRUCTURE_HEADER
> + *)ComputerSystemEmpty
> 
> +  );
> 
> +  }
> 
> +
> 
> +  if (EFI_ERROR (Status)) {
> 
> +return Status;
> 
> +  }
> 
> +
> 
>return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND);
> 
>  }
> 
> 
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> index c383cad59029..2d257e01da2b 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSys
> +++ temCommon.c
> @@ -793,7 +793,7 @@ ProvisioningComputerSystemProperties (
>);
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a: ToStructure failure: %r\n", __func__, Status));
> 
> -return Status;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>ComputerSystemCs = ComputerSystem->ComputerSystem;
> 
> @@ -1235,7 +1235,7 @@ ProvisioningComputerSystemProperties (
>   );
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a: ToJson() failed: %r\n", __func__, Status));
> 
> -return Status;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>if (PropertyChanged) {
> 
> @@ -1244,10 +1244,14 @@ ProvisioningComputerSystemProperties (
>  if (EFI_ERROR (Status)) {
> 
>DEBUG ((DEBUG_ERROR, "%a: Fail to remove Redfish unchangeable
> properties from ResultJson.\n", __func__));
> 
>*ResultJson = NULL;
> 
> -  return Status;
> 
> +  goto ON_RELEASE;
> 
>  }
> 
>}
> 
> 
> 
> +  Status = EFI_SUCCESS;
> 
> +
> 
> +ON_RELEASE:
> 
> +
> 
>//
> 
>// Release resource.
> 
>//
> 
> @@ -1263,10 +1267,17 @@ ProvisioningComputerSystemProperties (
>  DestoryRedfishCharArray (ComputerSystemCsEmpty->Boot->BootOrder,
> ArraySize);
> 
>}
> 
> 
> 
> -  JsonStructProtocol->DestoryStructure (
> 
> -

Re: [edk2-devel] [PATCH 2/4][edk2-redfish-client] RedfishClientPkg: fix leak in provisioning properties functions

2024-03-11 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Mike
> Maslenkin via groups.io
> Sent: Sunday, March 10, 2024 6:42 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-devel] [PATCH 2/4][edk2-redfish-client] RedfishClientPkg: fix 
> leak
> in provisioning properties functions
> 
> External email: Use caution opening links or attachments
> 
> 
> The structure instance retunred by ToStructure() must be deallocated properly.
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c| 5 -
>  .../Features/BootOption/v1_0_4/Common/BootOptionCommon.c | 5 -
>  .../Features/Memory/V1_7_1/Common/MemoryCommon.c | 5 -
>  3 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> index 1eb269a84222..f40fe215afeb 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> @@ -247,7 +247,6 @@ ProvisioningBiosProperties (
>   );
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a, ToJson() failed: %r\n", __func__, Status));
> 
> -return Status;
> 
>}
> 
> 
> 
>//
> 
> @@ -258,6 +257,10 @@ ProvisioningBiosProperties (
>  (EFI_REST_JSON_STRUCTURE_HEADER *)Bios
> 
>  );
> 
> 
> 
> +  if (EFI_ERROR (Status)) {
> 
> +return Status;
> 
> +  }
> 
> +
> 
>return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND);
> 
>  }
> 
> 
> 
> diff --git
> a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.
> c
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.
> c
> index 339c8ba04103..358b32253973 100644
> ---
> a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.
> c
> +++
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommo
> +++ n.c
> @@ -334,7 +334,6 @@ ON_RELEASE:
>   );
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a: ToJson() failed: %r\n", __func__, Status));
> 
> -return Status;
> 
>}
> 
> 
> 
>//
> 
> @@ -345,6 +344,10 @@ ON_RELEASE:
>  (EFI_REST_JSON_STRUCTURE_HEADER *)BootOption
> 
>  );
> 
> 
> 
> +  if (EFI_ERROR (Status)) {
> 
> +return Status;
> 
> +  }
> 
> +
> 
>return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND);
> 
>  }
> 
> 
> 
> diff --git
> a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
> b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
> index e873f05ca040..39ec7ec0c34b 100644
> --- a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
> +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
> @@ -2133,7 +2133,6 @@ ProvisioningMemoryProperties (
>   );
> 
>if (EFI_ERROR (Status)) {
> 
>  DEBUG ((DEBUG_ERROR, "%a, ToJson() failed: %r\n", __func__, Status));
> 
> -return Status;
> 
>}
> 
> 
> 
>//
> 
> @@ -2144,6 +2143,10 @@ ProvisioningMemoryProperties (
>  (EFI_REST_JSON_STRUCTURE_HEADER *)Memory
> 
>  );
> 
> 
> 
> +  if (EFI_ERROR (Status)) {
> 
> +return Status;
> 
> +  }
> 
> +
> 
>return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND);
> 
>  }
> 
> 
> 
> --
> 2.32.0 (Apple Git-132)
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#116566): https://edk2.groups.io/g/devel/message/116566
> Mute This Topic: https://groups.io/mt/104841893/7129762
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [nick...@nvidia.com] -=-=-
> =-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116625): https://edk2.groups.io/g/devel/message/116625
Mute This Topic: https://groups.io/mt/104841893/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/4][edk2-redfish-client] RedfishClientPkg: fix memory leak

2024-03-11 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Mike
> Maslenkin via groups.io
> Sent: Sunday, March 10, 2024 6:42 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-devel] [PATCH 1/4][edk2-redfish-client] RedfishClientPkg: fix
> memory leak
> 
> External email: Use caution opening links or attachments
> 
> 
> This patch fixes leak of EFI_REDFISH_COMPUTERSYSTEMCOLLECTION instance
> on error path.
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../ComputerSystemCollectionDxe.c| 12 +---
>  .../MemoryCollectionDxe/MemoryCollectionDxe.c| 11 ---
>  2 files changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> index 55a6d07dbf2e..3deefa824629 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> +++ b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSyst
> +++ emCollectionDxe.c
> @@ -174,11 +174,13 @@ HandleCollectionResource (
>CollectionCs = Collection->ComputerSystemCollection;
> 
> 
> 
>if (*CollectionCs->Membersodata_count == 0) {
> 
> -return EFI_NOT_FOUND;
> 
> +Status = EFI_NOT_FOUND;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>if (IsLinkEmpty (>Members)) {
> 
> -return EFI_NOT_FOUND;
> 
> +Status = EFI_NOT_FOUND;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>List = GetFirstLink (>Members);
> 
> @@ -206,12 +208,16 @@ HandleCollectionResource (
>  List = GetNextLink (>Members, List);
> 
>}
> 
> 
> 
> +  Status = EFI_SUCCESS;
> 
> +
> 
> +ON_RELEASE:
> 
> +
> 
>//
> 
>// Release resource.
> 
>//
> 
>Private->JsonStructProtocol->DestoryStructure (Private->JsonStructProtocol,
> (EFI_REST_JSON_STRUCTURE_HEADER *)Collection);
> 
> 
> 
> -  return EFI_SUCCESS;
> 
> +  return Status;
> 
>  }
> 
> 
> 
>  EFI_STATUS
> 
> diff --git
> a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> index d963fb52ad37..38f28f902715 100644
> --- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> +++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.
> +++ c
> @@ -165,11 +165,13 @@ HandleCollectionResource (
>CollectionCs = Collection->MemoryCollection;
> 
> 
> 
>if (*CollectionCs->Membersodata_count == 0) {
> 
> -return EFI_NOT_FOUND;
> 
> +Status = EFI_NOT_FOUND;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>if (IsLinkEmpty (>Members)) {
> 
> -return EFI_NOT_FOUND;
> 
> +Status = EFI_NOT_FOUND;
> 
> +goto ON_RELEASE;
> 
>}
> 
> 
> 
>List = GetFirstLink (>Members);
> 
> @@ -197,12 +199,15 @@ HandleCollectionResource (
>  List = GetNextLink (>Members, List);
> 
>}
> 
> 
> 
> +  Status = EFI_SUCCESS;
> 
> +
> 
> +ON_RELEASE:
> 
>//
> 
>// Release resource.
> 
>//
> 
>Private->JsonStructProtocol->DestoryStructure (Private->JsonStructProtocol,
> (EFI_REST_JSON_STRUCTURE_HEADER *)Collection);
> 
> 
> 
> -  return EFI_SUCCESS;
> 
> +  return Status;
> 
>  }
> 
> 
> 
>  EFI_STATUS
> 
> --
> 2.32.0 (Apple Git-132)
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#116565): https://edk2.groups.io/g/devel/message/116565
> Mute This Topic: https://groups.io/mt/104841892/7129762
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [nick...@nvidia.com] -=-=-
> =-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116624): https://edk2.groups.io/g/devel/message/116624
Mute This Topic: https://groups.io/mt/104841892/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH v3 2/2] RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2 protocol

2024-03-06 Thread Nickle Wang via groups.io
-Support Redfish resource config2 protocol in Edk2RedfishResourceConfigLib.
This library will try Redfish resource config2 protocol first. And if
there is no matching protocol found, Redfish resource config protocol will
be used.
-Because EdkIIRedfishResourceConfigLib is updated to support Redfish
resource config2 protocol, update corresponding functions in feature
drivers.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
 .../BootOptionCollectionDxe.c |  14 +-
 .../ComputerSystemCollectionDxe.c |  16 +-
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 8 files changed, 415 insertions(+), 117 deletions(-)
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
index 2d10445f0..998a05c80 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
@@ -22,6 +22,7 @@
 #
 
 [Sources]
+  EdkIIRedfishResourceConfigInternal.h
   EdkIIRedfishResourceConfigLib.c
 
 [Packages]
@@ -42,8 +43,9 @@
   RedfishHttpLib
 
 [Protocols]
-  gEdkIIRedfishResourceConfigProtocolGuid   ## CONSUMES ##
+  gEdkIIRedfishResourceConfigProtocolGuid ## CONSUMES ##
   gEdkIIRedfishFeatureInterchangeDataProtocolGuid ## CONSUMES ##
+  gEdkIIRedfishResourceConfig2ProtocolGuid## CONSUEMS ##
 
 [Pcd]
   gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h 
b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
index 3aa953cec..57c7f2b80 100644
--- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
+++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /**
@@ -23,6 +24,7 @@
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
   @param[in]   InformationExchange Pointer to RESOURCE_INFORMATION_EXCHANGE.
   @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
FALSE if the resource exist but some of 
properties are missing,
@@ -33,9 +35,11 @@
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigProvisioning (
   IN REDFISH_SCHEMA_INFO*Schema,
   IN EFI_STRING Uri,
+  IN CHAR8  *JsonText OPTIONAL,
   IN RESOURCE_INFORMATION_EXCHANGE  *InformationExchange,
   IN BOOLEANHttpPostMode
   );
@@ -45,15 +49,18 @@ EdkIIRedfishResourceConfigProvisioning (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigConsume (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
@@ -61,21 +68,25 @@ EdkIIRedfishResourceConfigConsume (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigUpdate (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
   Check resource on given URI.
 
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval EFI_UNSUPPORTED  This resource is not owned by feature 
driver.
@@ -84,9 +95,11 @@ 

[edk2-devel] [edk2-redfish-client][PATCH v3 1/2] RedfishClientPkg: introduce Redfish resource config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
Redfish Resource Config Protocol, this protocol adds new parameter
called "JsonText". This allows Redfish caller driver to pass JSON
context to callee. Callee save the effort of getting same data from
Redfish service again. This is useful when Redfish service supports
"expand" query parameter. "Version" is added to this protocol too so
we don't create new protocol to add new parameter in the future.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfig2Protocol.h | 158 ++
 2 files changed, 160 insertions(+)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h

diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index aa018d714..f894f30ab 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -48,6 +48,8 @@
   gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 
0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
   ## Include/Protocol/EdkIIRedfishOverrideProtocol.h
   gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9, { 
0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
+  ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
+  gEdkIIRedfishResourceConfig2ProtocolGuid  = { 0xe9bef87f, 0xbff4, 0x4872, { 
0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
 
 [Guids]
   ## Include/Guid/RedfishClientPkgTokenSpace.h
diff --git 
a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h 
b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
new file mode 100644
index 0..a0613048b
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
@@ -0,0 +1,158 @@
+/** @file
+  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_
+#define EDKII_REDFISH_RESOURCE_CONFIG2_H_
+
+#include 
+
+typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
+
+/**
+  Provision redfish resource by given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
+   FALSE if the resource exist but some of 
properties are missing,
+   HTTP PUT method is used.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_PROVISIONING)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL,
+  IN BOOLEAN  HttpPostMode
+  );
+
+/**
+  Consume resource from given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CONSUME)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
+  );
+
+/**
+  Update resource to given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+
+  @retval EFI_SUCCESS

[edk2-devel] [edk2-redfish-client][PATCH v3 0/2] introduce Redfish Resource Config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
v3: merge 2/3 and 3/3 in v2 together so we don't break the build.

v2: address review comment about the description of "JsonText" parameter.

Introduce EDKII Redfish Resource Config2 Protocol so that caller can 
pass Redfish data to callee when caller uses "expand" query parameter
to get multiple Redfish resources all together. Then, callee does not 
get Redfish resource from Redfish service again and save the communication
effort between BIOS and Redfish service.

EdkIIRedfishConfigLib is updated to select Redfish Resource Config2 
Protocol as first priority. If there is no Config2 protocol supported,
library will use config protocol automatically.

Pull request is created: 
https://github.com/tianocore/edk2-redfish-client/pull/80

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 

Nickle Wang (2):
  RedfishClientPkg: introduce Redfish resource config2 protocol.
  RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2
protocol

 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfig2Protocol.h | 158 +++
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
 .../BootOptionCollectionDxe.c |  14 +-
 .../ComputerSystemCollectionDxe.c |  16 +-
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 10 files changed, 575 insertions(+), 117 deletions(-)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116466): https://edk2.groups.io/g/devel/message/116466
Mute This Topic: https://groups.io/mt/104781197/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
> Can we say "The additional JSON data in ASCII string format passed to callee. 
> The
> usage is defined between the Redfish feature driver and subordinate Redfish
> resource feature driver."? Seems to me more clear about the usage.
> Also apply this description to the following functions.
> 

Thanks for your comment, Abner! I update the description of "JsonText" in 
version 2 patch set.

Regards,
Nickle

> -Original Message-
> From: Chang, Abner 
> Sent: Wednesday, March 6, 2024 1:16 PM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: RE: [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce 
> Redfish
> resource config2 protocol.
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Monday, March 4, 2024 9:27 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > ; Nick Ramirez 
> > Subject: [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce
> > Redfish resource config2 protocol.
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
> > Redfish Resource Config Protocol, this protocol adds new parameter
> > called "JsonText". This allows Redfish caller driver to pass JSON
> > context to callee. Callee save the effort of getting same data from
> > Redfish service again. This is useful when Redfish service supports
> > "expand" query parameter. "Version" is added to this protocol too so
> > we don't create new protocol to add new parameter in the future.
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Cc: Nick Ramirez 
> > ---
> >  RedfishClientPkg/RedfishClientPkg.dec |   2 +
> >  .../EdkIIRedfishResourceConfig2Protocol.h | 148 ++
> >  2 files changed, 150 insertions(+)
> >  create mode 100644
> > RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.
> > h
> >
> > diff --git a/RedfishClientPkg/RedfishClientPkg.dec
> > b/RedfishClientPkg/RedfishClientPkg.dec
> > index aa018d714..f894f30ab 100644
> > --- a/RedfishClientPkg/RedfishClientPkg.dec
> > +++ b/RedfishClientPkg/RedfishClientPkg.dec
> > @@ -48,6 +48,8 @@
> >gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4,
> > 0x4e90, { 0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
> >## Include/Protocol/EdkIIRedfishOverrideProtocol.h
> >gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9,
> > { 0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
> > +  ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
> > +  gEdkIIRedfishResourceConfig2ProtocolGuid  = { 0xe9bef87f, 0xbff4,
> > 0x4872, { 0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
> >
> >  [Guids]
> >## Include/Guid/RedfishClientPkgTokenSpace.h
> > diff --git
> > a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protoco
> > l.h
> > b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protoco
> > l.h
> > new file mode 100644
> > index 0..96384e265
> > --- /dev/null
> > +++
> > b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protoco
> > l.h
> > @@ -0,0 +1,148 @@
> > +/** @file
> > +  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL
> > interface.
> > +
> > +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > +
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_ #define
> > +EDKII_REDFISH_RESOURCE_CONFIG2_H_
> > +
> > +#include 
> > +
> > +typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL
> > EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
> > +
> > +/**
> > +  Provision redfish resource by given URI.
> > +
> > +  @param[in]   ThisPointer to
> > EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
> > +  @param[in]   Uri Target URI to create resource.
> > +  @param[in]   JsonTextThe JSON data in ASCII string format. 
> > This is
> > optional.
> Can we say "The additional JSON data in ASCII string format passed to callee. 
> The
> usage is defined between the Redfish feature driver and subordinate Redfish
> resource feature driver."? Seems to me more clear about the usage.
> Also apply this description to the following functions.
> 
> Thanks
> Abner
> 
> > +  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP 
> > POST
> > method is used.
> > +   FALSE if the resource exist but
> > + some of properties are
> > missing,
> > +   HTTP PUT method is used.
> > +
> > +  @retval EFI_SUCCESS  Value is returned successfully.
> > +  @retval Others   Some error happened.
> > +
> > +**/
> > +typedef
> > 

[edk2-devel] [edk2-redfish-client][PATCH v2 3/3] RedfishClientPkg/Features: support config2 protocol

2024-03-06 Thread Nickle Wang via groups.io
Because EdkIIRedfishResourceConfigLib is updated to support
Redfish resource config2 protocol, update corresponding
functions in feature drivers.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../Features/Bios/v1_0_9/Common/BiosCommon.c | 14 +++---
 .../BootOptionCollectionDxe.c| 14 +++---
 .../ComputerSystemCollectionDxe.c| 16 
 .../MemoryCollectionDxe/MemoryCollectionDxe.c| 16 
 4 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index 1f3c30147..1eb269a84 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -782,7 +782,7 @@ HandleResource (
 
   DEBUG ((REDFISH_DEBUG_TRACE, "%a, process resource for: %s\n", __func__, 
Uri));
 
-  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, );
+  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, NULL, );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to get schema information from: %s %r\n", 
__func__, Uri, Status));
 return Status;
@@ -795,7 +795,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a Identify for %s\n", __func__, Uri));
   ConfigLang = RedfishGetConfigLanguage (Uri);
   if (ConfigLang == NULL) {
-Status = EdkIIRedfishResourceConfigIdentify (, Uri, 
Private->InformationExchange);
+Status = EdkIIRedfishResourceConfigIdentify (, Uri, NULL, 
Private->InformationExchange);
 if (EFI_ERROR (Status)) {
   if (Status == EFI_UNSUPPORTED) {
 DEBUG ((DEBUG_MANAGEABILITY, "%a, \"%s\" is not handled by us\n", 
__func__, Uri));
@@ -811,17 +811,17 @@ HandleResource (
   }
 
   //
-  // Check and see if target property exist or not even when collection 
memeber exists.
+  // Check and see if target property exist or not even when collection member 
exists.
   // If not, we sill do provision.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigCheck (, Uri);
+  Status = EdkIIRedfishResourceConfigCheck (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 //
 // The target property does not exist, do the provision to create property.
 //
 DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri));
-Status = EdkIIRedfishResourceConfigProvisioning (, Uri, 
Private->InformationExchange, FALSE);
+Status = EdkIIRedfishResourceConfigProvisioning (, Uri, NULL, 
Private->InformationExchange, FALSE);
 if (EFI_ERROR (Status)) {
   DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", 
__func__, Status));
 }
@@ -833,7 +833,7 @@ HandleResource (
   // Consume first.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigConsume (, Uri);
+  Status = EdkIIRedfishResourceConfigConsume (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", 
__func__, Uri, Status));
   }
@@ -842,7 +842,7 @@ HandleResource (
   // Patch.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigUpdate (, Uri);
+  Status = EdkIIRedfishResourceConfigUpdate (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", 
__func__, Uri, Status));
   }
diff --git 
a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c 
b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
index 4f94a4495..cd1437f54 100644
--- a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
+++ b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
@@ -44,7 +44,7 @@ HandleResource (
 
   DEBUG ((REDFISH_BOOT_OPTION_COLLECTION_DEBUG_TRACE, "%a: process resource 
for: %s\n", __func__, Uri));
 
-  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, );
+  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, NULL, );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: failed to get schema information from: %s %r\n", 
__func__, Uri, Status));
 return Status;
@@ -58,7 +58,7 @@ HandleResource (
   SystemRestDetected = FALSE;
   ConfigLang = RedfishGetConfigLanguage (Uri);
   if (ConfigLang == NULL) {
-Status = EdkIIRedfishResourceConfigIdentify (, Uri, 
Private->InformationExchange);
+Status = EdkIIRedfishResourceConfigIdentify (, Uri, NULL, 
Private->InformationExchange);
 if (EFI_ERROR (Status)) {
   if (Status == EFI_UNSUPPORTED) {
 DEBUG ((REDFISH_BOOT_OPTION_COLLECTION_DEBUG_TRACE, "%a: \"%s\" is not 
handled by 

[edk2-devel] [edk2-redfish-client][PATCH v2 2/3] RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2 protocol

2024-03-06 Thread Nickle Wang via groups.io
Support Redfish resource config2 protocol in Edk2RedfishResourceConfigLib.
This library will try Redfish resource config2 protocol first. And if
there is no matching protocol found, Redfish resource config protocol will
be used.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
---
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 4 files changed, 385 insertions(+), 87 deletions(-)
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
index 2d10445f0..998a05c80 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
@@ -22,6 +22,7 @@
 #
 
 [Sources]
+  EdkIIRedfishResourceConfigInternal.h
   EdkIIRedfishResourceConfigLib.c
 
 [Packages]
@@ -42,8 +43,9 @@
   RedfishHttpLib
 
 [Protocols]
-  gEdkIIRedfishResourceConfigProtocolGuid   ## CONSUMES ##
+  gEdkIIRedfishResourceConfigProtocolGuid ## CONSUMES ##
   gEdkIIRedfishFeatureInterchangeDataProtocolGuid ## CONSUMES ##
+  gEdkIIRedfishResourceConfig2ProtocolGuid## CONSUEMS ##
 
 [Pcd]
   gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h 
b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
index 3aa953cec..57c7f2b80 100644
--- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
+++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /**
@@ -23,6 +24,7 @@
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
   @param[in]   InformationExchange Pointer to RESOURCE_INFORMATION_EXCHANGE.
   @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
FALSE if the resource exist but some of 
properties are missing,
@@ -33,9 +35,11 @@
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigProvisioning (
   IN REDFISH_SCHEMA_INFO*Schema,
   IN EFI_STRING Uri,
+  IN CHAR8  *JsonText OPTIONAL,
   IN RESOURCE_INFORMATION_EXCHANGE  *InformationExchange,
   IN BOOLEANHttpPostMode
   );
@@ -45,15 +49,18 @@ EdkIIRedfishResourceConfigProvisioning (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigConsume (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
@@ -61,21 +68,25 @@ EdkIIRedfishResourceConfigConsume (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigUpdate (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
   Check resource on given URI.
 
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval EFI_UNSUPPORTED  This resource is not owned by feature 
driver.
@@ -84,9 +95,11 @@ EdkIIRedfishResourceConfigUpdate (
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigCheck (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
@@ -94,6 +107,7 @@ EdkIIRedfishResourceConfigCheck (
 
   @param[in]   Schema  Redfish 

[edk2-devel] [edk2-redfish-client][PATCH v2 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
Redfish Resource Config Protocol, this protocol adds new parameter
called "JsonText". This allows Redfish caller driver to pass JSON
context to callee. Callee save the effort of getting same data from
Redfish service again. This is useful when Redfish service supports
"expand" query parameter. "Version" is added to this protocol too so
we don't create new protocol to add new parameter in the future.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfig2Protocol.h | 158 ++
 2 files changed, 160 insertions(+)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h

diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index aa018d714..f894f30ab 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -48,6 +48,8 @@
   gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 
0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
   ## Include/Protocol/EdkIIRedfishOverrideProtocol.h
   gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9, { 
0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
+  ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
+  gEdkIIRedfishResourceConfig2ProtocolGuid  = { 0xe9bef87f, 0xbff4, 0x4872, { 
0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
 
 [Guids]
   ## Include/Guid/RedfishClientPkgTokenSpace.h
diff --git 
a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h 
b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
new file mode 100644
index 0..a0613048b
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
@@ -0,0 +1,158 @@
+/** @file
+  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_
+#define EDKII_REDFISH_RESOURCE_CONFIG2_H_
+
+#include 
+
+typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
+
+/**
+  Provision redfish resource by given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
+   FALSE if the resource exist but some of 
properties are missing,
+   HTTP PUT method is used.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_PROVISIONING)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL,
+  IN BOOLEAN  HttpPostMode
+  );
+
+/**
+  Consume resource from given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CONSUME)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
+  );
+
+/**
+  Update resource to given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+
+  @retval EFI_SUCCESS

[edk2-devel] [edk2-redfish-client][PATCH v2 0/3] introduce Redfish Resource Config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
v2: address review comment about the description of "JsonText" parameter.

Introduce EDKII Redfish Resource Config2 Protocol so that caller can 
pass Redfish data to callee when caller uses "expand" query parameter
to get multiple Redfish resources all together. Then, callee does not 
get Redfish resource from Redfish service again and save the communication
effort between BIOS and Redfish service.

EdkIIRedfishConfigLib is updated to select Redfish Resource Config2 
Protocol as first priority. If there is no Config2 protocol supported,
library will use config protocol automatically.

Pull request is created: 
https://github.com/tianocore/edk2-redfish-client/pull/80

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 

Nickle Wang (3):
  RedfishClientPkg: introduce Redfish resource config2 protocol.
  RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2
protocol
  RedfishClientPkg/Features: support config2 protocol

 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfig2Protocol.h | 158 +++
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
 .../BootOptionCollectionDxe.c |  14 +-
 .../ComputerSystemCollectionDxe.c |  16 +-
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 10 files changed, 575 insertions(+), 117 deletions(-)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116444): https://edk2.groups.io/g/devel/message/116444
Mute This Topic: https://groups.io/mt/104766134/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 2/2] RedfishClientPkg: Remove unused header files.

2024-03-06 Thread Nickle Wang via groups.io
stdarg.h and stdio.h are not used in RedfishClientPkg.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/PrivateInclude/Crt/stdarg.h | 14 --
 RedfishClientPkg/PrivateInclude/Crt/stdio.h  | 14 --
 2 files changed, 28 deletions(-)
 delete mode 100644 RedfishClientPkg/PrivateInclude/Crt/stdarg.h
 delete mode 100644 RedfishClientPkg/PrivateInclude/Crt/stdio.h

diff --git a/RedfishClientPkg/PrivateInclude/Crt/stdarg.h 
b/RedfishClientPkg/PrivateInclude/Crt/stdarg.h
deleted file mode 100644
index 5f458c0a4..0
--- a/RedfishClientPkg/PrivateInclude/Crt/stdarg.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/** @file
-  Include file to support building the third-party jansson library.
-
- (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#ifndef REDFISH_CLIENT_CRT_STDARG_H_
-#define REDFISH_CLIENT_CRT_STDARG_H_
-
-#include 
-
-#endif
diff --git a/RedfishClientPkg/PrivateInclude/Crt/stdio.h 
b/RedfishClientPkg/PrivateInclude/Crt/stdio.h
deleted file mode 100644
index 30a0afae6..0
--- a/RedfishClientPkg/PrivateInclude/Crt/stdio.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/** @file
-  Include file to support building the third-party jansson library.
-
- (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#ifndef REDFISH_CLIENT_CRT_STDIO_H_
-#define REDFISH_CLIENT_CRT_STDIO_H_
-
-#include 
-
-#endif
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116443): https://edk2.groups.io/g/devel/message/116443
Mute This Topic: https://groups.io/mt/104766064/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/Features: support config2 protocol

2024-03-05 Thread Nickle Wang via groups.io
Yes that is correct.

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner
> via groups.io
> Sent: Wednesday, March 6, 2024 1:51 PM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 3/3]
> RedfishClientPkg/Features: support config2 protocol
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> Hi Nickle, I think we have to merge this patch with 2/3. Otherwise, the build 
> will
> be failed on the commit of 2/3, right?
> 
> Thanks
> Abner
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Monday, March 4, 2024 9:27 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > ; Nick Ramirez 
> > Subject: [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/Features:
> > support
> > config2 protocol
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Because EdkIIRedfishResourceConfigLib is updated to support Redfish
> > resource config2 protocol, update corresponding functions in feature
> > drivers.
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Cc: Nick Ramirez 
> > ---
> >  .../Features/Bios/v1_0_9/Common/BiosCommon.c | 14 +++---
> >  .../BootOptionCollectionDxe.c| 14 +++---
> >  .../ComputerSystemCollectionDxe.c| 16 
> >  .../MemoryCollectionDxe/MemoryCollectionDxe.c| 16 
> >  4 files changed, 30 insertions(+), 30 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> > b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> > index 1f3c30147..1eb269a84 100644
> > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> > @@ -782,7 +782,7 @@ HandleResource (
> >
> >DEBUG ((REDFISH_DEBUG_TRACE, "%a, process resource for: %s\n",
> > __func__, Uri));
> >
> > -  Status = GetRedfishSchemaInfo (Private->RedfishService, Private-
> > >JsonStructProtocol, Uri, );
> > +  Status = GetRedfishSchemaInfo (Private->RedfishService, Private-
> > >JsonStructProtocol, Uri, NULL, );
> >if (EFI_ERROR (Status)) {
> >  DEBUG ((DEBUG_ERROR, "%a, failed to get schema information from:
> > %s %r\n", __func__, Uri, Status));
> >  return Status;
> > @@ -795,7 +795,7 @@ HandleResource (
> >DEBUG ((REDFISH_DEBUG_TRACE, "%a Identify for %s\n", __func__, Uri));
> >ConfigLang = RedfishGetConfigLanguage (Uri);
> >if (ConfigLang == NULL) {
> > -Status = EdkIIRedfishResourceConfigIdentify (, Uri, Private-
> > >InformationExchange);
> > +Status = EdkIIRedfishResourceConfigIdentify (, Uri,
> > + NULL,
> > Private->InformationExchange);
> >  if (EFI_ERROR (Status)) {
> >if (Status == EFI_UNSUPPORTED) {
> >  DEBUG ((DEBUG_MANAGEABILITY, "%a, \"%s\" is not handled by
> > us\n", __func__, Uri)); @@ -811,17 +811,17 @@ HandleResource (
> >}
> >
> >//
> > -  // Check and see if target property exist or not even when
> > collection memeber exists.
> > +  // Check and see if target property exist or not even when
> > + collection
> > member exists.
> >// If not, we sill do provision.
> >//
> >DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri));
> > -  Status = EdkIIRedfishResourceConfigCheck (, Uri);
> > +  Status = EdkIIRedfishResourceConfigCheck (, Uri, NULL);
> >if (EFI_ERROR (Status)) {
> >  //
> >  // The target property does not exist, do the provision to create 
> > property.
> >  //
> >  DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri));
> > -Status = EdkIIRedfishResourceConfigProvisioning (, Uri,
> > Private->InformationExchange, FALSE);
> > +Status = EdkIIRedfishResourceConfigProvisioning (,
> > + Uri, NULL,
> > Private->InformationExchange, FALSE);
> >  if (EFI_ERROR (Status)) {
> >DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode:
> > %r\n", __func__, Status));
> >  }
> > @@ -833,7 +833,7 @@ HandleResource (
> >// Consume first.
> >//
> >DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__,
> > Uri));
> > -  Status = EdkIIRedfishResourceConfigConsume (, Uri);
> > +  Status = EdkIIRedfishResourceConfigConsume (, Uri,
> > + NULL);
> >if (EFI_ERROR (Status)) {
> >  DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s:
> > %r\n", __func__, Uri, Status));
> >}
> > @@ -842,7 +842,7 @@ HandleResource (
> >// Patch.
> >//
> >DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
> > -  Status = EdkIIRedfishResourceConfigUpdate (, Uri);
> > +  Status = EdkIIRedfishResourceConfigUpdate (, Uri, NULL);
> >if (EFI_ERROR (Status)) {
> >  DEBUG 

Re: [edk2-devel] [edk2-redfish-client][PATCH 00/13] use Redfish HTTP protocol

2024-03-05 Thread Nickle Wang via groups.io
Thanks for your feedback, Igor!

I will create a patch and remove RedfishLib in RedfishClientPkg.

Regards,
Nickle

From: Igor Kulchytskyy 
Sent: Wednesday, March 6, 2024 1:50 AM
To: Nickle Wang ; Mike Maslenkin 
; devel@edk2.groups.io
Cc: Abner Chang 
Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH 00/13] use 
Redfish HTTP protocol

External email: Use caution opening links or attachments

Hi Nickle,
Sorry, for late response.
AMI does not use RedfishLib in RedfishClientPkg, but library in RedfishPkg used.
Thank you,
Igor


From: Nickle Wang mailto:nick...@nvidia.com>>
Sent: Thursday, February 29, 2024 8:24 PM
To: Mike Maslenkin mailto:mike.maslen...@gmail.com>>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Igor Kulchytskyy 
mailto:ig...@ami.com>>
Cc: Abner Chang mailto:abner.ch...@amd.com>>
Subject: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH 00/13] use 
Redfish HTTP protocol


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

Hi Mike,



> May I know why didn't you remove

> RedfishClientPkg/PrivateLibrary/RedfishLib completely?



Yes, Abner and I had discussed this before. RedfishLib brings some difficulty 
to maintain because it is private library in two separated repositories.



Before we go and remove it, we like to make sure that no one is using it. @Igor 
Kulchytskyy<mailto:ig...@ami.com>, if my memory serves me well, you mentioned 
that AMI is using RedfishLib. Is it ok for us to remove RedfishLib in 
RedfishCientPkg (not RedfishPkg)?



Thanks,

Nickle



> -Original Message-

> From: Mike Maslenkin 
> mailto:mike.maslen...@gmail.com>>

> Sent: Friday, March 1, 2024 8:08 AM

> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Nickle Wang 
> mailto:nick...@nvidia.com>>

> Cc: Abner Chang mailto:abner.ch...@amd.com>>; Igor 
> Kulchytskyy mailto:ig...@ami.com>>

> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 00/13] use Redfish HTTP

> protocol

>

> External email: Use caution opening links or attachments

>

>

> Good work, Nickle!

>

> On Thu, Feb 29, 2024 at 11:53 AM Nickle Wang via groups.io

> mailto:nicklew=nvidia@groups.io>> wrote:

> >

> > Redfish HTTP protocol is introduced to edk2 RedfishPkg. Update

> > RedfishClientPkg to use RedfishHttpLib. And remove the use of

> > RedfishHttpCacheLib.

> >

> > I also replace several functions from RedfishLib with the function

> > provided in RedfishHttpLib. In this way, there is no dependency on

> > RedfishLib in RedfishClientPkg.

>

> May I know why didn't you remove

> RedfishClientPkg/PrivateLibrary/RedfishLib completely?

> I've been looking at this library for a long time and started improving it 
> with this

> set.

> Eventually I realized that the improved functions are not used in 
> RedfishClientPkg.

> Then I just deleted RedfishClientPkg/PrivateLibrary and

> RedfishClientPkg/PrivateInclude/Library/RedfishLib.h,

> tuned the dec and dsc files, and I successfully built the package.

> Removing this library is a big improvement since it duplicates RedfishLib from

> RedfishPkg.

> and their headers no longer conflict.

>

> Regards,

> Mike.

>

>

> >

> > I noticed that there is false alarm in uncrustify check. When there

> > are deleted files, uncrustiry cannot check them and trigger uncrustify

> > failure.

> >

> > Pull request is created here for testing CI:

> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith%2F=05%7C02%7Cnicklew%40nvidia.com%7C05c61959f6604763e61208dc3d3cbe64%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638452578319230226%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=4reM%2FifNUi4hskVe5ZazRuNX07Yt1hf4IHkJowqzl5I%3D=0>

> > ub.com%2Ftianocore%2Fedk2-redfish-

> client%2Fpull%2F79=05%7C02%7Cni

> >

> cklew%40nvidia.com%7C44d7d139b40b4acff94508dc3983b3df%7C43083d1572

> 7340

> >

> c1b7db39efd9ccc17a%7C0%7C0%7C638448485034820142%7CUnknown%7CTW

> FpbGZsb3

> >

> d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D

> %7

> >

> C0%7C%7C%7C=ocqaIR0%2BtKvx8ETphWlWFX2uZIQbQvDKWkn7D36c2z

> 0%3D

> > erved=0

> >

> > Signed-off-by: Nickle Wang mailto:nick...@nvidia.com>>

> > Cc: Abner Chang mailto:abner.ch...@amd.com>>

> > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> >

> > Nickle Wang (13):

> >   RedfishClientPkg/.github: do not run uncrustify to deleted fil

Re: [edk2-devel] [edk2-redfish-client][PATCH 0/3] introduce Redfish Resource Config2 protocol.

2024-03-04 Thread Nickle Wang via groups.io
Hi Abner,

Per offline discussion, Redfish collection driver may use query parameter 
"expand" to get members data all together. And then Redfish collection driver 
can send these data to non-collection driver. Non-collection driver does not 
need to get data from BMC again and this saves time of communication between 
BIOS and BMC. This is very helpful when we are working on Redfish Boot Options 
collection, which may contains many boot options on system.

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner
> via groups.io
> Sent: Tuesday, March 5, 2024 10:27 AM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 0/3] introduce Redfish
> Resource Config2 protocol.
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> Hi Nickle,
> May I know what is the scenario on edk2 Redfish driver stack to use Resource
> Config2 protocol?
> 
> Thanks
> Abner
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Monday, March 4, 2024 9:27 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > ; Nick Ramirez 
> > Subject: [edk2-redfish-client][PATCH 0/3] introduce Redfish Resource
> > Config2 protocol.
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Introduce EDKII Redfish Resource Config2 Protocol so that caller can
> > pass Redfish data to callee when caller uses "expand" query parameter
> > to get multiple Redfish resources all together. Then, callee does not
> > get Redfish resource from Redfish service again and save the
> > communication effort between BIOS and Redfish service.
> >
> > EdkIIRedfishConfigLib is updated to select Redfish Resource Config2
> > Protocol as first priority. If there is no Config2 protocol supported,
> > library will use config protocol automatically.
> >
> > Pull request is created:
> > https://github.com/tianocore/edk2-redfish-client/pull/80
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Cc: Nick Ramirez 
> >
> > Nickle Wang (3):
> >   RedfishClientPkg: introduce Redfish resource config2 protocol.
> >   RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2
> > protocol
> >   RedfishClientPkg/Features: support config2 protocol
> >
> >  RedfishClientPkg/RedfishClientPkg.dec |   2 +
> >  .../EdkIIRedfishResourceConfigLib.inf |   4 +-
> >  .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
> >  .../EdkIIRedfishResourceConfig2Protocol.h | 148 +++
> >  .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
> >  .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
> >  .../BootOptionCollectionDxe.c |  14 +-
> >  .../ComputerSystemCollectionDxe.c |  16 +-
> >  .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
> >  .../EdkIIRedfishResourceConfigLib.c   | 391 ++
> >  10 files changed, 565 insertions(+), 117 deletions(-)  create mode
> > 100644
> > RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.
> > h
> >  create mode 100644
> > RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishRes
> > ourc
> > eConfigInternal.h
> >
> > --
> > 2.34.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116351): https://edk2.groups.io/g/devel/message/116351
Mute This Topic: https://groups.io/mt/104721505/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/Features: support config2 protocol

2024-03-04 Thread Nickle Wang via groups.io
Because EdkIIRedfishResourceConfigLib is updated to support
Redfish resource config2 protocol, update corresponding
functions in feature drivers.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../Features/Bios/v1_0_9/Common/BiosCommon.c | 14 +++---
 .../BootOptionCollectionDxe.c| 14 +++---
 .../ComputerSystemCollectionDxe.c| 16 
 .../MemoryCollectionDxe/MemoryCollectionDxe.c| 16 
 4 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index 1f3c30147..1eb269a84 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -782,7 +782,7 @@ HandleResource (
 
   DEBUG ((REDFISH_DEBUG_TRACE, "%a, process resource for: %s\n", __func__, 
Uri));
 
-  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, );
+  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, NULL, );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to get schema information from: %s %r\n", 
__func__, Uri, Status));
 return Status;
@@ -795,7 +795,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a Identify for %s\n", __func__, Uri));
   ConfigLang = RedfishGetConfigLanguage (Uri);
   if (ConfigLang == NULL) {
-Status = EdkIIRedfishResourceConfigIdentify (, Uri, 
Private->InformationExchange);
+Status = EdkIIRedfishResourceConfigIdentify (, Uri, NULL, 
Private->InformationExchange);
 if (EFI_ERROR (Status)) {
   if (Status == EFI_UNSUPPORTED) {
 DEBUG ((DEBUG_MANAGEABILITY, "%a, \"%s\" is not handled by us\n", 
__func__, Uri));
@@ -811,17 +811,17 @@ HandleResource (
   }
 
   //
-  // Check and see if target property exist or not even when collection 
memeber exists.
+  // Check and see if target property exist or not even when collection member 
exists.
   // If not, we sill do provision.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigCheck (, Uri);
+  Status = EdkIIRedfishResourceConfigCheck (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 //
 // The target property does not exist, do the provision to create property.
 //
 DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri));
-Status = EdkIIRedfishResourceConfigProvisioning (, Uri, 
Private->InformationExchange, FALSE);
+Status = EdkIIRedfishResourceConfigProvisioning (, Uri, NULL, 
Private->InformationExchange, FALSE);
 if (EFI_ERROR (Status)) {
   DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", 
__func__, Status));
 }
@@ -833,7 +833,7 @@ HandleResource (
   // Consume first.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigConsume (, Uri);
+  Status = EdkIIRedfishResourceConfigConsume (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", 
__func__, Uri, Status));
   }
@@ -842,7 +842,7 @@ HandleResource (
   // Patch.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigUpdate (, Uri);
+  Status = EdkIIRedfishResourceConfigUpdate (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", 
__func__, Uri, Status));
   }
diff --git 
a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c 
b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
index 4f94a4495..cd1437f54 100644
--- a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
+++ b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
@@ -44,7 +44,7 @@ HandleResource (
 
   DEBUG ((REDFISH_BOOT_OPTION_COLLECTION_DEBUG_TRACE, "%a: process resource 
for: %s\n", __func__, Uri));
 
-  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, );
+  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, NULL, );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: failed to get schema information from: %s %r\n", 
__func__, Uri, Status));
 return Status;
@@ -58,7 +58,7 @@ HandleResource (
   SystemRestDetected = FALSE;
   ConfigLang = RedfishGetConfigLanguage (Uri);
   if (ConfigLang == NULL) {
-Status = EdkIIRedfishResourceConfigIdentify (, Uri, 
Private->InformationExchange);
+Status = EdkIIRedfishResourceConfigIdentify (, Uri, NULL, 
Private->InformationExchange);
 if (EFI_ERROR (Status)) {
   if (Status == EFI_UNSUPPORTED) {
 DEBUG ((REDFISH_BOOT_OPTION_COLLECTION_DEBUG_TRACE, "%a: \"%s\" is not 
handled by 

[edk2-devel] [edk2-redfish-client][PATCH 2/3] RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2 protocol

2024-03-04 Thread Nickle Wang via groups.io
Support Redfish resource config2 protocol in Edk2RedfishResourceConfigLib.
This library will try Redfish resource config2 protocol first. And if
there is no matching protocol found, Redfish resource config protocol will
be used.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 4 files changed, 385 insertions(+), 87 deletions(-)
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
index 2d10445f0..998a05c80 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
@@ -22,6 +22,7 @@
 #
 
 [Sources]
+  EdkIIRedfishResourceConfigInternal.h
   EdkIIRedfishResourceConfigLib.c
 
 [Packages]
@@ -42,8 +43,9 @@
   RedfishHttpLib
 
 [Protocols]
-  gEdkIIRedfishResourceConfigProtocolGuid   ## CONSUMES ##
+  gEdkIIRedfishResourceConfigProtocolGuid ## CONSUMES ##
   gEdkIIRedfishFeatureInterchangeDataProtocolGuid ## CONSUMES ##
+  gEdkIIRedfishResourceConfig2ProtocolGuid## CONSUEMS ##
 
 [Pcd]
   gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h 
b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
index 3aa953cec..57c7f2b80 100644
--- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
+++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /**
@@ -23,6 +24,7 @@
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
   @param[in]   InformationExchange Pointer to RESOURCE_INFORMATION_EXCHANGE.
   @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
FALSE if the resource exist but some of 
properties are missing,
@@ -33,9 +35,11 @@
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigProvisioning (
   IN REDFISH_SCHEMA_INFO*Schema,
   IN EFI_STRING Uri,
+  IN CHAR8  *JsonText OPTIONAL,
   IN RESOURCE_INFORMATION_EXCHANGE  *InformationExchange,
   IN BOOLEANHttpPostMode
   );
@@ -45,15 +49,18 @@ EdkIIRedfishResourceConfigProvisioning (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigConsume (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
@@ -61,21 +68,25 @@ EdkIIRedfishResourceConfigConsume (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigUpdate (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
   Check resource on given URI.
 
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval EFI_UNSUPPORTED  This resource is not owned by feature 
driver.
@@ -84,9 +95,11 @@ EdkIIRedfishResourceConfigUpdate (
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigCheck (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
@@ -94,6 +107,7 @@ EdkIIRedfishResourceConfigCheck (
 
   @param[in]   Schema  Redfish schema information.
   

[edk2-devel] [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol.

2024-03-04 Thread Nickle Wang via groups.io
Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
Redfish Resource Config Protocol, this protocol adds new parameter
called "JsonText". This allows Redfish caller driver to pass JSON
context to callee. Callee save the effort of getting same data from
Redfish service again. This is useful when Redfish service supports
"expand" query parameter. "Version" is added to this protocol too so
we don't create new protocol to add new parameter in the future.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfig2Protocol.h | 148 ++
 2 files changed, 150 insertions(+)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h

diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index aa018d714..f894f30ab 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -48,6 +48,8 @@
   gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 
0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
   ## Include/Protocol/EdkIIRedfishOverrideProtocol.h
   gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9, { 
0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
+  ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
+  gEdkIIRedfishResourceConfig2ProtocolGuid  = { 0xe9bef87f, 0xbff4, 0x4872, { 
0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
 
 [Guids]
   ## Include/Guid/RedfishClientPkgTokenSpace.h
diff --git 
a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h 
b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
new file mode 100644
index 0..96384e265
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
@@ -0,0 +1,148 @@
+/** @file
+  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL interface.
+
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_
+#define EDKII_REDFISH_RESOURCE_CONFIG2_H_
+
+#include 
+
+typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
+
+/**
+  Provision redfish resource by given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
+  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
+   FALSE if the resource exist but some of 
properties are missing,
+   HTTP PUT method is used.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_PROVISIONING)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL,
+  IN BOOLEAN  HttpPostMode
+  );
+
+/**
+  Consume resource from given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CONSUME)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
+  );
+
+/**
+  Update resource to given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_UPDATE)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
+  );
+
+/**
+  Check resource on given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to 

[edk2-devel] [edk2-redfish-client][PATCH 0/3] introduce Redfish Resource Config2 protocol.

2024-03-04 Thread Nickle Wang via groups.io
Introduce EDKII Redfish Resource Config2 Protocol so that caller can 
pass Redfish data to callee when caller uses "expand" query parameter
to get multiple Redfish resources all together. Then, callee does not 
get Redfish resource from Redfish service again and save the communication
effort between BIOS and Redfish service.

EdkIIRedfishConfigLib is updated to select Redfish Resource Config2 
Protocol as first priority. If there is no Config2 protocol supported,
library will use config protocol automatically.

Pull request is created: 
https://github.com/tianocore/edk2-redfish-client/pull/80

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 

Nickle Wang (3):
  RedfishClientPkg: introduce Redfish resource config2 protocol.
  RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2
protocol
  RedfishClientPkg/Features: support config2 protocol

 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfig2Protocol.h | 148 +++
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
 .../BootOptionCollectionDxe.c |  14 +-
 .../ComputerSystemCollectionDxe.c |  16 +-
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 10 files changed, 565 insertions(+), 117 deletions(-)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116314): https://edk2.groups.io/g/devel/message/116314
Mute This Topic: https://groups.io/mt/104721505/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH 00/13] use Redfish HTTP protocol

2024-02-29 Thread Nickle Wang via groups.io
Hi Mike,



> May I know why didn't you remove

> RedfishClientPkg/PrivateLibrary/RedfishLib completely?



Yes, Abner and I had discussed this before. RedfishLib brings some difficulty 
to maintain because it is private library in two separated repositories.



Before we go and remove it, we like to make sure that no one is using it. @Igor 
Kulchytskyy<mailto:ig...@ami.com>, if my memory serves me well, you mentioned 
that AMI is using RedfishLib. Is it ok for us to remove RedfishLib in 
RedfishCientPkg (not RedfishPkg)?



Thanks,

Nickle



> -Original Message-

> From: Mike Maslenkin 

> Sent: Friday, March 1, 2024 8:08 AM

> To: devel@edk2.groups.io; Nickle Wang 

> Cc: Abner Chang ; Igor Kulchytskyy 

> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 00/13] use Redfish HTTP

> protocol

>

> External email: Use caution opening links or attachments

>

>

> Good work, Nickle!

>

> On Thu, Feb 29, 2024 at 11:53 AM Nickle Wang via groups.io

> mailto:nicklew=nvidia@groups.io>> wrote:

> >

> > Redfish HTTP protocol is introduced to edk2 RedfishPkg. Update

> > RedfishClientPkg to use RedfishHttpLib. And remove the use of

> > RedfishHttpCacheLib.

> >

> > I also replace several functions from RedfishLib with the function

> > provided in RedfishHttpLib. In this way, there is no dependency on

> > RedfishLib in RedfishClientPkg.

>

> May I know why didn't you remove

> RedfishClientPkg/PrivateLibrary/RedfishLib completely?

> I've been looking at this library for a long time and started improving it 
> with this

> set.

> Eventually I realized that the improved functions are not used in 
> RedfishClientPkg.

> Then I just deleted RedfishClientPkg/PrivateLibrary and

> RedfishClientPkg/PrivateInclude/Library/RedfishLib.h,

> tuned the dec and dsc files, and I successfully built the package.

> Removing this library is a big improvement since it duplicates RedfishLib from

> RedfishPkg.

> and their headers no longer conflict.

>

> Regards,

> Mike.

>

>

> >

> > I noticed that there is false alarm in uncrustify check. When there

> > are deleted files, uncrustiry cannot check them and trigger uncrustify

> > failure.

> >

> > Pull request is created here for testing CI:

> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith

> > ub.com%2Ftianocore%2Fedk2-redfish-

> client%2Fpull%2F79=05%7C02%7Cni

> >

> cklew%40nvidia.com%7C44d7d139b40b4acff94508dc3983b3df%7C43083d1572

> 7340

> >

> c1b7db39efd9ccc17a%7C0%7C0%7C638448485034820142%7CUnknown%7CTW

> FpbGZsb3

> >

> d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D

> %7

> >

> C0%7C%7C%7C=ocqaIR0%2BtKvx8ETphWlWFX2uZIQbQvDKWkn7D36c2z

> 0%3D

> > erved=0

> >

> > Signed-off-by: Nickle Wang mailto:nick...@nvidia.com>>

> > Cc: Abner Chang mailto:abner.ch...@amd.com>>

> > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> >

> > Nickle Wang (13):

> >   RedfishClientPkg/.github: do not run uncrustify to deleted file.

> >   RedfishClientPkg: remove RedfishHttpCacheLib

> >   RedfishClientPkg: ues RedfishHttpLib

> >   RedfishClientPkg/RedfishResourceConfigLib: ues RedfishHttpLib

> >   RedfishClientPkg/RedfishFeatureUtilityLib: ues RedfishHttpLib

> >   RedfishClientPkg/RedfishVersionLib: ues RedfishHttpLib

> >   RedfishClientPkg/BiosDxe: ues RedfishHttpLib

> >   RedfishClientPkg/BootOptionDxe: ues RedfishHttpLib

> >   RedfishClientPkg/BootOptionCollectionDxe: ues RedfishHttpLib

> >   RedfishClientPkg/ComputerSystemDxe: ues RedfishHttpLib

> >   RedfishClientPkg/ComputerSystemCollectionDxe: ues RedfishHttpLib

> >   RedfishClientPkg/MemoryDxe: ues RedfishHttpLib

> >   RedfishClientPkg/MemoryCollectionDxe: ues RedfishHttpLib

> >

> >  RedfishClientPkg/RedfishClientPkg.dec |   1 -

> >  RedfishClientPkg/RedfishClientLibs.dsc.inc|   2 +-

> >  RedfishClientPkg/RedfishClientPkg.dsc |   1 -

> >  .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf  |   3 +-

> >  .../BootOption/v1_0_4/Dxe/BootOptionDxe.inf   |   5 +-

> >  .../BootOptionCollectionDxe.inf   |   5 +-

> >  .../v1_13_0/Dxe/ComputerSystemDxe.inf |   3 +-

> >  .../v1_5_0/Dxe/ComputerSystemDxe.inf  |   3 +-

> >  .../ComputerSystemCollectionDxe.inf   |   3 +-

> >  .../Features/Memory/V1_7_1/Dxe/MemoryDxe.inf  |   3 +-

> >  .../MemoryCollectionDxe.inf   |   3 +-

> >  .../EdkIIRedfishResourceConfigLib.inf |   2 +-

> >  .../RedfishFeatureUtilityLib.inf  |   

Re: [edk2-devel] [edk2-redfish-client][PATCH 00/13] use Redfish HTTP protocol

2024-02-29 Thread Nickle Wang via groups.io
Hi Laszlo,

Thanks for your reminder. I enable sendemail.thread now.

Regards,
Nickle

> -Original Message-
> From: Laszlo Ersek 
> Sent: Thursday, February 29, 2024 5:04 PM
> To: devel@edk2.groups.io; Nickle Wang 
> Cc: Abner Chang ; Igor Kulchytskyy 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 00/13] use Redfish HTTP
> protocol
> 
> External email: Use caution opening links or attachments
> 
> 
> Hi Nickle,
> 
> On 2/29/24 09:52, Nickle Wang via groups.io wrote:
> > Redfish HTTP protocol is introduced to edk2 RedfishPkg. Update
> > RedfishClientPkg to use RedfishHttpLib. And remove the use of
> > RedfishHttpCacheLib.
> >
> > I also replace several functions from RedfishLib with the function
> > provided in RedfishHttpLib. In this way, there is no dependency on
> > RedfishLib in RedfishClientPkg.
> >
> > I noticed that there is false alarm in uncrustify check. When there
> > are deleted files, uncrustiry cannot check them and trigger uncrustify
> > failure.
> >
> > Pull request is created here for testing CI:
> > https://github.com/tianocore/edk2-redfish-client/pull/79
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> >
> > Nickle Wang (13):
> >   RedfishClientPkg/.github: do not run uncrustify to deleted file.
> >   RedfishClientPkg: remove RedfishHttpCacheLib
> >   RedfishClientPkg: ues RedfishHttpLib
> >   RedfishClientPkg/RedfishResourceConfigLib: ues RedfishHttpLib
> >   RedfishClientPkg/RedfishFeatureUtilityLib: ues RedfishHttpLib
> >   RedfishClientPkg/RedfishVersionLib: ues RedfishHttpLib
> >   RedfishClientPkg/BiosDxe: ues RedfishHttpLib
> >   RedfishClientPkg/BootOptionDxe: ues RedfishHttpLib
> >   RedfishClientPkg/BootOptionCollectionDxe: ues RedfishHttpLib
> >   RedfishClientPkg/ComputerSystemDxe: ues RedfishHttpLib
> >   RedfishClientPkg/ComputerSystemCollectionDxe: ues RedfishHttpLib
> >   RedfishClientPkg/MemoryDxe: ues RedfishHttpLib
> >   RedfishClientPkg/MemoryCollectionDxe: ues RedfishHttpLib
> 
> can you please enable (shallow) threading in your git config?
> 
> $ git config sendemail.thread true
> 
> Thanks!
> Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116155): https://edk2.groups.io/g/devel/message/116155
Mute This Topic: https://groups.io/mt/104640214/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 13/13] RedfishClientPkg/MemoryCollectionDxe: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../MemoryCollectionDxe/MemoryCollectionDxe.inf   |  3 +--
 .../MemoryCollectionDxe/MemoryCollectionDxe.c | 15 ++-
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git 
a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf 
b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf
index 67c38f62d..97c59000c 100644
--- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf
+++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf
@@ -35,13 +35,12 @@
   ConverterCommonLib
   MemoryAllocationLib
   RedfishFeatureUtilityLib
-  RedfishLib
+  RedfishHttpLib
   UefiLib
   UefiDriverEntryPoint
   UefiBootServicesTableLib
   EdkIIRedfishResourceConfigLib
   RedfishVersionLib
-  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishConfigHandlerProtocolGuid## CONSUMED
diff --git 
a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c 
b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
index 2127570fb..1b7d74e86 100644
--- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
+++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
@@ -247,18 +247,7 @@ ReleaseCollectionResource (
   //
   // Release resource
   //
-  if (Private->Response.Payload != NULL) {
-RedfishFreeResponse (
-  Private->Response.StatusCode,
-  Private->Response.HeaderCount,
-  Private->Response.Headers,
-  Private->Response.Payload
-  );
-Private->Response.StatusCode  = NULL;
-Private->Response.HeaderCount = 0;
-Private->Response.Headers = NULL;
-Private->Response.Payload = NULL;
-  }
+  RedfishHttpFreeResponse (>Response);
 
   if (Private->CollectionJson != NULL) {
 FreePool (Private->CollectionJson);
@@ -289,7 +278,7 @@ CollectionHandler (
   //
   // Query collection from Redfish service.
   //
-  Status = RedfishHttpGetResource (Private->RedfishService, 
Private->CollectionUri, >Response, TRUE);
+  Status = RedfishHttpGetResource (Private->RedfishService, 
Private->CollectionUri, NULL, >Response, TRUE);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, unable to get resource from: %s :%r\n", 
__func__, Private->CollectionUri, Status));
 goto ON_RELEASE;
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116153): https://edk2.groups.io/g/devel/message/116153
Mute This Topic: https://groups.io/mt/104640238/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 12/13] RedfishClientPkg/MemoryDxe: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../Features/Memory/V1_7_1/Dxe/MemoryDxe.inf  |   3 +-
 .../Memory/V1_7_1/Common/MemoryCommon.c   |  86 ++
 .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c| 111 +-
 3 files changed, 69 insertions(+), 131 deletions(-)

diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.inf 
b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.inf
index 43039b9f4..687c1a39d 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.inf
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.inf
@@ -32,12 +32,11 @@
   BaseMemoryLib
   DebugLib
   EdkIIRedfishResourceConfigLib
-  RedfishLib
+  RedfishHttpLib
   RedfishFeatureUtilityLib
   RedfishResourceIdentifyLib
   UefiLib
   UefiDriverEntryPoint
-  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c 
b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
index 00a69f748..e873f05ca 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
@@ -2,7 +2,7 @@
   Redfish feature driver implementation - common functions
 
   (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -67,7 +67,7 @@ RedfishConsumeResourceCommon (
 // No change
 //
 DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore consume 
action\n", __func__, Private->Uri));
-Status = EFI_ALREADY_STARTED;
+Status = EFI_SUCCESS;
 goto ON_RELEASE;
   }
 
@@ -2154,17 +2154,17 @@ ProvisioningMemoryResource (
   IN  EFI_STRING   ConfigureLang
   )
 {
-  CHAR8   *Json;
-  EFI_STATUS  Status;
-  EFI_STRING  NewResourceLocation;
-  CHAR8   *EtagStr;
-  CHAR8   ResourceId[16];
+  CHAR8 *Json;
+  EFI_STATUSStatus;
+  EFI_STRINGNewResourceLocation;
+  CHAR8 ResourceId[16];
+  REDFISH_RESPONSE  Response;
 
   if (IS_EMPTY_STRING (ConfigureLang) || (Private == NULL)) {
 return EFI_INVALID_PARAMETER;
   }
 
-  EtagStr = NULL;
+  ZeroMem (, sizeof (REDFISH_RESPONSE));
   AsciiSPrint (ResourceId, sizeof (ResourceId), "%d", Index);
 
   Status = ProvisioningMemoryProperties (
@@ -2180,27 +2180,27 @@ ProvisioningMemoryResource (
 return Status;
   }
 
-  Status = CreatePayloadToPostResource (Private->RedfishService, 
Private->Payload, Json, , );
+  Status = RedfishHttpPostResource (Private->RedfishService, Private->Uri, 
Json, );
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, post Memory resource for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a, post Bios resource for %s failed: %r\n", 
__func__, ConfigureLang, Status));
 goto RELEASE_RESOURCE;
   }
 
-  ASSERT (NewResourceLocation != NULL);
-
   //
-  // Keep location of new resource.
+  // Per Redfish spec. the URL of new resource will be returned in "Location" 
header.
   //
-  if (NewResourceLocation != NULL) {
-RedfishSetRedfishUri (ConfigureLang, NewResourceLocation);
+  Status = GetHttpResponseLocation (, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: cannot find new location: %r\n", __func__, 
Status));
+goto RELEASE_RESOURCE;
   }
 
   //
-  // Handle Etag
+  // Keep location of new resource.
   //
-  if (EtagStr != NULL) {
-SetEtagWithUri (EtagStr, NewResourceLocation);
-FreePool (EtagStr);
+  if (NewResourceLocation != NULL) {
+DEBUG ((DEBUG_MANAGEABILITY, "%a: Location: %s\n", __func__, 
NewResourceLocation));
+RedfishSetRedfishUri (ConfigureLang, NewResourceLocation);
   }
 
 RELEASE_RESOURCE:
@@ -2255,18 +2255,18 @@ ProvisioningMemoryExistResource (
   IN  REDFISH_RESOURCE_COMMON_PRIVATE  *Private
   )
 {
-  EFI_STATUS  Status;
-  EFI_STRING  ConfigureLang;
-  CHAR8   *EtagStr;
-  CHAR8   *Json;
+  EFI_STATUSStatus;
+  EFI_STRINGConfigureLang;
+  CHAR8 *Json;
+  REDFISH_RESPONSE  Response;
 
   if (Private == NULL) {
 return EFI_INVALID_PARAMETER;
   }
 
-  EtagStr   = NULL;
   Json  = NULL;
   ConfigureLang = NULL;
+  ZeroMem (, sizeof (REDFISH_RESPONSE));
 
   ConfigureLang = RedfishGetConfigLanguage (Private->Uri);
   if (ConfigureLang == NULL) {
@@ -2293,23 +2293,17 @@ ProvisioningMemoryExistResource (
 
   DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s\n", 
__func__, ConfigureLang));
   //
-  // PUT back to instance
+  // PATCH back to instance
   //
-  Status = CreatePayloadToPatchResource (Private->RedfishService, 
Private->Payload, Json, );
+  

[edk2-devel] [edk2-redfish-client][PATCH 11/13] RedfishClientPkg/ComputerSystemCollectionDxe: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../ComputerSystemCollectionDxe.inf   |  3 +--
 .../ComputerSystemCollectionDxe.c | 15 ++-
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git 
a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.inf
 
b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.inf
index b848f69f9..7c00f8f56 100644
--- 
a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.inf
+++ 
b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.inf
@@ -35,13 +35,12 @@
   ConverterCommonLib
   MemoryAllocationLib
   RedfishFeatureUtilityLib
-  RedfishLib
+  RedfishHttpLib
   UefiLib
   UefiDriverEntryPoint
   UefiBootServicesTableLib
   EdkIIRedfishResourceConfigLib
   RedfishVersionLib
-  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishConfigHandlerProtocolGuid## CONSUMED
diff --git 
a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
 
b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
index 05d746252..975ba0564 100644
--- 
a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
+++ 
b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
@@ -256,18 +256,7 @@ ReleaseCollectionResource (
   //
   // Release resource
   //
-  if (Private->Response.Payload != NULL) {
-RedfishFreeResponse (
-  Private->Response.StatusCode,
-  Private->Response.HeaderCount,
-  Private->Response.Headers,
-  Private->Response.Payload
-  );
-Private->Response.StatusCode  = NULL;
-Private->Response.HeaderCount = 0;
-Private->Response.Headers = NULL;
-Private->Response.Payload = NULL;
-  }
+  RedfishHttpFreeResponse (>Response);
 
   if (Private->CollectionJson != NULL) {
 FreePool (Private->CollectionJson);
@@ -298,7 +287,7 @@ CollectionHandler (
   //
   // Query collection from Redfish service.
   //
-  Status = RedfishHttpGetResource (Private->RedfishService, 
Private->CollectionUri, >Response, TRUE);
+  Status = RedfishHttpGetResource (Private->RedfishService, 
Private->CollectionUri, NULL, >Response, TRUE);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: unable to get resource from: %s :%r\n", 
__func__, Private->CollectionUri, Status));
 goto ON_RELEASE;
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116152): https://edk2.groups.io/g/devel/message/116152
Mute This Topic: https://groups.io/mt/104640235/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 10/13] RedfishClientPkg/ComputerSystemDxe: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../v1_13_0/Dxe/ComputerSystemDxe.inf |  3 +-
 .../v1_5_0/Dxe/ComputerSystemDxe.inf  |  3 +-
 .../v1_13_0/Common/ComputerSystemCommon.c | 68 +--
 .../v1_13_0/Dxe/ComputerSystemDxe.c   | 85 ---
 .../v1_5_0/Common/ComputerSystemCommon.c  | 68 +--
 .../v1_5_0/Dxe/ComputerSystemDxe.c| 84 --
 6 files changed, 116 insertions(+), 195 deletions(-)

diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
index be1c2164d..40403ac7f 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
@@ -32,13 +32,12 @@
   BaseMemoryLib
   DebugLib
   EdkIIRedfishResourceConfigLib
-  RedfishLib
+  RedfishHttpLib
   RedfishFeatureUtilityLib
   RedfishResourceIdentifyLib
   UefiLib
   UefiDriverEntryPoint
   RedfishAddendumLib
-  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
index 4e7dc5c7c..46ac2d4e5 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
@@ -32,13 +32,12 @@
   BaseMemoryLib
   DebugLib
   EdkIIRedfishResourceConfigLib
-  RedfishLib
+  RedfishHttpLib
   RedfishFeatureUtilityLib
   RedfishResourceIdentifyLib
   UefiLib
   UefiDriverEntryPoint
   RedfishAddendumLib
-  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
index d69fc176a..df22a1c90 100644
--- 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
@@ -2,7 +2,7 @@
   Redfish feature driver implementation - common functions
 
   (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
   Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -407,18 +407,18 @@ ProvisioningComputerSystemResource (
   IN  EFI_STRING   ConfigureLang
   )
 {
-  CHAR8   *Json;
-  CHAR8   *JsonWithAddendum;
-  EFI_STATUS  Status;
-  EFI_STRING  NewResourceLocation;
-  CHAR8   *EtagStr;
-  CHAR8   ResourceId[16];
+  CHAR8 *Json;
+  CHAR8 *JsonWithAddendum;
+  EFI_STATUSStatus;
+  EFI_STRINGNewResourceLocation;
+  CHAR8 ResourceId[16];
+  REDFISH_RESPONSE  Response;
 
   if (IS_EMPTY_STRING (ConfigureLang) || (Private == NULL)) {
 return EFI_INVALID_PARAMETER;
   }
 
-  EtagStr = NULL;
+  ZeroMem (, sizeof (REDFISH_RESPONSE));
   AsciiSPrint (ResourceId, sizeof (ResourceId), "%d", Index);
 
   Status = ProvisioningComputerSystemProperties (
@@ -466,27 +466,31 @@ ProvisioningComputerSystemResource (
 JsonWithAddendum = NULL;
   }
 
-  Status = CreatePayloadToPostResource (Private->RedfishService, 
Private->Payload, Json, , );
+  Status = RedfishHttpPostResource (Private->RedfishService, Private->Uri, 
Json, );
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a: post ComputerSystem resource for %s failed: 
%r\n", __func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a, post Bios resource for %s failed: %r\n", 
__func__, ConfigureLang, Status));
 goto RELEASE_RESOURCE;
   }
 
-  ASSERT (NewResourceLocation != NULL);
+  //
+  // Per Redfish spec. the URL of new resource will be returned in "Location" 
header.
+  //
+  Status = GetHttpResponseLocation (, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: cannot find new location: %r\n", __func__, 
Status));
+goto RELEASE_RESOURCE;
+  }
 
   //
   // Keep location of new resource.
   //
   if (NewResourceLocation != NULL) {
+DEBUG ((DEBUG_MANAGEABILITY, "%a: Location: %s\n", __func__, 
NewResourceLocation));
 RedfishSetRedfishUri (ConfigureLang, NewResourceLocation);
   }
 
 RELEASE_RESOURCE:
 
-  if (EtagStr != NULL) {
-FreePool (EtagStr);
-  }
-
   if (NewResourceLocation != NULL) {
 FreePool (NewResourceLocation);
   }
@@ -495,6 +499,8 @@ RELEASE_RESOURCE:
 FreePool (Json);
   }
 
+  RedfishHttpFreeResponse ();
+
   return Status;
 }
 
@@ 

[edk2-devel] [edk2-redfish-client][PATCH 08/13] RedfishClientPkg/BootOptionDxe: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../BootOption/v1_0_4/Dxe/BootOptionDxe.inf   |  5 +-
 .../v1_0_4/Common/BootOptionCommon.c  | 45 ++
 .../BootOption/v1_0_4/Dxe/BootOptionDxe.c | 86 ---
 3 files changed, 26 insertions(+), 110 deletions(-)

diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
index 00c1c5bba..cd3c1c711 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 #
 #  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
-#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -32,13 +32,12 @@
   BaseMemoryLib
   DebugLib
   EdkIIRedfishResourceConfigLib
-  RedfishLib
+  RedfishHttpLib
   RedfishFeatureUtilityLib
   RedfishResourceIdentifyLib
   UefiLib
   UefiDriverEntryPoint
   RedfishAddendumLib
-  RedfishHttpCacheLib
   UefiBootManagerLib
   DevicePathLib
   BaseLib
diff --git 
a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
index f471c01c3..339c8ba04 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
@@ -2,7 +2,7 @@
   Redfish feature driver implementation - common functions
 
   (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
   Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -449,7 +449,7 @@ RedfishProvisioningResourceCommon (
 JsonWithAddendum = NULL;
   }
 
-  Status = CreatePayloadToPostResource (Private->RedfishService, 
Private->Payload, Json, NULL, NULL);
+  Status = RedfishHttpPostResource (Private->RedfishService, Private->Uri, 
Json, );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: post BootOption resource for %s failed: %r\n", 
__func__, BootOptionName, Status));
 goto RELEASE_RESOURCE;
@@ -482,12 +482,7 @@ RELEASE_RESOURCE:
 FreePool (Json);
   }
 
-  RedfishFreeResponse (
-Response.StatusCode,
-Response.HeaderCount,
-Response.Headers,
-Response.Payload
-);
+  RedfishHttpFreeResponse ();
 
   return Status;
 }
@@ -519,7 +514,6 @@ RedfishCheckResourceCommon (
   BOOLEAN   DeleteResourceRequired;
   EFI_STRINGDevicePathString;
   CHAR8 *DevicePathAsciiString;
-  CHAR8 *AsciiUri;
 
   if ((Private == NULL) || IS_EMPTY_STRING (Json)) {
 return EFI_INVALID_PARAMETER;
@@ -531,8 +525,6 @@ RedfishCheckResourceCommon (
   DeleteResourceRequired = FALSE;
   BootOptionName = NULL;
   BootOption = NULL;
-  AsciiUri   = NULL;
-  Response.Payload   = NULL;
   Status = Private->JsonStructProtocol->ToStructure (
   
Private->JsonStructProtocol,
   NULL,
@@ -594,13 +586,7 @@ RedfishCheckResourceCommon (
   //
   if (DeleteResourceRequired) {
 DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: boot option %s is deleted in 
system. Delete %s\n", __func__, BootOptionName, Private->Uri));
-AsciiUri = StrUnicodeToAscii (Private->Uri);
-if (AsciiUri == NULL) {
-  Status = EFI_OUT_OF_RESOURCES;
-  goto ON_RELEASE;
-}
-
-Status = RedfishDeleteByUri (Private->RedfishService, AsciiUri, );
+Status = RedfishHttpDeleteResource (Private->RedfishService, Private->Uri, 
);
 if (EFI_ERROR (Status)) {
   DEBUG ((DEBUG_ERROR, "%a: can not delete %s: %r\n", __func__, 
Private->Uri, Status));
 }
@@ -631,16 +617,8 @@ ON_RELEASE:
   //
   // Release resource
   //
-  RedfishFreeResponse (
-Response.StatusCode,
-Response.HeaderCount,
-Response.Headers,
-Response.Payload
-);
+  RedfishHttpFreeResponse ();
 
-  //
-  // Release resource.
-  //
   Private->JsonStructProtocol->DestoryStructure (
  Private->JsonStructProtocol,
  (EFI_REST_JSON_STRUCTURE_HEADER *)BootOption
@@ -650,10 +628,6 @@ ON_RELEASE:
 FreePool (BootOptionName);
   }
 
-  if (AsciiUri != NULL) {
-FreePool (AsciiUri);
-  }
-
   return Status;
 }
 
@@ -748,7 +722,7 @@ RedfishUpdateResourceCommon (
   //
   // PATCH back to instance
   //

[edk2-devel] [edk2-redfish-client][PATCH 09/13] RedfishClientPkg/BootOptionCollectionDxe: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../BootOptionCollectionDxe.inf   |  5 ++--
 .../BootOptionCollectionDxe.c | 26 ---
 2 files changed, 7 insertions(+), 24 deletions(-)

diff --git 
a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf 
b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf
index 7977fa461..90aae8e9e 100644
--- a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf
+++ b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf
@@ -3,7 +3,7 @@
 #  Redfish BootOptionCollection collection driver.
 #
 #  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
-#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -35,13 +35,12 @@
   ConverterCommonLib
   MemoryAllocationLib
   RedfishFeatureUtilityLib
-  RedfishLib
+  RedfishHttpLib
   UefiLib
   UefiDriverEntryPoint
   UefiBootServicesTableLib
   EdkIIRedfishResourceConfigLib
   RedfishVersionLib
-  RedfishHttpCacheLib
   UefiBootManagerLib
   DevicePathLib
 
diff --git 
a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c 
b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
index 54cabcbe8..4f94a4495 100644
--- a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
+++ b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
@@ -3,7 +3,7 @@
   Redfish feature driver implementation - BootOptionCollection
 
   (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -169,7 +169,7 @@ MarkBootOptionProcessed (
   // Get boot option reference attribute
   //
   ZeroMem (, sizeof (REDFISH_RESPONSE));
-  Status = RedfishHttpGetResource (RedfishService, Uri, , TRUE);
+  Status = RedfishHttpGetResource (RedfishService, Uri, NULL, , TRUE);
   if (EFI_ERROR (Status) || (Response.Payload == NULL)) {
 DEBUG ((DEBUG_ERROR, "%a: failed to get resource from %s: %r", __func__, 
Uri, Status));
 return Status;
@@ -212,12 +212,7 @@ MarkBootOptionProcessed (
 
 ON_RELEASE:
 
-  RedfishFreeResponse (
-Response.StatusCode,
-Response.HeaderCount,
-Response.Headers,
-Response.Payload
-);
+  RedfishHttpFreeResponse ();
 
   return Status;
 }
@@ -436,18 +431,7 @@ ReleaseCollectionResource (
   //
   // Release resource
   //
-  if (Private->Response.Payload != NULL) {
-RedfishFreeResponse (
-  Private->Response.StatusCode,
-  Private->Response.HeaderCount,
-  Private->Response.Headers,
-  Private->Response.Payload
-  );
-Private->Response.StatusCode  = NULL;
-Private->Response.HeaderCount = 0;
-Private->Response.Headers = NULL;
-Private->Response.Payload = NULL;
-  }
+  RedfishHttpFreeResponse (>Response);
 
   if (Private->CollectionJson != NULL) {
 FreePool (Private->CollectionJson);
@@ -478,7 +462,7 @@ CollectionHandler (
   //
   // Query collection from Redfish service.
   //
-  Status = RedfishHttpGetResource (Private->RedfishService, 
Private->CollectionUri, >Response, TRUE);
+  Status = RedfishHttpGetResource (Private->RedfishService, 
Private->CollectionUri, NULL, >Response, TRUE);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: unable to get resource from: %s :%r\n", 
__func__, Private->CollectionUri, Status));
 goto ON_RELEASE;
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116148): https://edk2.groups.io/g/devel/message/116148
Mute This Topic: https://groups.io/mt/104640231/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 07/13] RedfishClientPkg/BiosDxe: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf  |   3 +-
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  92 +++---
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.c| 113 +-
 3 files changed, 74 insertions(+), 134 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
index 6ba4c3cfa..a2ac18e61 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
@@ -32,14 +32,13 @@
   BaseMemoryLib
   DebugLib
   EdkIIRedfishResourceConfigLib
-  RedfishLib
+  RedfishHttpLib
   RedfishFeatureUtilityLib
   RedfishVersionLib
   RedfishResourceIdentifyLib
   UefiLib
   UefiDriverEntryPoint
   RedfishAddendumLib
-  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index f3f993c87..1f3c30147 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -2,7 +2,7 @@
   Redfish feature driver implementation - common functions
 
   (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -68,7 +68,7 @@ RedfishConsumeResourceCommon (
 // No change
 //
 DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore consume 
action\n", __func__, Private->Uri));
-Status = EFI_ALREADY_STARTED;
+Status = EFI_SUCCESS;
 goto ON_RELEASE;
   }
 
@@ -268,18 +268,18 @@ ProvisioningBiosResource (
   IN  EFI_STRING   ConfigureLang
   )
 {
-  CHAR8   *Json;
-  CHAR8   *JsonWithAddendum;
-  EFI_STATUS  Status;
-  EFI_STRING  NewResourceLocation;
-  CHAR8   *EtagStr;
-  CHAR8   ResourceId[16];
+  CHAR8 *Json;
+  CHAR8 *JsonWithAddendum;
+  EFI_STATUSStatus;
+  EFI_STRINGNewResourceLocation;
+  CHAR8 ResourceId[16];
+  REDFISH_RESPONSE  Response;
 
   if (IS_EMPTY_STRING (ConfigureLang) || (Private == NULL)) {
 return EFI_INVALID_PARAMETER;
   }
 
-  EtagStr = NULL;
+  ZeroMem (, sizeof (REDFISH_RESPONSE));
   AsciiSPrint (ResourceId, sizeof (ResourceId), "%d", Index);
 
   Status = ProvisioningBiosProperties (
@@ -327,27 +327,27 @@ ProvisioningBiosResource (
 JsonWithAddendum = NULL;
   }
 
-  Status = CreatePayloadToPostResource (Private->RedfishService, 
Private->Payload, Json, , );
+  Status = RedfishHttpPostResource (Private->RedfishService, Private->Uri, 
Json, );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, post Bios resource for %s failed: %r\n", 
__func__, ConfigureLang, Status));
 goto RELEASE_RESOURCE;
   }
 
-  ASSERT (NewResourceLocation != NULL);
-
   //
-  // Keep location of new resource.
+  // Per Redfish spec. the URL of new resource will be returned in "Location" 
header.
   //
-  if (NewResourceLocation != NULL) {
-RedfishSetRedfishUri (ConfigureLang, NewResourceLocation);
+  Status = GetHttpResponseLocation (, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: cannot find new location: %r\n", __func__, 
Status));
+goto RELEASE_RESOURCE;
   }
 
   //
-  // Handle Etag
+  // Keep location of new resource.
   //
-  if (EtagStr != NULL) {
-SetEtagWithUri (EtagStr, NewResourceLocation);
-FreePool (EtagStr);
+  if (NewResourceLocation != NULL) {
+DEBUG ((DEBUG_MANAGEABILITY, "%a: Location: %s\n", __func__, 
NewResourceLocation));
+RedfishSetRedfishUri (ConfigureLang, NewResourceLocation);
   }
 
 RELEASE_RESOURCE:
@@ -360,6 +360,8 @@ RELEASE_RESOURCE:
 FreePool (Json);
   }
 
+  RedfishHttpFreeResponse ();
+
   return Status;
 }
 
@@ -402,19 +404,19 @@ ProvisioningBiosExistResource (
   IN  REDFISH_RESOURCE_COMMON_PRIVATE  *Private
   )
 {
-  EFI_STATUS  Status;
-  EFI_STRING  ConfigureLang;
-  CHAR8   *EtagStr;
-  CHAR8   *Json;
-  CHAR8   *JsonWithAddendum;
+  EFI_STATUSStatus;
+  EFI_STRINGConfigureLang;
+  CHAR8 *Json;
+  CHAR8 *JsonWithAddendum;
+  REDFISH_RESPONSE  Response;
 
   if (Private == NULL) {
 return EFI_INVALID_PARAMETER;
   }
 
-  EtagStr   = NULL;
   Json  = NULL;
   ConfigureLang = NULL;
+  ZeroMem (, sizeof (REDFISH_RESPONSE));
 
   ConfigureLang = RedfishGetConfigLanguage (Private->Uri);
   if (ConfigureLang == NULL) {
@@ -473,23 +475,17 @@ ProvisioningBiosExistResource (
 
   DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s\n", 
__func__, ConfigureLang));
   

[edk2-devel] [edk2-redfish-client][PATCH 06/13] RedfishClientPkg/RedfishVersionLib: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../RedfishVersionLib/RedfishVersionLib.inf   |  3 +--
 .../RedfishVersionLib/RedfishVersionLib.c | 24 +++
 2 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf 
b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
index 10e335af3..5c3f4de39 100644
--- a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
+++ b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
@@ -36,9 +36,8 @@
   DebugLib
   MemoryAllocationLib
   PcdLib
-  RedfishLib
+  RedfishHttpLib
   JsonLib
-  RedfishHttpCacheLib
 
 [Protocols]
 
diff --git a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c 
b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
index 828693766..a55238d22 100644
--- a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
+++ b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
@@ -14,11 +14,10 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
-#include 
 
 #define REDFISH_VERSION_DEFAULT_STRING  L"v1"
 #define REDFISH_ROOT_URIL"/redfish"
@@ -112,22 +111,12 @@ RedfishGetVersion (
   Status = RedfishHttpGetResource (
  Service,
  REDFISH_ROOT_URI,
+ NULL,
  ,
  TRUE
  );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, RedfishGetByService to %s failed: %r\n", 
__func__, REDFISH_ROOT_URI, Status));
-if (Response.Payload != NULL) {
-  RedfishDumpPayload (Response.Payload);
-  RedfishFreeResponse (
-NULL,
-0,
-NULL,
-Response.Payload
-);
-  Response.Payload = NULL;
-}
-
 goto ON_ERROR;
   }
 
@@ -156,14 +145,7 @@ ON_ERROR:
 VersionString = REDFISH_VERSION_DEFAULT_STRING;
   }
 
-  if (Response.Payload != NULL) {
-RedfishFreeResponse (
-  Response.StatusCode,
-  Response.HeaderCount,
-  Response.Headers,
-  Response.Payload
-  );
-  }
+  RedfishHttpFreeResponse ();
 
   DEBUG ((DEBUG_MANAGEABILITY, "%a: Redfish version - %s\n", __func__, 
VersionString));
   return AllocateCopyPool (StrSize (VersionString), VersionString);
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116146): https://edk2.groups.io/g/devel/message/116146
Mute This Topic: https://groups.io/mt/104640227/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 05/13] RedfishClientPkg/RedfishFeatureUtilityLib: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
- Remove RedfishHttpCacheLib and use EDK2 RedfishHttpLib.
- Remove RedfishLib.
- Remove CreatePayloadToPostResource and CreatePayloadToPatchResource
because we no longer need them.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../RedfishFeatureUtilityLib.inf  |   3 +-
 .../Library/RedfishFeatureUtilityLib.h|  46 +
 .../RedfishFeatureUtilityInternal.h   |   3 +-
 .../RedfishFeatureUtilityLib.c| 182 +-
 4 files changed, 6 insertions(+), 228 deletions(-)

diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
index d8f3da373..1cb2d5595 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
@@ -40,7 +40,7 @@
   ConverterCommonLib
   DebugLib
   MemoryAllocationLib
-  RedfishLib
+  RedfishHttpLib
   RedfishPlatformConfigLib
   UefiLib
   UefiBootServicesTableLib
@@ -48,7 +48,6 @@
   PrintLib
   HttpLib
   RedfishDebugLib
-  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishETagProtocolGuid   ## CONSUMED ##
diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h 
b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
index 1b6d3f4cf..ba9ea0150 100644
--- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
+++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
@@ -12,7 +12,7 @@
 #ifndef REDFISH_FEATURE_UTILITY_LIB_H_
 #define REDFISH_FEATURE_UTILITY_LIB_H_
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -352,50 +352,6 @@ ApplyFeatureSettingsBooleanArrayType (
   IN  RedfishCS_bool_Array  *ArrayHead
   );
 
-/**
-
-  Create HTTP payload and send them to redfish service with POST method.
-
-  @param[in]  Service Redfish service.
-  @param[in]  TargetPayload   Target payload
-  @param[in]  JsonData in JSON format.
-  @param[out] LocationReturned location string from Redfish service.
-  @param[out] EtagReturned ETAG string from Redfish service.
-
-  @retval EFI_SUCCESS Data is sent to redfish service successfully.
-  @retval Others  Errors occur.
-
-**/
-EFI_STATUS
-CreatePayloadToPostResource (
-  IN  REDFISH_SERVICE  *Service,
-  IN  REDFISH_PAYLOAD  *TargetPayload,
-  IN  CHAR8*Json,
-  OUT EFI_STRING   *Location,
-  OUT CHAR8**Etag
-  );
-
-/**
-
-  Create HTTP payload and send them to redfish service with PATCH method.
-
-  @param[in]  Service Redfish service.
-  @param[in]  TargetPayload   Target payload
-  @param[in]  JsonData in JSON format.
-  @param[out] EtagReturned ETAG string from Redfish service.
-
-  @retval EFI_SUCCESS Data is sent to redfish service successfully.
-  @retval Others  Errors occur.
-
-**/
-EFI_STATUS
-CreatePayloadToPatchResource (
-  IN  REDFISH_SERVICE  *Service,
-  IN  REDFISH_PAYLOAD  *TargetPayload,
-  IN  CHAR8*Json,
-  OUT CHAR8**Etag
-  );
-
 /**
 
   Save Redfish URI in database for further use.
diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h
 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h
index b4cfca030..b1c2ee468 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h
@@ -21,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
index 21ce8ddad..cc2b37b79 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
@@ -154,7 +154,7 @@ SetEtagFromUri (
   }
 
   ZeroMem (, sizeof (Response));
-  Status = RedfishHttpGetResource (RedfishService, Uri, , TRUE);
+  Status = RedfishHttpGetResource (RedfishService, Uri, NULL, , TRUE);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri));
 return Status;
@@ -215,14 +215,7 @@ ON_RELEASE:
 FreePool (PendingSettingUri);
   }
 
-  if (Response.Payload != NULL) {
-RedfishFreeResponse (
-  Response.StatusCode,
-  Response.HeaderCount,
-  Response.Headers,
-  Response.Payload
-  );
-  }
+  RedfishHttpFreeResponse ();
 
   return Status;
 }
@@ -1894,175 +1887,6 @@ CheckIsServerEtagSupported (
   return FixedPcdGetBool (PcdRedfishServiceEtagSupported);
 }
 
-/**
-
-  Create HTTP payload and 

[edk2-devel] [edk2-redfish-client][PATCH 04/13] RedfishClientPkg/RedfishResourceConfigLib: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Remove RedfishHttpCacheLib and use EDK2 RedfishHttpLib.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../EdkIIRedfishResourceConfigLib.inf   | 2 +-
 .../Include/Library/EdkIIRedfishResourceConfigLib.h | 4 ++--
 .../EdkIIRedfishResourceConfigLib.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
index a5a81e9a2..2d10445f0 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
@@ -39,7 +39,7 @@
   MemoryAllocationLib
   RedfishFeatureUtilityLib
   RedfishPlatformConfigLib
-  RedfishHttpCacheLib
+  RedfishHttpLib
 
 [Protocols]
   gEdkIIRedfishResourceConfigProtocolGuid   ## CONSUMES ##
diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h 
b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
index 561ecbbaf..3aa953cec 100644
--- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
+++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
@@ -2,7 +2,7 @@
   This file defines the EDKII resource config Library interface.
 
   (C) Copyright 2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -13,7 +13,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c
index ed225a23b..5d0944f8c 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c
@@ -15,8 +15,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 
 EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL   
*mRedfishResourceConfigProtocol = NULL;
 EFI_HANDLE   mCachedHandle;
@@ -58,7 +58,7 @@ GetRedfishSchemaInfo (
   }
 
   ZeroMem (, sizeof (Response));
-  Status = RedfishHttpGetResource (RedfishService, Uri, , TRUE);
+  Status = RedfishHttpGetResource (RedfishService, Uri, NULL, , TRUE);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to get resource from %s: %r", __func__, 
Uri, Status));
 return Status;
@@ -99,7 +99,7 @@ GetRedfishSchemaInfo (
   //
   JsonStructProtocol->DestoryStructure (JsonStructProtocol, Header);
   FreePool (JsonText);
-  RedfishFreeResponse (Response.StatusCode, Response.HeaderCount, 
Response.Headers, Response.Payload);
+  RedfishHttpFreeResponse ();
 
   return EFI_SUCCESS;
 }
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116144): https://edk2.groups.io/g/devel/message/116144
Mute This Topic: https://groups.io/mt/104640225/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 03/13] RedfishClientPkg: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/Include/RedfishCollectionCommon.h | 3 +--
 RedfishClientPkg/Include/RedfishResourceCommon.h   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/RedfishClientPkg/Include/RedfishCollectionCommon.h 
b/RedfishClientPkg/Include/RedfishCollectionCommon.h
index b1e313da2..f7c870172 100644
--- a/RedfishClientPkg/Include/RedfishCollectionCommon.h
+++ b/RedfishClientPkg/Include/RedfishCollectionCommon.h
@@ -21,13 +21,12 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 
 //
 // Protocols
diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h 
b/RedfishClientPkg/Include/RedfishResourceCommon.h
index c1286adc1..43a527a05 100644
--- a/RedfishClientPkg/Include/RedfishResourceCommon.h
+++ b/RedfishClientPkg/Include/RedfishResourceCommon.h
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include 
-#include 
 
 //
 // Protocols
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116143): https://edk2.groups.io/g/devel/message/116143
Mute This Topic: https://groups.io/mt/104640217/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 02/13] RedfishClientPkg: remove RedfishHttpCacheLib

2024-02-29 Thread Nickle Wang via groups.io
Remove RedfishHttpCacheLib and use EDK2 RedfishHttpLib.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/RedfishClientPkg.dec |   1 -
 RedfishClientPkg/RedfishClientLibs.dsc.inc|   2 +-
 RedfishClientPkg/RedfishClientPkg.dsc |   1 -
 .../RedfishHttpCacheLib.inf   |  48 --
 .../Include/Library/RedfishHttpCacheLib.h |  59 --
 .../RedfishHttpCacheLibInternal.h |  63 --
 .../RedfishHttpCacheLib/RedfishHttpCacheLib.c | 774 --
 7 files changed, 1 insertion(+), 947 deletions(-)
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
 delete mode 100644 RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLibInternal.h
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.c

diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index ce3b6d975..aa018d714 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -27,7 +27,6 @@
   EdkIIRedfishResourceConfigLib|Include/Library/EdkIIRedfishResourceConfigLib.h
   RedfishEventLib|Include/Library/RedfishEventLib.h
   RedfishVersionLib|Include/Library/RedfishVersionLib.h
-  RedfishHttpCacheLib|Include/Library/RedfishHttpCacheLib.h
 
 [LibraryClasses.Common.Private]
   ##  @libraryclass Redfish Helper Library
diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc 
b/RedfishClientPkg/RedfishClientLibs.dsc.inc
index 9c7889d2b..8ec27baa3 100644
--- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
+++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
@@ -42,4 +42,4 @@
   
RedfishVersionLib|RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
   
RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
   RedfishDebugLib|RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
-  
RedfishHttpCacheLib|RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
+  RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
diff --git a/RedfishClientPkg/RedfishClientPkg.dsc 
b/RedfishClientPkg/RedfishClientPkg.dsc
index 0e3ef1ac9..f37bf93ac 100644
--- a/RedfishClientPkg/RedfishClientPkg.dsc
+++ b/RedfishClientPkg/RedfishClientPkg.dsc
@@ -61,6 +61,5 @@
   
RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
   RedfishClientPkg/PrivateLibrary/RedfishLib/RedfishLib.inf
   RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
-  RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
 
   !include RedfishClientPkg/RedfishClient.dsc.inc
diff --git 
a/RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf 
b/RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
deleted file mode 100644
index e76c8b65e..0
--- a/RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
+++ /dev/null
@@ -1,48 +0,0 @@
-## @file
-#  Redfish HTTP cache library helps Redfish application to get Redfish resource
-#  from Redfish service with cache mechanism enabled.
-#
-#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
-#
-#  SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
-  INF_VERSION= 0x00010006
-  BASE_NAME  = RedfishHttpCacheLib
-  FILE_GUID  = 21F8FEEC-023C-451D-824D-823058FD9481
-  MODULE_TYPE= DXE_DRIVER
-  VERSION_STRING = 1.0
-  LIBRARY_CLASS  = RedfishHttpCacheLib| DXE_DRIVER UEFI_DRIVER
-  CONSTRUCTOR= RedfishHttpCacheConstructor
-  DESTRUCTOR = RedfishHttpCacheDestructor
-
-#
-#  VALID_ARCHITECTURES   = IA32 X64 EBC
-#
-
-[Sources]
-  RedfishHttpCacheLibInternal.h
-  RedfishHttpCacheLib.c
-
-[Packages]
-  MdePkg/MdePkg.dec
-  MdeModulePkg/MdeModulePkg.dec
-  RedfishPkg/RedfishPkg.dec
-  RedfishClientPkg/RedfishClientPkg.dec
-
-[LibraryClasses]
-  BaseLib
-  DebugLib
-  UefiBootServicesTableLib
-  MemoryAllocationLib
-  RedfishLib
-  UefiLib
-  RedfishDebugLib
-  ReportStatusCodeLib
-  PrintLib
-
-[depex]
-  TRUE
-
diff --git a/RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h 
b/RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h
deleted file mode 100644
index 1277b9814..0
--- a/RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file
-  This file defines the Redfish HTTP cache library interface.
-
-  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef REDFISH_HTTP_CACHE_LIB_H_
-#define REDFISH_HTTP_CACHE_LIB_H_
-
-#include 
-#include 
-
-/**
-  Get redfish resource from given resource URI with cache mechanism
-  supported. It's caller's responsibility to Response 

[edk2-devel] [edk2-redfish-client][PATCH 01/13] RedfishClientPkg/.github: do not run uncrustify to deleted file.

2024-02-29 Thread Nickle Wang via groups.io
Check to see if file exists or not before running uncrustify.
The file in change list may be a deleted file.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .github/workflows/uncrustify-check.sh | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/uncrustify-check.sh 
b/.github/workflows/uncrustify-check.sh
index 7c1765cff..e6cf00b1f 100755
--- a/.github/workflows/uncrustify-check.sh
+++ b/.github/workflows/uncrustify-check.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -40,12 +40,17 @@ fi
 
 for file in $CHANGED_FILES
 do
-  echo "Uncrustify check file: $file"
-  uncrustify -c $CONFIG_FILE -f $file --check
-  if [ $? -ne 0 ]
+  if [ -e "$file" ]
   then
-echo "Uncrustify check failure on file: $file"
-FAILURE=1
+echo "Uncrustify check file: $file"
+uncrustify -c $CONFIG_FILE -f $file --check
+if [ $? -ne 0 ]
+then
+  echo "Uncrustify check failure on file: $file"
+  FAILURE=1
+fi
+  else
+echo "File does not exist (deleted file?): $file"
   fi
 done
 
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116141): https://edk2.groups.io/g/devel/message/116141
Mute This Topic: https://groups.io/mt/104640215/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH 00/13] use Redfish HTTP protocol

2024-02-29 Thread Nickle Wang via groups.io
Redfish HTTP protocol is introduced to edk2 RedfishPkg. Update 
RedfishClientPkg to use RedfishHttpLib. And remove the use of 
RedfishHttpCacheLib. 

I also replace several functions from RedfishLib with the function 
provided in RedfishHttpLib. In this way, there is no dependency on 
RedfishLib in RedfishClientPkg.

I noticed that there is false alarm in uncrustify check. When there
are deleted files, uncrustiry cannot check them and trigger uncrustify
failure.

Pull request is created here for testing CI: 
https://github.com/tianocore/edk2-redfish-client/pull/79

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 

Nickle Wang (13):
  RedfishClientPkg/.github: do not run uncrustify to deleted file.
  RedfishClientPkg: remove RedfishHttpCacheLib
  RedfishClientPkg: ues RedfishHttpLib
  RedfishClientPkg/RedfishResourceConfigLib: ues RedfishHttpLib
  RedfishClientPkg/RedfishFeatureUtilityLib: ues RedfishHttpLib
  RedfishClientPkg/RedfishVersionLib: ues RedfishHttpLib
  RedfishClientPkg/BiosDxe: ues RedfishHttpLib
  RedfishClientPkg/BootOptionDxe: ues RedfishHttpLib
  RedfishClientPkg/BootOptionCollectionDxe: ues RedfishHttpLib
  RedfishClientPkg/ComputerSystemDxe: ues RedfishHttpLib
  RedfishClientPkg/ComputerSystemCollectionDxe: ues RedfishHttpLib
  RedfishClientPkg/MemoryDxe: ues RedfishHttpLib
  RedfishClientPkg/MemoryCollectionDxe: ues RedfishHttpLib

 RedfishClientPkg/RedfishClientPkg.dec |   1 -
 RedfishClientPkg/RedfishClientLibs.dsc.inc|   2 +-
 RedfishClientPkg/RedfishClientPkg.dsc |   1 -
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf  |   3 +-
 .../BootOption/v1_0_4/Dxe/BootOptionDxe.inf   |   5 +-
 .../BootOptionCollectionDxe.inf   |   5 +-
 .../v1_13_0/Dxe/ComputerSystemDxe.inf |   3 +-
 .../v1_5_0/Dxe/ComputerSystemDxe.inf  |   3 +-
 .../ComputerSystemCollectionDxe.inf   |   3 +-
 .../Features/Memory/V1_7_1/Dxe/MemoryDxe.inf  |   3 +-
 .../MemoryCollectionDxe.inf   |   3 +-
 .../EdkIIRedfishResourceConfigLib.inf |   2 +-
 .../RedfishFeatureUtilityLib.inf  |   3 +-
 .../RedfishHttpCacheLib.inf   |  48 --
 .../RedfishVersionLib/RedfishVersionLib.inf   |   3 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |   4 +-
 .../Library/RedfishFeatureUtilityLib.h|  46 +-
 .../Include/Library/RedfishHttpCacheLib.h |  59 --
 .../Include/RedfishCollectionCommon.h |   3 +-
 .../Include/RedfishResourceCommon.h   |   3 +-
 .../RedfishFeatureUtilityInternal.h   |   3 +-
 .../RedfishHttpCacheLibInternal.h |  63 --
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  92 +--
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.c| 113 +--
 .../v1_0_4/Common/BootOptionCommon.c  |  45 +-
 .../BootOption/v1_0_4/Dxe/BootOptionDxe.c |  86 +-
 .../BootOptionCollectionDxe.c |  26 +-
 .../v1_13_0/Common/ComputerSystemCommon.c |  68 +-
 .../v1_13_0/Dxe/ComputerSystemDxe.c   |  85 +-
 .../v1_5_0/Common/ComputerSystemCommon.c  |  68 +-
 .../v1_5_0/Dxe/ComputerSystemDxe.c|  84 +-
 .../ComputerSystemCollectionDxe.c |  15 +-
 .../Memory/V1_7_1/Common/MemoryCommon.c   |  86 +-
 .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c| 111 +--
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  15 +-
 .../EdkIIRedfishResourceConfigLib.c   |   6 +-
 .../RedfishFeatureUtilityLib.c| 182 +---
 .../RedfishHttpCacheLib/RedfishHttpCacheLib.c | 774 --
 .../RedfishVersionLib/RedfishVersionLib.c |  24 +-
 .github/workflows/uncrustify-check.sh |  17 +-
 40 files changed, 328 insertions(+), 1838 deletions(-)
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
 delete mode 100644 RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLibInternal.h
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.c

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116140): https://edk2.groups.io/g/devel/message/116140
Mute This Topic: https://groups.io/mt/104640214/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-28 Thread Nickle Wang via groups.io
> Sure!
> 
> Reviewed-by: Mike Maslenkin 

Thanks, Mike!

> But I didn't see any implementation of gzip coding/encoding for edk2.
> Do you know of any?

I just talked to Aber about this. We are working to see if we can provide gzip 
implementation in edk2 or not. It seems to me that we need 3rd party library to 
edk2 for supporting gzip. Anber, please feel free to correct me if I am wrong.

> I hope you know that patch 5 breaks edk2-redfish-client compilation (Instance 
> of
> library class [RedfishHttpLib] is not found) But I understand these changes 
> are not
> atomic for edk2 and edk2-redfish-client.

Yes, I also have patch for edk2-redfish-client to use Redfish HTTP protocol. I 
had tested Redfish HTTP protocol on edk2-redfish-client. I will send out patch 
for review after Redfish HTTP protocol gets merged in edk2.

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Thursday, February 29, 2024 1:56 AM
> To: Nickle Wang 
> Cc: devel@edk2.groups.io; Igor Kulchytskyy ; Abner Chang
> ; Nick Ramirez 
> Subject: Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP
> protocol
> 
> External email: Use caution opening links or attachments
> 
> 
> On Wed, Feb 28, 2024 at 2:47 PM Nickle Wang  wrote:
> >
> > Hi @Mike Maslenkin,
> >
> >
> >
> > May I have your reviewed-by if version 3 patch set look good to you?
> >
> 
> Sure!
> 
> Reviewed-by: Mike Maslenkin 
> 
> BTW I'm just curious, there is a mention in patch 2 "We currently only support
> gzip Content-Encoding."
> But I didn't see any implementation of gzip coding/encoding for edk2.
> Do you know of any?
> 
> I hope you know that patch 5 breaks edk2-redfish-client compilation (Instance 
> of
> library class [RedfishHttpLib] is not found) But I understand these changes 
> are not
> atomic for edk2 and edk2-redfish-client.
> 
> Regards,
> Mike.
> 
> 
> >
> >
> > Thanks,
> >
> > Nickle
> >
> >
> >
> > > -Original Message-
> >
> > > From: devel@edk2.groups.io  On Behalf Of
> > > Nickle Wang
> >
> > > via groups.io
> >
> > > Sent: Tuesday, February 27, 2024 8:49 AM
> >
> > > To: Mike Maslenkin 
> >
> > > Cc: devel@edk2.groups.io; Igor Kulchytskyy ; Abner
> > > Chang
> >
> > > ; Nick Ramirez 
> >
> > > Subject: Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement
> > > Redfish HTTP
> >
> > > protocol
> >
> > >
> >
> > > External email: Use caution opening links or attachments
> >
> > >
> >
> > >
> >
> > > Thanks for your confirmation, Mike!
> >
> > >
> >
> > > Version 3 patch set is here:
> > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fed
> > >
> k2.groups.io%2Fg%2Fdevel%2Fmessage%2F115985=05%7C02%7Cnicklew
> %4
> > >
> 0nvidia.com%7Ca30038f7379c4f8dad3b08dc3886a03b%7C43083d15727340c1b
> 7d
> > >
> b39efd9ccc17a%7C0%7C0%7C638447398077724632%7CUnknown%7CTWFpbG
> Zsb3d8e
> > >
> yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
> C
> > >
> 0%7C%7C%7C=0tXBIuafvJuG7AM1DpAgSGGLf1QeUbOOmCq2WQCYpeg%
> 3D
> > > rved=0
> >
> > >
> >
> > > Regards,
> >
> > > Nickle
> >
> > >
> >
> > > > -Original Message-
> >
> > > > From: Mike Maslenkin 
> >
> > > > Sent: Tuesday, February 27, 2024 8:13 AM
> >
> > > > To: Nickle Wang 
> >
> > > > Cc: devel@edk2.groups.io; Igor Kulchytskyy ; Abner
> >
> > > > Chang ; Nick Ramirez 
> >
> > > > Subject: Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement
> > > > Redfish
> >
> > > > HTTP protocol
> >
> > > >
> >
> > > > External email: Use caution opening links or attachments
> >
> > > >
> >
> > > >
> >
> > > > Hii Nickle,
> >
> > > >
> >
> > > >
> >
> > > > On Mon, Feb 26, 2024 at 4:44 PM Nickle Wang 
> wrote:
> >
> > > > >
> >
> > > > > Hi Mike,
> >
> > > > >
> >
> > > > > > So finally we have
> >
> > > > > > HttpFreeHeaderFields (Response->Headers,
> > > > > > Response->HeaderCount);
> >
> > > > > > but
> >
> > 

Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-28 Thread Nickle Wang via groups.io
Hi @Mike Maslenkin<mailto:mike.maslen...@gmail.com>,



May I have your reviewed-by if version 3 patch set look good to you?



Thanks,

Nickle



> -Original Message-

> From: devel@edk2.groups.io  On Behalf Of Nickle Wang

> via groups.io

> Sent: Tuesday, February 27, 2024 8:49 AM

> To: Mike Maslenkin 

> Cc: devel@edk2.groups.io; Igor Kulchytskyy ; Abner Chang

> ; Nick Ramirez 

> Subject: Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP

> protocol

>

> External email: Use caution opening links or attachments

>

>

> Thanks for your confirmation, Mike!

>

> Version 3 patch set is here: https://edk2.groups.io/g/devel/message/115985

>

> Regards,

> Nickle

>

> > -Original Message-

> > From: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>

> > Sent: Tuesday, February 27, 2024 8:13 AM

> > To: Nickle Wang mailto:nick...@nvidia.com>>

> > Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Igor Kulchytskyy 
> > mailto:ig...@ami.com>>; Abner

> > Chang mailto:abner.ch...@amd.com>>; Nick Ramirez 
> > mailto:nrami...@nvidia.com>>

> > Subject: Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish

> > HTTP protocol

> >

> > External email: Use caution opening links or attachments

> >

> >

> > Hii Nickle,

> >

> >

> > On Mon, Feb 26, 2024 at 4:44 PM Nickle Wang 
> > mailto:nick...@nvidia.com>> wrote:

> > >

> > > Hi Mike,

> > >

> > > > So finally we have

> > > > HttpFreeHeaderFields (Response->Headers, Response->HeaderCount);

> > > > but

> > > > Response->HeaderCount does not count partially allocated elements. 
> > > > Right?

> > > >

> > > > To fix this, it is required to set *DstHeaderCount =

> > > > SrcHeaderCount unconditionally right after DstHeaders  allocation,

> > > > and HttpFreeHeaderFields() will do the work then.

> > >

> > > I follow your suggestion to update DstHeaderCount right after

> > > DstHeaders is

> > allocated.  So, HttpFreeHeaderFields can release headers correctly. I

> > also create a macro to implemented AsciiStrCpy. Please check below link to 
> > see

> my changes:

> > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgi

> > > th

> > >

> >

> ub.com%2Ftianocore%2Fedk2%2Fcompare%2F0f391b1c2f988d90a3ac723b314a

> > c28b

> > >

> >

> a7b0b8df..f0fa1b8fdcd933beb52fd3127c2476443c00ef8d=05%7C02%7Cnic

> > k

> > >

> >

> lew%40nvidia.com%7Cf3870f71360e44f3b4e208dc3728ff87%7C43083d1572734

> > 0c1

> > >

> >

> b7db39efd9ccc17a%7C0%7C0%7C638445896465360452%7CUnknown%7CTWFp

> > bGZsb3d8

> > >

> >

> eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%

> > 7C0

> > >

> >

> %7C%7C%7C=K%2FEA2QWpk%2F8NHQ1QhzqkvQqao4db%2BILn1Jt%2BB

> > qQ5n1E%3D

> > > =0

> >

> > These changes looks good. Internal strings

> > initialization/deinitialization code much cleaner now and possible leak 
> > seems to

> have been fixed.

> >

> > Thank you!

> >

> > Regards,

> > Mike.

>

>

> 

>




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116114): https://edk2.groups.io/g/devel/message/116114
Mute This Topic: https://groups.io/mt/104505404/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: check JSON value type

2024-02-27 Thread Nickle Wang via groups.io
Check and see if JSON object type is desired type before
getting its value. According to the Redfish schema, attribute
value can be null value. Add this error handling to avoid
system assertion while getting attribute value.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c 
b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
index 250ef75e4..7ee3c86e1 100644
--- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
+++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
@@ -1,5 +1,7 @@
 /** @file
 
+  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
   Copyright Notice:
   Copyright 2019-2024 Distributed Management Task Force, Inc. All rights 
reserved.
   License: BSD 3-Clause License. For full text see link: 
https://github.com/DMTF/Redfish-JSON-C-Struct-Converter/blob/master/LICENSE.md
@@ -829,6 +831,10 @@ GetRedfishPropertyStr (
 return RedfishCS_status_not_found;
   }
 
+  if (!json_is_string (TempJsonObj)) {
+return RedfishCS_status_not_found;
+  }
+
   Status = allocateDuplicateStr (Cs, (char *)json_string_value (TempJsonObj), 
(void **)DstBuffer);
   return Status;
 }
@@ -914,6 +920,10 @@ GetRedfishPropertyInt64 (
 return Status;
   }
 
+  if (!json_is_integer (TempJsonObj)) {
+return RedfishCS_status_not_found;
+  }
+
   **Dst = (RedfishCS_int64)json_integer_value (TempJsonObj);
   return RedfishCS_status_success;
 }
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116040): https://edk2.groups.io/g/devel/message/116040
Mute This Topic: https://groups.io/mt/104601599/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-26 Thread Nickle Wang via groups.io
Thanks for your confirmation, Mike!

Version 3 patch set is here: https://edk2.groups.io/g/devel/message/115985

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Tuesday, February 27, 2024 8:13 AM
> To: Nickle Wang 
> Cc: devel@edk2.groups.io; Igor Kulchytskyy ; Abner Chang
> ; Nick Ramirez 
> Subject: Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP
> protocol
> 
> External email: Use caution opening links or attachments
> 
> 
> Hii Nickle,
> 
> 
> On Mon, Feb 26, 2024 at 4:44 PM Nickle Wang  wrote:
> >
> > Hi Mike,
> >
> > > So finally we have
> > > HttpFreeHeaderFields (Response->Headers, Response->HeaderCount); but
> > > Response->HeaderCount does not count partially allocated elements. Right?
> > >
> > > To fix this, it is required to set
> > > *DstHeaderCount = SrcHeaderCount unconditionally right after
> > > DstHeaders  allocation, and HttpFreeHeaderFields() will do the work
> > > then.
> >
> > I follow your suggestion to update DstHeaderCount right after DstHeaders is
> allocated.  So, HttpFreeHeaderFields can release headers correctly. I also 
> create a
> macro to implemented AsciiStrCpy. Please check below link to see my changes:
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> >
> ub.com%2Ftianocore%2Fedk2%2Fcompare%2F0f391b1c2f988d90a3ac723b314a
> c28b
> >
> a7b0b8df..f0fa1b8fdcd933beb52fd3127c2476443c00ef8d=05%7C02%7Cnic
> k
> >
> lew%40nvidia.com%7Cf3870f71360e44f3b4e208dc3728ff87%7C43083d1572734
> 0c1
> >
> b7db39efd9ccc17a%7C0%7C0%7C638445896465360452%7CUnknown%7CTWFp
> bGZsb3d8
> >
> eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
> 7C0
> >
> %7C%7C%7C=K%2FEA2QWpk%2F8NHQ1QhzqkvQqao4db%2BILn1Jt%2BB
> qQ5n1E%3D
> > =0
> 
> These changes looks good. Internal strings initialization/deinitialization 
> code much
> cleaner now and possible leak seems to have been fixed.
> 
> Thank you!
> 
> Regards,
> Mike.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115991): https://edk2.groups.io/g/devel/message/115991
Mute This Topic: https://groups.io/mt/104505404/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver

2024-02-26 Thread Nickle Wang via groups.io
Thanks for your explanation, Abner.


Reviewed-by: Nickle Wang mailto:nick...@nvidia.com>>

Regards,
Nickle

From: Chang, Abner 
Sent: Tuesday, February 27, 2024 8:40 AM
To: Nickle Wang ; devel@edk2.groups.io
Cc: Igor Kulchytskyy 
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C 
Structure DXE driver

External email: Use caution opening links or attachments


[AMD Official Use Only - General]

Hi Nickle,
As from spec viewpoint, REST JSON C Structure was not designed for Redfish 
only. Which was designed for any RESTful application that uses JSON as the 
representation of data model.
I was proposed having this driver under MdeModulePkg long time ago when this 
driver was introduced, but as I can remember they considered this driver is 
only used by Redfish back to the moment. That's true, however this driver 
doesn't require any reference of Redfish actually.

Thanks
Abner


From: Nickle Wang mailto:nick...@nvidia.com>>
Sent: Monday, February 26, 2024 9:50 PM
To: Chang, Abner mailto:abner.ch...@amd.com>>; 
devel@edk2.groups.io
Cc: Igor Kulchytskyy mailto:ig...@ami.com>>
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C 
Structure DXE driver

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


Hi @abner.ch...@amd.com,



RestJsonStructureDxe is a driver in RedfishPkg. May I know why we can not have 
dependency to RedfishPkg? Do we need to move it to MdeModulePkg for this goal 
(removing dependency to RedfishPkg)?



Regards,

Nickle



> -Original Message-

> From: abner.ch...@amd.com 
> mailto:abner.ch...@amd.com>>

> Sent: Monday, February 26, 2024 10:44 AM

> To: devel@edk2.groups.io

> Cc: Nickle Wang mailto:nick...@nvidia.com>>; Igor 
> Kulchytskyy mailto:ig...@ami.com>>

> Subject: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure

> DXE driver

>

> External email: Use caution opening links or attachments

>

>

> From: Abner Chang mailto:abner.ch...@amd.com>>

>

> BZ #: 4711

> - Add mode debug messages.

> - This driver shouldn't have a dependency on Redfish package and

>   the references of "Redfish" terminology.

>   Remove the references of "Redfish" from this driver.

> - Fix the missing parameter of DEBUG macros used in this

>   driver.

>

> Signed-off-by: Abner Chang mailto:abner.ch...@amd.com>>

> Cc: Nickle Wang mailto:nick...@nvidia.com>>

> Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> ---

>  .../RestJsonStructureDxe.inf  |  3 +-

>  .../RestJsonStructureInternal.h   |  3 +-

>  .../RestJsonStructureDxe.c| 96 ++-

>  3 files changed, 96 insertions(+), 6 deletions(-)

>

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> index 61e6253d318..e74c9dfd38b 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> @@ -2,6 +2,7 @@

>  # Implementation of EFI REST JSON Structure Protocol.

>  #

>  #  (C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> +reserved.

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

>

> @@ -17,7 +18,6 @@

>  [Packages]

>MdePkg/MdePkg.dec

>MdeModulePkg/MdeModulePkg.dec

> -  RedfishPkg/RedfishPkg.dec

>

>  [Sources]

>RestJsonStructureDxe.c

> @@ -26,6 +26,7 @@

>  [LibraryClasses]

>BaseLib

>BaseMemoryLib

> +  DebugLib

>MemoryAllocationLib

>UefiBootServicesTableLib

>UefiDriverEntryPoint

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> index 8d7175125c1..04be5cc80b5 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> @@ -3,6 +3,7 @@

>Protocol.

>

>(C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> + reserved.

>

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

>

> @@ -25,7 +26,7 @@

>  typedef struct _REST_JSON_STRUCTURE_INSTANCE {

>LIST_ENTRY   
> NextRestJsonStructureInstance; ///< Next

> convertor instance

>UINTNNumberOfNameSpaceToConvert;   
>  ///< Number

> of resource type this convertor supports.

> -  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The resource type linklist

> +  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The supported resource type array.

>EFI_REST_JSON_STRUCTURE_TO_STRUCTURE

[edk2-devel] [PATCH v3 6/6] RedfishPkg/RedfishCrtLib: fix unresolved external symbol issue

2024-02-26 Thread Nickle Wang via groups.io
-Fix below compiler error reported in edk2 CI.
ERROR - Linker #2001 from JsonLib.lib(load.obj) : unresolved external
symbol __ftol2
-The file MathFtol.c is copied from IntrinsicLib in CryptoPkg.
-Add MathFtol.c to EccCheck IgnoreFiles.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 .../RedfishCrtLib/RedfishCrtLib.inf   |  7 +++-
 .../RedfishCrtLib/Ia32/MathFtol.c | 37 +++
 RedfishPkg/RedfishPkg.ci.yaml |  2 +
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c

diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf 
b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
index 6ff5dba75c..3a5e309d1a 100644
--- a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
+++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
@@ -3,6 +3,7 @@
 #
 # Copyright (c) 2019, Intel Corporation. All rights reserved.
 # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -23,6 +24,9 @@
 [Sources]
   RedfishCrtLib.c
 
+[Sources.IA32]
+  Ia32/MathFtol.c   | MSFT
+
 [LibraryClasses]
   BaseLib
   SortLib
@@ -35,4 +39,5 @@
   MdeModulePkg/MdeModulePkg.dec
   RedfishPkg/RedfishPkg.dec
 
-
+[BuildOptions]
+  MSFT:*_*_IA32_CC_FLAGS = /GL-
diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c 
b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
new file mode 100644
index 00..e49f00eaf5
--- /dev/null
+++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
@@ -0,0 +1,37 @@
+/** @file This file is copied from 
CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
+  64-bit Math Worker Function.
+  The 32-bit versions of C compiler generate calls to library routines
+  to handle 64-bit math. These functions use non-standard calling conventions.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+/*
+ * Floating point to integer conversion.
+ */
+__declspec(naked) void
+_ftol2 (
+  void
+  )
+{
+  _asm {
+fistp qword ptr [esp-8]
+mov   edx, [esp-4]
+mov   eax, [esp-8]
+ret
+  }
+}
+
+__declspec(naked) void
+_ftol2_sse (
+  void
+  )
+{
+  _asm {
+fistp dword ptr [esp-4]
+mov   eax,[esp-4]
+ret
+  }
+}
diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml
index 69b6bf39f5..b95e8bfdc7 100644
--- a/RedfishPkg/RedfishPkg.ci.yaml
+++ b/RedfishPkg/RedfishPkg.ci.yaml
@@ -2,6 +2,7 @@
 # CI configuration for NetworkPkg
 #
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
@@ -38,6 +39,7 @@
 "PrivateInclude/Crt/string.h",
 "PrivateInclude/Crt/time.h",
 "PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c",
+"PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c",
 "Include/Library/RedfishCrtLib.h",
 ##
 ## For jansson library open source
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115989): https://edk2.groups.io/g/devel/message/115989
Mute This Topic: https://groups.io/mt/104594906/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v3 5/6] RedfishPkg/RedfishDebugLib: use RedfishHttpLib

2024-02-26 Thread Nickle Wang via groups.io
Remove RedfishLib and use RedfishHttpLib for debug printing
Redfish response data.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf | 4 ++--
 RedfishPkg/Include/Library/RedfishDebugLib.h   | 2 +-
 RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c   | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
index 048d27c6dc..d468bb213b 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  INF file for Redfish debug library.
 #
-#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -32,7 +32,7 @@
   DebugLib
   JsonLib
   MemoryAllocationLib
-  RedfishLib
+  RedfishHttpLib
   UefiLib
 
 [Depex]
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index 3430cf1d14..ad7a697586 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -11,9 +11,9 @@
 #define REDFISH_DEBUG_LIB_H_
 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include 
 
diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
index 3728f51213..8b0425b8c3 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #ifndef IS_EMPTY_STRING
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115988): https://edk2.groups.io/g/devel/message/115988
Mute This Topic: https://groups.io/mt/104594903/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v3 4/6] RedfishPkg/RedfishLib: include RedfishServiceData.h

2024-02-26 Thread Nickle Wang via groups.io
Redfish common structures are moved to RedfishServiceData.h. Remove
them from RedfishLib.h

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/Include/Library/RedfishLib.h | 17 +
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishLib.h 
b/RedfishPkg/Include/Library/RedfishLib.h
index 8309a67c76..fb30ff68f6 100644
--- a/RedfishPkg/Include/Library/RedfishLib.h
+++ b/RedfishPkg/Include/Library/RedfishLib.h
@@ -70,6 +70,7 @@
 #ifndef REDFISH_LIB_H_
 #define REDFISH_LIB_H_
 
+#include 
 #include 
 
 #include 
@@ -78,22 +79,6 @@
 #define ODATA_TYPE_NAME_MAX_SIZE  128
 #define ODATA_TYPE_MAX_SIZE   128
 
-///
-/// Library class public defines
-///
-typedef  VOID  *REDFISH_SERVICE;
-typedef  VOID  *REDFISH_PAYLOAD;
-
-///
-/// Library class public structures/unions
-///
-typedef struct {
-  EFI_HTTP_STATUS_CODE*StatusCode;
-  UINTN   HeaderCount;
-  EFI_HTTP_HEADER *Headers;
-  REDFISH_PAYLOAD Payload;
-} REDFISH_RESPONSE;
-
 ///
 /// Odata type-name mapping structure.
 ///
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115987): https://edk2.groups.io/g/devel/message/115987
Mute This Topic: https://groups.io/mt/104594902/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v3 3/6] RedfishPkg: introduce RedfishHttpLib

2024-02-26 Thread Nickle Wang via groups.io
RedfishHttpLib is a wrapper library for Redfish feature drivers to
call Redfish HTTP Protocol easily.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |   5 +
 RedfishPkg/RedfishLibs.dsc.inc|   3 +-
 RedfishPkg/RedfishPkg.dsc |   3 +-
 .../Library/RedfishHttpLib/RedfishHttpLib.inf |  43 ++
 RedfishPkg/Include/Library/RedfishHttpLib.h   | 326 ++
 .../Library/RedfishHttpLib/RedfishHttpLib.c   | 585 ++
 6 files changed, 963 insertions(+), 2 deletions(-)
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 create mode 100644 RedfishPkg/Include/Library/RedfishHttpLib.h
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 114f8d2ad8..1a9c9ed7bc 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -69,6 +69,11 @@
   #
   RedfishPlatformConfigLib|Include/Library/RedfishPlatformConfigLib.h
 
+  ##  @libraryclass  Provides the library functions to access Redfish HTTP
+  #   protocol.
+  #
+  RedfishHttpLib|Include/Library/RedfishHttpLib.h
+
 [LibraryClasses.Common.Private]
   ##  @libraryclass  Provides the private C runtime library functions.
   #   CRT library is currently used by edk2 JsonLib (open source
diff --git a/RedfishPkg/RedfishLibs.dsc.inc b/RedfishPkg/RedfishLibs.dsc.inc
index 5426957da8..55846aaa9d 100644
--- a/RedfishPkg/RedfishLibs.dsc.inc
+++ b/RedfishPkg/RedfishLibs.dsc.inc
@@ -6,7 +6,7 @@
 # of EDKII network library classes.
 #
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -21,5 +21,6 @@
   
RedfishPlatformCredentialLib|RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.inf
   HiiUtilityLib|RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf
   
RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.inf
+  RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 !endif
 
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 5849e7cf9e..b0150043a9 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -4,7 +4,7 @@
 # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
 # (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
 # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -74,5 +74,6 @@
   RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
   RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf
   RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.inf
+  RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 
   !include RedfishPkg/Redfish.dsc.inc
diff --git a/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf 
b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
new file mode 100644
index 00..fd53b8c2ed
--- /dev/null
+++ b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
@@ -0,0 +1,43 @@
+## @file
+#  Redfish HTTP library is wrapper library for application to call Redfish
+#  HTTP protocol easily.
+#
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010006
+  BASE_NAME  = RedfishHttpLib
+  FILE_GUID  = 62855D9B-441B-436B-9CA6-B7FEB7ABF54E
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = RedfishHttpLib| DXE_DRIVER UEFI_DRIVER
+  CONSTRUCTOR= RedfishHttpConstructor
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 EBC
+#
+
+[Sources]
+  RedfishHttpLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+  UefiLib
+  UefiBootServicesTableLib
+
+[Protocols]
+  gEdkIIRedfishHttpProtocolGuid   ## CONSUMES ##
+
+[depex]
+  TRUE
+
diff --git a/RedfishPkg/Include/Library/RedfishHttpLib.h 
b/RedfishPkg/Include/Library/RedfishHttpLib.h
new file mode 100644
index 00..39b2098139
--- /dev/null
+++ b/RedfishPkg/Include/Library/RedfishHttpLib.h
@@ -0,0 +1,326 @@
+/** @file
+  This file defines the Redfish HTTP library interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent

[edk2-devel] [PATCH v3 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-26 Thread Nickle Wang via groups.io
implement Redfish HTTP protocol driver.

Signed-off-by: Nickle Wang 
Co-authored-by: Igor Kulchytskyy 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |7 +-
 RedfishPkg/RedfishComponents.dsc.inc  |3 +-
 RedfishPkg/RedfishPkg.dsc |2 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf  |   73 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h   |  256 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h|   44 +
 .../RedfishHttpDxe/RedfishHttpOperation.h |   77 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c   |  667 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c| 1344 +
 .../RedfishHttpDxe/RedfishHttpOperation.c |  692 +
 RedfishPkg/Redfish.fdf.inc|3 +-
 11 files changed, 3164 insertions(+), 4 deletions(-)
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 9b424efdf3..114f8d2ad8 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -157,8 +157,11 @@
   # set to EFI_REST_EX_PROTOCOL.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x1009
-  ## This is used to enable HTTP content encoding on Redfish communication.
-  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|TRUE|BOOLEAN|0x100A
+  #
+  # This PCD string is introduced for platform developer to set the encoding 
method supported by BMC Redfish.
+  # Currently only "None" and "gzip" are supported.
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|"None"|VOID*|0x100A
   #
   # Use below PCDs to control Redfhs HTTP protocol.
   #
diff --git a/RedfishPkg/RedfishComponents.dsc.inc 
b/RedfishPkg/RedfishComponents.dsc.inc
index 464ffc8606..d6c5b73d7f 100644
--- a/RedfishPkg/RedfishComponents.dsc.inc
+++ b/RedfishPkg/RedfishComponents.dsc.inc
@@ -7,7 +7,7 @@
 # "RedfishDefines.dsc.inc".
 #
 # (C) Copyright 2020-2021 Hewlett Packard Enterprise Development LP
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -28,4 +28,5 @@
   RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf
   RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
   MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
+  RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
 !endif
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 25ed193182..5849e7cf9e 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -45,6 +45,8 @@
   
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
   
RedfishPlatformCredentialLib|RedfishPkg/Library/PlatformCredentialLibNull/PlatformCredentialLibNull.inf
   
RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+  SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
 
   # NULL instance of IPMI related library.
   IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
diff --git a/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf 
b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
new file mode 100644
index 00..c7dfdffacf
--- /dev/null
+++ b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
@@ -0,0 +1,73 @@
+## @file
+#  RedfishHttpDxe is the DXE driver which provides
+#  EdkIIRedfishHttpProtocol to EDK2 Redfish Feature
+#  drivers for HTTP operation.
+#
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001000b
+  BASE_NAME  = RedfishHttpDxe
+  FILE_GUID  = 85ADB2F1-DA93-47D4-AF4F-3D920D9BD2C0
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= RedfishHttpEntryPoint
+  UNLOAD_IMAGE   = RedfishHttpDriverUnload
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64 RISCV64
+#
+
+[Sources]
+  RedfishHttpData.c
+  RedfishHttpData.h
+  RedfishHttpDxe.c
+  RedfishHttpDxe.h
+  RedfishHttpOperation.c
+  RedfishHttpOperation.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  

[edk2-devel] [PATCH v3 1/6] RedfishPkg: introduce Redfish HTTP protocol

2024-02-26 Thread Nickle Wang via groups.io
Introduce Redfish HTTP protocol to improve Redfish performance
and communication stability between BIOS and Redfish service.
- Feature drivers often query same Redfish resource multiple
times for different purpose. Implement HTTP cache mechanism to
improve HTTP GET performance. "UseCache" parameter is provided
if application likes to send HTTP GET request to Redfish service
without using cache data.
- This driver will retire stale cache data automatically when
application modify Redfish resource at service side.
- PCD PcdHttpCacheDisabled is used to disable cache mechanism in
this driver for debugging purpose.
- PCD PcdRedfishServiceContentEncoding is used to enable content
encoding while sending data to Redfish service.
- Redfish HTTP protocol also implement retry mechanism to retry
HTTP request when BIOS receive unexpected response from Redfish service.
This function helps BIOS Redfish to finish its job as much as possible.
- PCDs are defined to control how many times BIOS will retry the
request and how many time BIOS will wait between retries.

Signed-off-by: Nickle Wang 
Co-authored-by: Igor Kulchytskyy 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |  24 +-
 .../Protocol/EdkIIRedfishHttpProtocol.h   | 308 ++
 RedfishPkg/Include/RedfishServiceData.h   |  43 +++
 3 files changed, 374 insertions(+), 1 deletion(-)
 create mode 100644 RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
 create mode 100644 RedfishPkg/Include/RedfishServiceData.h

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 3ea9ff3ef7..9b424efdf3 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -4,7 +4,7 @@
 # Copyright (c) 2019, Intel Corporation. All rights reserved.
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2023, American Megatrends International LLC.
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -93,6 +93,9 @@
   # Redfish Host Interface ready notification protocol
   gEdkIIRedfishHostInterfaceReadyProtocolGuid = { 0xC3F6D062, 0x3D38, 0x4EA4, 
{ 0x92, 0xB1, 0xE8, 0xF8, 0x02, 0x27, 0x63, 0xDF } }
 
+  ## Include/Protocol/EdkIIRedfishHttpProtocol.h
+  gEdkIIRedfishHttpProtocolGuid = { 0x58a0f47e, 0xf45f, 0x4d44, { 0x89, 0x5b, 
0x2a, 0xfe, 0xb0, 0x80, 0x15, 0xe2 } }
+
 [Guids]
   gEfiRedfishPkgTokenSpaceGuid  = { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x88, 
0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }}
 
@@ -154,3 +157,22 @@
   # set to EFI_REST_EX_PROTOCOL.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x1009
+  ## This is used to enable HTTP content encoding on Redfish communication.
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|TRUE|BOOLEAN|0x100A
+  #
+  # Use below PCDs to control Redfhs HTTP protocol.
+  #
+  ## The number of retry when HTTP GET request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpGetRetry|0|UINT16|0x100B
+  ## The number of retry when HTTP PUT request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPutRetry|0|UINT16|0x100C
+  ## The number of retry when HTTP PATCH request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPatchRetry|0|UINT16|0x100D
+  ## The number of retry when HTTP POST request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPostRetry|0|UINT16|0x100E
+  ## The number of retry when HTTP DELETE request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpDeleteRetry|0|UINT16|0x100F
+  ## The number of second to wait before driver retry HTTP request. If the 
value is 0, there is no wait before next retry.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x1010
+  ## This is used to disable Redfish HTTP cache function and every request 
will be sent to Redfish service.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x1011
diff --git a/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h 
b/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
new file mode 100644
index 00..59f1f865fc
--- /dev/null
+++ b/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
@@ -0,0 +1,308 @@
+/** @file
+  This file defines the EDKII_REDFISH_HTTP_PROTOCOL interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_HTTP_PROTOCOL_H_
+#define EDKII_REDFISH_HTTP_PROTOCOL_H_
+
+#include 
+#include 
+#include 
+
+typedef struct _EDKII_REDFISH_HTTP_PROTOCOL 

[edk2-devel] [PATCH v3 0/6] Introduce Redfish http protocol

2024-02-26 Thread Nickle Wang via groups.io
v3: address review comments.
1) handle the condition while memory allocation failure happens to
HTTP headers. Make sure that HTTP headers can be released properly while 
calling HttpFreeHeaderFields().
2) Create macro ASCII_STR_DUPLICATE() to copy ASCII string.
3) Fix typos.

v2: address review comments.
1) add comment to show the source file of MathFtol.c
2) update macro to follow file name in RedfishHttpOperation.h

This patch series introduce Redfish HTTP protocol to RedfishPkg. 
This is to improve Redfish performance and communication stability 
between BIOS and Redfish service. Two big functions are introduced:
1) HTTP cache mechanism is implemented to reduce the number of 
communiocation between BIOS and BMC. 
2) HTTP request retry mechanism is implemented to handle communication 
failure. With retry mechanism, Redfish feature driver can finish its job 
as best as possible.

Several libraries are updated to fix build issues. Pull request is created:
https://github.com/tianocore/edk2/pull/5348

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 

Nickle Wang (6):
  RedfishPkg: introduce Redfish HTTP protocol
  RedfishPkg: implement Redfish HTTP protocol
  RedfishPkg: introduce RedfishHttpLib
  RedfishPkg/RedfishLib: include RedfishServiceData.h
  RedfishPkg/RedfishDebugLib: use RedfishHttpLib
  RedfishPkg/RedfishCrtLib: fix unresolved external symbol issue

 RedfishPkg/RedfishPkg.dec |   32 +-
 RedfishPkg/RedfishComponents.dsc.inc  |3 +-
 RedfishPkg/RedfishLibs.dsc.inc|3 +-
 RedfishPkg/RedfishPkg.dsc |5 +-
 .../RedfishDebugLib/RedfishDebugLib.inf   |4 +-
 .../Library/RedfishHttpLib/RedfishHttpLib.inf |   43 +
 .../RedfishCrtLib/RedfishCrtLib.inf   |7 +-
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf  |   73 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |2 +-
 RedfishPkg/Include/Library/RedfishHttpLib.h   |  326 
 RedfishPkg/Include/Library/RedfishLib.h   |   17 +-
 .../Protocol/EdkIIRedfishHttpProtocol.h   |  308 
 RedfishPkg/Include/RedfishServiceData.h   |   43 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h   |  256 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h|   44 +
 .../RedfishHttpDxe/RedfishHttpOperation.h |   77 +
 .../Library/RedfishDebugLib/RedfishDebugLib.c |1 +
 .../Library/RedfishHttpLib/RedfishHttpLib.c   |  585 +++
 .../RedfishCrtLib/Ia32/MathFtol.c |   37 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c   |  667 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c| 1344 +
 .../RedfishHttpDxe/RedfishHttpOperation.c |  692 +
 RedfishPkg/Redfish.fdf.inc|3 +-
 RedfishPkg/RedfishPkg.ci.yaml |2 +
 24 files changed, 4549 insertions(+), 25 deletions(-)
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
 create mode 100644 RedfishPkg/Include/Library/RedfishHttpLib.h
 create mode 100644 RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
 create mode 100644 RedfishPkg/Include/RedfishServiceData.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.h
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c
 create mode 100644 RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.c

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115983): https://edk2.groups.io/g/devel/message/115983
Mute This Topic: https://groups.io/mt/104594891/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method used for provisioning

2024-02-26 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Monday, February 26, 2024 12:55 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy ;
> Mike Maslenkin 
> Subject: [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method
> used for provisioning
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Clarify the HTTP method that is used to provision BIOS managed Redfish
> resource.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Cc: Mike Maslenkin 
> ---
>  RedfishClientPkg/Readme.md| 35 ---
>  .../Media/redfish-call-flow-provisioning.svg  |  2 +-  .../Media/redfish-
> synchronization-design.svg  |  4 +--
>  3 files changed, 26 insertions(+), 15 deletions(-)
> 
> diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md index
> 82cb9c8c99..1789dff6f8 100644
> --- a/RedfishClientPkg/Readme.md
> +++ b/RedfishClientPkg/Readme.md
> @@ -310,21 +310,32 @@ job.
> 
>  Several interfaces defined in EDKII Redfish Resource Config Protocol work
> together to support Redfish synchronization:
>  - Identify()
> -  - This function is used to check if the given Redfish resource is the one 
> the
> feature driver wants to manage. A platform
> -library `RedfishResourceIdentifyLib` is introduced for platform to 
> implement its
> own policy to identify Redfish resource.
> +  - This function is used to check if the given Redfish resource is the one 
> the
> feature driver
> +wants to manage. A platform library `RedfishResourceIdentifyLib` is
> introduced for
> +platform to implement its own policy to identify Redfish resource.
>  - Check()
> -  - This function is used to check the attribute status on Redfish service. 
> If all
> attributes the feature driver manages
> -are presented in Redfish service, feature driver must provision them 
> already.
> Otherwise, Provisioning() will be called
> -to perform resource provisioning job.
> +  - This function is used to check the attribute status on Redfish service. 
> If all
> attributes
> +the feature driver manages are presented in Redfish service, feature 
> driver
> must provision
> +them already. Otherwise, Provisioning() will be called to perform 
> resource
> provisioning
> +job.
>  - Provisioning()
> -  - When this function is called, feature driver will provision all 
> attributes that it
> managed to Redfish service. This
> -operation usually create new resource at Redfish service and require 
> different
> operation that specified by Redfish service.
> +  - When this function is called, feature driver will provision all 
> attributes that it
> managed
> +to Redfish service. This operation usually creates the new Redfish 
> properties
> at the
> +existing URI in Redfish service. Use HTTP PATCH to provision Redfish
> properties as BIOS
> +may only manage some but not all of the properties of the resource. See
> [Redfish-edk2 implementation](#Redfish-Service-Implementation-that-
> Incorporates-with-EDK2-Redfish) for
> +the details. HTTP POST is still used for creating a collection member, 
> such as
> the
> +collection member of processor or memory for the Redfish inventory
> management.
> +However, HTTP PUT to overwrite an entire Redfish resource is not used in
> edk2 Redfish
> +implementation as edk2 Redfish implementation has no idea of whether the
> Redfish resource
> +is entirely managed by BIOS or not.
>  - Consume()
> -  - When there is pending settings in Redfish service, this function is 
> called for
> feature driver to consume pending settings
> -requested by user.
> +  - When there is pending settings in Redfish service, this function is 
> called for
> feature
> +driver to consume pending settings requested by user. HTTP GET is the 
> method
> used
> +to retrieve Redfish properties.
>  - Update()
> -  - When platform configuration is updated, this function is called to update
> configuration changes to Redfish service and
> -Redfish service can show the latest settings on platform.
> +  - When platform configuration is updated, this function is called to update
> configuration
> +changes to Redfish service and Redfish service can show the latest 
> settings on
> platform.
> +HTTP PATCH is the method used to update the properties of Redfish 
> resource.
> 
>  The EDKII Redfish Resource Addendum Protocol is introduced to provide 
> platform
> addendum data that Redfish service requires.
>  This protocol will be called at Provisioning() and Update() functions so 
> platform
> can add OEM attribute or any other attribute @@ -338,7 +349,7 @@ struct
> _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {  };  ```
> 
> -### Redfish Service Implementation that Incorporates with EDK2 Redfish
> +###  +name="Redfish-Service-Implementation-that-Incorporates-with-EDK2-Redfis
> +h">Redfish 

Re: [edk2-devel] [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver

2024-02-26 Thread Nickle Wang via groups.io
Hi @abner.ch...@amd.com,



RestJsonStructureDxe is a driver in RedfishPkg. May I know why we can not have 
dependency to RedfishPkg? Do we need to move it to MdeModulePkg for this goal 
(removing dependency to RedfishPkg)?



Regards,

Nickle



> -Original Message-

> From: abner.ch...@amd.com 

> Sent: Monday, February 26, 2024 10:44 AM

> To: devel@edk2.groups.io

> Cc: Nickle Wang ; Igor Kulchytskyy 

> Subject: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure

> DXE driver

>

> External email: Use caution opening links or attachments

>

>

> From: Abner Chang mailto:abner.ch...@amd.com>>

>

> BZ #: 4711

> - Add mode debug messages.

> - This driver shouldn't have a dependency on Redfish package and

>   the references of "Redfish" terminology.

>   Remove the references of "Redfish" from this driver.

> - Fix the missing parameter of DEBUG macros used in this

>   driver.

>

> Signed-off-by: Abner Chang mailto:abner.ch...@amd.com>>

> Cc: Nickle Wang mailto:nick...@nvidia.com>>

> Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> ---

>  .../RestJsonStructureDxe.inf  |  3 +-

>  .../RestJsonStructureInternal.h   |  3 +-

>  .../RestJsonStructureDxe.c| 96 ++-

>  3 files changed, 96 insertions(+), 6 deletions(-)

>

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> index 61e6253d318..e74c9dfd38b 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> @@ -2,6 +2,7 @@

>  # Implementation of EFI REST JSON Structure Protocol.

>  #

>  #  (C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> +reserved.

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

>

> @@ -17,7 +18,6 @@

>  [Packages]

>MdePkg/MdePkg.dec

>MdeModulePkg/MdeModulePkg.dec

> -  RedfishPkg/RedfishPkg.dec

>

>  [Sources]

>RestJsonStructureDxe.c

> @@ -26,6 +26,7 @@

>  [LibraryClasses]

>BaseLib

>BaseMemoryLib

> +  DebugLib

>MemoryAllocationLib

>UefiBootServicesTableLib

>UefiDriverEntryPoint

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> index 8d7175125c1..04be5cc80b5 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> @@ -3,6 +3,7 @@

>Protocol.

>

>(C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> + reserved.

>

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

>

> @@ -25,7 +26,7 @@

>  typedef struct _REST_JSON_STRUCTURE_INSTANCE {

>LIST_ENTRY   
> NextRestJsonStructureInstance; ///< Next

> convertor instance

>UINTNNumberOfNameSpaceToConvert;   
>  ///< Number

> of resource type this convertor supports.

> -  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The resource type linklist

> +  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The supported resource type array.

>EFI_REST_JSON_STRUCTURE_TO_STRUCTURE JsonToStructure;

> ///< JSON to C structure function

>EFI_REST_JSON_STRUCTURE_TO_JSON  StructureToJson;  
>  ///< C

> structure to JSON function

>EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTUREDestroyStructure;

> ///< Destory C struture function.

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> index 404866fb319..0da5132e5ae 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> @@ -4,12 +4,14 @@

>Protocol.

>

>(C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> + reserved.

>

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

>

>  **/

>

>  #include 

> +#include 

>  #include   #include 
> "RestJsonStructureInternal.h"

>

> @@ -72,6 +74,8 @@ RestJsonStructureRegister (

>  }

>}

>

> +  DEBUG ((DEBUG_MANAGEABILITY, "%a: %d REST JSON-C interpreter(s) to

> + register for the name spaces.\n", __func__, NumberOfNS));

> +

>Instance =

>  (REST_JSON_STRUCTURE_INSTANCE *)AllocateZeroPool (sizeof

> (REST_JSON_STRUCTURE_INSTANCE) + NumberOfNS * sizeof

> (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER));

>if (Instance == NULL) {

> @@ -88,6 +92,10 @@ RestJsonStructureRegister (

>ThisSupportedInterp= JsonStructureSupported;

>for (Index = 0; Index < NumberOfNS; Index++) {

> 

Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback

2024-02-23 Thread Nickle Wang via groups.io
Thanks Mike! I merged the pull request.

Regards,
Nickle

From: M M 
Sent: Friday, February 23, 2024 7:32 PM
To: Nickle Wang 
Cc: devel@edk2.groups.io; Abner Chang ; Igor Kulchytskyy 

Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: 
refine RedfishExternalResourceResourceFeatureCallback

External email: Use caution opening links or attachments

Hi Nickle,

I've updated commit message with your R-b and pushed it to PR.

Regards,
Mike.


On 23. 2. 2024., at 12:38, Nickle Wang 
mailto:nick...@nvidia.com>> wrote:

Hi @Mike Maslenkin<mailto:mike.maslen...@gmail.com>,

Can you please help me to add my reviewed-by to this commit message? 
https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af
  Then I can merge this pull request.

Thanks,
Nickle

> -Original Message-
> From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
> mailto:devel@edk2.groups.io>> On Behalf Of Nickle Wang
> via groups.io<http://groups.io/>
> Sent: Thursday, February 22, 2024 10:14 AM
> To: Mike Maslenkin 
> mailto:mike.maslen...@gmail.com>>; 
> devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Abner Chang mailto:abner.ch...@amd.com>>; Igor 
> Kulchytskyy mailto:ig...@ami.com>>
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] 
> RedfishClientPkg:
> refine RedfishExternalResourceResourceFeatureCallback
>
> External email: Use caution opening links or attachments
>
>
> Thanks for addressing my comment.
>
>
> Reviewed-by: Nickle Wang mailto:nick...@nvidia.com>>
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>
> > Sent: Thursday, February 22, 2024 4:06 AM
> > To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> > Cc: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>; Nickle Wang
> > mailto:nick...@nvidia.com>>; Abner Chang 
> > mailto:abner.ch...@amd.com>>; Igor
> > Kulchytskyy mailto:ig...@ami.com>>
> > Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine
> > RedfishExternalResourceResourceFeatureCallback
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Use local variable for BiosUri passed to HandleResource() to avoid
> > problems in case of Private->Uri is overriden down the call stack.
> >
> > Suggested-by: Nickle Wang mailto:nick...@nvidia.com>>
> > Cc: Abner Chang mailto:abner.ch...@amd.com>>
> > Cc: Nickle Wang mailto:nick...@nvidia.com>>
> > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>
> > Signed-off-by: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>
> > ---
> >  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++-
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > index f40f2d85af80..db77ed3dfccb 100644
> > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
> >REDFISH_SERVICE  RedfishService;
> >
> >REDFISH_RESOURCE_COMMON_PRIVATE  *Private;
> >
> >EFI_STRING   ResourceUri;
> >
> > +  EFI_STRING   BiosUri;
> >
> >
> >
> >if (FeatureAction != CallbackActionStartOperation) {
> >
> >  return EFI_UNSUPPORTED;
> >
> > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
> >//
> >
> >// Initialize collection path
> >
> >//
> >
> > -  Private->Uri = RedfishGetUri (ResourceUri);
> >
> > -  if (Private->Uri == NULL) {
> >
> > +  BiosUri = RedfishGetUri (ResourceUri);
> >
> > +  if (BiosUri == NULL) {
> >
> >  ASSERT (FALSE);
> >
> >  FreePool (ResourceUri);
> >
> >  return EFI_OUT_OF_RESOURCES;
> >
> >}
> >
> >
> >
> > -  Status = HandleResource (Private, Private->Uri);
> >
> > +  Status = HandleResource (Private, BiosUri);
> >
> >if (EFI_ERROR (Status)) {
> >
> > -DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",
> > __func__, Private->Uri, Status));
> >
> > +DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:
> > + %r\n", __func__, BiosUri, Status));
> >
> >}
> >
> >
> >
> > -  FreePool (Private->Uri);
> >
> > +  FreePool (BiosUri);
> >
> >FreePool (ResourceUri);
> >
> >return Status;
> >
> >  }
> >
> > --
> > 2.32.0 (Apple Git-132)
>
>
>
> 
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115884): https://edk2.groups.io/g/devel/message/115884
Mute This Topic: https://groups.io/mt/104495956/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback

2024-02-23 Thread Nickle Wang via groups.io
Hi @Mike Maslenkin<mailto:mike.maslen...@gmail.com>,



Can you please help me to add my reviewed-by to this commit message? 
https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af
  Then I can merge this pull request.



Thanks,

Nickle



> -Original Message-

> From: devel@edk2.groups.io  On Behalf Of Nickle Wang

> via groups.io

> Sent: Thursday, February 22, 2024 10:14 AM

> To: Mike Maslenkin ; devel@edk2.groups.io

> Cc: Abner Chang ; Igor Kulchytskyy 

> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] 
> RedfishClientPkg:

> refine RedfishExternalResourceResourceFeatureCallback

>

> External email: Use caution opening links or attachments

>

>

> Thanks for addressing my comment.

>

>

> Reviewed-by: Nickle Wang mailto:nick...@nvidia.com>>

>

> Regards,

> Nickle

>

> > -Original Message-

> > From: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>

> > Sent: Thursday, February 22, 2024 4:06 AM

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

> > Cc: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>; Nickle Wang

> > mailto:nick...@nvidia.com>>; Abner Chang 
> > mailto:abner.ch...@amd.com>>; Igor

> > Kulchytskyy mailto:ig...@ami.com>>

> > Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine

> > RedfishExternalResourceResourceFeatureCallback

> >

> > External email: Use caution opening links or attachments

> >

> >

> > Use local variable for BiosUri passed to HandleResource() to avoid

> > problems in case of Private->Uri is overriden down the call stack.

> >

> > Suggested-by: Nickle Wang mailto:nick...@nvidia.com>>

> > Cc: Abner Chang mailto:abner.ch...@amd.com>>

> > Cc: Nickle Wang mailto:nick...@nvidia.com>>

> > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> > Signed-off-by: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>

> > ---

> >  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++-

> >  1 file changed, 6 insertions(+), 5 deletions(-)

> >

> > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c

> > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c

> > index f40f2d85af80..db77ed3dfccb 100644

> > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c

> > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c

> > @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (

> >REDFISH_SERVICE  RedfishService;

> >

> >REDFISH_RESOURCE_COMMON_PRIVATE  *Private;

> >

> >EFI_STRING   ResourceUri;

> >

> > +  EFI_STRING   BiosUri;

> >

> >

> >

> >if (FeatureAction != CallbackActionStartOperation) {

> >

> >  return EFI_UNSUPPORTED;

> >

> > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (

> >//

> >

> >// Initialize collection path

> >

> >//

> >

> > -  Private->Uri = RedfishGetUri (ResourceUri);

> >

> > -  if (Private->Uri == NULL) {

> >

> > +  BiosUri = RedfishGetUri (ResourceUri);

> >

> > +  if (BiosUri == NULL) {

> >

> >  ASSERT (FALSE);

> >

> >  FreePool (ResourceUri);

> >

> >  return EFI_OUT_OF_RESOURCES;

> >

> >}

> >

> >

> >

> > -  Status = HandleResource (Private, Private->Uri);

> >

> > +  Status = HandleResource (Private, BiosUri);

> >

> >if (EFI_ERROR (Status)) {

> >

> > -DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",

> > __func__, Private->Uri, Status));

> >

> > +DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:

> > + %r\n", __func__, BiosUri, Status));

> >

> >}

> >

> >

> >

> > -  FreePool (Private->Uri);

> >

> > +  FreePool (BiosUri);

> >

> >FreePool (ResourceUri);

> >

> >return Status;

> >

> >  }

> >

> > --

> > 2.32.0 (Apple Git-132)

>

>

>

> 

>




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115877): https://edk2.groups.io/g/devel/message/115877
Mute This Topic: https://groups.io/mt/104495956/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-22 Thread Nickle Wang via groups.io
Thanks for catching this typo, Abner. Version 2 patch is sent.

Regards,
Nickle

> -Original Message-
> From: Chang, Abner 
> Sent: Wednesday, February 21, 2024 9:52 AM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: RE: [PATCH 2/6] RedfishPkg: implement Redfish HTTP protocol
>
> External email: Use caution opening links or attachments
>
>
> [AMD Official Use Only - General]
>
> One comment below.
>
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Tuesday, February 20, 2024 2:41 PM
> > To: devel@edk2.groups.io
> > Cc: Igor Kulchytskyy ; Chang, Abner
> > ; Nick Ramirez 
> > Subject: [PATCH 2/6] RedfishPkg: implement Redfish HTTP protocol
> >
> > Caution: This message originated from an External Source. Use proper caution
> > when opening attachments, clicking links, or responding.
> >
> >
> > implement Redfish HTTP protocol driver.
> >
> > Signed-off-by: Nickle Wang 
> > Co-authored-by: Igor Kulchytskyy 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Cc: Nick Ramirez 
> > ---
> >  RedfishPkg/RedfishPkg.dec |7 +-
> >  RedfishPkg/RedfishComponents.dsc.inc  |3 +-
> >  RedfishPkg/RedfishPkg.dsc |2 +
> >  RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf  |   73 +
> >  RedfishPkg/RedfishHttpDxe/RedfishHttpData.h   |  256 
> >  RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h|   44 +
> >  .../RedfishHttpDxe/RedfishHttpOperation.h |   76 +
> >  RedfishPkg/RedfishHttpDxe/RedfishHttpData.c   |  667 
> >  RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c| 1344
> > +
> >  .../RedfishHttpDxe/RedfishHttpOperation.c |  693 +
> >  RedfishPkg/Redfish.fdf.inc|3 +-
> >  11 files changed, 3164 insertions(+), 4 deletions(-)
> >  create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
> >  create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h
> >  create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h
> >  create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.h
> >  create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c
> >  create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c
> >  create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.c
> >
> > diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
> > index 9b424efdf3..114f8d2ad8 100644
> > --- a/RedfishPkg/RedfishPkg.dec
> > +++ b/RedfishPkg/RedfishPkg.dec
> > @@ -157,8 +157,11 @@
> ># set to EFI_REST_EX_PROTOCOL.
> >#
> >
> > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT3
> > 2|0x1009
> > -  ## This is used to enable HTTP content encoding on Redfish communication.
> > -
> > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|TRUE|BO
> > OLEAN|0x100A
> > +  #
> > +  # This PCD string is introduced for platform developer to set the 
> > encoding
> > method supported by BMC Redfish.
> > +  # Currently only "None" and "gzip" are supported.
> > +  #
> > +
> > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|"None"|V
> > OID*|0x100A
> >#
> ># Use below PCDs to control Redfhs HTTP protocol.
> >#
> > diff --git a/RedfishPkg/RedfishComponents.dsc.inc
> > b/RedfishPkg/RedfishComponents.dsc.inc
> > index 464ffc8606..d6c5b73d7f 100644
> > --- a/RedfishPkg/RedfishComponents.dsc.inc
> > +++ b/RedfishPkg/RedfishComponents.dsc.inc
> > @@ -7,7 +7,7 @@
> >  # "RedfishDefines.dsc.inc".
> >  #
> >  # (C) Copyright 2020-2021 Hewlett Packard Enterprise Development LP
> > -# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > +# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> >  #
> >  #SPDX-License-Identifier: BSD-2-Clause-Patent
> >  #
> > @@ -28,4 +28,5 @@
> >RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf
> >RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
> >MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> > +  RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
> >  !endif
> > diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
> > index 25ed193182..5849e7cf9e 100644
> > --- a/RedfishPkg/RedfishPkg.dsc
> > +++ b/RedfishPkg/RedfishPkg.dsc
> > @@ -45,6 +45,8 @@
> >
> > UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesL
> > ib.inf
> >
> > RedfishPlatformCredentialLib|RedfishPkg/Library/PlatformCredentialLibNull/
> > PlatformCredentialLibNull.inf
> >
> > RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/
> > RedfishContentCodingLibNull.inf
> > +
> > ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeR
> > eportStatusCodeLib.inf
> > +  SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
> >
> ># NULL instance of IPMI related library.
> >IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
> > diff --git 

Re: [edk2-devel] [PATCH 6/6] RedfishPkg/RedfishCrtLib: fix unresolved external symbol issue

2024-02-22 Thread Nickle Wang via groups.io
Hi Abner,

Please check v2 patch. I add the source location of MathFtol.c

Thanks,
Nickle

> -Original Message-
> From: Chang, Abner 
> Sent: Wednesday, February 21, 2024 10:10 AM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: RE: [PATCH 6/6] RedfishPkg/RedfishCrtLib: fix unresolved external
> symbol issue
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Tuesday, February 20, 2024 2:42 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > ; Nick Ramirez 
> > Subject: [PATCH 6/6] RedfishPkg/RedfishCrtLib: fix unresolved external
> > symbol issue
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > -Fix below compiler error reported in edk2 CI.
> > ERROR - Linker #2001 from JsonLib.lib(load.obj) : unresolved external
> > symbol __ftol2 -The file MathFtol.c is copied from IntrinsicLib in
> > CryptoPkg.
> > -Add MathFtol.c to EccCheck IgnoreFiles.
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Cc: Nick Ramirez 
> > ---
> >  .../RedfishCrtLib/RedfishCrtLib.inf   |  7 +++-
> >  .../RedfishCrtLib/Ia32/MathFtol.c | 37 +++
> >  RedfishPkg/RedfishPkg.ci.yaml |  2 +
> >  3 files changed, 45 insertions(+), 1 deletion(-)  create mode 100644
> > RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
> >
> > diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
> > b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
> > index 6ff5dba75c..3a5e309d1a 100644
> > --- a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
> > +++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
> > @@ -3,6 +3,7 @@
> >  #
> >  # Copyright (c) 2019, Intel Corporation. All rights reserved.  #
> > (C) Copyright 2020 Hewlett Packard Enterprise Development LP
> > +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> >  #
> >  #SPDX-License-Identifier: BSD-2-Clause-Patent
> >  #
> > @@ -23,6 +24,9 @@
> >  [Sources]
> >RedfishCrtLib.c
> >
> > +[Sources.IA32]
> > +  Ia32/MathFtol.c   | MSFT
> > +
> >  [LibraryClasses]
> >BaseLib
> >SortLib
> > @@ -35,4 +39,5 @@
> >MdeModulePkg/MdeModulePkg.dec
> >RedfishPkg/RedfishPkg.dec
> >
> > -
> > +[BuildOptions]
> > +  MSFT:*_*_IA32_CC_FLAGS = /GL-
> > diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
> > b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
> > new file mode 100644
> > index 00..adfe249b1d
> > --- /dev/null
> > +++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
> > @@ -0,0 +1,37 @@
> > +/** @file
> 
> Hi Nickle,
> Could you please add the information here after @file about where this file 
> or the
> source code come from, such as the location of original file?
> Thanks
> Abner
> 
> 
> > +  64-bit Math Worker Function.
> > +  The 32-bit versions of C compiler generate calls to library
> > + routines  to handle 64-bit math. These functions use non-standard
> > + calling
> > conventions.
> > +
> > +Copyright (c) 2019, Intel Corporation. All rights reserved.
> > +SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +/*
> > + * Floating point to integer conversion.
> > + */
> > +__declspec(naked) void
> > +_ftol2 (
> > +  void
> > +  )
> > +{
> > +  _asm {
> > +fistp qword ptr [esp-8]
> > +mov   edx, [esp-4]
> > +mov   eax, [esp-8]
> > +ret
> > +  }
> > +}
> > +
> > +__declspec(naked) void
> > +_ftol2_sse (
> > +  void
> > +  )
> > +{
> > +  _asm {
> > +fistp dword ptr [esp-4]
> > +mov   eax,[esp-4]
> > +ret
> > +  }
> > +}
> > diff --git a/RedfishPkg/RedfishPkg.ci.yaml
> > b/RedfishPkg/RedfishPkg.ci.yaml index 69b6bf39f5..b95e8bfdc7 100644
> > --- a/RedfishPkg/RedfishPkg.ci.yaml
> > +++ b/RedfishPkg/RedfishPkg.ci.yaml
> > @@ -2,6 +2,7 @@
> >  # CI configuration for NetworkPkg
> >  #
> >  # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> > +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> >  # SPDX-License-Identifier: BSD-2-Clause-Patent  ##  { @@ -38,6 +39,7
> > @@
> >  "PrivateInclude/Crt/string.h",
> >  "PrivateInclude/Crt/time.h",
> >  "PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c",
> > +"PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c",
> >  "Include/Library/RedfishCrtLib.h",
> >  ##
> >  ## For jansson library open source
> > --
> > 2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115780): https://edk2.groups.io/g/devel/message/115780
Mute This Topic: https://groups.io/mt/104463409/21656
Group Owner: devel+ow...@edk2.groups.io

[edk2-devel] [PATCH v2 5/6] RedfishPkg/RedfishDebugLib: use RedfishHttpLib

2024-02-22 Thread Nickle Wang via groups.io
Remove RedfishLib and use RedfishHttpLib for debug printing
Redfish response data.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
---
 RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf | 4 ++--
 RedfishPkg/Include/Library/RedfishDebugLib.h   | 2 +-
 RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c   | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
index 048d27c6dc..d468bb213b 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  INF file for Redfish debug library.
 #
-#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -32,7 +32,7 @@
   DebugLib
   JsonLib
   MemoryAllocationLib
-  RedfishLib
+  RedfishHttpLib
   UefiLib
 
 [Depex]
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index 3430cf1d14..ad7a697586 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -11,9 +11,9 @@
 #define REDFISH_DEBUG_LIB_H_
 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include 
 
diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
index 3728f51213..8b0425b8c3 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #ifndef IS_EMPTY_STRING
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115779): https://edk2.groups.io/g/devel/message/115779
Mute This Topic: https://groups.io/mt/104505408/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 6/6] RedfishPkg/RedfishCrtLib: fix unresolved external symbol issue

2024-02-22 Thread Nickle Wang via groups.io
-Fix below compiler error reported in edk2 CI.
ERROR - Linker #2001 from JsonLib.lib(load.obj) : unresolved external
symbol __ftol2
-The file MathFtol.c is copied from IntrinsicLib in CryptoPkg.
-Add MathFtol.c to EccCheck IgnoreFiles.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../RedfishCrtLib/RedfishCrtLib.inf   |  7 +++-
 .../RedfishCrtLib/Ia32/MathFtol.c | 37 +++
 RedfishPkg/RedfishPkg.ci.yaml |  2 +
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c

diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf 
b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
index 6ff5dba75c..3a5e309d1a 100644
--- a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
+++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
@@ -3,6 +3,7 @@
 #
 # Copyright (c) 2019, Intel Corporation. All rights reserved.
 # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -23,6 +24,9 @@
 [Sources]
   RedfishCrtLib.c
 
+[Sources.IA32]
+  Ia32/MathFtol.c   | MSFT
+
 [LibraryClasses]
   BaseLib
   SortLib
@@ -35,4 +39,5 @@
   MdeModulePkg/MdeModulePkg.dec
   RedfishPkg/RedfishPkg.dec
 
-
+[BuildOptions]
+  MSFT:*_*_IA32_CC_FLAGS = /GL-
diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c 
b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
new file mode 100644
index 00..e49f00eaf5
--- /dev/null
+++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
@@ -0,0 +1,37 @@
+/** @file This file is copied from 
CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
+  64-bit Math Worker Function.
+  The 32-bit versions of C compiler generate calls to library routines
+  to handle 64-bit math. These functions use non-standard calling conventions.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+/*
+ * Floating point to integer conversion.
+ */
+__declspec(naked) void
+_ftol2 (
+  void
+  )
+{
+  _asm {
+fistp qword ptr [esp-8]
+mov   edx, [esp-4]
+mov   eax, [esp-8]
+ret
+  }
+}
+
+__declspec(naked) void
+_ftol2_sse (
+  void
+  )
+{
+  _asm {
+fistp dword ptr [esp-4]
+mov   eax,[esp-4]
+ret
+  }
+}
diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml
index 69b6bf39f5..b95e8bfdc7 100644
--- a/RedfishPkg/RedfishPkg.ci.yaml
+++ b/RedfishPkg/RedfishPkg.ci.yaml
@@ -2,6 +2,7 @@
 # CI configuration for NetworkPkg
 #
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
@@ -38,6 +39,7 @@
 "PrivateInclude/Crt/string.h",
 "PrivateInclude/Crt/time.h",
 "PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c",
+"PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c",
 "Include/Library/RedfishCrtLib.h",
 ##
 ## For jansson library open source
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115778): https://edk2.groups.io/g/devel/message/115778
Mute This Topic: https://groups.io/mt/104505407/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 3/6] RedfishPkg: introduce RedfishHttpLib

2024-02-22 Thread Nickle Wang via groups.io
RedfishHttpLib is a wrapper library for Redfish feature drivers to
call Redfish HTTP Protocol easily.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
---
 RedfishPkg/RedfishPkg.dec |   5 +
 RedfishPkg/RedfishLibs.dsc.inc|   3 +-
 RedfishPkg/RedfishPkg.dsc |   3 +-
 .../Library/RedfishHttpLib/RedfishHttpLib.inf |  43 ++
 RedfishPkg/Include/Library/RedfishHttpLib.h   | 326 ++
 .../Library/RedfishHttpLib/RedfishHttpLib.c   | 585 ++
 6 files changed, 963 insertions(+), 2 deletions(-)
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 create mode 100644 RedfishPkg/Include/Library/RedfishHttpLib.h
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 114f8d2ad8..1a9c9ed7bc 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -69,6 +69,11 @@
   #
   RedfishPlatformConfigLib|Include/Library/RedfishPlatformConfigLib.h
 
+  ##  @libraryclass  Provides the library functions to access Redfish HTTP
+  #   protocol.
+  #
+  RedfishHttpLib|Include/Library/RedfishHttpLib.h
+
 [LibraryClasses.Common.Private]
   ##  @libraryclass  Provides the private C runtime library functions.
   #   CRT library is currently used by edk2 JsonLib (open source
diff --git a/RedfishPkg/RedfishLibs.dsc.inc b/RedfishPkg/RedfishLibs.dsc.inc
index 5426957da8..55846aaa9d 100644
--- a/RedfishPkg/RedfishLibs.dsc.inc
+++ b/RedfishPkg/RedfishLibs.dsc.inc
@@ -6,7 +6,7 @@
 # of EDKII network library classes.
 #
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -21,5 +21,6 @@
   
RedfishPlatformCredentialLib|RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.inf
   HiiUtilityLib|RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf
   
RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.inf
+  RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 !endif
 
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 5849e7cf9e..b0150043a9 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -4,7 +4,7 @@
 # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
 # (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
 # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -74,5 +74,6 @@
   RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
   RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf
   RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.inf
+  RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 
   !include RedfishPkg/Redfish.dsc.inc
diff --git a/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf 
b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
new file mode 100644
index 00..fd53b8c2ed
--- /dev/null
+++ b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
@@ -0,0 +1,43 @@
+## @file
+#  Redfish HTTP library is wrapper library for application to call Redfish
+#  HTTP protocol easily.
+#
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010006
+  BASE_NAME  = RedfishHttpLib
+  FILE_GUID  = 62855D9B-441B-436B-9CA6-B7FEB7ABF54E
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = RedfishHttpLib| DXE_DRIVER UEFI_DRIVER
+  CONSTRUCTOR= RedfishHttpConstructor
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 EBC
+#
+
+[Sources]
+  RedfishHttpLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+  UefiLib
+  UefiBootServicesTableLib
+
+[Protocols]
+  gEdkIIRedfishHttpProtocolGuid   ## CONSUMES ##
+
+[depex]
+  TRUE
+
diff --git a/RedfishPkg/Include/Library/RedfishHttpLib.h 
b/RedfishPkg/Include/Library/RedfishHttpLib.h
new file mode 100644
index 00..b07a46993b
--- /dev/null
+++ b/RedfishPkg/Include/Library/RedfishHttpLib.h
@@ -0,0 +1,326 @@
+/** @file
+  This file defines the Redfish HTTP library interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef 

[edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-22 Thread Nickle Wang via groups.io
implement Redfish HTTP protocol driver.

Signed-off-by: Nickle Wang 
Co-authored-by: Igor Kulchytskyy 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishPkg/RedfishPkg.dec |7 +-
 RedfishPkg/RedfishComponents.dsc.inc  |3 +-
 RedfishPkg/RedfishPkg.dsc |2 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf  |   73 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h   |  256 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h|   44 +
 .../RedfishHttpDxe/RedfishHttpOperation.h |   76 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c   |  667 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c| 1344 +
 .../RedfishHttpDxe/RedfishHttpOperation.c |  693 +
 RedfishPkg/Redfish.fdf.inc|3 +-
 11 files changed, 3164 insertions(+), 4 deletions(-)
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 9b424efdf3..114f8d2ad8 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -157,8 +157,11 @@
   # set to EFI_REST_EX_PROTOCOL.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x1009
-  ## This is used to enable HTTP content encoding on Redfish communication.
-  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|TRUE|BOOLEAN|0x100A
+  #
+  # This PCD string is introduced for platform developer to set the encoding 
method supported by BMC Redfish.
+  # Currently only "None" and "gzip" are supported.
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|"None"|VOID*|0x100A
   #
   # Use below PCDs to control Redfhs HTTP protocol.
   #
diff --git a/RedfishPkg/RedfishComponents.dsc.inc 
b/RedfishPkg/RedfishComponents.dsc.inc
index 464ffc8606..d6c5b73d7f 100644
--- a/RedfishPkg/RedfishComponents.dsc.inc
+++ b/RedfishPkg/RedfishComponents.dsc.inc
@@ -7,7 +7,7 @@
 # "RedfishDefines.dsc.inc".
 #
 # (C) Copyright 2020-2021 Hewlett Packard Enterprise Development LP
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -28,4 +28,5 @@
   RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf
   RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
   MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
+  RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
 !endif
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 25ed193182..5849e7cf9e 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -45,6 +45,8 @@
   
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
   
RedfishPlatformCredentialLib|RedfishPkg/Library/PlatformCredentialLibNull/PlatformCredentialLibNull.inf
   
RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+  SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
 
   # NULL instance of IPMI related library.
   IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
diff --git a/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf 
b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
new file mode 100644
index 00..c7dfdffacf
--- /dev/null
+++ b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
@@ -0,0 +1,73 @@
+## @file
+#  RedfishHttpDxe is the DXE driver which provides
+#  EdkIIRedfishHttpProtocol to EDK2 Redfish Feature
+#  drivers for HTTP operation.
+#
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001000b
+  BASE_NAME  = RedfishHttpDxe
+  FILE_GUID  = 85ADB2F1-DA93-47D4-AF4F-3D920D9BD2C0
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= RedfishHttpEntryPoint
+  UNLOAD_IMAGE   = RedfishHttpDriverUnload
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64 RISCV64
+#
+
+[Sources]
+  RedfishHttpData.c
+  RedfishHttpData.h
+  RedfishHttpDxe.c
+  RedfishHttpDxe.h
+  RedfishHttpOperation.c
+  RedfishHttpOperation.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  NetworkPkg/NetworkPkg.dec
+  RedfishPkg/RedfishPkg.dec
+

[edk2-devel] [PATCH v2 4/6] RedfishPkg/RedfishLib: include RedfishServiceData.h

2024-02-22 Thread Nickle Wang via groups.io
Redfish common structures are moved to RedfishServiceData.h. Remove
them from RedfishLib.h

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
---
 RedfishPkg/Include/Library/RedfishLib.h | 17 +
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishLib.h 
b/RedfishPkg/Include/Library/RedfishLib.h
index 8309a67c76..fb30ff68f6 100644
--- a/RedfishPkg/Include/Library/RedfishLib.h
+++ b/RedfishPkg/Include/Library/RedfishLib.h
@@ -70,6 +70,7 @@
 #ifndef REDFISH_LIB_H_
 #define REDFISH_LIB_H_
 
+#include 
 #include 
 
 #include 
@@ -78,22 +79,6 @@
 #define ODATA_TYPE_NAME_MAX_SIZE  128
 #define ODATA_TYPE_MAX_SIZE   128
 
-///
-/// Library class public defines
-///
-typedef  VOID  *REDFISH_SERVICE;
-typedef  VOID  *REDFISH_PAYLOAD;
-
-///
-/// Library class public structures/unions
-///
-typedef struct {
-  EFI_HTTP_STATUS_CODE*StatusCode;
-  UINTN   HeaderCount;
-  EFI_HTTP_HEADER *Headers;
-  REDFISH_PAYLOAD Payload;
-} REDFISH_RESPONSE;
-
 ///
 /// Odata type-name mapping structure.
 ///
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115775): https://edk2.groups.io/g/devel/message/115775
Mute This Topic: https://groups.io/mt/104505403/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 1/6] RedfishPkg: introduce Redfish HTTP protocol

2024-02-22 Thread Nickle Wang via groups.io
Introduce Redfish HTTP protocol to improve Redfish performance
and communication stability between BIOS and Redfish service.
- Feature drivers often query same Redfish resource multiple
times for different purpose. Implement HTTP cache mechanism to
improve HTTP GET performance. "UseCache" parameter is provided
if application likes to send HTTP GET request to Redfish service
without using cache data.
- This driver will retire stale cache data automatically when
application modify Redfish resource at service side.
- PCD PcdHttpCacheDisabled is used to disable cache mechanism in
this driver for debugging purpose.
- PCD PcdRedfishServiceContentEncoding is used to enable content
encoding while sending data to Redfish service.
- Redfish HTTP protocol also implement retry mechanism to retry
HTTP request when BIOS receive unexpected response from Redfish service.
This function helps BIOS Redfish to finish its job as much as possible.
- PCDs are defined to control how many times BIOS will retry the
request and how many time BIOS will wait between retries.

Signed-off-by: Nickle Wang 
Co-authored-by: Igor Kulchytskyy 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
---
 RedfishPkg/RedfishPkg.dec |  24 +-
 .../Protocol/EdkIIRedfishHttpProtocol.h   | 308 ++
 RedfishPkg/Include/RedfishServiceData.h   |  43 +++
 3 files changed, 374 insertions(+), 1 deletion(-)
 create mode 100644 RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
 create mode 100644 RedfishPkg/Include/RedfishServiceData.h

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 3ea9ff3ef7..9b424efdf3 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -4,7 +4,7 @@
 # Copyright (c) 2019, Intel Corporation. All rights reserved.
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2023, American Megatrends International LLC.
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -93,6 +93,9 @@
   # Redfish Host Interface ready notification protocol
   gEdkIIRedfishHostInterfaceReadyProtocolGuid = { 0xC3F6D062, 0x3D38, 0x4EA4, 
{ 0x92, 0xB1, 0xE8, 0xF8, 0x02, 0x27, 0x63, 0xDF } }
 
+  ## Include/Protocol/EdkIIRedfishHttpProtocol.h
+  gEdkIIRedfishHttpProtocolGuid = { 0x58a0f47e, 0xf45f, 0x4d44, { 0x89, 0x5b, 
0x2a, 0xfe, 0xb0, 0x80, 0x15, 0xe2 } }
+
 [Guids]
   gEfiRedfishPkgTokenSpaceGuid  = { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x88, 
0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }}
 
@@ -154,3 +157,22 @@
   # set to EFI_REST_EX_PROTOCOL.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x1009
+  ## This is used to enable HTTP content encoding on Redfish communication.
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|TRUE|BOOLEAN|0x100A
+  #
+  # Use below PCDs to control Redfhs HTTP protocol.
+  #
+  ## The number of retry when HTTP GET request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpGetRetry|0|UINT16|0x100B
+  ## The number of retry when HTTP PUT request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPutRetry|0|UINT16|0x100C
+  ## The number of retry when HTTP PATCH request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPatchRetry|0|UINT16|0x100D
+  ## The number of retry when HTTP POST request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPostRetry|0|UINT16|0x100E
+  ## The number of retry when HTTP DELETE request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpDeleteRetry|0|UINT16|0x100F
+  ## The number of second to wait before driver retry HTTP request. If the 
value is 0, there is no wait before next retry.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x1010
+  ## This is used to disable Redfish HTTP cache function and every request 
will be sent to Redfish service.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x1011
diff --git a/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h 
b/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
new file mode 100644
index 00..fef365730d
--- /dev/null
+++ b/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
@@ -0,0 +1,308 @@
+/** @file
+  This file defines the EDKII_REDFISH_HTTP_PROTOCOL interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_HTTP_PROTOCOL_H_
+#define EDKII_REDFISH_HTTP_PROTOCOL_H_
+
+#include 
+#include 
+#include 
+
+typedef struct _EDKII_REDFISH_HTTP_PROTOCOL EDKII_REDFISH_HTTP_PROTOCOL;
+

  1   2   3   4   5   6   >