Skip to content

Can not print full temperature sensors when the number of sensors is greater than 8 #396

Open
thangtran-ampere opened this issue Feb 10, 2023 · 0 comments
Assignees

Comments

@thangtran-ampere
Copy link

thangtran-ampere commented Feb 10, 2023

Describe the bug
When the number of "CPU temperature sensors(41h)" in the BMC is greater than 8, the list of sensors when calling "ipmitool dcmi get_temp_reading" is incorrect.

IPMITOOL Version
1.8.19

To Reproduce
Steps to reproduce the behavior:

  1. In the BMC software, define 28 sensors "CPU temperature".
  2. Call "ipmitool dcmi get_temp_reading"
  3. Only 11 "CPU temperature" sensors are displayed. The sensor ID 8 is displayed 2 times.
CPU temperature sensors(41h)		1		+27 C
CPU temperature sensors(41h)		2		+0 C
CPU temperature sensors(41h)		3		+0 C
CPU temperature sensors(41h)		4		+0 C
CPU temperature sensors(41h)		5		+0 C
CPU temperature sensors(41h)		6		+0 C
CPU temperature sensors(41h)		7		+0 C
CPU temperature sensors(41h)		8		+0 C
CPU temperature sensors(41h)		8		+0 C
CPU temperature sensors(41h)		16		+0 C
CPU temperature sensors(41h)		24		+0 C

Expected behavior
28 "CPU temperature" sensors are displayed.

Additional context
I saw that the problem come from this line of code https://github.com/ipmitool/ipmitool/blob/master/lib/ipmi_dcmi.c#L1606
The ipmi_dcmi_prnt_get_temp_readings function is trying to read 8 sensors for each message, when a message is finished, it requests to read the next 8 sensors.
But when it calls ipmi_dcmi_get_temp_readings function in the while loop, it is setting the incorrect value of parameters. Currently, it is setting entityInst = offset and entityInstStart = 0. As define in the DCMI specification, when the "Entity Instance" is not equal to 0, it only reads 1 sensor for each message. Therefore, ipmi_dcmi_get_temp_readings function only returns one sensor when the offset is not equal to 0.
Screenshot 2023-02-10 at 16 13 48
Based on the DCMI specification, I think when ipmi_dcmi_get_temp_readings is called, the entityInst should be 0 and entityInstStart is offset. I updated the source code as attached file and see that the issue is resolved. Besides that, the initialization value of offset should be 1 (the instance ID is greater than 0) to avoid sensor ID 8 is displayed double times. You can see my update in this file
0001-Correct-the-order-of-paramters.patch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants