bugGNU FreeIPMI - Bugs: bug #38799, IPMI 2.0 "Special Timestamp...

 
 

bug #38799: IPMI 2.0 "Special Timestamp values" are not supported

Submitted by:  Rob Swindell <rswindell>
Submitted on:  Mon 22 Apr 2013 04:38:24 AM UTC  
 
Category: ipmi-selSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Improper Behaviour
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Operating System: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 01 May 2013 01:04:38 AM UTC, comment #3:

This has been fixed in the FreeIPMI trunk.

A new function ipmi_timestamp_string() was added into libfreeipmi and was used appropriately throughout FreeIPMI (in ipmi-fru, ipmi-sel, ipmi-sensors, ipmi-oem, ipmi-dcmi, and bmc-device).

Albert Chu <chu11>
Project Administrator
Sat 27 Apr 2013 03:39:48 PM UTC, comment #2:

In order to get this to work in all of FreeIPMI, it'll require a bit of architecture change, so I'm going to aim this for FreeIPMI 1.3.1 instead of a 1.2.X minor release.

Albert Chu <chu11>
Project Administrator
Thu 25 Apr 2013 10:29:12 PM UTC, comment #1:

Here's a patch for one instance of this problem. A more generic "IPMI timestamp" display function should be created and used through-out the IPMI/DCMI code to address this problem globally:

Index: bmc-device/bmc-device.c
===================================================================
--- bmc-device/bmc-device.c (revision 9608)
+++ bmc-device/bmc-device.c (working copy)
@@ -1274,15 +1274,26 @@
goto cleanup;
}

- /* Posix says individual calls need not clear/set all portions of
- * 'struct tm', thus passing 'struct tm' between functions could
- * have issues. So we need to memset.
- */
- memset (&tm, '\0', sizeof(struct tm));
+/* Per IPMI 2.0 section 37.1: */
+#define IPMI_TIMESTAMP_UNSPECIFIED 0xffffffff
+#define IPMI_TIMESTAMP_POST_INIT 0x20000000
+ if (val == IPMI_TIMESTAMP_UNSPECIFIED)
+ snprintf (timestr, sizeof (timestr), "Unspecified");
+ else if (val <= IPMI_TIMESTAMP_POST_INIT)
+ snprintf (timestr, sizeof (timestr), "%u seconds since initialization", (unsigned)val);
+ else
+ {
+ /* Posix says individual calls need not clear/set all portions of
+ * 'struct tm', thus passing 'struct tm' between functions could
+ * have issues. So we need to memset.
+ */
+ memset (&tm, '\0', sizeof(struct tm));

- t = val;
- localtime_r (&t, &tm);
- strftime (timestr, sizeof (timestr), "%m/%d/%Y - %H:%M:%S", &tm);
+ t = val;
+ localtime_r (&t, &tm);
+ strftime (timestr, sizeof (timestr), "%m/%d/%Y - %H:%M:%S", &tm);
+ }
+
pstdout_printf (state_data->pstate,
"SEL Time : %s\n",
timestr);

Rob Swindell <rswindell>
Mon 22 Apr 2013 04:38:24 AM UTC, original submission:

IPMI 2.0 section 37.1 ("Special Timestamp values") states that the timestamp values 0xffffffff and values 0x00000000 through 0x20000000 are to be treat specially, yet ipmi-sel and bmc-device do not treat these timestamp values (e.g. from SEL or SDR repository) any different than any other timestamp values.

To be compliant with IPMI 2.0 section 37.1:

Timestamp value 0xffffffff should be displayed to the user as "unknown" or "unspecified".

Timestamp values 0x00000000 through 0x20000000 should be displayed as "seconds since initialization" and not interpreted/displayed as an actual wall-clock date/time.

Rob Swindell <rswindell>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by chu11 (Posted a comment)
  • -unavailable- added by rswindell (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 01 May 2013 01:04:38 AM UTCchu11Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1