History log of /openbmc/bmcweb/redfish-core/lib/pcie.hpp (Results 1 – 25 of 81)
Revision Date Author Comments
# 8c1d0549 12-Mar-2024 Myung Bae <myungbae@us.ibm.com>

Fix handling of lanesInUse default value

phophor-dbus-interfaces changes the default of lanesInUse to MAXINT by
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/53650

Thus bmcweb als

Fix handling of lanesInUse default value

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>

show more ...


# 253f11b8 16-May-2024 Ed Tanous <ed@tanous.net>

Allow configuring "bmc" and "system"

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"

Allow configuring "bmc" and "system"

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>

show more ...


# 25b54dba 17-Apr-2024 Ed Tanous <ed@tanous.net>

Bring consistency to config options

The configuration options that exist in bmcweb are an amalgimation of
CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms
and meson options usi

Bring consistency to config options

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>

show more ...


# dc8cfa66 07-Apr-2024 Ed Tanous <ed@tanous.net>

Add nullptr check

Change-Id: If511f1210cca7bd1da3a8c5152688487d3036e2f
Signed-off-by: Ed Tanous <ed@tanous.net>


# 8cb2c024 27-Mar-2024 Ed Tanous <ed@tanous.net>

Fix moves/forward

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 s

Fix moves/forward

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>

show more ...


# 70c4d545 08-Jun-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Refactor PCIeDeviceList to use getCollectionMembers

This commit refactors the code in the PCIeDeviceList function to use the
getCollectionMembers function for retrieving collection members.
Addition

Refactor PCIeDeviceList to use getCollectionMembers

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>

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 ...


# 609ba4c9 11-Jul-2023 Ed Tanous <edtanous@google.com>

Remove PCIeInterface DeviceType

This code was added in 543f9a75a0819ca9e3541b2c48fe8b4d5cf6c4f7, which
in the description claimed to only be a refactor, but moved the
DeviceType record.

Because Dev

Remove PCIeInterface DeviceType

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>

show more ...


# 814bf20a 04-Jul-2023 Konstantin Aladyshev <aladyshev22@gmail.com>

Add MaxLanes and MaxPCIeType properties to the PCIeInterface

According to the Redfish Data Model specification PCIeInterface (v1.3+)
of the PCIeDevice model contains the following properties:

MaxLa

Add MaxLanes and MaxPCIeType properties to the PCIeInterface

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>

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 ...


# 9bb0a7fe 04-Jul-2023 Konstantin Aladyshev <aladyshev22@gmail.com>

Correct type for the lanesInUse property

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' f

Correct type for the lanesInUse property

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>

show more ...


# a5409991 20-Apr-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Add PCIe Slot information to PCIeDevice schema

To align with Redfish's transition from using the PCIeSlot schema to
including the Slot within the PCIeDevice schema, this commit adds PCIe
Slot inform

Add PCIe Slot information to PCIeDevice schema

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>

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 ...


# 9e9325e6 02-May-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Use getPCIeDeviceList in PCIeDeviceCollection

The current implementation of PCIeDeviceCollection uses
getCollectionMembers to obtain the list of PCIe devices, but this method
does not include empty

Use getPCIeDeviceList in PCIeDeviceCollection

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>

show more ...


# 7f3e84a1 28-Dec-2022 Ed Tanous <ed@tanous.net>

Add an option flag for multi-computersystem

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 n

Add an option flag for multi-computersystem

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>

show more ...


# 768a143d 14-Jun-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Fix Redfish validator failure in PCIeFunction

This commit addresses the Redfish validator failure related to the URI
mismatch in PCIeFunction. The error reported that the URI
"/redfish/v1/Systems/sy

Fix Redfish validator failure in PCIeFunction

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>

show more ...


# e164f1b6 12-Apr-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Add Health information for PCIeDevice

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

Add Health information for PCIeDevice

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>

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 ...


# ac106bf6 07-Jun-2023 Ed Tanous <edtanous@google.com>

Consistently name AsyncResp variables

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 negl

Consistently name AsyncResp variables

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>

show more ...


# 472bd202 22-Mar-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Move getPCIeDeviceList to pcie_util

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 P

Move getPCIeDeviceList to pcie_util

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>

show more ...


# d5e74b80 31-May-2023 Myung Bae <myungbae@us.ibm.com>

Fix bmcweb coredump by Non-existent PCIeFunctionId

When a non-existent PCIeFunctionId is queried, bmcweb
returns the success but with the incorrect output.

```
curl -k -X GET https://${bmc}:18080/r

Fix bmcweb coredump by Non-existent PCIeFunctionId

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>

show more ...


# e14742ca 31-May-2023 Ed Tanous <edtanous@google.com>

Replace atoi

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>
C

Replace atoi

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

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 ...


# c6bb3285 12-Apr-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Add State information for PCIeDevice

This commit is to add state information according to the Redfish
PCIeDevice schema. Default state is "Enabled".
ref: https://redfish.dmtf.org/schemas/v1/PCIeDevi

Add State information for PCIeDevice

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>

show more ...


1234