public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()
@ 2024-03-23 12:00 Mike Maslenkin
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex() Mike Maslenkin
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Mike Maslenkin @ 2024-03-23 12:00 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Igor Kulchytskyy, Nickle Wang, Mike Maslenkin

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, &EndOfChar);

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

Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117065): https://edk2.groups.io/g/devel/message/117065
Mute This Topic: https://groups.io/mt/105101990/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex()
  2024-03-23 12:00 [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Mike Maslenkin
@ 2024-03-23 12:00 ` Mike Maslenkin
  2024-03-26 12:16   ` Nickle Wang via groups.io
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing " Mike Maslenkin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Mike Maslenkin @ 2024-03-23 12:00 UTC (permalink / raw)
  To: devel; +Cc: Mike Maslenkin, Abner Chang, Igor Kulchytskyy, Nickle Wang

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]:<null string>
 GetRedpathNodeByIndex[2]:<null string>
 GetRedpathNodeByIndex[3]:<null string>
 GetRedpathNodeByIndex[4]:<null string>
 GetRedpathNodeByIndex[5]:<null string>

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]:<null string>

Note: it is supposed that caller will set terminating '\0' explicitly
at the next position pointed by returned EndOfNodePtr value.

Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 .../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/RedfishFeatureUtilityLib.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 (#117066): https://edk2.groups.io/g/devel/message/117066
Mute This Topic: https://groups.io/mt/105101991/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing in GetRedpathNodeByIndex()
  2024-03-23 12:00 [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Mike Maslenkin
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex() Mike Maslenkin
@ 2024-03-23 12:00 ` Mike Maslenkin
  2024-03-26 12:17   ` Nickle Wang via groups.io
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first node " Mike Maslenkin
  2024-03-25  2:12 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Chang, Abner via groups.io
  3 siblings, 1 reply; 11+ messages in thread
From: Mike Maslenkin @ 2024-03-23 12:00 UTC (permalink / raw)
  To: devel; +Cc: Mike Maslenkin, Abner Chang, Igor Kulchytskyy, Nickle Wang

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]:<null string>

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 <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 .../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/RedfishFeatureUtilityLib.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 (#117067): https://edk2.groups.io/g/devel/message/117067
Mute This Topic: https://groups.io/mt/105101992/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* [edk2-devel] [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first node processing in GetRedpathNodeByIndex()
  2024-03-23 12:00 [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Mike Maslenkin
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex() Mike Maslenkin
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing " Mike Maslenkin
@ 2024-03-23 12:00 ` Mike Maslenkin
  2024-03-26 13:39   ` Nickle Wang via groups.io
  2024-03-25  2:12 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Chang, Abner via groups.io
  3 siblings, 1 reply; 11+ messages in thread
From: Mike Maslenkin @ 2024-03-23 12:00 UTC (permalink / raw)
  To: devel; +Cc: Mike Maslenkin, Abner Chang, Igor Kulchytskyy, Nickle Wang

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 <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 .../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 (#117068): https://edk2.groups.io/g/devel/message/117068
Mute This Topic: https://groups.io/mt/105101993/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()
  2024-03-23 12:00 [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Mike Maslenkin
                   ` (2 preceding siblings ...)
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first node " Mike Maslenkin
@ 2024-03-25  2:12 ` Chang, Abner via groups.io
  2024-03-26 13:41   ` Nickle Wang via groups.io
  3 siblings, 1 reply; 11+ messages in thread
From: Chang, Abner via groups.io @ 2024-03-25  2:12 UTC (permalink / raw)
  To: Mike Maslenkin, devel; +Cc: Igor Kulchytskyy, Nickle Wang

[AMD Official Use Only - General]

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

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

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy <igork@ami.com>;
> Nickle Wang <nicklew@nvidia.com>; Mike Maslenkin
> <mike.maslenkin@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,
> &EndOfChar);
>
> and return of EndOfChar value is not affected by this set.
>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117073): https://edk2.groups.io/g/devel/message/117073
Mute This Topic: https://groups.io/mt/105101990/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex()
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex() Mike Maslenkin
@ 2024-03-26 12:16   ` Nickle Wang via groups.io
  0 siblings, 0 replies; 11+ messages in thread
From: Nickle Wang via groups.io @ 2024-03-26 12:16 UTC (permalink / raw)
  To: Mike Maslenkin, devel; +Cc: Abner Chang, Igor Kulchytskyy



Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin <mike.maslenkin@gmail.com>; Abner Chang
> <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>; Nickle Wang
> <nicklew@nvidia.com>
> 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]:<null string>
>  GetRedpathNodeByIndex[2]:<null string>
>  GetRedpathNodeByIndex[3]:<null string>
>  GetRedpathNodeByIndex[4]:<null string>
>  GetRedpathNodeByIndex[5]:<null string>
> 
> 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]:<null string>
> 
> Note: it is supposed that caller will set terminating '\0' explicitly at the next
> position pointed by returned EndOfNodePtr value.
> 
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  .../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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing in GetRedpathNodeByIndex()
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing " Mike Maslenkin
@ 2024-03-26 12:17   ` Nickle Wang via groups.io
  0 siblings, 0 replies; 11+ messages in thread
From: Nickle Wang via groups.io @ 2024-03-26 12:17 UTC (permalink / raw)
  To: Mike Maslenkin, devel; +Cc: Abner Chang, Igor Kulchytskyy


Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin <mike.maslenkin@gmail.com>; Abner Chang
> <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>; Nickle Wang
> <nicklew@nvidia.com>
> 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]:<null string>
> 
> 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 <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  .../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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first node processing in GetRedpathNodeByIndex()
  2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first node " Mike Maslenkin
@ 2024-03-26 13:39   ` Nickle Wang via groups.io
  0 siblings, 0 replies; 11+ messages in thread
From: Nickle Wang via groups.io @ 2024-03-26 13:39 UTC (permalink / raw)
  To: Mike Maslenkin, devel; +Cc: Abner Chang, Igor Kulchytskyy



Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin <mike.maslenkin@gmail.com>; Abner Chang
> <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>; Nickle Wang
> <nicklew@nvidia.com>
> 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 <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  .../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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()
  2024-03-25  2:12 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Chang, Abner via groups.io
@ 2024-03-26 13:41   ` Nickle Wang via groups.io
  2024-03-26 21:18     ` Mike Maslenkin
  0 siblings, 1 reply; 11+ messages in thread
From: Nickle Wang via groups.io @ 2024-03-26 13:41 UTC (permalink / raw)
  To: Chang, Abner, Mike Maslenkin, devel; +Cc: Igor Kulchytskyy

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

Thanks for your reminder, Abner. I verify this patch series on my system, and I don't see any issue.



Hi @Mike Maslenkin<mailto:mike.maslenkin@gmail.com>, 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 <Abner.Chang@amd.com>

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

> To: Mike Maslenkin <mike.maslenkin@gmail.com>; devel@edk2.groups.io

> Cc: Igor Kulchytskyy <igork@ami.com>; Nickle Wang <nicklew@nvidia.com>

> 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 <abner.chang@amd.com<mailto:abner.chang@amd.com>>

>

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

>

> > -----Original Message-----

> > From: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>

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

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

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

> > <igork@ami.com<mailto:igork@ami.com>>; Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>; Mike Maslenkin

> > <mike.maslenkin@gmail.com<mailto:mike.maslenkin@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,

> > &EndOfChar);

> >

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

> >

> > Cc: Abner Chang <abner.chang@amd.com<mailto:abner.chang@amd.com>>

> > Cc: Igor Kulchytskyy <igork@ami.com<mailto:igork@ami.com>>

> > Cc: Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>

> > Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

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

* Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()
  2024-03-26 13:41   ` Nickle Wang via groups.io
@ 2024-03-26 21:18     ` Mike Maslenkin
  2024-04-01 13:33       ` Nickle Wang via groups.io
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Maslenkin @ 2024-03-26 21:18 UTC (permalink / raw)
  To: Nickle Wang; +Cc: Chang, Abner, devel, Igor Kulchytskyy

Hi,

I have updated patches with R-b and pushed it to PR
https://github.com/tianocore/edk2-redfish-client/pull/85

Thank you for the review!

Regards,
Mike

On Tue, Mar 26, 2024 at 4:41 PM Nickle Wang <nicklew@nvidia.com> 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 <Abner.Chang@amd.com>
>
> > Sent: Monday, March 25, 2024 10:13 AM
>
> > To: Mike Maslenkin <mike.maslenkin@gmail.com>; devel@edk2.groups.io
>
> > Cc: Igor Kulchytskyy <igork@ami.com>; Nickle Wang <nicklew@nvidia.com>
>
> > 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 <abner.chang@amd.com>
>
> >
>
> > Hi Nickle, please also take a look at this change. Thanks Abner
>
> >
>
> > > -----Original Message-----
>
> > > From: Mike Maslenkin <mike.maslenkin@gmail.com>
>
> > > Sent: Saturday, March 23, 2024 8:01 PM
>
> > > To: devel@edk2.groups.io
>
> > > Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
>
> > > <igork@ami.com>; Nickle Wang <nicklew@nvidia.com>; Mike Maslenkin
>
> > > <mike.maslenkin@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,
>
> > > &EndOfChar);
>
> > >
>
> > > and return of EndOfChar value is not affected by this set.
>
> > >
>
> > > Cc: Abner Chang <abner.chang@amd.com>
>
> > > Cc: Igor Kulchytskyy <igork@ami.com>
>
> > > Cc: Nickle Wang <nicklew@nvidia.com>
>
> > > Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
>
> > >
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117141): https://edk2.groups.io/g/devel/message/117141
Mute This Topic: https://groups.io/mt/105101990/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()
  2024-03-26 21:18     ` Mike Maslenkin
@ 2024-04-01 13:33       ` Nickle Wang via groups.io
  0 siblings, 0 replies; 11+ messages in thread
From: Nickle Wang via groups.io @ 2024-04-01 13:33 UTC (permalink / raw)
  To: Mike Maslenkin; +Cc: Chang, Abner, devel, Igor Kulchytskyy

Thanks, Mike!

I merged this pull request.

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Wednesday, March 27, 2024 5:19 AM
> To: Nickle Wang <nicklew@nvidia.com>
> Cc: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io; Igor
> Kulchytskyy <igork@ami.com>
> 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&data=05%7C02%7Cnicklew%40nvidia.com%7Cb629e25259
> 1746cf422108dc4dda60d8%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0
> %7C638470847554354719%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&s
> data=%2BcHo1%2B%2F5kopSeQxXQjbiXLctLbqeg5tzevhIH%2Bg3hv8%3D&reserv
> ed=0
>
> Thank you for the review!
>
> Regards,
> Mike
>
> On Tue, Mar 26, 2024 at 4:41 PM Nickle Wang <nicklew@nvidia.com> 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 <Abner.Chang@amd.com>
> >
> > > Sent: Monday, March 25, 2024 10:13 AM
> >
> > > To: Mike Maslenkin <mike.maslenkin@gmail.com>; devel@edk2.groups.io
> >
> > > Cc: Igor Kulchytskyy <igork@ami.com>; Nickle Wang <nicklew@nvidia.com>
> >
> > > 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 <abner.chang@amd.com>
> >
> > >
> >
> > > Hi Nickle, please also take a look at this change. Thanks Abner
> >
> > >
> >
> > > > -----Original Message-----
> >
> > > > From: Mike Maslenkin <mike.maslenkin@gmail.com>
> >
> > > > Sent: Saturday, March 23, 2024 8:01 PM
> >
> > > > To: devel@edk2.groups.io
> >
> > > > Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
> >
> > > > <igork@ami.com>; Nickle Wang <nicklew@nvidia.com>; Mike Maslenkin
> >
> > > > <mike.maslenkin@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,
> >
> > > > &EndOfChar);
> >
> > > >
> >
> > > > and return of EndOfChar value is not affected by this set.
> >
> > > >
> >
> > > > Cc: Abner Chang <abner.chang@amd.com>
> >
> > > > Cc: Igor Kulchytskyy <igork@ami.com>
> >
> > > > Cc: Nickle Wang <nicklew@nvidia.com>
> >
> > > > Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> >
> > > >
> >
> >


-=-=-=-=-=-=-=-=-=-=-=-
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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

end of thread, other threads:[~2024-04-01 13:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-23 12:00 [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Mike Maslenkin
2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex() Mike Maslenkin
2024-03-26 12:16   ` Nickle Wang via groups.io
2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing " Mike Maslenkin
2024-03-26 12:17   ` Nickle Wang via groups.io
2024-03-23 12:00 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first node " Mike Maslenkin
2024-03-26 13:39   ` Nickle Wang via groups.io
2024-03-25  2:12 ` [edk2-devel] [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex() Chang, Abner via groups.io
2024-03-26 13:41   ` Nickle Wang via groups.io
2024-03-26 21:18     ` Mike Maslenkin
2024-04-01 13:33       ` Nickle Wang via groups.io

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