<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
No, there is only the one buffer, which is posted at the beginning of time and then re-posted whenever I read a FI_MULTI_RECV CQ event.  And while buf[2].buf through buf[4].buf are earlier in the buffer than buf[0].buf, they are not anywhere near the beginning
 of it.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
greg</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Hefty, Sean <sean.hefty@intel.com><br>
<b>Sent:</b> Wednesday, June 24, 2020 4:50 PM<br>
<b>To:</b> Titus, Greg <gregory.titus@hpe.com><br>
<b>Cc:</b> libfabric-users@lists.openfabrics.org <libfabric-users@lists.openfabrics.org><br>
<b>Subject:</b> RE: multi-receive CQ entry with FI_MULTI_RECV, not the last one read by fi_cq_read()?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">> I called fi_cq_read(cq, buf, 5) and it filled in buf with 5 entries.<br>
> buf[0].flags==FI_MSG|FI_RECV and buf[0].buf was near the end of the multi-receive<br>
> buffer.  buf[1].flags==FI_MULTI_RECV.  buf[2].flags==FI_MSG|FI_RECV and buf[2].buf was<br>
> much earlier in the multi-receive buffer than buf[0].buf.  buf[3] and buf[4] were the<br>
> same as buf[2] but with different .buf pointers though both were also much earlier in<br>
> the multi-receive buffer than buf[0].buf.<br>
<br>
Are you sure that the buffer was only posted once?  When is the buffer reposted?<br>
<br>
The scenario you're describing is possible if the buffer is posted twice, or if a single buffer were split and posted as two receives.  For example:<br>
<br>
If buf[0].buf + buf[0].len is near the end of the buffer...<br>
<br>
buf[1] would mark the buffer as done (FI_MULTI_RECV set)<br>
<br>
buf[2].buf would then reference the start of the buffer again<br>
buf[3].buf would be near buf[2].buf + buf[2].len<br>
buf[4].buf ~ buf[3].buf + buf[3].len<br>
</div>
</span></font></div>
</body>
</html>