<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Century Gothic";
panose-1:2 11 5 2 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello Johnathan, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for your reply. <o:p></o:p></p>
<p class="MsoNormal">>> We're proposing adding a "ShortName" entry to the JSON configuration file read by Entity Manager.<o:p></o:p></p>
<p class="MsoNormal">Could you please add some more detail here, how this would be consumed by ipmid ?
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The sensors can be created by an application, and we were looking to do modification in one place where this conversion can happen.
<o:p></o:p></p>
<p class="MsoNormal">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.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks <o:p></o:p></p>
<p class="MsoNormal">Rohit PAI <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="mso-ligatures:none">From:</span></b><span style="mso-ligatures:none"> Johnathan Mantey <johnathanx.mantey@intel.com>
<br>
<b>Sent:</b> Wednesday, June 28, 2023 7:42 PM<br>
<b>To:</b> Rohit Pai <ropai@nvidia.com>; Ed Tanous <edtanous@google.com>; openbmc@lists.ozlabs.org<br>
<b>Subject:</b> Re: IPMI Sensor Name limitation of 16 bytes<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="1" cellspacing="3" cellpadding="0" style="background:#FFEB9C">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black">External email: Use caution opening links or attachments</span></b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black">
</span><span style="mso-ligatures:none"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On 6/28/23 03:23, Rohit Pai wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoPlainText">Hello, <o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText">Below I have the proposal for a simple algorithm which seem to work for the sensors names we have in our platforms.
<o:p></o:p></p>
<p class="MsoPlainText">Any feedback on making it more generic and reusable would be appreciated.
<o:p></o:p></p>
</blockquote>
<p>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.<o:p></o:p></p>
<p>For example:<br>
"Name": "CPU_ADC_Controller",<br>
"ShortName": "CPU_ADC_Ctrlr",<o:p></o:p></p>
<p>The long example below might be represented by a human like this:<br>
"Name": "ProcessorModule_0_MemCntl_0_PageRetirementCountl_0",<br>
"ShortName": "PM0_MC0_PgRC0"<br>
This is 13 chars, and leaves room for regex replacement of the '0' characters to allow for PM1_MC0, PM0_MC2, etc...<br>
<br>
This also does away with the current solution that erases specific strings, which increases the probability of a sensor name collision.<br>
constexpr std::array<const char*, 7> suffixes = {<br>
"_Output_Voltage", "_Input_Voltage", "_Output_Current", "_Input_Current",<br>
"_Output_Power", "_Input_Power", "_Temperature"};<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText">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.
<o:p></o:p></p>
<p class="MsoPlainText">Step 2: Start from the first sub word and repeat for all the sub words. <o:p></o:p></p>
<p class="MsoPlainText"> 2.1: if the sub word character length is less than allowed_min_char_length then skip and leave it as it is. <o:p></o:p></p>
<p class="MsoPlainText"> 2.2: else remove all the characters from the sub word which appear after the offset allowed_min_char_length<o:p></o:p></p>
<p class="MsoPlainText"> 2.3: Stop the abbreviation process if the total length of the new string is less than 16 chars.
<o:p></o:p></p>
<p class="MsoPlainText">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.
<o:p></o:p></p>
<p class="MsoPlainText"> 3.1: if the sub word character length is less than threshold then skip and leave it as it is.
<o:p></o:p></p>
<p class="MsoPlainText"> 3.2: else remove all the characters from the sub word which appear after the offset threshold.
<o:p></o:p></p>
<p class="MsoPlainText"> 3.3: Stop the abbreviation process if the total length of the new string is less than 16 chars.<o:p></o:p></p>
<p class="MsoPlainText">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.<o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText">Some unit test data with allowed_min_char_length set to value 5.
<o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="border-collapse:collapse">
<tbody>
<tr style="height:15.75pt">
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">Length
</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-left:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">Input Names</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-left:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">New Length
</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-left:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">Short Names
</span><o:p></o:p></p>
</td>
</tr>
<tr style="height:15.75pt">
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">14</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">CPU_0_Energy_0</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:9.0pt;color:black">14</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">CPU_0_Energy_0</span><o:p></o:p></p>
</td>
</tr>
<tr style="height:15.75pt">
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">20</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">GPU_0_DRAM_0_Power_0</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:9.0pt;color:black">15</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">GPU0DRAM0Power0</span><o:p></o:p></p>
</td>
</tr>
<tr style="height:15.75pt">
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">20</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">CPU_0_EDPViolation_0</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:9.0pt;color:black">15</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">CPU0EDPViolati0</span><o:p></o:p></p>
</td>
</tr>
<tr style="height:15.75pt">
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">26</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">ProcessorModule_0_Energy_0</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:9.0pt;color:black">15</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">ProcModu0Energ0</span><o:p></o:p></p>
</td>
</tr>
<tr style="height:15.75pt">
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">23</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">Baseboard_HSC_0_Power_0</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:9.0pt;color:black">15</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">BasebHSC0Power0</span><o:p></o:p></p>
</td>
</tr>
<tr style="height:15.75pt">
<td valign="bottom" style="border:solid #CCCCCC 1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">50</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">ProcessorModule_0_MemCntl_0_PageRetirementCountl_0</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:9.0pt;color:black">15</span><o:p></o:p></p>
</td>
<td valign="bottom" style="border-top:none;border-left:none;border-bottom:solid #CCCCCC 1.0pt;border-right:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">PM0MC0PaReCoun0</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText">Thanks <o:p></o:p></p>
<p class="MsoPlainText">Rohit <o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="mso-ligatures:none">--
<br>
</span><span style="font-family:"Century Gothic",sans-serif;color:#1F497D;mso-ligatures:none">Johnathan Mantey<br>
</span><span style="font-size:7.5pt;font-family:"Century Gothic",sans-serif;color:#1F497D;mso-ligatures:none">Senior Software Engineer</span><span style="font-family:"Century Gothic",sans-serif;color:#1F497D;mso-ligatures:none"><br>
</span><b><span style="font-size:10.0pt;font-family:"Century Gothic",sans-serif;color:#555555;mso-ligatures:none">azad technology partners</span></b><span style="font-size:12.0pt;font-family:"Century Gothic",sans-serif;color:#555555;mso-ligatures:none"><br>
</span><span style="font-size:7.5pt;font-family:"Century Gothic",sans-serif;color:#1F497D;mso-ligatures:none">Contributing to Technology Innovation since 1992</span><span style="font-size:7.5pt;font-family:"Century Gothic",sans-serif;color:#555555;mso-ligatures:none"><br>
</span><span style="font-size:7.5pt;font-family:"Century Gothic",sans-serif;color:#1F497D;mso-ligatures:none">Phone: (503) 712-6764<br>
Email: <a href="mailto:johnathanx.mantey@intel.com">johnathanx.mantey@intel.com</a></span><span style="mso-ligatures:none"><o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>