#
504af5a0 |
| 03-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <p
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
d7857201 |
| 28-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is largely just taking the clang-recommended fixes and checking them in. Subsequent patches will fix the more unique issues.
Note, that a number of new ignores are added into the .clang-tidy file. These can be cleaned up over time as they're understood. The majority are places where boost includes a impl/x.hpp and x.hpp, but expects you to use the later. include-cleaner opts for the impl, but it isn't clear why.
Change-Id: Id3fdd7ee6df6c33b2fd35626898523048dd51bfb Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
40e9b92e |
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This pa
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This patchset does not intend to modify any intent on any existing copyrights or licenses, only to standardize their inclusion.
[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects
Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
deae6a78 |
| 11-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Move getProperty calls to utility
Having all dbus calls run through the same utility reduces the amount of generated code, and more importantly, gives us a place where we can log the requests and re
Move getProperty calls to utility
Having all dbus calls run through the same utility reduces the amount of generated code, and more importantly, gives us a place where we can log the requests and responses to help with debugging.
Tested: Redfish service validator passes.
Change-Id: Ic1bf45130b5069cd57f7af26e12c8d3159c87c67 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
bd79bce8 |
| 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
5a39f77a |
| 20-Oct-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I2f9540cf0d545a2da4d6289fc87b754f684bc9a7 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
62598e31 |
| 17-Jul-2023 |
Ed Tanous <ed@tanous.net> |
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level of compile time checks, it needs to be a method, instead of the stream style logging we had before. This requires a pretty substantial change. Fortunately, this change can be largely automated, via the script included in this commit under scripts/replace_logs.py. This is to aid people in moving their patchsets over to the new form in the short period where old patches will be based on the old logging. The intention is that this script eventually goes away.
The old style logging (stream based) looked like.
BMCWEB_LOG_DEBUG << "Foo " << foo;
The new equivalent of the above would be: BMCWEB_LOG_DEBUG("Foo {}", foo);
In the course of doing this, this also cleans up several ignored linter errors, including macro usage, and array to pointer deconstruction.
Note, This patchset does remove the timestamp from the log message. In practice, this was duplicated between journald and bmcweb, and there's no need for both to exist.
One design decision of note is the addition of logPtr. Because the compiler can't disambiguate between const char* and const MyThing*, it's necessary to add an explicit cast to void*. This is identical to how fmt handled it.
Tested: compiled with logging meson_option enabled, and launched bmcweb
Saw the usual logging, similar to what was present before: ``` [Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled [Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800 [Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist [Info src/webserver_main.cpp:59] Starting webserver on port 18080 [Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file. [Info src/webserver_main.cpp:137] Start Hostname Monitor Service... ``` Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8
show more ...
|
#
82f80326 |
| 10-Jul-2023 |
Konstantin Aladyshev <aladyshev22@gmail.com> |
Omit Slot "Lanes" property if it is equal to 0
In the context of a PCIeSlot the 0 value for the 'Lanes' property means undefined. According to the bmcweb guidelines, DBus properties with "unknown"/"
Omit Slot "Lanes" property if it is equal to 0
In the context of a PCIeSlot the 0 value for the 'Lanes' property means undefined. According to the bmcweb guidelines, DBus properties with "unknown"/"unspecified" values should be omitted from the Redfish tree. Therefore don't populate 'Lanes' property if it is equal to 0.
Tested: validator passed
Change-Id: Ic3d142dd8b10da2367d73c370d5480208ba1510a Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
show more ...
|
#
cf3b484e |
| 27-Jun-2023 |
Lakshmi Yadlapati <lakshmiy@us.ibm.com> |
Refactor redfishPcieGenerationFromDbus and redfishSlotType
This commit refactors the redfishPcieGenerationFromDbus and redfishSlotType functions by changing their return types. The return value std:
Refactor redfishPcieGenerationFromDbus and redfishSlotType
This commit refactors the redfishPcieGenerationFromDbus and redfishSlotType functions by changing their return types. The return value std::nullopt indicates that there is no output, while the return value pcie_device::PCIeTypes::Invalid indicates that the input was invalid and returns an internal error. Additionally, the code that calls these functions has been updated to accommodate the changes.
Tested: Validator passed
Change-Id: I3f7c1a3c8c6b53fd9a39928e3ad9a5fed9be97ff Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
show more ...
|
#
c49c329d |
| 19-Apr-2023 |
Lakshmi Yadlapati <lakshmiy@us.ibm.com> |
Move PCIe functions to common file
Move redfishPcieGenerationFromDbus, called from both pcie.hpp and pcie_slots.hpp, and busSlotTypeToRf functions, called from pcie_slots.hpp, to a common PCIe utili
Move PCIe functions to common file
Move redfishPcieGenerationFromDbus, called from both pcie.hpp and pcie_slots.hpp, and busSlotTypeToRf functions, called from pcie_slots.hpp, to a common PCIe utility file.
In the future commit, when integrating PCIeSlot with PCIeDevice, we will call the busSlotTypeToRf function from pcie.hpp, so having it in the common utility file will make it readily available.
Tested: build successful, no additional testing needed.
Change-Id: I6286bd5547ddafa6eac4f224ac56f6d790a44c7a Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
show more ...
|
#
d87fdd9e |
| 02-May-2023 |
Lakshmi Yadlapati <lakshmiy@us.ibm.com> |
Fix internal error caused by unknown PCIe SlotType
Previously, when the SlotType field of a PCIeSlot object in D-Bus was set to xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.Unknown, pcie_sl
Fix internal error caused by unknown PCIe SlotType
Previously, when the SlotType field of a PCIeSlot object in D-Bus was set to xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.Unknown, pcie_slots was returning an internal service error. This commit updates the code to not return the SlotType if it is unknown.
Tested: Validator passed
''' busctl get-property -j xyz.openbmc_project.Inventory.Manager \ /xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane1/nvme5 \ xyz.openbmc_project.Inventory.Item.PCIeSlot SlotType { "type" : "s", "data" : "xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.Unknown" }
curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots { "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots", "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots", "Id": "1", "Name": "PCIe Slot Information", "Slots": [ { "HotPluggable": false, "Lanes": 0 }, ..... }
busctl get-property -j xyz.openbmc_project.Inventory.Manager \ /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot9 \ xyz.openbmc_project.Inventory.Item.PCIeSlot SlotType { "type" : "s", "data" : "xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.FullLength" }
curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots { "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots", "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots", "Id": "1", "Name": "PCIe Slot Information", "Slots": [ { "HotPluggable": false, "Lanes": 0 "SlotType": "FullLength" }, ..... } '''
Change-Id: Ib7399cebcb8dd4f9f19014d4d2154bc77e9dc999 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
show more ...
|
#
ef4c65b7 |
| 24-Apr-2023 |
Ed Tanous <edtanous@google.com> |
Boost::urls::format
Boost 1.82 dropped a lovely new toy, boost::urls::format, which is a lot like our urlFromPieces method, but better in that it makes the resulting uris more readable, and allows d
Boost::urls::format
Boost 1.82 dropped a lovely new toy, boost::urls::format, which is a lot like our urlFromPieces method, but better in that it makes the resulting uris more readable, and allows doing things like fragments in a single line instead of multiple. We should prefer it in some cases.
Tested: Redfish service validator passes. Spot checks of URLs work as expected. Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia7b38f0a95771c862507e7d5b4aa68aa1c98403c
show more ...
|
#
bbf372a6 |
| 02-May-2023 |
Lakshmi Yadlapati <lakshmiy@us.ibm.com> |
Fix invalid PCIeType in pcie_slots
When the Generation field of a PCIeSlot object in D-Bus is set to "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown", pcie_slots was returning an in
Fix invalid PCIeType in pcie_slots
When the Generation field of a PCIeSlot object in D-Bus is set to "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown", pcie_slots was returning an invalid PCIeType of "false". This caused the Redfish validator to fail. To resolve this, the code has been updated to not return the PCIeType if the Generation field is empty or unknown.
Tested: Validator passed ''' busctl get-property -j xyz.openbmc_project.Inventory.Manager \ /xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/nvme0 \ xyz.openbmc_project.Inventory.Item.PCIeSlot Generation { "type" : "s", "data" : "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown" }
curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots { "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots", "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots", "Id": "1", "Name": "PCIe Slot Information", "Slots": [ { "HotPluggable": false, "Lanes": 0, "SlotType": "U2" }, ..... }
busctl set-property xyz.openbmc_project.Inventory.Manager \ /xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/nvme0 \ xyz.openbmc_project.Inventory.Item.PCIeSlot Generation s \ xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen1
curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots { "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots", "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots", "Id": "1", "Name": "PCIe Slot Information", "Slots": [ { "HotPluggable": false, "Lanes": 0, "PCIeType": "Gen1", "SlotType": "U2" }, .... } '''
Change-Id: I143ce7e90cf24447a667a09d946e42f00c091a64 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
show more ...
|
#
89492a15 |
| 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I75f89d2959b0f1338c20d72ad669fbdc1d720835 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
6c3e9451 |
| 02-Mar-2023 |
George Liu <liuxiwei@inspur.com> |
Refactor getAssociationEndPoints method
Since the getAssociationEndPoints method has been implemented in dbus_utility and this commit is to integrate all the places where the endpoints attribute is
Refactor getAssociationEndPoints method
Since the getAssociationEndPoints method has been implemented in dbus_utility and this commit is to integrate all the places where the endpoints attribute is obtained, and use the method in dbus_utility uniformly.
Tested: 1. Redfish Validator Passed 2. For all the endpoints we changed, we got the same result as before
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I91a5e80de5bc3b5712c2d5b81f2f8b982d1c884e
show more ...
|
#
5e7e2dc5 |
| 16-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a co
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a copy in some cases.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae
show more ...
|
#
4ce2c1b5 |
| 10-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Make pcie_slots compile
This code doesn't compile; Including it in redfish.hpp, even if it's not used, ensures that we keep code compiling.
Tested: Code compiles. No functional impact.
Signed-of
Make pcie_slots compile
This code doesn't compile; Including it in redfish.hpp, even if it's not used, ensures that we keep code compiling.
Tested: Code compiles. No functional impact.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia1009416a692b9700998d6329a297a6754076cf0
show more ...
|
#
e99073f5 |
| 08-Dec-2022 |
George Liu <liuxiwei@inspur.com> |
Refactor GetSubTree method
Since the GetSubTree method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTree method is called, and use the method i
Refactor GetSubTree method
Since the GetSubTree method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTree method is called, and use the method in dbus_utility uniformly.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: If3852b487d74e7cd8f123e0efffbd4affe92743c
show more ...
|
#
3ccb3adb |
| 13-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't catch most of these.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic741fbb2cc9e5e92955fd5a1b778a482830e80e8
show more ...
|
#
0ec8b83d |
| 14-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Generate Redfish enums from schemas
OpenBMC tends to have a significant problem in doing the appropriate lookups from the schema files, and many bugs have been injected by users picking a bad enum,
Generate Redfish enums from schemas
OpenBMC tends to have a significant problem in doing the appropriate lookups from the schema files, and many bugs have been injected by users picking a bad enum, or mistyping the casing of an enum value.
At the same time, nlohmann::json has recently added first class support for enums, https://json.nlohmann.me/features/enum_conversion/
This commit attempts to build a set of redfish includes file with all the available Redfish enums in an easy to use enum class. This makes it very clear which enums are supported by the schemas we produce, and adds very little to no extra boilerplate on the human-written code we produced previously.
Note, in the generated enum class, because of our use of the clang-tidy check for macros, the clang-tidy check needs an exception for these macros that don't technically follow the coding standard. This seems like a reasonable compromise, and in this case, given that nlohmann doesn't support a non-macro version of this.
One question that arises is what this does to the binary size.... Under the current compiler optimizations, and with the current best practices, it leads to an overall increase in binary size of ~1200 bytes for the enum machinery, then approximately 200 bytes for every call site we switch over. We should decide if this nominal increase is reasonable.
Tested: Redfish protocol validator runs with same number of failures as previously. Redfish Service Validator passes (one unrelated qemu-specific exception)
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7c7ee4db0823f7c57ecaa59620b280b53a46e2c1
show more ...
|
#
d1bde9e5 |
| 07-Sep-2022 |
Krzysztof Grobelny <krzysztof.grobelny@intel.com> |
used sdbusplus::unpackPropertiesNoThrow part 8
used sdbusplus::unpackPropertiesNoThrow in other places, also replaced all usages of "GetAll" with sdbusplus::asio::getAllProperties
bmcweb size:
used sdbusplus::unpackPropertiesNoThrow part 8
used sdbusplus::unpackPropertiesNoThrow in other places, also replaced all usages of "GetAll" with sdbusplus::asio::getAllProperties
bmcweb size: 2697640 -> 2685336 (-12304) compressed size: 1129728 -> 1126078 (-3650)
Tested: - Executed redfish service validator, no new errors detected
Change-Id: I916e462e004fcbde67c209daef295de8f5fb68eb Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
show more ...
|
#
d8a5d5d8 |
| 05-Aug-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
Update content of ResourceNotFound/ResourceAlreadyExists message
According to Redfish Base Message Registry definition [1], the first argument of ResourceNotFound and ResourceAlreadyExists is the sc
Update content of ResourceNotFound/ResourceAlreadyExists message
According to Redfish Base Message Registry definition [1], the first argument of ResourceNotFound and ResourceAlreadyExists is the schema name of the resource. This patch changes the first argument to non- versioned schema name treewide.
Tested: Verified the error message matches the definition, and Redfish Service Validator passed.
[1] https://redfish.dmtf.org/registries/Base.1.13.0.json
Change-Id: Ib5cd853578ef0bffda1184d10827241e94faaf68 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
2aacf856 |
| 17-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Fix PCIeSlots build
This got caught up in a tree wide change to setUPRedfishRoute. Make the fix.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I55c0b1e5e0f57853
Fix PCIeSlots build
This got caught up in a tree wide change to setUPRedfishRoute. Make the fix.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I55c0b1e5e0f578533903385bc80e87efa0bad08f
show more ...
|
#
7691cc2f |
| 25-Jan-2021 |
Chicago Duan <duanzhijia01@inspur.com> |
Implement Redfish PCIeSlots schema
PCIeSlotCollection, and PCIeSlot schemas are used for determining and inspecting the PCIe physical topology of a system. It is used to determine what a particular
Implement Redfish PCIeSlots schema
PCIeSlotCollection, and PCIeSlot schemas are used for determining and inspecting the PCIe physical topology of a system. It is used to determine what a particular physical slots formfactor is.
This commit supports the as documented in Redfish.md.
https://redfish.dmtf.org/schemas/PCIeSlots_v1.xml
Tested: Validator passes (on previous patchset) 1、Get PCIe slots curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PCIeSlots { "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots", "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots", "Id": "PCIeSlots", "Name": "PCIe Slot Information", "Slots": [ { "HotPluggable": false, "Lanes": 16, "PCIeType": "Gen1", "SlotType": "FullLength" }, { "HotPluggable": false, "Lanes": 16, "PCIeType": "Gen2", "SlotType": "OEM" } ] }
2、No PCIeSlots curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PCIeSlots { "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots", "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots", "Id": "PCIeSlots", "Name": "PCIe Slot Information", "Slots": [] }
3、Bad chassis ID return 404 curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/badChassisID/PCIeSlots Returns 404 and ResourceNotFound
Signed-off-by: Chicago Duan <duanzhijia01@inspur.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I11e1bf94b3865986cbd580293ea906fe96067912
show more ...
|