From: "Nickle Wang via groups.io" <nicklew=nvidia.com@groups.io>
To: Mike Maslenkin <mike.maslenkin@gmail.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>, Igor Kulchytskyy <igork@ami.com>
Subject: Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing in GetRedpathNodeByIndex()
Date: Tue, 26 Mar 2024 12:17:04 +0000 [thread overview]
Message-ID: <MW4PR12MB703115CF403512C8923E7597D9352@MW4PR12MB7031.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20240323120050.53834-3-mike.maslenkin@gmail.com>
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]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-03-26 12:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MW4PR12MB703115CF403512C8923E7597D9352@MW4PR12MB7031.namprd12.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox