History log of /openbmc/phosphor-host-ipmid/sensorhandler.cpp (Results 1 – 25 of 129)
Revision Date Author Comments
# a008871d 29-Jan-2024 George Liu <liuxiwei@ieisystem.com>

Remove the mapper_get_service method

Since `mapper_get_service` is a tool and may need to be refactored
in the future [1], this patch is to delete the use of
`mapper_get_service` and use the GetObje

Remove the mapper_get_service method

Since `mapper_get_service` is a tool and may need to be refactored
in the future [1], this patch is to delete the use of
`mapper_get_service` and use the GetObject method on the server side
instead.

[1] https://gerrit.openbmc.org/c/openbmc/phosphor-objmgr/+/68965

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Ia365ab4aa359ab5f9a2850ed305b9088d4f485fb

show more ...


# 68d9d405 09-Nov-2023 Matt Simmering <matthew.simmering@intel.com>

Update terminology used within repo

Update the terms to more inclusive language. This change if only for
variables used in the repo.

Change-Id: I5151c9c2efab707b5dbc707e55333a3cb8c4e32b
Signed-off-

Update terminology used within repo

Update the terms to more inclusive language. This change if only for
variables used in the repo.

Change-Id: I5151c9c2efab707b5dbc707e55333a3cb8c4e32b
Signed-off-by: Matt Simmering <matthew.simmering@intel.com>

show more ...


# 369824e7 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: Ic5fd073faa7391d3f0b37787d6a9c7688c9a3253
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 523e2d1b 05-Sep-2023 Willy Tu <wltu@google.com>

ipmid: Update sdbuspp namespaces

Fixed all errors when we remove
`SDBUSPP_REMOVE_DEPRECATED_NAMESPACE` in sdbusplus.

Change-Id: I5607585b2709faa7aee347d26e458ef769ca1626
Signed-off-by: Willy Tu <wl

ipmid: Update sdbuspp namespaces

Fixed all errors when we remove
`SDBUSPP_REMOVE_DEPRECATED_NAMESPACE` in sdbusplus.

Change-Id: I5607585b2709faa7aee347d26e458ef769ca1626
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# 64b7621c 11-Aug-2022 Wang Xiaohua <wangxiaohua.1217@bytedance.com>

sensorhandler: Get sensor type and event type from yaml-generated

Get the sensor type and event type from the yaml-generated cpp

Tested:
```
<1>. Verify the voltage sensor, the return value should

sensorhandler: Get sensor type and event type from yaml-generated

Get the sensor type and event type from the yaml-generated cpp

Tested:
```
<1>. Verify the voltage sensor, the return value should
be "02 01"
ipmitool raw 0x04 0x2f 0xa0
02 01

<2>. Verfity the temp sensor, the return value should
be "01 01"
ipmitool raw 0x04 0x2f 0x01
01 01

<3>. Verify the power sensor, the return value should
be "0b 01"
ipmitool raw 0x04 0x2f 0xe6
0b 01

<4>. verify the SYS_FAN_Status sensor, the return value
should be "04 07"
ipmitool raw 0x04 0x2f 0xda
04 07

```

Signed-off-by: Wang Xiaohua <wangxiaohua.1217@bytedance.com>
Change-Id: I24771d0f7ff2b6cd0f3d91521a640125d5d0ff0a

show more ...


# 9cf0838a 28-Apr-2023 Vernon Mauery <vernon.mauery@linux.intel.com>

move entity_map_json to libipmid

entity_map_json is used by dbus-sdr sensor handling so it needs to be in
a common location or loading order matters. This change moves the file
from the ipmi20 provi

move entity_map_json to libipmid

entity_map_json is used by dbus-sdr sensor handling so it needs to be in
a common location or loading order matters. This change moves the file
from the ipmi20 provider library to libipmi, a common library.

Tested: Found that even though the dbus-sdr provider loads before
ipmi20, it loads properly without missing symbols.

Change-Id: I9ab6833c78e6f3c89c02cf998ce0a36353059c3d
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...


# fbc6c9d7 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

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: copy latest and re-format

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: I44441096113929ce96eb1439e2932e6ff3c87f27
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 51136984 18-Aug-2022 Paul Fertser <fercerpav@gmail.com>

Specify "8-bit ASCII + Latin 1" SDR encoding

Applications using OpenSolaris libipmi can't handle "Unicode" (type 0)
encoding for the sensor names [0].

This results in issues with VMWare ESXi which

Specify "8-bit ASCII + Latin 1" SDR encoding

Applications using OpenSolaris libipmi can't handle "Unicode" (type 0)
encoding for the sensor names [0].

This results in issues with VMWare ESXi which uses IPMI to fetch sensor
data from the BMC, all the names are shown as "Unspecified 1" (if
default EntityId is used), so status page, SEL entries and the logs
become very confusing.

Fix this by telling it to process all bytes as is by using "8-bit ASCII
+ Latin 1" type.

The patch is untested however similar changes to intel-ipmi-oem were
tried with VMWare ESXi 7.0 Update 2 and regular ipmitool (using GNU
FreeIPMI), both show names correctly.

[0] https://github.com/kofemann/opensolaris/blob/master/usr/src/lib/libipmi/common/ipmi_util.c#L258

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: Idf19833e4877af1acb32f016e85e93c6f58df27e

show more ...


# 9154caab 02-Dec-2021 Willy Tu <wltu@google.com>

sensordatahandler: clamp the values instead of removing the sensor

Clamping the sensor values to prevent sensors from going missing.

Based on
https://github.com/openbmc/phosphor-host-ipmid/blob/5aa

sensordatahandler: clamp the values instead of removing the sensor

Clamping the sensor values to prevent sensors from going missing.

Based on
https://github.com/openbmc/phosphor-host-ipmid/blob/5aae092cab08279d45c7914c466314b356164b7c/dbus-sdr/sensorutils.cpp#L258-L304

Clamping the threshold value to correct the result of negative threshold
value.

Tested:
Set 'sensorUnits1: 0x80' in config for sensor cpu0_abcd_cur which has
low threshold -1 and high threshold 7.6.
Before:
~# ipmitool sensor | grep cpu0_abcd_cur
cpu0_abcd_cur | 0.022 | Amps | ok | na | 4.020 | 4.020 | 7.587 | 7.587 | na
After:
~# ipmitool sensor | grep cpu0_abcd_cur
cpu0_abcd_cur | -0.135 | Amps | ok | na | -0.998 | -0.998 | 7.587 | 7.587 | na

Change-Id: Ie5af79ccbe8ab9660755f1c9d281e49a08d01309
Signed-off-by: Willy Tu <wltu@google.com>
Signed-off-by: JeffLin <JeffLin2@quantatw.com>
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# 92079a24 07-Oct-2022 Hieu Huynh <hieuh@os.amperecomputing.com>

Fix wrong threshold report

For the sensor that does not support the threshold values such as
WarningLow, WarningHigh, CriticalLow, CriticalHigh.
These value should be 'na'.

Tested:
1. Get sensor in

Fix wrong threshold report

For the sensor that does not support the threshold values such as
WarningLow, WarningHigh, CriticalLow, CriticalHigh.
These value should be 'na'.

Tested:
1. Get sensor info via ipmi command
ipmitool sensor get S1_SOC_Temp
...
Lower Non-Recoverable : na
Lower Critical : na
Lower Non-Critical : na
Upper Non-Critical : na
Upper Critical : 105.000
....

Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: Ia366a906300c289ea94110b87fff92bca7e2b865

show more ...


# fefb5855 22-Sep-2022 Thang Tran <thuutran@amperecomputing.com>

replace static converting with rounding

Issue: When the users request to get the sensor thresholds via "ipmitool
sensor get <sensor_name>" command, sometimes the value is not correct.
E.g: The real

replace static converting with rounding

Issue: When the users request to get the sensor thresholds via "ipmitool
sensor get <sensor_name>" command, sometimes the value is not correct.
E.g: The real sensor threshold is 2.01, the "scale" = 0, "exponentR"=-3,
"coefficientM" = 10. After calculating, the ipmid should return 201 to
ipmitool, but the actual return value is 200. Ipmitool displays the
value of the threshold is 2.00.

Root cause: The "float point" can not present exactly the "double" value
in somecase. Therefore, after calculating, the value of sensor
thresholds is incorrect when convert from double to uint8_t.

Solution: Replace static converting with rounding.

Tested:
1. Check the result of the threshold whose value is 2.01
ipmitool sensor get <2.01_Sensor_name>
2. The threshold value is 2.01

Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
Change-Id: I7f3e72640beb76eda9370f60e32f42d2b2c1fbda

show more ...


# 4a105cd6 05-Aug-2022 Jian Zhang <zhangjian.3032@bytedance.com>

Optimize sensorsOwnerMatch init

`sensorsOwnerMatch` should init once, not every time a sensor is added.

Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
Change-Id: I3a610d73bd732e7a019a4f53

Optimize sensorsOwnerMatch init

`sensorsOwnerMatch` should init once, not every time a sensor is added.

Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
Change-Id: I3a610d73bd732e7a019a4f53b40eac7df4fb256b

show more ...


# 5d82f474 22-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibd2a0b512bfb7caf65bfab64b271d194da520aac

show more ...


# 11d68897 20-Jan-2022 Willy Tu <wltu@google.com>

cleanup: Remove all warning errors for the Meson build support

Remove all the build warning to prepare for the meson build.
Meson build will be in
https://gerrit.openbmc-project.xyz/c/openbmc/phosph

cleanup: Remove all warning errors for the Meson build support

Remove all the build warning to prepare for the meson build.
Meson build will be in
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/47748

Tested:
Ipmi command works fine the cleanup.
```
$ systemctl status phosphor-ipmi-host
● phosphor-ipmi-host.service - Phosphor Inband IPMI
Loaded: loaded (/lib/systemd/system/phosphor-ipmi-host.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 1970-01-08 21:20:56 UTC; 21s ago
Main PID: 24987 (ipmid)
CGroup: /system.slice/phosphor-ipmi-host.service
└─24987 /tmp/ipmid

Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X30] for Ethstats Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X30] for Ethstats Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X32] for Sys Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X02] for I2C
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X02] for I2C
Jan 08 21:20:56 $HOST ipmid[24987]: I2C_WHITELIST_CHECK is disabled, do not populate whitelist
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X04] for Manual Zone Control
Jan 08 21:20:56 $HOST systemd[1]: Started Phosphor Inband IPMI.
Jan 08 21:20:56 $HOST ipmid[24987]: Loading whitelist filter
Jan 08 21:20:56 $HOST ipmid[24987]: Set restrictedMode = true
(reverse-i-search)`ipmi': systemctl status phosphor-^Cmi-host

$ ipmitool mc info
Device ID : 32
Device Revision : 1
Firmware Revision : 0.00
IPMI Version : 2.0
Manufacturer ID : 7244
Manufacturer Name : Quanta Computer Inc.
Product ID : 14426 (0x385a)
Product Name : Unknown (0x385A)
Device Available : yes
Provides Device SDRs : yes
Additional Device Support :
Sensor Device
SEL Device
FRU Inventory Device
Chassis Device
Aux Firmware Rev Info :
0x00
0x00
0x00
0x00
```

Change-Id: I372c9433a274bc633a24d213b7a1bc205531e33d
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# d3d2fe29 12-Nov-2021 Vivekanand Veeracholan <vveerach@google.com>

Prevent default cmdGetDeviceSdr handler registration in dynamic sensors

Signed-off-by: Vivekanand Veeracholan <vveerach@google.com>
Change-Id: Iedfa2e1983137afd032c05df07ab5d4a5f09fae9


# 7f3a70f0 07-Dec-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Invalidate cache when sensor disappears

When a sensor disappears from DBus, invalidate the cache.
Ideally it could be done by adding a match for interfacesRemoved
signal.
However, inte

sensor-cache: Invalidate cache when sensor disappears

When a sensor disappears from DBus, invalidate the cache.
Ideally it could be done by adding a match for interfacesRemoved
signal.
However, interfacesRemoved signal is not emitted if a service is
terminated or crashed, so we have to use nameOwnerChanged signal
as well. The `nameOwnerChanged` signal does not provide DBus object's
information, so the code needs to record the relationship between sensor
ids and the services, so that when the event occurs, it knows which
sensors should be invalidated.

Tested: Manually stop virtual-sensor, and verify the related sensors are
shown as `na` in ipmitool sensor list:

total_power | na | | na | na | na | na | na | na | na

Restart virtual-sensor, and verify the related sensors have
valid readings:

total_power | 510.000 | Watts | ok | na | na | na | na | na | na

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: If145a1cd163477c3aca3fd17f3dbde96263f6b75

show more ...


# 8e8152c5 06-Dec-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Use async calls in get sensor reading

Use the async calls in ipmiSensorGetSensorReading() for cached sensors.

Note that the code was using sdbusplus::message as the parameter for the

sensor-cache: Use async calls in get sensor reading

Use the async calls in ipmiSensorGetSensorReading() for cached sensors.

Note that the code was using sdbusplus::message as the parameter for the
getFunc(), now it could be simplified to ipmi::PropertyMap and unify the
two cases: property update callback and getting property.

Tested: Verify the ipmi sensor list works fine.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: If7afed410f794a5317b8d4b4965cac291a735d12

show more ...


# a55e9ea1 18-Sep-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Read sensor data when there is no cache

When IPMI starts and the sensor has no match callback, the sensor cache
is empty. Read the sensor data in such case and cache it.

Tested: Verif

sensor-cache: Read sensor data when there is no cache

When IPMI starts and the sensor has no match callback, the sensor cache
is empty. Read the sensor data in such case and cache it.

Tested: Verify the sensor list works as expected, the first sensor
list takes longer time, and the following sensor list takes less
time because of the cache.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Icc33185b93cf21462584b3817b7c522e24b70baf

show more ...


# 9714050f 17-Sep-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Implement reading data

Implement reading data in property changed callback.
With sensor-cache, the sensor's property is returned by the
callback of propertiesChanged match, parse the p

sensor-cache: Implement reading data

Implement reading data in property changed callback.
With sensor-cache, the sensor's property is returned by the
callback of propertiesChanged match, parse the property from the message
and generate the sensor's response.

Tested: Verify the sensors using `readingData` have valid values in
QEMU, e.g.

Inlet_Temp | 20.000 | degrees C | ok | na | 0.000 | 5.000 | 38.000 | 43.000 | na

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I2c6328cb6001d0daf2045d17e73773dccf55d521

show more ...


# 8c2c048e 16-Sep-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Use new get function

The get function for sensor-cache will use the sdbusplus message to get
the sensor data instead of making DBus calls, where the sdbusplus
message could be a signal

sensor-cache: Use new get function

The get function for sensor-cache will use the sdbusplus message to get
the sensor data instead of making DBus calls, where the sdbusplus
message could be a signal callback, or the getAllProperty's reply message.

So the get function's prototype is changed.

Tested: Verify the build is OK when enable or disable the sensor-cache
option.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Ife2f55d87ce2b0941a4efdb599e46d80d827c2ff

show more ...


# 962e68ba 16-Sep-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: configure: Add option

Add --enable-sensors-cache option to enable the feature of sensor cache.
The option is disabled by default.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change

sensor-cache: configure: Add option

Add --enable-sensors-cache option to enable the feature of sensor cache.
The option is disabled by default.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I97bcd366c83a0bd6df42ed7024d6ef03baaf8e7e

show more ...


# be5c6b2a 16-Sep-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Initial commit

This is the initial commit of a series of changes for caching the
sensors in ipmid, so that the ipmi sensor/sdr related handlers could use
the cached values instead of g

sensor-cache: Initial commit

This is the initial commit of a series of changes for caching the
sensors in ipmid, so that the ipmi sensor/sdr related handlers could use
the cached values instead of getting the sensors from DBus.

The goal is to improve the ipmi sensor list's performance.
With all the patches in the series, the ipmitool sensor list time on
g220a (140+ sensors) is reduced from 20s+ to about 11s.

Tested: Manually verify the matches are working correctly in QEMU.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I4c4be8613dd89b5a83d8ff59354a8a3991e98cbf

show more ...


# 14a47819 17-Sep-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Add cache for sdr and threshold

Add cache for sdr and threshold so that it does not have to make DBus
calls every time.

Tested: Verify the ipmi sensor list/sdr list works fine.

Signe

sensor-cache: Add cache for sdr and threshold

Add cache for sdr and threshold so that it does not have to make DBus
calls every time.

Tested: Verify the ipmi sensor list/sdr list works fine.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I8047144b1f66b95414905d1a065c9bf54410f0f5

show more ...


# f93da667 18-Oct-2021 Lotus Xu <xuxiaohan@bytedance.com>

Add SetSensorThrehold Command

Support to modify the sensor threshold
`with the ipmitool command.
This piece of code refers to the following code:
https://github.com/openbmc/intel-ipmi-oem/blob/f4d5e

Add SetSensorThrehold Command

Support to modify the sensor threshold
`with the ipmitool command.
This piece of code refers to the following code:
https://github.com/openbmc/intel-ipmi-oem/blob/f4d5e05e388aafd06d8320a2f81594de35c77c0d/src/sensorcommands.cpp#L597

Tested: Run `ipmitool sensor thresh Inlet_Temp unc 40`
threshold set ok.

Signed-off-by: Lotus Xu <xuxiaohan@bytedance.com>
Change-Id: I78f315a06c913466649e1ae91d046c3e8c50bbed

show more ...


# d351a729 12-Aug-2021 Willy Tu <wltu@google.com>

dbus-sdr: prevent handler registration if dbus-sdr is enabled

Compile out the handler registration if it is using dynamic stack.
Reorder the handlers to have common handlers between the

dbus-sdr: prevent handler registration if dbus-sdr is enabled

Compile out the handler registration if it is using dynamic stack.
Reorder the handlers to have common handlers between the two
implementations alway registered.

Managing the handlers like this all code to be compiled during CI while
providing some control over the handlers used.

Change-Id: I6e9cffacfac4127d2307e8c5e548c84323742c94
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


123456