From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id D8460780091 for ; Tue, 28 Nov 2023 01:16:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=lBMSMfJIPxCtSPi+TiNiUoDcfRp7w+N/ewy/PcWa8uo=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1701134177; v=1; b=YxB4HbcR7mCzzu5sR8Dmzvw1mTdflnQCSwJ7doOhPN4YL9gD0GJ03ZOWRHV5XUNFnXsHSF3H qLZ5TdfE8O7fbTdEwJzG54knjCAd66p+7ohw6THx7reA/2GX2Xa1phUZHfhtHODxgLI/WWCm+fo zIBYHV6ft9Idq8eisT/x8g0g= X-Received: by 127.0.0.2 with SMTP id oUMsYY7687511xJFCYPHTFfz; Mon, 27 Nov 2023 17:16:17 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.51]) by mx.groups.io with SMTP id smtpd.web11.11826.1701134176586753877 for ; Mon, 27 Nov 2023 17:16:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IjbbjM8I8McH8aAx1lTlub/Jl8g47ArvWQdWqLPHZrs9xZF7lvwiDi+DHdwdjzfEOYGjtdQ5aGoVynd+PDCiE9HB2FFPtFK4yUVLkh8vTqvO+TfM0uoTLE3gZmtNlQ8Xh8P4UB5+2qj1XSPRPaO37LuFVqr+/t3vH1zGFrO9V7jVCgXgBvZVkSxjGiPyyYojEDiMJ3EJh/Ldb8JCqMcvTH2ISJ2ebrzwUfUG9k0HP9zHt3hbRHTupyIFkXe+S11WGZLpDKf0jaZtL72x3zoFN+0roY0ivszO/SLTIOr/jqHvmAAMdXh24DyGwdB0ODYJ4y0jJEXTwwksK44Myhn5Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=i5FNXN6v+JHATqFuSBP7ppGOEwQkC44LTc8vd4Q0MWY=; b=ThikrlZW0XPKRfAkQHpOhuHipgJuZkMC4e9bF3y7cYewrznJkzkxJGF2EtOazfXifm5TdKLn76sBwWopyTAOc12XvY0lLwTrh8Qodb/ZPrEuJ0pmDjeoTatdUIJueb+Mq2TkTLfFR7A+RdZJWQgAV2nFfojZLYkYwgrNqLi9zDflXjKxQqbVrDpDagQKz1j+cNZBotEHkvgV0+zzAh5ZqIcQzZwtL7zw3m/kGpknDXna38+Z6s1Y9W6d01uDTaY9FiZ7ym5iIjDjvEqjjdLyWOP040z4oSED4yadGYvEp4jUSK0WdsIcQpsUg91QnS+ha9yTpyGgV35G4DHn9TVFNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) X-Received: from BL0PR03CA0008.namprd03.prod.outlook.com (2603:10b6:208:2d::21) by IA0PR12MB7505.namprd12.prod.outlook.com (2603:10b6:208:443::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Tue, 28 Nov 2023 01:16:12 +0000 X-Received: from BL02EPF0001A104.namprd05.prod.outlook.com (2603:10b6:208:2d:cafe::47) by BL0PR03CA0008.outlook.office365.com (2603:10b6:208:2d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29 via Frontend Transport; Tue, 28 Nov 2023 01:16:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.160) by BL02EPF0001A104.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.17 via Frontend Transport; Tue, 28 Nov 2023 01:16:11 +0000 X-Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 27 Nov 2023 17:15:57 -0800 X-Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 27 Nov 2023 17:15:57 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 27 Nov 2023 17:15:56 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-redfish-client][PATCH 1/1] RedfishClientPkg/RedfishFeatureCoreDxe: fix incorrect URI issue Date: Tue, 28 Nov 2023 09:15:55 +0800 Message-ID: <20231128011555.7596-1-nicklew@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A104:EE_|IA0PR12MB7505:EE_ X-MS-Office365-Filtering-Correlation-Id: a0d246cc-3d9a-47d6-a7c8-08dbefaf9bd4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 0M7Fb2vvetAxAvm8jiB5tbZQEI6iVqcsYpfaEA3zEsiALOhDuaF797tilJBPELEl+U+ad6TWyf3ZfmK9DwGx1Wy8fMqVz2yiYnGIxnq6//bi+EKD67RQvH750lJtrke34J4o9h0Wsrx7f9J2Ep8Ia0KpMyKFKplJdi8vRuyeIApLyysbfd5HoRTOCjoWw3psUiJgr6qxUcFsuF658sKgRi2dODVV9RfELz4XSKOoPzi9fVSpPRia+jaWUpcD/ucGoXUinSfcB+62O5s3XN5OM9HWjsYSda8o+bsHOxbh78gO3d+4onu9n9LxqUEvE7J2Vd2wP415CYzu2Xwz/85mPL9qmZ3wnEJ1Ph8O/dznqT6wd+Ed50JpexiVw6AcPobpxREkoJL1wMaUNX/ZRLXsennEUtd2KVTwiqUziKbqOozjRvP3OfDo9nRHTrzm1XIwZyuZDbcz2dA8xdt1vK6I2ODkUy2yuW6xJkoZmsdi3PaG+GWqzKGnLVGb+E1Hr5UKWBHUt5lMIRI6EVORR3ucdq47eNUTf14MgvYn7rxU7KzoDXIzDpAB9k/NmjmmeAUmiZQT29CCfHX/BTYOI76PQma0XhX3ROWXicjlXGSSVgmMqIsWPDRJTvg1G5jZB37dqa3l3NUsP6dxxy4jsU+QVLpWmLv2aY4xmF7z+1fS9ShkGXLFnnEwejeB01mSosuquTwVl94cz+QkBBSxGuLvTl16oby6n76hcBboT3AGDIQMYkHCgXR10Rx9mCqrqJ5O X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 01:16:11.3433 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0d246cc-3d9a-47d6-a7c8-08dbefaf9bd4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A104.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7505 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NfEndpEMQQtZOZVyB8OxkaRax7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Spam-Flag: yes X-Spam-Level: ************ X-GND-Spam-Score: 190 X-GND-Status: SPAM Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=YxB4HbcR; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io -Fix incorrect URI issue. There is missing "/" while StartUpFeatureDriver() recursively calls itself. -Fix typo. -Update function name to follow the naming style. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../RedfishFeatureCoreDxe.h | 5 +- .../RedfishFeatureCoreDxe.c | 51 ++++++++++--------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h index 93139af2..acefa41b 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h @@ -27,8 +27,9 @@ =20 #define MaxNodeNameLength 64 #define MaxParentUriLength 512 -#define NodeSeperator L'/' -#define UriSeperator L';' +#define NodeSeparator L'/' +#define NodeSeparatorStr L"/" +#define UriSeparator L';' #define NodeIsCollectionLeftBracket L'{' #define NodeIsCollectionRightBracket L'}' #define NodeIsCollectionSymbol L"/{}" diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c index e2ae125f..51d0387c 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c @@ -20,13 +20,13 @@ RESOURCE_INFORMATION_EXCHANGE *mInformationExchange; Setup the information to deliver to child feature/collection driver. =20 @param[in] ThisList REDFISH_FEATURE_INTERNAL_DATA insta= nce. - @param[in] ParentConfgLanguageUri Parent configure language URI. + @param[in] ParentConfigLanguageUri Parent configure language URI. =20 **/ EFI_STATUS SetupExchangeInformationInfo ( IN REDFISH_FEATURE_INTERNAL_DATA *ThisList, - IN EFI_STRING ParentConfgLanguageUri + IN EFI_STRING ParentConfigLanguageUri ) { ThisList->InformationExchange->SendInformation.ParentUri =3D (EFI_STRING= )AllocateZeroPool (MaxParentUriLength * sizeof (CHAR16)); @@ -52,7 +52,7 @@ SetupExchangeInformationInfo ( // // Setup parent config language URI // - StrCpyS (ThisList->InformationExchange->SendInformation.ParentUri, MaxPa= rentUriLength, ParentConfgLanguageUri); + StrCpyS (ThisList->InformationExchange->SendInformation.ParentUri, MaxPa= rentUriLength, ParentConfigLanguageUri); =20 // // Full config language URI @@ -63,7 +63,7 @@ SetupExchangeInformationInfo ( ThisList->InformationExchange->SendInformation.ParentUri ); if (StrLen (ThisList->InformationExchange->SendInformation.FullUri) !=3D= 0) { - StrCatS (ThisList->InformationExchange->SendInformation.FullUri, MaxPa= rentUriLength, L"/"); + StrCatS (ThisList->InformationExchange->SendInformation.FullUri, MaxPa= rentUriLength, NodeSeparatorStr); } =20 StrCatS (ThisList->InformationExchange->SendInformation.FullUri, MaxPare= ntUriLength, ThisList->InformationExchange->SendInformation.PropertyName); @@ -77,7 +77,7 @@ SetupExchangeInformationInfo ( =20 **/ EFI_STATUS -DestroryExchangeInformation ( +DestroyExchangeInformation ( IN REDFISH_FEATURE_INTERNAL_DATA *ThisList ) { @@ -111,7 +111,7 @@ DestroryExchangeInformation ( } =20 /** - Startup child feature drivers and it's sibing feature drivers. + Startup child feature drivers and it's sibling feature drivers. =20 @param[in] ThisFeatureDriverList This feature driver list. @param[in] CurrentConfigLanguageUri The current parent configure langua= ge URI. @@ -121,7 +121,7 @@ DestroryExchangeInformation ( VOID StartUpFeatureDriver ( IN REDFISH_FEATURE_INTERNAL_DATA *ThisFeatureDriverList, - IN EFI_STRING CurrentConfigLanguageUri, + IN EFI_STRING CurrentConfigLanguageUri OPTIONAL, IN REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext ) { @@ -131,6 +131,10 @@ StartUpFeatureDriver ( REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList; EFI_STRING NextParentUri; =20 + if ((ThisFeatureDriverList =3D=3D NULL) || (StartupContext =3D=3D NULL))= { + return; + } + NextParentUri =3D (EFI_STRING)AllocateZeroPool (MaxParentUriLength * siz= eof (CHAR16)); if (NextParentUri =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for parent configure= language.\n", __func__)); @@ -174,7 +178,7 @@ StartUpFeatureDriver ( // Copy RESOURCE_INFORMATION_RETURNED then destroy the exchange = information. // CopyConfiglanguageList (&ThisList->InformationExchange->Returned= Information.ConfigureLanguageList, &ConfigLangList); - DestroryExchangeInformation (ThisList); + DestroyExchangeInformation (ThisList); // // Modify the collection instance according to the returned Info= rmationTypeCollectionMemberConfigLanguage. // @@ -192,6 +196,7 @@ StartUpFeatureDriver ( return; } } else { + StrCatS (NextParentUri, MaxParentUriLength, NodeSeparatorStr); StrCatS (NextParentUri, MaxParentUriLength, ThisList->NodeName); StartUpFeatureDriver (ThisList->ChildList, NextParentUri, StartupC= ontext); } @@ -205,7 +210,7 @@ StartUpFeatureDriver ( NextParentUri[0] =3D 0; } } else { - DestroryExchangeInformation (ThisList); + DestroyExchangeInformation (ThisList); } =20 // @@ -340,7 +345,7 @@ NewInternalInstance ( REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; =20 if ((PtrToNewInternalData =3D=3D NULL) || (NodeName =3D=3D NULL)) { - DEBUG ((DEBUG_ERROR, "%a: Inproper given parameters\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Improper given parameters\n", __func__)); return EFI_INVALID_PARAMETER; } =20 @@ -373,7 +378,7 @@ NewInternalInstance ( Insert the URI node into internal data structure =20 @param[in] HeadEntryToInsert The head entry to start the searchi= ng. - @param[in] PrevisouEntry Previsou entry. + @param[in] PreviousEntry Previous entry. @param[in] NodeName Name of URI node. @param[in] NodeIsCollection TRUE means the node to add is the c= ollection node. Otherwise it is a resource node. @@ -390,7 +395,7 @@ NewInternalInstance ( EFI_STATUS InsertRedfishFeatureUriNode ( IN REDFISH_FEATURE_INTERNAL_DATA *HeadEntryToInsert, - IN REDFISH_FEATURE_INTERNAL_DATA **PrevisouEntry, + IN REDFISH_FEATURE_INTERNAL_DATA **PreviousEntry, IN EFI_STRING NodeName, IN BOOLEAN NodeIsCollection, IN OUT REDFISH_FEATURE_INTERNAL_DATA **NextNodeEntry, @@ -422,10 +427,10 @@ InsertRedfishFeatureUriNode ( if ((HeadEntryToInsert =3D=3D NULL) && (ResourceUriNodeList =3D=3D NUL= L)) { ResourceUriNodeList =3D NewInternalData; } else { - (*PrevisouEntry)->ChildList =3D NewInternalData; + (*PreviousEntry)->ChildList =3D NewInternalData; } =20 - *PrevisouEntry =3D NewInternalData; + *PreviousEntry =3D NewInternalData; *NextNodeEntry =3D NewInternalData->ChildList; return EFI_SUCCESS; } @@ -439,12 +444,12 @@ InsertRedfishFeatureUriNode ( if (StrCmp ((CONST CHAR16 *)ThisInternalData->NodeName, (CONST CHAR16 = *)NodeName) =3D=3D 0) { *MatchNodeEntry =3D ThisInternalData; *NextNodeEntry =3D ThisInternalData->ChildList; - *PrevisouEntry =3D ThisInternalData; + *PreviousEntry =3D ThisInternalData; return EFI_SUCCESS; } =20 // - // If sibing exist? + // If sibling exist? // if (SiblingList =3D=3D NULL) { Status =3D NewInternalInstance (&NewInternalData, NodeName, NodeIsCo= llection); @@ -453,7 +458,7 @@ InsertRedfishFeatureUriNode ( } =20 ThisInternalData->SiblingList =3D NewInternalData; - *PrevisouEntry =3D NewInternalData; + *PreviousEntry =3D NewInternalData; *NextNodeEntry =3D NewInternalData->ChildList; return EFI_SUCCESS; } @@ -483,7 +488,7 @@ InsertRedfishFeatureUriNode ( on Redfish resource which is managed by= this Redfish feature driver. @param[in] Context The context of the registering feature = driver. The pointer - to the conext is delivered through call= back function. + to the context is delivered through cal= lback function. @retval EFI_SUCCESS Redfish feature driver is registered su= ccessfully. @retval EFI_SUCCESS Redfish feature driver is registered su= ccessfully. @retval EFI_INVALID_PARAMETER Improper given parameters or fail to re= gister @@ -535,8 +540,8 @@ RedfishFeatureRegister ( } =20 NodeName[Index - AnchorIndex] =3D *(FeatureManagedUri + Index); - if ((NodeName[Index - AnchorIndex] =3D=3D NodeSeperator) || (NodeName[= Index - AnchorIndex] =3D=3D UriSeperator) || (NodeName[Index - AnchorIndex]= =3D=3D (CHAR16)0)) { - if (NodeName[Index - AnchorIndex] =3D=3D UriSeperator) { + if ((NodeName[Index - AnchorIndex] =3D=3D NodeSeparator) || (NodeName[= Index - AnchorIndex] =3D=3D UriSeparator) || (NodeName[Index - AnchorIndex]= =3D=3D (CHAR16)0)) { + if (NodeName[Index - AnchorIndex] =3D=3D UriSeparator) { NewUri =3D TRUE; } =20 @@ -554,7 +559,7 @@ RedfishFeatureRegister ( Index +=3D (StrLen (NodeIsCollectionSymbol)); AnchorIndex +=3D (StrLen (NodeIsCollectionSymbol)); ItsCollection =3D TRUE; - if (*(FeatureManagedUri + Index) =3D=3D UriSeperator) { + if (*(FeatureManagedUri + Index) =3D=3D UriSeparator) { NewUri =3D TRUE; } } @@ -569,7 +574,7 @@ RedfishFeatureRegister ( =20 if (NewUri || ((Index + 1) >=3D UriLength)) { // - // Setup the callabck and restart the searching for the + // Setup the callback and restart the searching for the // next URI. // if (MatchNodeEntry !=3D NULL) { @@ -639,7 +644,7 @@ EDKII_REDFISH_FEATURE_PROTOCOL mRedfishFeatureProtocol= =3D { @param[in] ImageHandle Image handle this driver. @param[in] SystemTable Pointer to SystemTable. =20 - @retval EFI_SUCESS This function always complete successfully. + @retval EFI_SUCCESS This function always complete successfully. =20 **/ EFI_STATUS --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111775): https://edk2.groups.io/g/devel/message/111775 Mute This Topic: https://groups.io/mt/102842987/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-