IPMI Sensor Name limitation of 16 bytes

Rohit Pai ropai at nvidia.com
Fri Jun 30 19:04:12 AEST 2023


Hello Johnathan,

Thanks for your reply.
>> We're proposing adding a "ShortName" entry to the JSON configuration file read by Entity Manager.
Could you please add some more detail here, how this would be consumed by ipmid ?

The sensors can be created by an application, and we were looking to do modification in one place where this conversion can happen.
Also, as per your proposal we need to know all possible names of the sensor per platform and configure it right ? We wanted to propose some auto generation algorithms where it can take up any new sensors which can get added or discovered. I agree with you on the point that auto generation algorithms can produce mangled/duplicate names.


Thanks
Rohit PAI


From: Johnathan Mantey <johnathanx.mantey at intel.com>
Sent: Wednesday, June 28, 2023 7:42 PM
To: Rohit Pai <ropai at nvidia.com>; Ed Tanous <edtanous at google.com>; openbmc at lists.ozlabs.org
Subject: Re: IPMI Sensor Name limitation of 16 bytes

External email: Use caution opening links or attachments

On 6/28/23 03:23, Rohit Pai wrote:

Hello,



Below I have the proposal for a simple algorithm which seem to work for the sensors names we have in our platforms.

Any feedback on making it more generic and reusable would be appreciated.

I am currently in the process of a different solution. Instead of using an algorithm, which is either going to come up with a very mangled solution (50 char example below), or an algorithm that may mistakenly generate duplicate sensor names, we're proposing adding a "ShortName" entry to the JSON configuration file read by Entity Manager. Doing so allows each company to decide for themselves how they want the name to appear.

For example:
"Name": "CPU_ADC_Controller",
"ShortName": "CPU_ADC_Ctrlr",

The long example below might be represented by a human like this:
"Name": "ProcessorModule_0_MemCntl_0_PageRetirementCountl_0",
"ShortName": "PM0_MC0_PgRC0"
This is 13 chars, and leaves room for regex replacement of the '0' characters to allow for PM1_MC0, PM0_MC2, etc...

This also does away with the current solution that erases specific strings, which increases the probability of a sensor name collision.
 constexpr std::array<const char*, 7> suffixes = {
     "_Output_Voltage", "_Input_Voltage", "_Output_Current", "_Input_Current",
     "_Output_Power",   "_Input_Power",   "_Temperature"};



Step 1: Split the given name into sub words using predefined delimiter set, remove all delimiters, and combine the sub words, remember the position of the delimiters. Some examples of delimiter are _, space, -, camelCase pattern, etc. Combine the words without delimiters and exit if the new string is less than 16 chars.

Step 2: Start from the first sub word and repeat for all the sub words.

               2.1: if the sub word character length is less than allowed_min_char_length then skip and leave it as it is.

               2.2: else remove all the characters from the sub word which appear after the offset allowed_min_char_length

               2.3: Stop the abbreviation process if the total length of the new string is less than 16 chars.

Step 3: Start by setting threshold as ( allowed_min_char_length - 1 ) and repeat by decreasing threshold by 1 in each iteration until it reaches value 1.

               3.1: if the sub word character length is less than threshold then skip and leave it as it is.

               3.2: else remove all the characters from the sub word which appear after the offset threshold.

               3.3: Stop the abbreviation process if the total length of the new string is less than 16 chars.

Step 4    Remove sub words starting from the first sub word until we reach last sub word or if the total length of the new string is less than 16 chars.



Some unit test data with allowed_min_char_length set to value 5.


Length
Input Names
New Length
Short Names
14
CPU_0_Energy_0
14
CPU_0_Energy_0
20
GPU_0_DRAM_0_Power_0
15
GPU0DRAM0Power0
20
CPU_0_EDPViolation_0
15
CPU0EDPViolati0
26
ProcessorModule_0_Energy_0
15
ProcModu0Energ0
23
Baseboard_HSC_0_Power_0
15
BasebHSC0Power0
50
ProcessorModule_0_MemCntl_0_PageRetirementCountl_0
15
PM0MC0PaReCoun0







Thanks

Rohit


--
Johnathan Mantey
Senior Software Engineer
azad technology partners
Contributing to Technology Innovation since 1992
Phone: (503) 712-6764
Email: johnathanx.mantey at intel.com<mailto:johnathanx.mantey at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20230630/442e7af5/attachment-0001.htm>


More information about the openbmc mailing list