<html 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=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.p1, li.p1, div.p1
{mso-style-name:p1;
margin:0cm;
font-size:10.5pt;
font-family:Helvetica;}
p.p2, li.p2, div.p2
{mso-style-name:p2;
margin:0cm;
font-size:10.5pt;
font-family:Helvetica;
color:#0000C0;}
p.p3, li.p3, div.p3
{mso-style-name:p3;
margin:0cm;
font-size:10.5pt;
font-family:Helvetica;
color:#3F7F5F;}
p.p4, li.p4, div.p4
{mso-style-name:p4;
margin:0cm;
font-size:10.5pt;
font-family:Helvetica;}
p.p5, li.p5, div.p5
{mso-style-name:p5;
margin:0cm;
font-size:10.5pt;
font-family:Helvetica;
color:#2A00FF;}
span.s1
{mso-style-name:s1;
color:#005032;}
span.s2
{mso-style-name:s2;
color:#7F0055;}
span.s3
{mso-style-name:s3;
color:black;}
span.s4
{mso-style-name:s4;
color:#3F7F5F;}
span.s5
{mso-style-name:s5;
color:#0000C0;}
span.s6
{mso-style-name:s6;
color:#2A00FF;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:2018270677;
mso-list-type:hybrid;
mso-list-template-ids:-1510672438 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style>
</head>
<body lang="en-VN" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi everyone,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m Tung Nguyen, developer for AmpereComputing - Altra system. While working with the IPMI commands I have a concern when comparing the design document and the implementation like the following:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The state-management-and-external-interfaces.md<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">The full mapping of Redfish and IPMI to xyz.openbmc_project.State.* is as follows:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Redfish IPMI xyz.openbmc_project.State.Transition<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Courier New";color:black">ForceOff</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:black">
<b>power down</b> <b>Chassis.Off</b><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">ForceOn power up Host.On<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">ForceRestart hard reset Host.ForceWarmReboot<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">GracefulRestart Host.GracefulWarmReboot<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">GracefulShutdown soft off Host.Off<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">On power up Host.On<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">PowerCycle (host on) power cycle Host.Reboot<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">PowerCycle (host off) Chassis.PowerCycle<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">the IPMI – chassishandler.cpp:<o:p></o:p></span></p>
<p class="p1"><span style="font-size:10.0pt">ipmi::<span class="s1">RspType</span><>
<b>ipmiChassisControl</b>(<span class="s1">uint8_t</span> chassisControl)<o:p></o:p></span></p>
<p class="p1"><span style="font-size:10.0pt">{<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span class="s2"><b><span style="font-size:10.0pt">int</span></b></span><span style="font-size:10.0pt"> rc = 0;<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span class="s2"><b><span style="font-size:10.0pt">switch</span></b></span><span style="font-size:10.0pt"> (chassisControl)<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">{<o:p></o:p></span></p>
<p class="p2"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span class="s2"><b><span style="font-size:10.0pt">case</span></b></span><span class="s3"><span style="font-size:10.0pt">
</span></span><i><span style="font-size:10.0pt">CMD_POWER_ON</span></i><span class="s3"><span style="font-size:10.0pt">:</span></span><span style="font-size:10.0pt"><o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">rc = initiate_state_transition(State::Host::Transition::On);<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span class="s2"><b><span style="font-size:10.0pt">break</span></b></span><span style="font-size:10.0pt">;<o:p></o:p></span></p>
<p class="p2"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span class="s2"><b><span style="font-size:10.0pt">case</span></b></span><span class="s3"><span style="font-size:10.0pt">
</span></span><i><span style="font-size:10.0pt">CMD_POWER_OFF</span></i><span class="s3"><span style="font-size:10.0pt">:</span></span><span style="font-size:10.0pt"><o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// This path would be hit in 2 conditions.<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// 1: When user asks for power off using ipmi chassis command 0x04<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// 2: Host asking for power off post shutting down.<o:p></o:p></span></p>
<p class="p4"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// If it's a host requested power off, then need to nudge Softoff<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// application that it needs to stop the watchdog timer if running.<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// If it is a user requested power off, then this is not really<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// needed. But then we need to differentiate between user and host<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// calling this same command<o:p></o:p></span></p>
<p class="p4"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// For now, we are going ahead with trying to nudge the soft off and<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// interpret the failure to do so as a non softoff case<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">rc = stop_soft_off_timer();<o:p></o:p></span></p>
<p class="p4"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// Only request the Off transition if the soft power off<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// application is not running<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span class="s2"><b><span style="font-size:10.0pt">if</span></b></span><span style="font-size:10.0pt"> (rc < 0)<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">{<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// First create a file to indicate to the soft off application<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// that it should not run. Not doing this will result in State<o:p></o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// manager doing a default soft power off when asked for power<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span class="s4"><span style="font-size:10.0pt">// off.</span></span><span style="font-size:10.0pt"><o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">indicate_no_softoff_needed();<o:p></o:p></span></p>
<p class="p4"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="p3"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span style="font-size:10.0pt">// Now request the shutdown<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">rc = initiate_state_transition(<b>State::Host::Transition::Off);</b><o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">}<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span class="s2"><b><span style="font-size:10.0pt">else</span></b></span><span style="font-size:10.0pt"><o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">{<o:p></o:p></span></p>
<p class="p5"><span class="apple-converted-space"><span style="font-size:10.0pt;color:black">
</span></span><span class="s3"><span style="font-size:10.0pt">log<</span></span><span class="s1"><span style="font-size:10.0pt">level</span></span><span class="s3"><span style="font-size:10.0pt">::</span></span><span class="s5"><i><span style="font-size:10.0pt">INFO</span></i></span><span class="s3"><span style="font-size:10.0pt">>(</span></span><span style="font-size:10.0pt">"Soft
off is running, so let shutdown target "<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span class="s6"><span style="font-size:10.0pt">"stop the host"</span></span><span style="font-size:10.0pt">);<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span style="font-size:10.0pt">}<o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span style="font-size:10.0pt">
</span></span><span class="s2"><b><span style="font-size:10.0pt">break</span></b></span><span style="font-size:10.0pt">;<o:p></o:p></span></p>
<p class="p1"><o:p> </o:p></p>
<p class="p1"><span lang="EN-US">The redfish – systems.hpp:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica">
<b><span style="color:#7F0055">else</span></b> <b><span style="color:#7F0055">if</span></b> (resetType ==
<span style="color:#2A00FF">"ForceOff"</span>)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica"> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black"> command =
</span><span style="font-size:10.0pt;font-family:Helvetica;color:#2A00FF">"xyz.openbmc_project.State.Chassis.Transition.Off"</span><span style="font-size:10.0pt;font-family:Helvetica;color:black">;</span><span style="font-size:10.0pt;font-family:Helvetica;color:#2A00FF"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica"> hostCommand =
<b><span style="color:#7F0055">false</span></b>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica"> }<o:p></o:p></span></p>
<p class="p1"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="p1"><o:p> </o:p></p>
<p class="p1"><span lang="EN-US">Although the </span>indicate_no_softoff_needed()<span lang="EN-US"> can prevent the host from soft off, but it seems like a mismatch b/w the design document and the IPMI implementation.<o:p></o:p></span></p>
<p class="p1"><span lang="EN-US">So, my question: is it reasonable for IPMI command ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Reference:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">https://github.com/openbmc/docs/blob/master/designs/state-management-and-external-interfaces.md<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Tung<o:p></o:p></span></p>
</div>
</body>
</html>