<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=us-ascii">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.textexposedshow
        {mso-style-name:text_exposed_show;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:570232692;
        mso-list-template-ids:651487972;}
@list l0:level1
        {mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi All, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">          Please find below the gerrit links for the Design and Sample code implementation of BIC request handling in the ipmi.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">          Design : <a href="https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/32213">
<span style="color:#1F497D;text-decoration:none">https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/32213</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">          Sample code implementation :
<a href="https://gerrit.openbmc-project.xyz/c/openbmc/fb-ipmi-oem/+/32215"><span style="color:#1F497D;text-decoration:none">https://gerrit.openbmc-project.xyz/c/openbmc/fb-ipmi-oem/+/32215</span></a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">         So, This is regarding the ipmi implementation issue as per the new design of handling BIC request,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="color:#1F497D"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span style="color:#1F497D">The Netfn= 0x38 and cmd=1 is verified, we are getting the commands from the BIC, the same is received at ipmb and ipmid also. The register call back is also called. When we fill up the response from
 the ipmiOemBicHandler works fine. The response is received at the BIC as well.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="color:#1F497D"><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span style="color:#1F497D">But as per the new design, we need to call ipmid-command handler recursively. When we get the Netfn= 0x38 and cmd=1 command in ipmiOemBicHandler, the handler needs to open the packet and there will
 be an another command (for ex Netfn=6 and cmd=1 get_dev_id). ipmiOemBicHandler needs to send this command again to ipmid for getting the response. This makes a recursive call.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="color:#1F497D"><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span style="color:#1F497D">This recursive call is failed with boost::asio library, as “thread operation not supported”. Then we tried enabling theading in ipmid, this crashes the ipmid process. (Method 2 in the gerrit link)<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">GDB LOG :<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Program terminated with signal SIGSEGV, Segmentation fault.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#0 boost::asio::detail::epoll_reactor::epoll_reactor (ctx=..., this=<optimized out>)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">at /usr/include/boost/asio/detail/impl/epoll_reactor.ipp:40<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">40 /usr/include/boost/asio/detail/impl/epoll_reactor.ipp: No such file or directory.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">(gdb) bt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#0 boost::asio::detail::epoll_reactor::epoll_reactor (ctx=..., this=<optimized out>)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">at /usr/include/boost/asio/detail/impl/epoll_reactor.ipp:40<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#1 boost::asio::detail::service_registry::create<boost::asio::detail::epoll_reactor, boost::asio::execution_context> (owner=0x0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">at /usr/include/boost/asio/detail/impl/service_registry.hpp:87<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#2 0x000340ac in boost::asio::detail::service_registry::do_use_service (owner=0x0, factory=<optimized out>, key=<synthetic pointer>...,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">this=0x1879100) at /usr/include/boost/asio/detail/impl/service_registry.ipp:132<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#3 boost::asio::detail::service_registry::do_use_service (owner=0x0, factory=<optimized out>, key=<synthetic pointer>..., this=0x1879100)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">at /usr/include/boost/asio/detail/impl/service_registry.ipp:113<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#4 boost::asio::detail::service_registry::use_service<boost::asio::detail::epoll_reactor> (this=0x1879100)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">at /usr/include/boost/asio/detail/impl/service_registry.hpp:30<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#5 boost::asio::use_service<boost::asio::detail::epoll_reactor> (e=...) at /usr/include/boost/asio/impl/execution_context.hpp:35<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#6 boost::asio::detail::reactive_descriptor_service::reactive_descriptor_service (context=..., this=0x1879a78)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">at /usr/include/boost/asio/detail/impl/reactive_descriptor_service.ipp:36<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#7 boost::asio::detail::service_registry::create<boost::asio::detail::reactive_descriptor_service, boost::asio::io_context> (<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">owner=<optimized out>) at /usr/include/boost/asio/detail/impl/service_registry.hpp:87<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#8 0x76d21b7c in ?? ()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Backtrace stopped: previous frame identical to this frame (corrupt stack?)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">(gdb) q<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Also we tried calling the recursive function with sd bus method, we see the same crash. (Method 1 in the gerrit link)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">GDB LOG :<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Program terminated with signal SIGSEGV, Segmentation fault.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#0  0x4b8ec990 in ?? ()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">(gdb) bt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#0  0x4b8ec990 in ?? ()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">#1  0x4bb709a0 in ?? ()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Backtrace stopped: previous frame identical to this frame (corrupt stack?)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">(gdb) list<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">685         /usr/include/c++/9.2.0/bits/shared_ptr.h: No such file or directory.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">(gdb) <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">685         in /usr/include/c++/9.2.0/bits/shared_ptr.h<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">(gdb)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Could you please review the design and code implementation and provide your comments on this.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks in Advance.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Note : if we are not using recursive method, we need to rewrite most of the commands Request and Response handling in the ipmid.  <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Kumar.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<font face="Arial" color="Gray" size="1">::DISCLAIMER::<br>
<hr>
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or
 incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely
 those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent
 of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.<br>
<hr>
</font>
</body>
</html>