commit | a3476273f00c6c2fc7cb47730b6d2d4ed9ade62d | [log] [tgz] |
---|---|---|
author | Harvey Wu <Harvey.Wu@quantatw.com> | Wed Mar 22 10:09:38 2023 +0800 |
committer | Harvey Wu <Harvey.Wu@quantatw.com> | Mon Apr 10 09:37:59 2023 +0800 |
tree | a447cad67b514a48c0d0710fc2451f74446ee583 | |
parent | 9e666cdaab413193d2e723f3060fe4c14db3e513 [diff] |
fix sdr count when number > 255 - After PR-60906, it will count the fru data and type 12 sensors. But when SDR count > 255, there are some problems. - If the lun of cmd isn't 0, the start position of recordID need to be updated. - Using if condition to add type 12 sensors. Because if sensor number + fru device is 254, it will overflow after adding 2 type 12 sensors. - The type of sdrCount is uint8, which means the maximum value is 255, so it needs to break while loop if the count reaches 255. refs: https://gerrit.openbmc.org/c/openbmc/phosphor-host-ipmid/+/60906 TEST: root@bmc:~# ipmitool sdr elist | wc -l 281 => 0x119 root@bmc:~# ipmitool sdr elist all | wc -l 295 => 0x127 Before: root@bmc:~# ipmitool raw -l 0 0x04 0x20 0x00 ff 83 c8 56 a2 63 root@bmc:~# ipmitool raw -l 0 0x04 0x20 0x01 ERROR 27 83 c8 56 a2 63 => count overflow root@bmc:~# ipmitool raw -l 1 0x04 0x20 0x00 1a 83 c8 56 a2 63 root@bmc:~# ipmitool raw -l 1 0x04 0x20 0x01 ERROR 1c 83 c8 56 a2 63 => doesn't count the fru data After: root@bmc:~# ipmitool raw -l 0 0x04 0x20 0x00 ff 83 3e 2c a3 63 root@bmc:~# ipmitool raw -l 0 0x04 0x20 0x01 ff 83 3e 2c a3 63 root@bmc:~# ipmitool raw -l 1 0x04 0x20 0x00 1a 83 3e 2c a3 63 root@bmc:~# ipmitool raw -l 1 0x04 0x20 0x01 28 83 3e 2c a3 63 If count < 255, root@bmc:~# ipmitool sdr elist | wc -l 151 root@bmc:~# ipmitool sdr elist all | wc -l 165 root@bmc:~# ipmitool raw -l 0 0x04 0x20 0x00 97 81 f0 2b a2 63 root@bmc:~# ipmitool raw -l 0 0x04 0x20 0x01 a5 81 f0 2b a2 63 Signed-off-by: Harvey Wu <Harvey.Wu@quantatw.com> Change-Id: Ic4645c82d85e154bea5dc7fdd6b54d1331e58c36
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C builddir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in ipmid/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja -C builddir test ninja -C builddir coverage