11
29
Fork
You've already forked ipmitool
33

ipmitool -b -t sensor list shows unexpected value #55

Open
opened 2025年05月09日 10:40:28 +02:00 by Jianfeng · 1 comment

Describe the bug
A clear and concise description of what the bug is.
Please DO NOT report ANYTHING about 1.8.18, it is outdated. Please first check your alleged bug with the latest code from the top of the master branch here.

IPMITOOL Version

Make sure you're reporting a bug in the latest code taken from master branch here, NOT a bug
that you've found in some version that you've got from your OS vendor or any source other than this repository.

$ ipmitool -V
ipmitool version 1.8.19

To Reproduce
Steps to reproduce the behavior:

  1. I have two BMC (OpenBMC) connected with IPMB over I2C. Their IPs are bmc_ip1/2.
  2. Run ipmitool -I lanplus -H <bmc_ip1> -U xxx -P xxx -b 0 -t 4 sensor list
  3. Observe the abnormal reply:
FAN1_PWM | 23.000 | percent | ok | na | na | na | na | na | na 
FAN2_PWM | 31.000 | percent | ok | na | na | na | na | na | na 
FAN3_PWM | 22.000 | percent | ok | na | na | na | na | na | na 
FAN4_PWM | 29.000 | percent | ok | na | na | na | na | na | na 
FAN1_F_RPM | 7310.000 | RPM | ok | na | na | na | na | na | na 
FAN1_R_RPM | 7310.000 | RPM | ok | na | na | na | na | na | na 
FAN2_F_RPM | 7310.000 | RPM | ok | na | na | na | na | na | na 
FAN2_R_RPM | 7310.000 | RPM | ok | na | na | na | na | na | na 
FAN3_F_RPM | 15996.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN3_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN4_F_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN4_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na
......
  1. Run ipmitool -I lanplus -H <bmc_ip2> -U xxx -P xxx sensor list
  2. Observe the normal reply:
FAN1_PWM | 85.000 | percent | ok | na | na | na | na | na | na 
FAN2_PWM | 85.000 | percent | ok | na | na | na | na | na | na 
FAN3_PWM | 85.000 | percent | ok | na | na | na | na | na | na 
FAN4_PWM | 85.000 | percent | ok | na | na | na | na | na | na 
FAN1_F_RPM | 15996.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN1_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN2_F_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN2_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN3_F_RPM | 15996.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN3_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN4_F_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na 
FAN4_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na
......
  1. Generally other commands are handled normally, except for 'sdr list', 'sensor list' and 'fru print'

Expected behavior
Two results are the same.

Additional context
When I study the code of ipmitool, I observe that it's the MACRO 'BRIDGE_TO_SENSOR' in include/ipmi_sdr.h that affected the result. If I manually set 'BRIDGE_TO_SENSOR' to false, the result of ipmitool command is normal.

#define BRIDGE_TO_SENSOR(_intf, _addr, _chan)			\
 ( !((_chan == 0 && _intf->target_ipmb_addr &&			\
			 _intf->target_ipmb_addr == _addr) ||	\
 (_addr == _intf->target_addr && _chan == _intf->target_channel)) )

I add some print, and see the values in the MACRO:

_chan = 0
_intf->target_ipmb_addr = 0
_addr = 0x20
_intf->target_addr = 4
_intf->target_channel = 0

It seems that _intf->target_ipmb_addr is obtained via netFn 0x2C cmd 0x01 (in ipmi_picmg_ipmb_address, or 0x40 in ipmi_vita_ipmb_address), which is not a standard command to get target_ipmb_addr?

**Describe the bug** A clear and concise description of what the bug is. *Please **DO NOT** report ANYTHING about 1.8.18, it is outdated. Please first check your alleged bug with the latest code from the top of the master branch here.* **IPMITOOL Version** Make sure you're reporting a bug in the latest code taken from `master` branch here, NOT a bug that you've found in some version that you've got from your OS vendor or any source other than this repository. ```none $ ipmitool -V ipmitool version 1.8.19 ``` **To Reproduce** Steps to reproduce the behavior: 1. I have two BMC (OpenBMC) connected with IPMB over I2C. Their IPs are bmc_ip1/2. 2. Run `ipmitool -I lanplus -H <bmc_ip1> -U xxx -P xxx -b 0 -t 4 sensor list` 3. Observe the abnormal reply: ```none FAN1_PWM | 23.000 | percent | ok | na | na | na | na | na | na FAN2_PWM | 31.000 | percent | ok | na | na | na | na | na | na FAN3_PWM | 22.000 | percent | ok | na | na | na | na | na | na FAN4_PWM | 29.000 | percent | ok | na | na | na | na | na | na FAN1_F_RPM | 7310.000 | RPM | ok | na | na | na | na | na | na FAN1_R_RPM | 7310.000 | RPM | ok | na | na | na | na | na | na FAN2_F_RPM | 7310.000 | RPM | ok | na | na | na | na | na | na FAN2_R_RPM | 7310.000 | RPM | ok | na | na | na | na | na | na FAN3_F_RPM | 15996.000 | RPM | ok | na | 430.000 | na | na | na | na FAN3_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na FAN4_F_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na FAN4_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na ...... ``` 4. Run `ipmitool -I lanplus -H <bmc_ip2> -U xxx -P xxx sensor list` 5. Observe the normal reply: ```none FAN1_PWM | 85.000 | percent | ok | na | na | na | na | na | na FAN2_PWM | 85.000 | percent | ok | na | na | na | na | na | na FAN3_PWM | 85.000 | percent | ok | na | na | na | na | na | na FAN4_PWM | 85.000 | percent | ok | na | na | na | na | na | na FAN1_F_RPM | 15996.000 | RPM | ok | na | 430.000 | na | na | na | na FAN1_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na FAN2_F_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na FAN2_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na FAN3_F_RPM | 15996.000 | RPM | ok | na | 430.000 | na | na | na | na FAN3_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na FAN4_F_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na FAN4_R_RPM | 15910.000 | RPM | ok | na | 430.000 | na | na | na | na ...... ``` 6. Generally other commands are handled normally, except for 'sdr list', 'sensor list' and 'fru print' **Expected behavior** Two results are the same. **Additional context** When I study the code of ipmitool, I observe that it's the MACRO 'BRIDGE_TO_SENSOR' in include/ipmi_sdr.h that affected the result. If I manually set 'BRIDGE_TO_SENSOR' to false, the result of ipmitool command is normal. ```none #define BRIDGE_TO_SENSOR(_intf, _addr, _chan) \ ( !((_chan == 0 && _intf->target_ipmb_addr && \ _intf->target_ipmb_addr == _addr) || \ (_addr == _intf->target_addr && _chan == _intf->target_channel)) ) ``` I add some print, and see the values in the MACRO: ```none _chan = 0 _intf->target_ipmb_addr = 0 _addr = 0x20 _intf->target_addr = 4 _intf->target_channel = 0 ``` It seems that _intf->target_ipmb_addr is obtained via netFn 0x2C cmd 0x01 (in ipmi_picmg_ipmb_address, or 0x40 in ipmi_vita_ipmb_address), which is not a standard command to get target_ipmb_addr?

Please confirm that the bug still exists with the latest code from the top of master branch here, there have been over 300 commits since 1.8.19 that you're using.

Please confirm that the bug still exists with the latest code from the top of `master` branch here, there have been over 300 commits since 1.8.19 that you're using.
Sign in to join this conversation.
No Branch/Tag specified
master
bugfix/43-Fix-timezone-and-DST-in-SEL
pages
bugfix/fix-ci-builds
feature/refactor-sdr-name-handling
cleanup/nm
feature/add-support-for-boot-mailbox
codefactor
bugfix/26
IPMITOOL_1_8_19
IPMITOOL_1_8_18
IPMITOOL_1_8_17
IPMITOOL_1_8_16
IPMITOOL_1_8_15
IPMITOOL_1_8_15RC1
IPMITOOL_1_8_14
IPMITOOL_1_8_14RC2
IPMITOOL_1_8_14RC1
ipmitool
IPMITOOL_1_8_13
IPMITOOL_1_8_13RC1
IPMITOOL_1_8_12
IPMITOOL_1_8_9
IPMITOOL_1_8_8
IPMITOOL_1_8_7
IPMITOOL_1_8_6
IPMITOOL_1_8_5
IPMITOOL_1_8_0
IPMITOOL_S10_U1
IPMITOOL_1_6_1
IPMITOOL_1_6_0
IPMITOOL_1_5_9
IPMITOOL_1_5_8
IPMITOOL_1_5_7
IPMITOOL_1_5_6
IPMITOOL_1_5_4
IPMITOOL_1_4_1_1
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IPMITool/ipmitool#55
Reference in a new issue
IPMITool/ipmitool
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?