Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra SDR Entries With Dynamic Sensors #186

Open
iwoloschin opened this issue Oct 19, 2022 · 2 comments
Open

Extra SDR Entries With Dynamic Sensors #186

iwoloschin opened this issue Oct 19, 2022 · 2 comments

Comments

@iwoloschin
Copy link

iwoloschin commented Oct 19, 2022

I am using phosphor-host-ipmid at SRCREV = "a23af1206bc4c835516909c87c71be0e7428264c" (this is slightly out of date), when I run ipmitool commands, such as ipmitool sdr or ipmitool fru on the host or BMC I get something like this:

Get SDR 004b command failed: Invalid data field in request
Get SDR 004b command failed: Invalid data field in request
Get SDR 004b command failed: Invalid data field in request
Get SDR 004b command failed: Invalid data field in request
Get SDR 004b command failed: Invalid data field in request

I can recreate this in qemu, less sensors so the number is lower.

~# ipmitool sdr
CPU              | no reading        | ns
Memory           | no reading        | ns
Storage RW       | no reading        | ns
Get SDR 0005 command failed: Invalid data field in request
Get SDR 0005 command failed: Invalid data field in request
Get SDR 0005 command failed: Invalid data field in request
Get SDR 0005 command failed: Invalid data field in request
Get SDR 0005 command failed: Invalid data field in request

The error is printed to stderr so it is pretty easy to ignore, but it winds up causing ipmitool commands to retry and bunch and take a lot longer to exit than they should. It seems as if ipmitool commands are exiting cleanly, despite the error, but in this case that is actually good as all of the expected data is present.

I unfortunately cannot share source, but I believe this can be recreated by simply enabling dynamic sensors.

@iwoloschin
Copy link
Author

This was resolved by @zevweiss by adding the following snippet to phosphor-ipmi-config.bbappend:

do_install:append() {
    # the default dummy data provided for this file causes breakage in
    # Get SDR commands.  Clearing out the provided entity-map entirely
    # avoids the issue.
    echo "[]" > ${D}${datadir}/ipmi-providers/entity-map.json
}

I'll leave this open for maintainers to decide whether or not that is a sufficient fix.

@pointbazaar
Copy link
Contributor

diff --git a/dbus-sdr/sensorcommands.cpp b/dbus-sdr/sensorcommands.cpp
index e48cd91..5877e66 100644
--- a/dbus-sdr/sensorcommands.cpp
+++ b/dbus-sdr/sensorcommands.cpp
@@ -2413,14 +2413,8 @@ ipmi::RspType<uint16_t,            // next record ID
         return ipmi::response(ret);
     }
 
-    const auto& entityRecords =
-        ipmi::sensor::EntityInfoMapContainer::getContainer()
-            ->getIpmiEntityRecords();
-    int entityCount = entityRecords.size();
-
     auto& sensorTree = getSensorTree();
-    size_t lastRecord = getNumberOfSensors() + fruCount +
-                        ipmi::storage::type12Count + entityCount - 1;
+    size_t lastRecord = getNumberOfSensors() + fruCount - 1;
     uint16_t nextRecordId = lastRecord > recordID ? recordID + 1 : 0XFFFF;
 
     if (!getSensorSubtree(sensorTree) && sensorTree.empty())
-- 
2.41.0

what i have. probably breaks something but atleast sensors + fru devices are there. above fix is probably better.

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

No branches or pull requests

2 participants