<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:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" 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 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</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 bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">Tina,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"> OK, Thanks, I miss sys_recvmsg(). So the msg is a kernel copy, not the pointer to user copy.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">--CQ<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext"> Tina Yang [mailto:tina.yang@oracle.com]
<br>
<b>Sent:</b> Friday, April 02, 2010 5:02 PM<br>
<b>To:</b> Andy Grover<br>
<b>Cc:</b> Tang, Changqing; RDS Devel<br>
<b>Subject:</b> Re: [rds-devel] FW: RDS -- how to detect peer is gone ?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Andy Grover wrote: <o:p></o:p></p>
<pre>I went ahead and opened bug 2006 with this analysis.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><a href="https://bugs.openfabrics.org/show_bug.cgi?id=2006">https://bugs.openfabrics.org/show_bug.cgi?id=2006</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Thanks! -- Regards -- Andy<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Tang, Changqing wrote:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Andy, Thank you, I will try to open a bug and provide a patch if I<o:p></o:p></pre>
<pre>could.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>After reading the rds_recvmsg() function in recv.c (RDS source code),<o:p></o:p></pre>
<pre>I find the msg.msg_controllen processing does not follow the Linux<o:p></o:p></pre>
<pre>recvmsg() man page.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>The Linux recvmsg() man page says that, upon return from recvmsg,<o:p></o:p></pre>
<pre>msg.msg_controllen should contain the length of control message<o:p></o:p></pre>
<pre>sequence. So if there is no control message, msg_controllen should be<o:p></o:p></pre>
<pre>set to zero.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>However, from the rds_recvmsg() code, if we receive rdma notification<o:p></o:p></pre>
<pre>control message, put_cmsg() is used on 'msghdr', in turn, put_cmsg()<o:p></o:p></pre>
<pre>just advance msg_control to next control message space, and<o:p></o:p></pre>
<pre>msg_controllen is decreased to the size of available space.<o:p></o:p></pre>
<pre>Eventually msg_controllen will be zero (if input length is multiple<o:p></o:p></pre>
<pre>of control message length). The same thing for receiving<o:p></o:p></pre>
<pre>RDS_CMSG_RDMA_DEST control message.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Also if there is no rdma notification control message, or other<o:p></o:p></pre>
<pre>control message, msg_controllen is not touched by RDS code.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>In another words, upon return from recvmsg(), msg_controllen is not<o:p></o:p></pre>
<pre>the buffer length RDS code filled in.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><br>
<br>
You seem to overlook the fact that the 'msghdr' rds_recvmsg() (and others like<br>
put_cmsg()) are manipulating is actually a kernel copy of the user-passed structure.<br>
To see what's returned after recvmsg(), you should go to sys_recvmsg() below,<br>
<br>
1955 if (MSG_CMSG_COMPAT & flags)<br>
1956 err = __put_user((unsigned long)msg_sys.msg_control-cmsg_ptr,<br>
1957 &msg_compat->msg_controllen);<br>
1958 else<br>
1959 err = __put_user((unsigned long)msg_sys.msg_control-cmsg_ptr,<br>
1960 &msg->msg_controllen);<br>
<br>
Here, you see the msg_controllen is indeed set to whatever it says it would in the
<br>
linux recvmsg() man page.<br>
<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Thanks for your comment.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>--CQ<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-----Original Message----- From: Andy Grover<o:p></o:p></pre>
<pre>[<a href="mailto:andy.grover@oracle.com">mailto:andy.grover@oracle.com</a>] Sent: Wednesday, March 31, 2010 6:43<o:p></o:p></pre>
<pre>PM To: Tang, Changqing Cc: RDS Devel Subject: Re: [rds-devel] FW: RDS<o:p></o:p></pre>
<pre>-- how to detect peer is gone ?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Tang, Changqing wrote:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>We strongly ask the ability to run both 32bit and 64bit RDS code on<o:p></o:p></pre>
<pre>64bit kernel.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>--CQ<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre>Please open a bug at bugs.openfabrics.org.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>This is more likely to get fixed faster if you also attach a patch.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Thanks -- Regards -- Andy<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message----- From: Andy Grover<o:p></o:p></pre>
<pre>[<a href="mailto:andy.grover@oracle.com">mailto:andy.grover@oracle.com</a>] Sent: Wednesday, March 31, 2010<o:p></o:p></pre>
<pre>4:40 PM To: Tang, Changqing Cc: RDS Devel Subject: Re: [rds-devel]<o:p></o:p></pre>
<pre>FW: RDS -- how to detect peer is gone ?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Tang, Changqing wrote:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Why not ? even IB verbs support both 32bit and 64bit apps.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre>We support 32bit apps on a 32bit kernel and 64bit apps on a 64bit <o:p></o:p></pre>
<pre>kernel. You are talking about some kind of 32bit userspace on a<o:p></o:p></pre>
<pre>64bit kernel. Nobody does that.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-- Andy<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>--CQ<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-----Original Message----- From: Andy Grover<o:p></o:p></pre>
<pre>[<a href="mailto:andy.grover@oracle.com">mailto:andy.grover@oracle.com</a>] Sent: Wednesday, March 31, 2010<o:p></o:p></pre>
<pre>1:33 PM To: Tang, Changqing Cc: RDS Devel Subject: Re:<o:p></o:p></pre>
<pre>[rds-devel] FW: RDS -- how to detect peer is gone ?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Tang, Changqing wrote:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Andy, Thank you for your confirmation, when do you have a fix<o:p></o:p></pre>
<pre>for this 32bit RDS problem on x86_64 system ?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>--CQ<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre>Running 32 bit apps on 64bit kernel is not supported.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-- Andy<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message----- From: Andy Grover<o:p></o:p></pre>
<pre>[<a href="mailto:andy.grover@oracle.com">mailto:andy.grover@oracle.com</a>] Sent: Tuesday, March 30, 2010<o:p></o:p></pre>
<pre>8:00 PM To: Tang, Changqing Cc: RDS Devel Subject: Re:<o:p></o:p></pre>
<pre>[rds-devel] FW: RDS -- how to detect peer is gone ?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Tang, Changqing wrote:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Andy, I looked 'man cmsg', 'struct rds_get_mr_args' is always<o:p></o:p></pre>
<pre>32 bytes. Here is my test code:<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>#include <stdio.h> #include <stdlib.h> #include<o:p></o:p></pre>
<pre><sys/socket.h><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>int main ()<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>{ struct cmsghdr *cmsg; char cmsgbuf[CMSG_SPACE(32)]; /*<o:p></o:p></pre>
<pre>using struct rds_get_mr_args size */<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>cmsg = (struct cmsghdr *)cmsgbuf;<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>cmsg->cmsg_len = CMSG_SPACE(32); cmsg->cmsg_type = 0; <o:p></o:p></pre>
<pre>cmsg->cmsg_level = 1;<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>fprintf(stderr, "offset %d\n",<o:p></o:p></pre>
<pre>(char*)CMSG_DATA(cmsg)-(char*)cmsg); }<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>The offset for 64bit is 16 and for 32bit is 12.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>So if my code is 32bit, I put 'struct rds_get_mr_args' on 12<o:p></o:p></pre>
<pre>bytes offset, but RDS kernel code will get it from 16 bytes<o:p></o:p></pre>
<pre>offset.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Am I wrong ? Thank you again.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre>Hi CQ,<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>First, please always CC rds-devel so this discussion may be<o:p></o:p></pre>
<pre>archived, and maybe help someone else in the future.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Regarding your question -- I think you're correct that 32bit<o:p></o:p></pre>
<pre>userland will not work with 64bit kernel.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Regards -- Andy<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>--CQ<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-----Original Message----- From: Andy Grover <o:p></o:p></pre>
<pre>[<a href="mailto:andy.grover@oracle.com">mailto:andy.grover@oracle.com</a>] Sent: Tuesday, March 30, 2010<o:p></o:p></pre>
<pre>1:41 PM To: Tang, Changqing; RDS Devel Subject: Re:<o:p></o:p></pre>
<pre>[rds-devel] FW: RDS -- how to detect peer is gone ?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Tang, Changqing wrote:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Andy, One simple question, does 32bit rds-rdma code work on<o:p></o:p></pre>
<pre>x86_64 machine ? I noticed that the size of 'struct<o:p></o:p></pre>
<pre>cmsghdr' is different between 32bit and 64bit, If the<o:p></o:p></pre>
<pre>kernel code is always 64bit, how does the RDS kernel code<o:p></o:p></pre>
<pre>figure out The control message buffer is passed as 32bit<o:p></o:p></pre>
<pre>format?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Do I miss something here ?<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre>See "man cmsg", it describes the various macros that resolve<o:p></o:p></pre>
<pre>32/64 differences.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Regards -- Andy<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Thank you. --CQ<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-----Original Message----- From: Andy Grover <o:p></o:p></pre>
<pre>[<a href="mailto:andy.grover@oracle.com">mailto:andy.grover@oracle.com</a>] Sent: Tuesday, March 16,<o:p></o:p></pre>
<pre>2010 5:44 PM To: Tang, Changqing Cc:<o:p></o:p></pre>
<pre><a href="mailto:rds-devel@oss.oracle.com">rds-devel@oss.oracle.com</a> Subject: Re: [rds-devel] FW: RDS<o:p></o:p></pre>
<pre>-- how to detect peer is gone ?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Tang, Changqing wrote:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>[CQ] yes, the node is up and the process may corrupted.<o:p></o:p></pre>
<pre>If you can extend the rds ping message a little bit to<o:p></o:p></pre>
<pre>process as optional, that would be wonderful.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre>I don't see why rds's ping functionality as-is is<o:p></o:p></pre>
<pre>insufficient for what you want to do.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>[CQ] What do you mean ? how can I use rds ping function<o:p></o:p></pre>
<pre>as-is to identify process down ?<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre>Like I said, if the process doesn't respond but the rds<o:p></o:p></pre>
<pre>ping does, then you know the machine is alive but the<o:p></o:p></pre>
<pre>process is not.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-- Andy<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>rds-devel mailing list<o:p></o:p></pre>
<pre><a href="mailto:rds-devel@oss.oracle.com">rds-devel@oss.oracle.com</a><o:p></o:p></pre>
<pre><a href="http://oss.oracle.com/mailman/listinfo/rds-devel">http://oss.oracle.com/mailman/listinfo/rds-devel</a><o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>