diff options
author | George Liu <liuxiwei@inspur.com> | 2021-02-01 09:42:49 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2021-08-20 22:12:03 +0300 |
commit | e8204933be90353ef672e62dc628448173279e1c (patch) | |
tree | dd769e166882e233a619089f0959aa5fd70c3d3d | |
parent | 1c05dae3011628e5726eefc3ec4dbe7733fbb4d5 (diff) | |
download | bmcweb-e8204933be90353ef672e62dc628448173279e1c.tar.xz |
Move sensor collection to all sensors
Redfish's thinking on what sensors should be included in the sensor
collection has changed. Roughly two years ago their thinking was
"for sensors that are not covered elsewhere in the model-meaning do
not duplicate Power and Thermal" and that is what OpenBMC implemented.
Today, as described in the new thermalSubsystem and powerSubsystem doc
the sensor collection should contain all sensors that are associated
with that chassis.
Link with: https://redfishforum.com/thread/190/sensorcollection-contain-all-sensors-chassis
All things considered as "sensors" should be included in the Sensor
collection.
To make this transition as easy as possible for clients, create a new
meson option, new-powersubsystem-thermalsubsystem. This "all sensors in
the sensor collection" behavior as well as the new ThermalSubsystem,
PowerSubsystem, Fans, and Power Supplies schemas will be under this
option. This option is defaulted to disabled. At a later time, the
default will move to enabled.
Move Redfish SensorCollection to show all sensors from
/xyz/openbmc_project/sensors with the "all_sensors" association for that
chassis if this option is enabled.
The SensorCollection is found at /redfish/v1/Chassis/<Id>/Sensors.
Tested:
1. Enabled redfish-new-powersubsystem-thermalsubsystem and
validator passes.
2. Performance testing (average of 5 times):
a. Redfish validator time:
without this patch: 71.375s
with this patch: 71.763s
b. Number of sensors tested:
without this patch: 8
with this patch: 63
c. Run `https://${bmc}/redfish/v1/Chassis/chassis/Sensors`:
without this patch: 0.197s
with this patch: 0.228s
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I2bdddcf616dc72cf0683515c9ab8453bd35eee09
-rw-r--r-- | meson.build | 10 | ||||
-rw-r--r-- | meson_options.txt | 1 | ||||
-rw-r--r-- | redfish-core/lib/sensors.hpp | 8 |
3 files changed, 19 insertions, 0 deletions
diff --git a/meson.build b/meson.build index f6a66f1462..eb2d3a908c 100644 --- a/meson.build +++ b/meson.build @@ -223,6 +223,16 @@ if (cxx.get_id() == 'gcc' and cxx.version().version_compare('>8.0')) summary({'power-thermal' :'-DBMCWEB_ALLOW_DEPRECATED_POWER_THERMAL' },section : 'Enabled Features') endif + + if( get_option('redfish-new-powersubsystem-thermalsubsystem').enabled()) + add_project_arguments([ + '-DBMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM' + ], + language : 'cpp') + + summary({'new-powersubsystem-thermalsubsystem' :'-DBMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM' + },section : 'Enabled Features') + endif endif endif diff --git a/meson_options.txt b/meson_options.txt index 23874027d1..ff5b8877dd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,6 +30,7 @@ option('ibm-management-console', type : 'feature', value : 'disabled', descripti option('google-api', type : 'feature', value : 'disabled', description : 'Enable the Google specific functionality. Paths are under \'/google/v1/\'') option('http-body-limit', type: 'integer', min : 0, max : 512, value : 30, description : 'Specifies the http request body length limit') option('redfish-allow-deprecated-hostname-patch', type : 'feature', value : 'disabled', description : 'Enable/disable Managers/bmc/NetworkProtocol HostName PATCH commands. The default condition is to prevent HostName changes from this URI, following the Redfish schema. Enabling this switch permits the HostName to be PATCHed at this URI. In Q4 2021 this feature will be removed, and the Redfish schema enforced, making the HostName read-only.') +option('redfish-new-powersubsystem-thermalsubsystem', type : 'feature', value : 'disabled', description : 'Enable/disable the new PowerSubsystem, ThermalSubsystem, and all children schemas. This includes displaying all sensors in the SensorCollection. At a later date, this feature will be defaulted to enabled.') option('redfish-allow-deprecated-power-thermal', type : 'feature', value : 'enabled', description : 'Enable/disable the old Power / Thermal. The default condition is allowing the old Power / Thermal.') option ('https_port', type : 'integer', min : 1, max : 65535, value : 443, description : 'HTTPS Port number.') diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp index cb7ea15381..f9d806b89c 100644 --- a/redfish-core/lib/sensors.hpp +++ b/redfish-core/lib/sensors.hpp @@ -64,6 +64,14 @@ static const boost::container::flat_map<std::string_view, {"/xyz/openbmc_project/sensors/power", "/xyz/openbmc_project/sensors/current", "/xyz/openbmc_project/sensors/airflow", +#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM + "/xyz/openbmc_project/sensors/voltage", + "/xyz/openbmc_project/sensors/fan_tach", + "/xyz/openbmc_project/sensors/temperature", + "/xyz/openbmc_project/sensors/fan_pwm", + "/xyz/openbmc_project/sensors/altitude", + "/xyz/openbmc_project/sensors/energy", +#endif "/xyz/openbmc_project/sensors/utilization"}}, {node::thermal, {"/xyz/openbmc_project/sensors/fan_tach", |