<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:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" 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:"Google Sans Mono";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}
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;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@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="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<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>
<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
<o:p></o:p></span></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<o:p></o:p></span></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
<o:p></o:p></span></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
<o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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;font-family:"Google Sans Mono",serif;color:black;mso-ligatures:none">14</span><span style="font-size:9.0pt;font-family:"Google Sans Mono",serif;mso-ligatures:none"><o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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;font-family:"Google Sans Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans Mono",serif;mso-ligatures:none"><o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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;font-family:"Google Sans Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans Mono",serif;mso-ligatures:none"><o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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;font-family:"Google Sans Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans Mono",serif;mso-ligatures:none"><o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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;font-family:"Google Sans Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans Mono",serif;mso-ligatures:none"><o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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<o:p></o:p></span></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;font-family:"Google Sans Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans Mono",serif;mso-ligatures:none"><o:p></o:p></span></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<o:p></o:p></span></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>
<p class="MsoPlainText">-----Original Message-----<br>
From: Ed Tanous <edtanous@google.com> <br>
Sent: Tuesday, May 9, 2023 2:22 AM<br>
To: Rohit Pai <ropai@nvidia.com><br>
Cc: openbmc@lists.ozlabs.org<br>
Subject: Re: IPMI Sensor Name limitation of 16 bytes</p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">External email: Use caution opening links or attachments<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">On Mon, May 8, 2023 at 10:52 AM Rohit Pai <<a href="mailto:ropai@nvidia.com"><span style="color:windowtext;text-decoration:none">ropai@nvidia.com</span></a>> wrote:<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> Would like to receive feedback about this solution and any alternative that may exist to solve this problem. Any pointers on existing patch also would be helpful.<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Overall, I'm in support of this feature, and I think it would give us a lot more flexibility in Redfish in the future. It's one of the design points that I really wasn't happy with in the original sensor subsystem.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">While I think most would directly take this feature, one thing to keep in mind is that there were organizations that had the requirement to be able to map IPMI names to Redfish names using a reasonable algorithm. Having this supported
would break that requirement, but I think that's something that an individual machine can figure out by coming up with names less than 16 characters for platforms that have this requirement.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">One thing I would also very much caution against is reducing the performance of SDR listing any more than it already is. It's current performance is at basically the bare minimum of where it should be, so if making this change requires
any additional dbus calls, that's going to cause some problems.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">One thing I had advocated for in the past is simply doing algorithmic string reduction until it fits, using the most common transforms.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Power -> Pwr<o:p></o:p></p>
<p class="MsoPlainText">Temperature -> Temp<o:p></o:p></p>
<p class="MsoPlainText">Power Supply -> PSU<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">These are algorithms that humans already do today manually to get to the 16 char length, so in theory you could do this transform without any changes needed to the actual platform configs, and if someone wanted to reverse the algorithm
later and come up with the Redfish string, they could. Something you could consider, but there might be simpler ideas that meet your goals.<o:p></o:p></p>
</div>
</body>
</html>