Remove redundant async call in collection threads

This commit removes the redundant std:async call in the detached thread
launched for parsing and publishing the VPD for an individual FRU. Since
we have a dedicated detached thread for each FRU, we can do VPD parse
and publish in a synchronous manner from the detached thread itself,
instead of launching a asynchronous task which adds unnecessary
performance cost. This commit also handles any exception thrown while
launching the detached thread for a FRU. In case launching detached
thread for a FRU fails, we add the EEPROM path of the FRU to a "failed
EEPROM" list. This list can be handled by Manager later on.

Test:
```
- Install bitbaked image on Everest system.

- Check vpd-manager service status:
root@p10bmc:~# systemctl show vpd-manager -p NRestarts
NRestarts=0

- Check BMC reaches ready state:
root@p10bmc:~# obmcutil state
CurrentBMCState     : xyz.openbmc_project.State.BMC.BMCState.Ready
CurrentPowerState   : xyz.openbmc_project.State.Chassis.PowerState.On
CurrentHostState    : xyz.openbmc_project.State.Host.HostState.Running
BootProgress        : xyz.openbmc_project.State.Boot.Progress.
ProgressStages.OSRunning
OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.
OSStatus.Inactive

-Check CollectionStatus property of vpd-manager D-Bus service:
root@p10bmc:~# busctl get-property com.ibm.VPD.Manager /com/ibm/VPD/
Manager com.ibm.VPD.Manager CollectionStatus
s "Completed"

- Check execution time change
Measure the time between vpd-manager event loop start and
CollectionStatus = Completed on a Everest system. Following figures were
measured across 3 reboots:
- On current code, (with the extra async call) it is 61 secs.
- With the changes in this PR, it is 60.33 secs.
```

Change-Id: I86dd9f9f6a4c67b8159e4c90d6ffdb005568cf6b
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
4 files changed
tree: d1e6f2cf42734a1a804238e62a6005c7b9fdd202
  1. configuration/
  2. scripts/
  3. service_files/
  4. test/
  5. vpd-manager/
  6. vpd-tool/
  7. vpdecc/
  8. .clang-format
  9. .gitignore
  10. LICENSE
  11. meson.build
  12. meson_options.txt
  13. OWNERS
  14. README.md
README.md

Overview

This repository hosts code for OpenPower and IBM IPZ format VPD parsers. Both OpenPower VPD and IPZ VPD formats are structured binaries that consist of records and keywords. A record is a collection of multiple keywords. More information about the format can be found here.

The repository consists of two distinct applications, which are:

OpenPower VPD Parser

This is a build-time YAML driven application that parses the OpenPower VPD format and uses the YAML configuration (see extra-properties-example.yaml and writefru.yaml) to determine:

  • The supported records and keywords.
  • How VPD data is translated into D-Bus interfaces and properties.

The application instance must be passed in the file path to the VPD (this can, for example, be a sysfs path exposed by the EEPROM device driver) and also the D-Bus object path(s) that EEPROM data needs to be published under.

IBM VPD Parser

This parser is can be built by passing in the --enable-ibm-parser configure option. This parser differs from the OpenPower VPD parser in the following ways:

  • It parses all the records and keywords from the VPD, including large keywords (Keywords that begin with a # and are > 255 bytes in length).
  • It relies on a runtime JSON configuration (see examples/inventory.json) to determine the D-Bus object path(s) that hold interfaces and properties representing the VPD for a given VPD file path.

Making the application runtime JSON driven allows us to support multiple systems (with different FRU configurations) to be supported in a single code image as well as making the application more flexible for future improvements.

TODOs and Future Improvements

  1. The long-term goal is to completely do away with the build time YAML driven configurations and instead reconcile the OpenPower VPD parser and the IBM VPD parser applications into a single runtime JSON driven application.
  2. Add details to the README on how to configure and build the application.
  3. More JSON documentation.
  4. Support for more IBM VPD formats.
  5. VPD Write and tool documentation.