From 337bc89eef8652d8694366393dd02766c288a31b Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Mon, 29 Nov 2021 14:50:20 -0800 Subject: Update to internal 0.77-8 Signed-off-by: Jason M. Bills --- ...-logs-to-isolate-the-coredump-issue-of-RT.patch | 261 ------------------- .../network/phosphor-network_%.bbappend | 3 +- ...5-Add-Model-CoreCount-to-ProcessorSummary.patch | 288 +++++++++++++++++++++ .../recipes-phosphor/interfaces/bmcweb_%.bbappend | 5 +- .../recipes-phosphor/pmci/libmctp-intel_git.bb | 2 +- .../recipes-phosphor/pmci/mctp-emulator.bb | 2 +- .../recipes-phosphor/pmci/mctp-wrapper.bb | 2 +- .../meta-common/recipes-phosphor/pmci/mctpd.bb | 6 +- ...Don-t-try-to-register-ourselves-as-a-remo.patch | 120 +++++++++ .../meta-common/recipes-phosphor/pmci/mctpwplus.bb | 2 +- .../recipes-phosphor/pmci/pmci-launcher.bb | 2 +- 11 files changed, 420 insertions(+), 273 deletions(-) delete mode 100644 meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0005-Added-debug-logs-to-isolate-the-coredump-issue-of-RT.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0025-Add-Model-CoreCount-to-ProcessorSummary.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd/0001-mctpd-pcie-Don-t-try-to-register-ourselves-as-a-remo.patch diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0005-Added-debug-logs-to-isolate-the-coredump-issue-of-RT.patch b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0005-Added-debug-logs-to-isolate-the-coredump-issue-of-RT.patch deleted file mode 100644 index 255ae4836..000000000 --- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0005-Added-debug-logs-to-isolate-the-coredump-issue-of-RT.patch +++ /dev/null @@ -1,261 +0,0 @@ -From f898e4512e7907ba185a1178ad36cb7af6ad0811 Mon Sep 17 00:00:00 2001 -From: sureshv1 -Date: Tue, 10 Aug 2021 16:38:42 +0530 -Subject: [PATCH] Added Debug logs to isolate coredump of RTNETLink Packet - Processing Clang Format updated - -Tested: -Flashed the BMC firmware image with logs included and observed that -the logs are logged during the boot up time and not flooding serial -console.After the BMC is booted up, logs were logged in when ever a -RT Net Link Packet is received and not flooding the journalctl logs. - -Change-Id: I5e1d152b18df17e5351c498210dae5c45f551f7b -Signed-off-by: sureshv1 ---- - src/network_manager.cpp | 15 ++++++++ - src/network_manager_main.cpp | 12 +++++++ - src/rtnetlink_server.cpp | 70 ++++++++++++++++++++++++++++++++++++ - 3 files changed, 97 insertions(+) - -diff --git a/src/network_manager.cpp b/src/network_manager.cpp -index 2f5097a..ec48f2a 100644 ---- a/src/network_manager.cpp -+++ b/src/network_manager.cpp -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -26,6 +27,8 @@ constexpr char SYSTEMD_PATH[] = "/org/freedesktop/systemd1"; - constexpr char SYSTEMD_INTERFACE[] = "org.freedesktop.systemd1.Manager"; - constexpr auto FirstBootFile = "/var/lib/network/firstBoot_"; - -+constexpr bool debug = true; -+ - namespace phosphor - { - namespace network -@@ -273,6 +276,12 @@ void Manager::createInterfaces() - - void Manager::createChildObjects() - { -+ if (debug) -+ { -+ std::cout -+ << "Create Child Objects called(restart system conf and DHCP conf)" -+ << "\n"; -+ } - // creates the ethernet interface dbus object. - createInterfaces(); - -@@ -289,6 +298,12 @@ void Manager::createChildObjects() - objPath /= "dhcp"; - dhcpConf = std::make_unique( - bus, objPath.string(), *this); -+ -+ if (debug) -+ { -+ std::cout << "Create Child Objects Exiting" -+ << "\n"; -+ } - } - - ObjectPath Manager::vlan(IntfName interfaceName, uint32_t id) -diff --git a/src/network_manager_main.cpp b/src/network_manager_main.cpp -index 983616f..c9bdb15 100644 ---- a/src/network_manager_main.cpp -+++ b/src/network_manager_main.cpp -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - #include - #ifdef SYNC_MAC_FROM_INVENTORY - #include -@@ -41,6 +42,8 @@ constexpr auto configFile = "/usr/share/network/config.json"; - constexpr auto invNetworkIntf = - "xyz.openbmc_project.Inventory.Item.NetworkInterface"; - -+constexpr bool debug = true; -+ - namespace phosphor - { - namespace network -@@ -255,10 +258,19 @@ void restartNetwork() - - void initializeTimers() - { -+ if (debug) -+ std::cout -+ << "Initialize Timer for Refresh Object Timer and Restart Timer" -+ << "\n"; -+ - auto event = sdeventplus::Event::get_default(); - refreshObjectTimer = - std::make_unique(event, std::bind(refreshObjects)); - restartTimer = std::make_unique(event, std::bind(restartNetwork)); -+ -+ if (debug) -+ std::cout << "Initialize Timer Exiting" -+ << "\n"; - } - - } // namespace network -diff --git a/src/rtnetlink_server.cpp b/src/rtnetlink_server.cpp -index 07ca08c..74f08b3 100644 ---- a/src/rtnetlink_server.cpp -+++ b/src/rtnetlink_server.cpp -@@ -11,12 +11,15 @@ - #include - #include - -+#include - #include - #include - #include - #include - #include - -+constexpr bool debug = true; -+ - namespace phosphor - { - namespace network -@@ -29,6 +32,9 @@ namespace rtnetlink - - static bool shouldRefresh(const struct nlmsghdr& hdr, std::string_view data) - { -+ if (debug) -+ std::cout << "Should Refresh the Received Header with Data" -+ << "\n"; - switch (hdr.nlmsg_type) - { - case RTM_NEWADDR: -@@ -36,22 +42,43 @@ static bool shouldRefresh(const struct nlmsghdr& hdr, std::string_view data) - case RTM_NEWROUTE: - case RTM_DELROUTE: - { -+ if (debug) -+ std::cout << "Don't Copy Data as the Message Type is:" -+ << hdr.nlmsg_type << "\n"; - return true; - } - case RTM_NEWNEIGH: - case RTM_DELNEIGH: - { -+ if (debug) -+ std::cout << "Message Type is" << hdr.nlmsg_type << "\n"; - struct ndmsg ndm; - if (data.size() < sizeof(ndm)) - { -+ if (debug) -+ std::cout << "Data Size:" << data.size() -+ << " NDM Size:" << sizeof(ndm) << "\n"; - return false; - } -+ if (debug) -+ std::cout -+ << "Processing/Copying the received Data for MLMSG_TYPE:" -+ << hdr.nlmsg_type << " Data Size:" << data.size() << "\n"; - memcpy(&ndm, data.data(), sizeof(ndm)); -+ if (debug) -+ std::cout << "Copied the received Data for MLMSG_TYPE:" -+ << hdr.nlmsg_type -+ << " and NDM Message Size is:" << sizeof(ndm) << "\n"; - // We only want to refresh for static neighbors - return ndm.ndm_state & NUD_PERMANENT; - } - } - -+ if (debug) -+ std::cout << "Should Refresh Object is verified and done without any " -+ "known header type" -+ << "\n"; -+ - return false; - } - -@@ -62,25 +89,58 @@ static int eventHandler(sd_event_source* /*es*/, int fd, uint32_t /*revents*/, - char buffer[phosphor::network::rtnetlink::BUFSIZE]{}; - int len{}; - -+ if (debug) -+ std::cout << "\n" -+ << "RTNETLINK event Handler is called to read the RTNETLINK " -+ "Packet and Refresh it for a buffer size:" -+ << phosphor::network::rtnetlink::BUFSIZE << "\n"; - auto netLinkHeader = reinterpret_cast(buffer); - while ((len = recv(fd, netLinkHeader, phosphor::network::rtnetlink::BUFSIZE, - 0)) > 0) - { -+ if (debug) -+ { -+ std::cout << "Received the Packet with a Length:" << len << "\n"; -+ } - for (; (NLMSG_OK(netLinkHeader, len)) && - (netLinkHeader->nlmsg_type != NLMSG_DONE); - netLinkHeader = NLMSG_NEXT(netLinkHeader, len)) - { -+ if (debug) -+ std::cout << "NetLinkHeader Message Type is:" -+ << netLinkHeader->nlmsg_type -+ << " with total length(len):" << len -+ << " and block data packet " -+ "length(netLinkHeader->nlmsg_len - NLMSG_HDRLEN):" -+ << netLinkHeader->nlmsg_len - NLMSG_HDRLEN -+ << " and Message Length(netLinkHeader->nlmsg_len):" -+ << netLinkHeader->nlmsg_len << "\n"; - std::string_view data( - reinterpret_cast(NLMSG_DATA(netLinkHeader)), - netLinkHeader->nlmsg_len - NLMSG_HDRLEN); -+ if (debug) -+ { -+ if (netLinkHeader) -+ std::cout << "NetLinkHeader is valid" -+ << "\n"; -+ } - if (shouldRefresh(*netLinkHeader, data)) - { - // starting the timer here to make sure that we don't want - // create the child objects multiple times. -+ if (debug) -+ std::cout << "Check Refresh Object Timer is enabled?" -+ << "\n"; - if (!refreshObjectTimer->isEnabled()) - { - // if start timer throws exception then let the application - // crash -+ if (debug) -+ std::cout -+ << "Call Restart Once with a Timeout seconds:" -+ << std::chrono::seconds(refreshTimeout).count() -+ << "\n"; -+ - refreshObjectTimer->restartOnce(refreshTimeout); - } // end if - } // end if -@@ -89,6 +149,16 @@ static int eventHandler(sd_event_source* /*es*/, int fd, uint32_t /*revents*/, - - } // end while - -+ if (debug) -+ { -+ std::cout << "RTNETLINK Event Handler completed read of packets and " -+ "processed it" -+ << " with an length(exit):" << len << "\n"; -+ -+ if (errno) -+ std::cout << "Error Number:" << errno << "\n"; -+ } -+ - return 0; - } - --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend index 63746d8be..6dc864deb 100644 --- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend @@ -3,11 +3,10 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" DEPENDS += "nlohmann-json boost" SRC_URI = "git://github.com/openbmc/phosphor-networkd" -SRCREV = "2c0fc568057c5575a75ad638ea91bc8c65b57160" +SRCREV = "205cc104cced7bca2521825b987dc7041d961a65" SRC_URI += " file://0003-Adding-channel-specific-privilege-to-network.patch \ file://0004-Fix-for-updating-MAC-address-from-RedFish.patch \ - file://0005-Added-debug-logs-to-isolate-the-coredump-issue-of-RT.patch \ " EXTRA_OECONF:append = " --enable-nic-ethtool=yes" 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 +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 +Signed-off-by: AppaRao Puli +--- + 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& aResp, const std::string& service, ++ const std::string& path, ++ const std::vector>>& ++ properties) ++{ ++ ++ BMCWEB_LOG_DEBUG << "Got " << properties.size() << " Cpu properties."; ++ ++ auto getCpuPresenceState = ++ [aResp](const boost::system::error_code ec3, ++ const std::variant& 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& 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(&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(); ++ ++ // 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(&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(); ++ ++ 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& 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>>& 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>& +- 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& +- 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& +- 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 +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 +--- + 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 prvDataCopy = prvData; + mctp_astpcie_pkt_private* pciePrivate = + reinterpret_cast(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 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" -- cgit v1.2.3