Age | Commit message (Collapse) | Author | Files | Lines |
|
phophor-dbus-interfaces changes the default of lanesInUse to MAXINT by
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/53650
Thus bmcweb also changes the logic to show the field as null if it is
MAXINT.
Change-Id: Ib229112374eb5a65e0a8ac97669c09c498ac26c7
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
In the early days of bmcweb, we made two pretty critical assumptions;
First, is that a given platform would only have a single BMC instance
(represented as "bmc") and a single host instance (represented as
"system").
Second we assumed that, given that Redfish suggests against hardcoding
URIs in client implementation and leaves them freeform, clients would
code to the standard.
Our own webui-vue hardcodes Redfish URIs [1], and the documentation is
littered with examples of hardcoded curl examples of hardcoding these
URIs. That bug was filed in 2020, and the issue has only gotten worse
over time.
This patchset is an attempt to give a target that we can start solving
these issues, without trying to boil the ocean and fix all clients in
parallel.
This commit adds the meson options
redfish-manager-uri-name
and
redfish-system-uri-name
These are used to control the "name" that bmcweb places in the fixed
locations in the ManagerCollection and ComputerSystemCollection schemas.
Note, managers is added, but is not currently testable. It will be
iterated on over time.
Tested:
Changed the URL options to "edsbmc" and "edssystem" in meson options.
Redfish service validator passes.
URLs appear changed when walking the tree.
[1] https://github.com/openbmc/webui-vue/issues/43
Change-Id: I4b44685067051512bd065da8c2e3db68ae5ce23a
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
The configuration options that exist in bmcweb are an amalgimation of
CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms
and meson options using a config file. This history has led to a lot of
different ways to configure code in the codebase itself, which has led
to problems, and issues in consistency.
ifdef options do no compile time checking of code not within the branch.
This is good when you have optional dependencies, but not great when
you're trying to ensure both options compile.
This commit moves all internal configuration options to:
1. A namespace called bmcweb
2. A naming scheme matching the meson option. hyphens are replaced with
underscores, and the option is uppercased. This consistent transform
allows matching up option keys with their code counterparts, without
naming changes.
3. All options are bool true = enabled, and any options with _ENABLED or
_DISABLED postfixes have those postfixes removed. (note, there are
still some options with disable in the name, those are left as-is)
4. All options are now constexpr booleans, without an explicit compare.
To accomplish this, unfortunately an option list in config/meson.build
is required, given that meson doesn't provide a way to dump all options,
as is a manual entry in bmcweb_config.h.in, in addition to the
meson_options. This obsoletes the map in the main meson.build, which
helps some of the complexity.
Now that we've done this, we have some rules that will be documented.
1. Runtime behavior changes should be added as a constexpr bool to
bmcweb_config.h
2. Options that require optionally pulling in a dependency shall use an
ifdef, defined in the primary meson.build. (note, there are no
options that currently meet this class, but it's included for
completeness.)
Note, that this consolidation means that at configure time, all options
are printed. This is a good thing and allows direct comparison of
configs in log files.
Tested: Code compiles
Server boots, and shows options configured in the default build. (HTTPS,
log level, etc)
Change-Id: I94e79a56bcdc01755036e4e7278c7e69e25809ce
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Change-Id: If511f1210cca7bd1da3a8c5152688487d3036e2f
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Clang has new checks for std::move/std::forward correctness, which
catches quite a few "wrong" things where we were making copies of
callback handlers.
Unfortunately, the lambda syntax of
callback{std::forward<Callback>(callback)}
in a capture confuses it, so change usages to
callback = std::forward<Callback>(callback)
to be consistent.
Tested: Redfish service validator passes.
Change-Id: I7a111ec00cf78ecb7d5f5b102c786c1c14d74384
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
This commit refactors the code in the PCIeDeviceList function to use the
getCollectionMembers function for retrieving collection members.
Additionally, a new function getCollectionToKey() is added to
handle the retrieval of collection members with custom key name.
Tested: Validator passed
'''
Test1: Redfish query of PCI devices on a system that does not have
any PCIe devices
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices",
"@odata.type": "#PCIeDeviceCollection.PCIeDeviceCollection",
"Description": "Collection of PCIe Devices",
"Members": [],
"Members@odata.count": 0,
"Name": "PCIe Device Collection"
}
Test2: Redfish query of PCIe devices on a system that has PCIe devices
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices",
"@odata.type": "#PCIeDeviceCollection.PCIeDeviceCollection",
"Description": "Collection of PCIe Devices",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/drive0"
},
.......
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card2"
},
.......
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card12"
}
],
"Members@odata.count": 22,
"Name": "PCIe Device Collection"
}
Test3: Redfish query of system with PCIe devices
curl -k https://$bmc/redfish/v1/Systems/system
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
"Actions": {
"#ComputerSystem.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo",
"target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset"
}
},
......
"PCIeDevices": [
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/drive0"
},
.......
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1"
},
....
],
"PCIeDevices@odata.count": 22,
"PartNumber": "",
....
"SubModel": "S0",
"SystemType": "Physical"
}
'''
Change-Id: Icb38945a2c7bc5219ff3917fbbc8a9986c9c6155
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
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>
|
|
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
|
|
This code was added in 543f9a75a0819ca9e3541b2c48fe8b4d5cf6c4f7, which
in the description claimed to only be a refactor, but moved the
DeviceType record.
Because DeviceType is an enum in Redfish, and a string in PDI, some
amount of conversion is required, so this code can't be corrected
easily.
Remove the property for the moment.
Tested: Redfish Validator passes.
Change-Id: I60a68e45a69370112f454b1c520fde5b70ca8591
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
According to the Redfish Data Model specification PCIeInterface (v1.3+)
of the PCIeDevice model contains the following properties:
MaxLanes (v1.3+)
The number of PCIe lanes supported by this device.
- This property shall contain the maximum number of
PCIe lanes supported by this device.
MaxPCIeType (v1.3+)
The highest version of the PCIe specification supported by
this device.
- This property shall contain the maximum PCIe
specification that this device supports.
Since PCIeDevice interface from the phosphor-dbus-interfaces has these
values in the 'MaxLanes' and 'GenerationSupported' properties, populate
the fields to Redfish.
Tested: Redfish validator passed
Before:
redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
...
"PCIeInterface": {
"LanesInUse": 4,
"PCIeType": "Gen3"
},
...
}
After:
redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
...
"PCIeInterface": {
"LanesInUse": 4,
"MaxLanes": 4,
"MaxPCIeType": "Gen3",
"PCIeType": "Gen3"
},
...
}
Change-Id: Iec786e376cea8fd2aa516b5b2a3da4286e59627a
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
|
|
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>
|
|
According to the phosphor-dbus-interfaces 'LanesInUse' property in the
PCIeDevice interface has a 'size_t' type. But the current bmcweb code
uses 'int64_t' for that variable in the 'unpackPropertiesNoThrow' call.
This causes function to fail. Correct variable type to fix the issue.
Tested: validator passed
Before:
redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "Bus_c3_Device_00",
"Manufacturer": "Intel Corporation",
"Model": "",
"Name": "PCIe Device",
"PartNumber": "",
"SerialNumber": "",
"Status": {
"Health": "OK",
"State": "Enabled"
},
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request failed due to an internal service
error. The service is still operational.",
"MessageArgs": [],
"MessageId": "Base.1.16.0.InternalError",
"MessageSeverity": "Critical",
"Resolution": "Resubmit the request. If the problem persists,
consider resetting the service."
}
],
"code": "Base.1.16.0.InternalError",
"message": "The request failed due to an internal service error.
The service is still operational."
}
}
After:
redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/
Bus_c3_Device_00",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "Bus_c3_Device_00",
"Manufacturer": "Intel Corporation",
"Model": "",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/
Bus_c3_Device_00/PCIeFunctions"
},
"PCIeInterface": {
"DeviceType": "MultiFunction",
"LanesInUse": 4,
"PCIeType": "Gen3"
},
"PartNumber": "",
"SerialNumber": "",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
Change-Id: I3c7cda6027814ded5e85cfe3d37dbac1bbbc2044
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
|
|
To align with Redfish's transition from using the PCIeSlot schema to
including the Slot within the PCIeDevice schema, this commit adds PCIe
Slot information to the PCIeDevice schema. The corresponding PCIe Slot
is retrieved using the 'contained_by' association, which establishes a
link from the PCIeDevice object to the PCIeSlot object. If there is no
PCIeSlot associated with the PCIeDevice, the Slot properties will not
be returned.
Directed associations, ‘containing’ and ‘contained_by’, are used to
establish a link between PCIeDevice and PCIeSlot. The 'containing'
association establishes a link from a PCIeSlot to the PCIeDevice it
contains, while the 'contained_by' association establishes a link from
a PCIeDevice to the PCIeSlot that contains it.
Additionally, this commit refactors the PCIeDevice schema to improve
its structure, readability, and adherence to best practices.
Redfish commit:
https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_11_0.json
Tested: Validator Passed
'''
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card7
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card7",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7/PCIeFunctions"
},
"PCIeInterface": {
"LanesInUse": -1
},
"Slot": {
"Lanes": 0,
"SlotType": "FullLength"
},
"Status": {
"Health": "OK",
"State": "Absent"
}
}
PCIeDevice with no association:
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card0
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card0",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card0",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card0/PCIeFunctions"
},
"PCIeInterface": {
"LanesInUse": -1
},
"Status": {
"Health": "OK",
"State": "Absent"
}
}
'''
Change-Id: I15ac33be0035721f44c60fded795092896bce9bd
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
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>
|
|
The current implementation of PCIeDeviceCollection uses
getCollectionMembers to obtain the list of PCIe devices, but this method
does not include empty PCIe slots. To address this limitation and to
prepare for future changes that will include PCIe slot information,
this commit updates PCIeDeviceCollection to use getPCIeDeviceList instead.
While getPCIeDeviceList currently does the same as getCollectionMembers,
moving forward it will be expanded to include PCIe slot information.
Tested: Validator passed
Change-Id: I3ef9fbfa45acd782e99d31136469993a64616710
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
A number of discussions have occurred, and it's clear that
multi-computer system is not a transition that can be done in a single
series of commits, and needs to be done incrementally over time. This
commit adds the initial option for multi-computer system support, with
an option flag that can be enabled when the new behavior is desired.
This is to prevent needing a long-lived fork.
This option operatates such that if enabled, all ComputerSystem route
options will now return 404. This is to allow the redfish service
validator to pass, and to be used for incremental development. As the
routes are moved over, they will be enabled, and service validator
re-run.
Per the description in the meson options, this option flag, and all code
beneath of it will be removed on 9/1/23. The expectation is that by
this date, given the appropriate level of effort in implementation,
there will be no code remaining under that option flag. After this
date, code beneath this option flag will be removed.
Tested: No functional changes without option.
With option enabled, /redfish/v1/Systems produces no entries.
Spot check of various routes returns 404.
Redfish service validator passes.
Change-Id: I3b58642cb76d61df668076c2e0f1e7bed110ae25
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
This commit addresses the Redfish validator failure related to the URI
mismatch in PCIeFunction. The error reported that the URI
"/redfish/v1/Systems/system/PCIeDevices/pcie_card1/PCIeFunctions/" does
not match the required URI in the PCIeFunction schema.
Commit that introduced the Redfish validator failure:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/63853
Tested: validator passed
Change-Id: Ie96b7461ad64f9b1c6392e4905276a4fe7799781
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
This commit is to add Health information according to the Redfish
PCIeDevice schema.
ref: https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_9_0.json
Code that updates the OperationalStatus for all the inventory
https://github.com/openbmc/openpower-vpd-parser/blob/ \
3fb026386546cfd288ab4f86156c9aa0ffa145d6/ibm_vpd_app.cpp#L620
Tested: Validator passed
'''
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card8
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card8",
"Manufacturer": "",
"Model": "6B87",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8/PCIeFunctions"
},
"PCIeInterface": {
"LanesInUse": -1
},
"PartNumber": "03FL194",
"SerialNumber": "Y131UF09S00J",
"Slot": {
"Location": {
"PartLocation": {
"ServiceLabel": "U78DB.ND0.WZS0018-P0-C8"
}
}
},
"SparePartNumber": "03FL195",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
'''
Change-Id: I53026792d0c223c10065c58aef9f3b9dc04a24ed
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
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>
|
|
In about half of our code, AsyncResp objects take the name asyncResp,
and in the other half they take the name aResp. While the difference
between them is negligeble and arbitrary, having two naming conventions
makes it more difficult to do automated changes over time via grep.
This commit was generated automtatically with the command:
git grep -l 'aResp' | xargs sed -i 's|aResp|asyncResp|g'
Tested: Code compiles.
Change-Id: Id363437b6a78f51e91cbf60aa0a0c2286f36a037
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Currently, getPCIeDeviceList is only used by systems.hpp to obtain the
list of PCIe devices. However, there are plans to use this function in
other parts of the PCIe code as well. To better organize our code and
make the function more reusable, this commit moves getPCIeDeviceList to
pcie_util.hpp, a common location for PCIe-related utilities.
Tested:
'''
curl -k https://$bmc/redfish/v1/Systems/system
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
"Actions": {
"#ComputerSystem.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo",
"target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset"
}
},
.....
.....
"PCIeDevices": [
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/dp0_drive2"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/dp0_drive3"
},
.....
.....
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card0"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10"
},
.....
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card9"
}
],
"PCIeDevices@odata.count": 20,
.....
.....
'''
Change-Id: I3aaa5b55e8574929154ffd743db53da6fbaeb75d
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
When a non-existent PCIeFunctionId is queried, bmcweb
returns the success but with the incorrect output.
```
curl -k -X GET https://${bmc}:18080/redfish/v1/Systems/system/PCIeDevices/pcie_card1/PCIeFunctions/12
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1/PCIeFunctions/12",
"@odata.type": "#PCIeFunction.v1_2_3.PCIeFunction",
"FunctionId": 12,
"Id": "12",
"Links": {
"PCIeDevice": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1"
}
},
"Name": "PCIe Function"
}%
```
This should be resulted as
```
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type PCIeFunction named '12' was not found.",
```
Change-Id: If6a1453e3e549e07b6961ff80ebf37b0537e2b7c
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Atoi has the potential to cause crashes if users request non-integer
pcie function numbers. Replace with functional code.
Tested: WIP
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6742ff6b69e6df4a4afae26610effa01f2450b1b
|
|
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
|
|
This commit is to add state information according to the Redfish
PCIeDevice schema. Default state is "Enabled".
ref: https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_9_0.json
Tested: Validator passed
'''
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card8
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card8",
"Manufacturer": "",
"Model": "6B87",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8/PCIeFunctions"
},
"PCIeInterface": {
"LanesInUse": -1
},
"PartNumber": "03FL194",
"SerialNumber": "Y131UF09S00J",
"Slot": {
"Location": {
"PartLocation": {
"ServiceLabel": "U78DB.ND0.WZS0018-P0-C8"
}
}
},
"SparePartNumber": "03FL195",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
'''
Change-Id: Ibee01345c81c2e824fc2387c4f27e421b3f4c507
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Remove Manufacturer from the PCIeDevice's PCIeInterface and fix the
following Redfish validator error:
ERROR - Manufacturer not defined in Complex PCIeInterface
PCIeDevice.v1_3_0.PCIeInterface (check version, spelling and casing)
This error is because there is no ["PCIeInterface"]["Manufacturer"] at
https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_11_0.json.
"Manufacturer" is already part of the root PCIeDevice and is
implemented on line 219.
On the backend "Manufacturer" is already part of Asset interface so
remove it from PCIeDevice interface in peci-pcie and
phosphor-dbus-interface.
phosphor-dbus-interfaces commit:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/61738
peci-pcie commit:
https://gerrit.openbmc.org/c/openbmc/peci-pcie/+/62256
Tested:
```
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card10
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card10",
"Manufacturer": "",
"Model": "6B87",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10/PCIeFunctions"
},
"PCIeInterface": {
"LanesInUse": 16,
"PCIeType": "Gen4"
},
"PartNumber": "03FL204",
"SerialNumber": "YA31UF07200Z",
"Slot": {
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND0.WZS003T-P0-C10"
}
}
},
"SparePartNumber": "03FL205"
}
```
Change-Id: I860bf60f6fa3cc5d6b57f945d781e7dcafc17d7f
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
It seems like clang-tidy doesn't catch every place that an emplace could
be used instead of a push. Use a few grep/sed pairs to find and fix up
some common patterns.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I93eaec26b8e3be240599e92b66cf54947073dc4c
|
|
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>
|
|
The current call to getSubTreePaths is using a depth of 1, which limits
the search to only the direct children of the inventoryPath. However,
the interface may be found at any depth in the subtree, so the depth
parameter should be set to 0 to search the entire subtree, in order to
ensure that all relevant objects are included in the search results.
getValidPCIeDevicePath and getPCIeDeviceList should call getSubTreePaths with the same depth parameter value to ensure that the same level of the PCIe device tree is being searched for devices.
Tested: Validator passed
Change-Id: Ic990581ef186f4bf1511a221c4e305ff6c2afdf2
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Specify correct interface for getSubTreePaths in getPCIeDeviceList.
This commit addresses a Redfish validator failure that occurred after a
previous commit.
'''
https://github.com/openbmc/bmcweb/commit/94c3a10b94c3ce063d6c1aed3a597f0d524594d5
'''
Both the inventory path and interface were incorrect, and the inventory
path was fixed in the previous commit. This commit fixes the interface
in the getSubTreePaths function to ensure that it returns the correct
PCIeDevice list. Without the correct interface, the function was
returning incorrect devices, which was causing the Redfish validator
failure.
Tested: Validator passed for PCIeDevice
Change-Id: Iab6a26ee0dd933be6cf371bdd13e5d10d6d10efa
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Remove unused variable pcieService, fix pciePath and use global
variables pciePath and pcieDeviceInterface.
Tested: tested PCIeDeviceCollection and PCIeDevice, and tested
the changes with the peci-pcie commit
https://gerrit.openbmc.org/c/openbmc/peci-pcie/+/62100
Change-Id: Iff8aee3f8bc43740b1885a2da584b0e6cf579dcc
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
This commit publishes inventory properties like SparePartNumber,
Model, PartNumber, SerialNumber, Manufacturer for PCIe devices.
Tested: Validator passed
```
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card10",
"Manufacturer": "",
"Model": "6B87",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10/PCIeFunctions"
},
"PCIeInterface": {
"LanesInUse": 16,
"PCIeType": "Gen4"
},
"PartNumber": "03FL204",
"SerialNumber": "YA31UF07200Z",
"SparePartNumber": "03FL205"
```
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: I850fe5eb2b3b3b9d47f4256ce0c4408bb1dd2bd1
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Move SystemPCIeFunction to a separate method, and refactor the code.
Validate the PCIe device path and add link header.
Tested: Validator passed
```
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7/PCIeFunctions/0",
"@odata.type": "#PCIeFunction.v1_2_3.PCIeFunction",
"ClassCode": "0x020000",
"DeviceId": "0x1657",
"FunctionId": 0,
"Id": "0",
"Links": {
"PCIeDevice": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7"
}
},
"Name": "PCIe Function",
"RevisionId": "0x01",
"SubsystemId": "0x0420",
"SubsystemVendorId": "0x1014",
"VendorId": "0x14e4"
}
```
Change-Id: I99add03210983a255a615512b6137d04982f83a5
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Move SystemPCIeFunctionCollection to a separate method, and refactor
the code.
Validate the PCIe device path and add link header.
Tested: Validator passed
```
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7/PCIeFunctions",
"@odata.type": "#PCIeFunctionCollection.PCIeFunctionCollection",
"Description": "Collection of PCIe Functions for PCIe Device pcie_card7",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7/PCIeFunctions/0"
}
],
"Name": "PCIe Function Collection",
"PCIeFunctions@odata.count": 1
}
```
Change-Id: I5aa10ce0b4d2f20104612f840cf4098698a83470
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Move SystemPCIeDevice to a separate method, and refactor the code.
Validate the PCIe device path.
Tested: Validator passed
```# curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card7
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card7",
"Name": "PCIe Device",
"PCIeInterface": {
"LanesInUse": 4,
"PCIeType": "Gen1"
}
}
```
Change-Id: Ib9bd3ff37293b64adbf9987c3d932882befd21d4
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Move PCIe device interface to
"xyz.openbmc_project.Inventory.Item.PCIeDevice".
peci-pcie commit:
https://gerrit.openbmc.org/c/openbmc/peci-pcie/+/62100
Tested: Validator passed
Change-Id: Ica6f4ca37bf9adca18bedc69422ff05f0c7d73f2
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Similar to the code we've been building elsewhere, move
PCIeDeviceCollection system to a separate method, and use
getCollectionMembers.
Tested: Validator passed
```
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices",
"@odata.type": "#PCIeDeviceCollection.PCIeDeviceCollection",
"Description": "Collection of PCIe Devices",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/dp0_drive2"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/dp0_drive3"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card0"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1"
},
.....
.....
],
"Members@odata.count": 20,
"Name": "PCIe Device Collection"
}
```
Change-Id: Ib8d468f9163e49fc3767dd92b81e70b4d48e8867
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
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
|
|
Only id in event_service and account_service have not been updated due
to the risk of it breaking the username/id. It will require further
testing to verify.
Use urlFromPieces wherever that is needed to insert a variable in the
URI. Don't use urlFromPieces when it is hardcoded values. This allow us
to control all resource URIs that is dynamically added and to sync with
the current recommanded method for `@odata.id`. The goal is to have a
common place to manage the url created from dbus-paths in order to
manage/update it easily when needed.
Tested:
RedfishValidtor Passed for all resource including the sensors with the
fragments.
Change-Id: I95cdfaaee58fc7f21c95f5944e1e5c813b3215f2
Signed-off-by: Willy Tu <wltu@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Added Redfish property 'LanesInUse' to PCIeDevices under
redfish/v1/Systems. LanesInUse maps to dbus LanesInUse property for the
Inventory.Item.PCIeDevice interface. Note: GUI might map this property
to 'LinkWidth'
Tested:
1) Redfish validator passed
2) Curl testing
curl -k <token> \
https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card8
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
...
"PCIeInterface": {
"LanesInUse": 16,
"PCIeType": "Gen4"
},
...
}
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
Change-Id: I896abe44f55414f25d01c5a93a31bb585264657e
|
|
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
|
|
Since the GetSubTreePaths method has been implemented in dbus_utility
and this commit is to integrate all the places where the
GetSubTreePaths method is called, and use the method in dbus_utility
uniformly.
Requires https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/60020 to
build.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie4140d4484a7e4f4b943013f4371ffd2d44a22e9
|
|
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
|
|
GET /redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/<str>
return resourceNotFound messages.
Test:
GET /redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/<str>
return the expected information of PCIeDevices.
Signed-off-by: Tony Lee <tony.lee@quantatw.com>
Change-Id: I1587a74e77225939dec8030bba7fb04865e8051e
|
|
GET /redfish/v1/Systems/system/PCIeDevices/<str> nothing will be
returned if their 'generationInUse' is Unknown.
The original intention is that if it is Unknown, there is no need to
display '"PCIeType"'. But the others still have to show.
After fix:
PCIeType is not Unknown:
GET http://${bmc}/redfish/v1/Systems/system/PCIeDevices/<str>
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/<str>.",
"@odata.type": "#PCIeDevice.v1_4_0.PCIeDevice",
"DeviceType": "SingleFunction",
"Id": "<str>",
"Manufacturer": "Intel Corporation",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id":
"/redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions"
},
"PCIeInterface": {
"PCIeType": "Gen1"
}
}
PCIeType is Unknown:
GET http://${bmc}/redfish/v1/Systems/system/PCIeDevices/<str>
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/<str>",
"@odata.type": "#PCIeDevice.v1_4_0.PCIeDevice",
"DeviceType": "SingleFunction",
"Id": "<str>",
"Manufacturer": "Intel Corporation",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id":
"/redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions"
}
}
Signed-off-by: Tony Lee <tony.lee@quantatw.com>
Change-Id: I85a97e0370a5789e4526964272381a557ce942a0
|
|
It's obvious that we want to skip if the string is empty, not if it is
valid.
Tested: code compiles. Trivial change.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I892e81fb0f87a8999eb880100fd284419054eece
|
|
I believe this was a typo. We shouldn't return when a deviceId is not
found.
Tested: s7106 doesn't have PCIe backend configured. I tested it on
a downstream system and Members@odata.count shows up.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I38491caf8998fac5fafa0c0f07396cf32066348b
|
|
This is preliminary patch to set up the route handling such that it's
ready for the addition of multiple hosts, multiple managers in the
future. Routes previously took the form of
/redfish/v1/Systems/system
which essentially hardcoded the name "system" into a number of places.
As the stack evolves to support multiple systems, this needs to change.
This patchset changes all the ComputerSystem resources to the form:
/redfish/v1/Systems/<str>
and adds 404 checks to each route such that they will be handled
properly still. This means that as we evolve our multi-host support,
each individual route can be moved one at a time to support multi-host.
In the future, moving these to redfish-spec-defined routing would likely
mean that we could generate this code in the future at some point, which
reduces the likelihood that people do it incorrectly.
This patch currently sets the resource id and resource type in the
resourceNotFound message to empty string (""). This handling is still
arguably more correct than what we had before, which just returned 404
with an empty payload, although this will be corrected in the future.
Tested: None yet. RFC to see if this is a pattern we'd like to
propogate
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If9c07ad69f5287bb054645f460d7e370d433dc27
|
|
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>
|
|
This reverts commit 7691cc2f7ef1f0ceedf3de0554045a614f25776d.
This causes validator failures
ERROR - JsonSchemas: GET of resource at URI /redfish/v1/JsonSchemas returned HTTP 404. Check URI.
ERROR - PCIeSlots: GET of resource at URI /redfish/v1/Chassis/motherboard/PCIeSlots returned HTTP 404. Check URI.
ERROR - PCIeSlots: GET of resource at URI /redfish/v1/Chassis/chassis/PCIeSlots returned HTTP 404. Check URI.
Change-Id: Ibcdf238a222da83127a89d8f38c8180501ffe882
Signed-off-by: Ed Tanous <edtanous@google.com>
|