diff options
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor')
9 files changed, 419 insertions, 10 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0025-Add-Model-CoreCount-to-ProcessorSummary.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0025-Add-Model-CoreCount-to-ProcessorSummary.patch new file mode 100644 index 000000000..edf4d219e --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0025-Add-Model-CoreCount-to-ProcessorSummary.patch @@ -0,0 +1,288 @@ +From f4f15a52610d1a199ddac948c8f849df05d86151 Mon Sep 17 00:00:00 2001 +From: Ali Ahmed <ama213000@gmail.com> +Date: Fri, 3 Sep 2021 02:33:43 -0500 +Subject: [PATCH] Add Model & CoreCount to ProcessorSummary + +In Redfish ComputerSystem schema, the ProcessorSummary parameter +lists summary information of the Processors on the system. This commit +adds the 'Model' and 'CoreCount' properties to ProcessorSummary. + +If the CPU Models are different, then the 'Model' field takes the first +entry in alphabetical order. + +Testing: +1. Redfish Validator Testing successfully passed. +2. Curl testing: + +curl -k -H "X-Auth-Token: $tok" https://$bmc/redfish/v1/Systems/system + +... + "ProcessorSummary": { + "CoreCount": 24, + "Count": 2, + "Model": "test_name", + "Status": { + "Health": "OK", + "HealthRollup": "OK", + "State": "Disabled" + } + }, +... + +Change-Id: I39cbf6ed35c35ce3a3551c9689237d5023775326 +Signed-off-by: Ali Ahmed <ama213000@gmail.com> +Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> +--- + redfish-core/lib/systems.hpp | 229 ++++++++++++++++++++++------------- + 1 file changed, 147 insertions(+), 82 deletions(-) + +diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp +index 680a0ee..3b5f9e4 100644 +--- a/redfish-core/lib/systems.hpp ++++ b/redfish-core/lib/systems.hpp +@@ -139,6 +139,152 @@ inline void + } + } + ++inline void getProcessorProperties( ++ const std::shared_ptr<bmcweb::AsyncResp>& aResp, const std::string& service, ++ const std::string& path, ++ const std::vector<std::pair< ++ std::string, std::variant<std::string, uint64_t, uint32_t, uint16_t>>>& ++ properties) ++{ ++ ++ BMCWEB_LOG_DEBUG << "Got " << properties.size() << " Cpu properties."; ++ ++ auto getCpuPresenceState = ++ [aResp](const boost::system::error_code ec3, ++ const std::variant<bool>& cpuPresenceCheck) { ++ if (ec3) ++ { ++ BMCWEB_LOG_ERROR << "DBUS response error " << ec3; ++ return; ++ } ++ modifyCpuPresenceState(aResp, cpuPresenceCheck); ++ }; ++ ++ auto getCpuFunctionalState = ++ [aResp](const boost::system::error_code ec3, ++ const std::variant<bool>& cpuFunctionalCheck) { ++ if (ec3) ++ { ++ BMCWEB_LOG_ERROR << "DBUS response error " << ec3; ++ return; ++ } ++ modifyCpuFunctionalState(aResp, cpuFunctionalCheck); ++ }; ++ ++ // Get the Presence of CPU ++ crow::connections::systemBus->async_method_call( ++ std::move(getCpuPresenceState), service, path, ++ "org.freedesktop.DBus.Properties", "Get", ++ "xyz.openbmc_project.Inventory.Item", "Present"); ++ ++ // Get the Functional State ++ crow::connections::systemBus->async_method_call( ++ std::move(getCpuFunctionalState), service, path, ++ "org.freedesktop.DBus.Properties", "Get", ++ "xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional"); ++ ++ for (const auto& property : properties) ++ { ++ if (property.first == "Family") ++ { ++ // Get the CPU Model ++ const std::string* modelStr = ++ std::get_if<std::string>(&property.second); ++ if (!modelStr) ++ { ++ BMCWEB_LOG_DEBUG << "Failed to get CPU Family"; ++ // Skip it and continue with other properties ++ continue; ++ } ++ if ((*modelStr).size() < 1) ++ { ++ BMCWEB_LOG_DEBUG << "Empty CPU Family info, skipping..."; ++ continue; ++ } ++ nlohmann::json& prevModel = ++ aResp->res.jsonValue["ProcessorSummary"]["Model"]; ++ std::string* prevModelPtr = prevModel.get_ptr<std::string*>(); ++ ++ // If CPU Models are different, use the first entry in ++ // alphabetical order ++ ++ // If Model has never been set ++ // before, set it to *modelStr ++ if (prevModelPtr == nullptr) ++ { ++ prevModel = *modelStr; ++ } ++ // If Model has been set before, only change if new Model is ++ // higher in alphabetical order ++ else ++ { ++ if (*modelStr < *prevModelPtr) ++ { ++ prevModel = *modelStr; ++ } ++ } ++ } ++ else if (property.first == "CoreCount") ++ { ++ // Get CPU CoreCount and add it to the total ++ const uint16_t* coreCountVal = ++ std::get_if<uint16_t>(&property.second); ++ ++ if (!coreCountVal) ++ { ++ BMCWEB_LOG_DEBUG << "Failed to get CPU Core count"; ++ // Skip it and continue with other properties ++ continue; ++ } ++ ++ nlohmann::json& coreCount = ++ aResp->res.jsonValue["ProcessorSummary"]["CoreCount"]; ++ uint64_t* coreCountPtr = coreCount.get_ptr<uint64_t*>(); ++ ++ if (coreCountPtr == nullptr) ++ { ++ coreCount = *coreCountVal; ++ } ++ else ++ { ++ *coreCountPtr += *coreCountVal; ++ } ++ } ++ } ++} ++ ++/* ++ * @brief Get ProcessorSummary fields ++ * ++ * @param[in] aResp Shared pointer for completing asynchronous calls ++ * @param[in] service dbus service for Cpu Information ++ * @param[in] path dbus path for Cpu ++ * ++ * @return None. ++ */ ++inline void getProcessorSummary(const std::shared_ptr<bmcweb::AsyncResp>& aResp, ++ const std::string& service, ++ const std::string& path) ++{ ++ ++ crow::connections::systemBus->async_method_call( ++ [aResp, service, ++ path](const boost::system::error_code ec2, ++ const std::vector<std::pair< ++ std::string, std::variant<std::string, uint64_t, uint32_t, ++ uint16_t>>>& properties) { ++ if (ec2) ++ { ++ BMCWEB_LOG_ERROR << "DBUS response error " << ec2; ++ messages::internalError(aResp->res); ++ return; ++ } ++ getProcessorProperties(aResp, service, path, properties); ++ }, ++ service, path, "org.freedesktop.DBus.Properties", "GetAll", ++ "xyz.openbmc_project.Inventory.Item.Cpu"); ++} ++ + /* + * @brief Retrieves computer system properties over dbus + * +@@ -309,88 +455,7 @@ inline void + BMCWEB_LOG_DEBUG + << "Found Cpu, now get its properties."; + +- crow::connections::systemBus->async_method_call( +- [aResp, service{connection.first}, +- path](const boost::system::error_code ec2, +- const std::vector< +- std::pair<std::string, VariantType>>& +- properties) { +- if (ec2) +- { +- BMCWEB_LOG_ERROR +- << "DBUS response error " << ec2; +- messages::internalError(aResp->res); +- return; +- } +- BMCWEB_LOG_DEBUG << "Got " +- << properties.size() +- << " Cpu properties."; +- +- auto getCpuPresenceState = +- [aResp]( +- const boost::system::error_code ec3, +- const std::variant<bool>& +- cpuPresenceCheck) { +- if (ec3) +- { +- BMCWEB_LOG_ERROR +- << "DBUS response error " +- << ec3; +- return; +- } +- modifyCpuPresenceState( +- aResp, cpuPresenceCheck); +- }; +- +- auto getCpuFunctionalState = +- [aResp]( +- const boost::system::error_code ec3, +- const std::variant<bool>& +- cpuFunctionalCheck) { +- if (ec3) +- { +- BMCWEB_LOG_ERROR +- << "DBUS response error " +- << ec3; +- return; +- } +- modifyCpuFunctionalState( +- aResp, cpuFunctionalCheck); +- }; +- +- // Get the Presence of CPU +- crow::connections::systemBus +- ->async_method_call( +- std::move(getCpuPresenceState), +- service, path, +- "org.freedesktop.DBus." +- "Properties", +- "Get", +- "xyz.openbmc_project.Inventory." +- "Item", +- "Present"); +- +- // Get the Functional State +- crow::connections::systemBus +- ->async_method_call( +- std::move(getCpuFunctionalState), +- service, path, +- "org.freedesktop.DBus." +- "Properties", +- "Get", +- "xyz.openbmc_project.State." +- "Decorator." +- "OperationalStatus", +- "Functional"); +- +- // Get the MODEL from +- // xyz.openbmc_project.Inventory.Decorator.Asset +- // support it later as Model is Empty +- // currently. +- }, +- connection.first, path, +- "org.freedesktop.DBus.Properties", "GetAll", +- "xyz.openbmc_project.Inventory.Item.Cpu"); ++ getProcessorSummary(aResp, connection.first, path); + + cpuHealth->inventory.emplace_back(path); + } +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend index 7806b5481..b810190a1 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend @@ -28,6 +28,7 @@ SRC_URI += "file://0001-Firmware-update-configuration-changes.patch \ file://0021-Add-message-registry-entry-for-FirmwareResiliencyErr.patch \ file://0023-Add-get-IPMI-session-id-s-to-Redfish.patch \ file://0024-Add-count-sensor-type.patch \ + file://0025-Add-Model-CoreCount-to-ProcessorSummary.patch \ " # OOB Bios Config: @@ -79,10 +80,6 @@ do_install:append() { install -d ${D}/etc/ssl/certs/authority } -# Temporary fix:Enable new power and thermal subsystem -EXTRA_OEMESON += " -Dredfish-new-powersubsystem-thermalsubsystem=enabled" -EXTRA_OEMESON += " -Dredfish-allow-deprecated-power-thermal=disabled" - # Enable PFR support EXTRA_OEMESON += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', '-Dredfish-provisioning-feature=enabled', '', d)}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb index 770870f1e..592d6ae0c 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb @@ -2,7 +2,7 @@ SUMMARY = "libmctp:intel" DESCRIPTION = "Implementation of MCTP(DMTF DSP0236)" SRC_URI = "git://github.com/Intel-BMC/libmctp.git;protocol=ssh" -SRCREV = "52117fa04e6afabe8eb1285c702f1400fecfb992" +SRCREV = "d530c2271e1f9ff5d76a170c0abd64bd03ef40fd" S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb index 128f6b544..b55c7edc1 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "c76742e725d7a1ebbee8a2d95168da8a53f0b2e1" +SRCREV = "83350af0d36cfc9440e73c0ec430d177704cdeba" S = "${WORKDIR}/git/mctp_emulator" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb index 10dd1cf29..412bd1430 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "c76742e725d7a1ebbee8a2d95168da8a53f0b2e1" +SRCREV = "83350af0d36cfc9440e73c0ec430d177704cdeba" S = "${WORKDIR}/git/mctp_wrapper" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb index 4ab99cae9..bc7f6c8ec 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb @@ -5,7 +5,11 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${PN}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "c76742e725d7a1ebbee8a2d95168da8a53f0b2e1" +SRCREV = "83350af0d36cfc9440e73c0ec430d177704cdeba" + +SRC_URI:append = "\ + file://0001-mctpd-pcie-Don-t-try-to-register-ourselves-as-a-remo.patch \ + " S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd/0001-mctpd-pcie-Don-t-try-to-register-ourselves-as-a-remo.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd/0001-mctpd-pcie-Don-t-try-to-register-ourselves-as-a-remo.patch new file mode 100644 index 000000000..58f4a6b94 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd/0001-mctpd-pcie-Don-t-try-to-register-ourselves-as-a-remo.patch @@ -0,0 +1,120 @@ +From 4df4b592b1dc4fb0c333e69881593bae1164ae40 Mon Sep 17 00:00:00 2001 +From: Iwona Winiarska <iwona.winiarska@intel.com> +Date: Tue, 5 Oct 2021 22:37:15 +0200 +Subject: [PATCH] mctpd: pcie: Don't try to register ourselves as a remote + endpoint + +BMC reads routing tables returned by MCTP bus owner and bridges and uses +it to resolve endpoint ID and provide basic information about endpoints +in MCTP network. +Our endpoint is not a remote endpoint and we don't need +to query any information about ourselves over the network. +Let's skip registering BMC as a remote endpoint to avoid sending packets +to ourselves. + +Add a negative test case verifying that BMC is not exposed on D-Bus. +Fix existing tests that check if endpoints are registered correctly by +skipping endpoint that equals own endpoint ID. + +Tested: +Verified if we don't skip registering BMC as a remote endpoint unit test +with the new test case fail. If the fix is applied, all tests pass. + +Change-Id: I41dd56bd5793f717b4983ef0a47c0b94ab80db0a +Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> +--- + mctpd/src/PCIeBinding.cpp | 9 ++++++++- + mctpd/tests/test-pcie_binding-devices.cpp | 23 ++++++++++++++++++++++- + 2 files changed, 30 insertions(+), 2 deletions(-) + +diff --git a/mctpd/src/PCIeBinding.cpp b/mctpd/src/PCIeBinding.cpp +index 44c01d9..5f40382 100644 +--- a/mctpd/src/PCIeBinding.cpp ++++ b/mctpd/src/PCIeBinding.cpp +@@ -339,11 +339,18 @@ void PCIeBinding::processRoutingTableChanges( + if (find(routingTable.begin(), routingTable.end(), routingEntry) == + routingTable.end()) + { ++ mctp_eid_t remoteEid = std::get<0>(routingEntry); ++ ++ if (remoteEid == ownEid) ++ { ++ continue; ++ } ++ + std::vector<uint8_t> prvDataCopy = prvData; + mctp_astpcie_pkt_private* pciePrivate = + reinterpret_cast<mctp_astpcie_pkt_private*>(prvDataCopy.data()); + pciePrivate->remote_id = std::get<1>(routingEntry); +- registerEndpoint(yield, prvDataCopy, std::get<0>(routingEntry), ++ registerEndpoint(yield, prvDataCopy, remoteEid, + getBindingMode(routingEntry)); + } + } +diff --git a/mctpd/tests/test-pcie_binding-devices.cpp b/mctpd/tests/test-pcie_binding-devices.cpp +index 2d7823f..b717beb 100644 +--- a/mctpd/tests/test-pcie_binding-devices.cpp ++++ b/mctpd/tests/test-pcie_binding-devices.cpp +@@ -228,10 +228,22 @@ class PCIeDevicePopulationTest : public PCIeDiscoveredTestBase, + std::vector<EndpointParam> endpoints; + }; + ++TEST_P(PCIeDevicePopulationTest, VeirfyOwnEidNotRegistered) ++{ ++ for (const auto& iface : bus->backdoor.interfaces) ++ { ++ ASSERT_NE(iface->path, "/xyz/openbmc_project/mctp/device/" + ++ std::to_string(assignedEid)); ++ } ++} ++ + TEST_P(PCIeDevicePopulationTest, VerifyEndpointInterface) + { + for (const auto& endpoint : endpoints) + { ++ if (endpoint.eid == assignedEid) ++ continue; ++ + auto endpointIface = bus->backdoor.get_interface( + endpoint.path, mctp_endpoint::interface); + +@@ -246,6 +258,9 @@ TEST_P(PCIeDevicePopulationTest, VerifyMsgTypesInterface) + { + for (const auto& endpoint : endpoints) + { ++ if (endpoint.eid == assignedEid) ++ continue; ++ + auto msgTypesIface = bus->backdoor.get_interface( + endpoint.path, mctp_msg_types::interface); + +@@ -263,6 +278,9 @@ TEST_P(PCIeDevicePopulationTest, VerifyUuidInterface) + { + for (const auto& endpoint : endpoints) + { ++ if (endpoint.eid == assignedEid) ++ continue; ++ + auto uuidIface = bus->backdoor.get_interface( + endpoint.path, "xyz.openbmc_project.Common.UUID"); + +@@ -292,6 +310,9 @@ TEST_P(PCIeDevicePopulationTest, OddDevicesRemoved) + // Verify that proper EIDs are left + for (auto& endpoint : endpoints) + { ++ if (endpoint.eid == assignedEid) ++ continue; ++ + auto ifacesCount = std::count_if( + bus->backdoor.interfaces.begin(), bus->backdoor.interfaces.end(), + [&](auto& iface) { return endpoint.path == iface->path; }); +@@ -316,4 +337,4 @@ TEST_P(PCIeDevicePopulationTest, OddDevicesRemoved) + } + + INSTANTIATE_TEST_SUITE_P(AddRemovalTests, PCIeDevicePopulationTest, +- ::testing::Values(2, 10, 100, 200, 254)); +\ No newline at end of file ++ ::testing::Values(2, 10, 100, 200, 254)); +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb index 87ac63624..53c3c5568 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=615045c30a05cde5c0e924854d43c327" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "c76742e725d7a1ebbee8a2d95168da8a53f0b2e1" +SRCREV = "83350af0d36cfc9440e73c0ec430d177704cdeba" S = "${WORKDIR}/git/mctpwplus" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb index dc4c03ae8..700d0f6c3 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "c76742e725d7a1ebbee8a2d95168da8a53f0b2e1" +SRCREV = "83350af0d36cfc9440e73c0ec430d177704cdeba" S = "${WORKDIR}/git/pmci_launcher" |