summaryrefslogtreecommitdiff
path: root/redfish-core/lib/memory.hpp
AgeCommit message (Collapse)AuthorFilesLines
2021-06-03Remove Redfish Node classJohn Edward Broadbent1-70/+33
Reduces the total number of lines and will allow for easier testing of the redfish responses. A main purpose of the node class was to set app.routeDynamic(). However now app.routeDynamic can handle the complexity that was once in critical to node. The macro app.routeDynamic() provides a shorter cleaner interface to the unerlying app.routeDyanic call. The old pattern set permissions for 6 interfaces (get, head, patch, put, delete_, and post) even if only one interface is created. That pattern creates unneeded code that can be safely removed with no effect. Unit test for the responses would have to mock the node the class in order to fully test responses. see https://github.com/openbmc/bmcweb/issues/181 The following files still need node to be extracted. virtual_media.hpp account_service.hpp redfish_sessions.hpp ethernet.hpp The files above use a pattern that is not trivial to address. Often their responses call an async lambda capturing the inherited class. ie (https://github.com/openbmc/bmcweb/blob/ffed87b5ad1797ca966d030e7f979770 28d258fa/redfish-core/lib/account_service.hpp#L1393) At a later point I plan to remove node from the files above. Tested: I ran the docker unit test with the following command. WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb ./openbmc-build-scripts/run-unit-test-docker.sh I ran the validator and this change did not create any issues. python3 RedfishServiceValidator.py -c config.ini Signed-off-by: John Edward Broadbent <jebr@google.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I147a0289c52cb4198345b1ad9bfe6fdddf57f3df
2021-04-21bmcweb:Check for dimm presense for State AttributeJoshi-Mansi1-0/+15
The state attribute was showing Enabled even if dimm was not present. Added Present property under Inventory Item interface to read the dimm presence and accordingly populate jsonValue["Status"]["State"] to Enabled or Absent. Tested: -Get of redfish/v1/Systems/system/Memory/dimm shows correct State values in both the cases. -Redfish validator passed. Signed-off-by: Joshi-Mansi <mansi.joshi@linux.intel.com> Change-Id: I0629fffcc8ca5abf09dd645af6640341d37e446e
2021-04-21Redfish : Return after InternalError instead of ContinueChicago Duan1-33/+33
"After setting response to internal error you should stop adding more content to response. Try to return instead of continuing a loop" https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/39970/9/redfish-core/lib/pcie_slots.hpp#169 Signed-off-by: Chicago Duan <duanzhijia01@inspur.com> Change-Id: Iadd3062ba7fef31ba61eea1e79eb3a903716b9e9
2021-04-08Using AsyncResp everywherezhanghch051-19/+19
Get the core using AsyncResp everywhere, and not have each individual handler creating its own object.We can call app.handle() without fear of the response getting ended after the first tree is done populating. Don't use res.end() anymore. Tested: 1. Validator passed. Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8
2021-02-22Add additional Redfish Memory propertiesSunnySrivastava19841-1/+36
This commit adds the following properties to the memory schema on bmcweb. a) LocationCode, a free form, implementation-defined string to provide the location of the DIMM. This is needed so an implementation can identify the DIMM via system diagrams and such. b) Model, maps to a CCIN/Card ID for IBM's implementation, is a string for the manufacturer's part model. For IBM's implementation, it is a four-digit value assigned for each possible FRU. c) SparePartNumber, also field-replaceable unit (FRU) Part Number, is a part number that identifies the FRU for replacement specifically ordering of a new part. Redfish validator has been executed on this change and no new error was found. Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com> Change-Id: I419a9cd8e956de3fbf7093903129389ad5e0e577
2020-11-26Memory: Remove if (*memorySize == 0)Gunnar Mills1-9/+0
Sent to mailing list here: https://lists.ozlabs.org/pipermail/openbmc/2020-October/023744.html Remove the if MemorySizeInKB is 0 set the "Status""State" to Absent and return. More work needed here to make Present and Functional work correctly. Tested: Validator passes. curl -k https://$bmc/redfish/v1/Systems/system/Memory/dimm6 { "@odata.id": "/redfish/v1/Systems/system/Memory/dimm6", "@odata.type": "#Memory.v1_7_0.Memory", "AllowedSpeedsMHz": [], "BaseModuleType": "RDIMM", "BusWidthBits": 0, "CapacityMiB": 0, "DataWidthBits": 0, "ErrorCorrection": "NoECC", "FirmwareRevision": "0", "Id": "dimm6", "Manufacturer": "Micron Technology", "Name": "DIMM Slot", "OperatingSpeedMhz": 0, "PartNumber": "", "RankCount": 0, "SerialNumber": "0x156d5d4f", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" } Change-Id: I40ab44b1cb5db266d0766501a6f625168baaa2a6 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-10-30Memory: Fix potential validator errorGunnar Mills1-8/+111
"Other" and "Unknown" are not valid Redfish MemoryDeviceType values. Do correct converting D-Bus enum to redfish. Straight mapping (D-Bus and Redfish both contain the same name): DDR DDR2 DDR3 DDR4 DDR4E_SDRAM LPDDR4_SDRAM LPDDR3_SDRAM DDR2_SDRAM_FB_DIMM DDR2_SDRAM_FB_DIMM_PROBE (no E on the end of the d-bus name) DDR_SGRAM ROM SDRAM EDO FastPageMode PipelinedNibble Logical HBM HBM2 The following D-Bus values are not mapped: Other Unknown DRAM EDRAM VRAM SRAM RAM FLASH EEPROM FEPROM EPROM CDRAM ThreeDRM RDRAM FBD2 LPDDR_SDRAM LPDDR2_SDRAM The following Redfish values don't have a mapping to: "DDR4_SDRAM" "DDR3_SDRAM" "DDR_SDRAM" "DDR2_SDRAM" Saw this because not setting the MemoryType so defaulting to "Other" and had removed the logic to leave off all other memory properties when MemorySizeInKB is 0 (commit above). IBM systems are not setting MemorySizeInKB so it is defaulting to 0 hence why this validator error has not been seen in CI. The validator error was "ERROR - MemoryDeviceType: Invalid Enum value 'Other' found, expected ['DDR', 'DDR2', 'DDR3', 'DDR4', 'DDR4_SDRAM', 'DDR4E_SDRAM', 'LPDDR4_SDRAM', 'DDR3_SDRAM', 'LPDDR3_SDRAM', 'DDR2_SDRAM', 'DDR2_SDRAM_FB_DIMM', 'DDR2_SDRAM_FB_DIMM_PROBE', 'DDR_SGRAM', 'DDR_SDRAM', 'ROM', 'SDRAM', 'EDO', 'FastPageMode', 'PipelinedNibble', 'Logical', 'HBM', 'HBM2']" https://github.com/openbmc/phosphor-dbus-interfaces/blob/1e8c11bf2656ed4a5fb27baa2dec3a65763bb47e/xyz/openbmc_project/Inventory/Item/Dimm.interface.yaml#L120 Tested: Passes the validator. Sent this property on D-Bus to different values. Change-Id: I629a1acd81fa6648893b7f531dfaab413cc2dd8f Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-10-23Turn on ALL perf checksEd Tanous1-1/+1
1st, alphabetize the tidy-list for good housekeeping. Next, enable all the clang-tidy performance checks, and resolve all the issues. most of the issues boil down to: 1. Using std::move on const variables. This does nothing. 2. Passing big variables (like std::string) by value. 3. Using double quotes on a find call, which constructs an intermediate string, rather than using the character overload. Tested Loaded on system, logged in successfully and pulled down webui-vue. No new errors. Walked the Redfish tree a bit, and observed no new problems. Ran redfish service validator. Got no new failures (although there are a lot of log service deprecation warnings that we should look at). Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I2238958c4b22c1e554e09a0a1787c744bdbca43e
2020-10-16Fix up Function to Populate collection MembersGunnar Mills1-2/+3
Added Doxygen comments, renamed the funciton, renamed several variables, and made more generic. Tested: Top commit passes validator and resources look good. Change-Id: I9a13176b7f4c8611ae38c6563b0e119e0f66edf2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-10-16cpudimm.hpp: Separate Memory and Processor functionalityGunnar Mills1-0/+817
To match other files move Redfish Memory classes and functions to a separate memory.hpp file. This naming "memory" (after the Redfish schemas) matches other filenames. Do the same with Processor classes and functions, moving to a separate processor.hpp. cpudimm.hpp had grown to 1300+ lines. Makes development and review easier. Tested: Validator passes. Resources look the same. Change-Id: I7e23ecaf9b4b69cc72aad6d94ad3a555ee76b28a Signed-off-by: Gunnar Mills <gmills@us.ibm.com>