lnet_parse_put() should re-match after lnet_eager_recv_locked()
b=17537
i=isaac
i=maxim
typedef struct {
struct list_head ptl_ml; /* match list */
struct list_head ptl_msgq; /* messages blocking for MD */
typedef struct {
struct list_head ptl_ml; /* match list */
struct list_head ptl_msgq; /* messages blocking for MD */
+ __u64 ptl_ml_version; /* validity stamp, only changed for new attached MD */
__u64 ptl_msgq_version; /* validity stamp */
unsigned int ptl_options;
} lnet_portal_t;
__u64 ptl_msgq_version; /* validity stamp */
unsigned int ptl_options;
} lnet_portal_t;
} else {
rc = lib_md_build(md, &umd, unlink);
if (rc == 0) {
} else {
rc = lib_md_build(md, &umd, unlink);
if (rc == 0) {
+ the_lnet.ln_portals[me->me_portal].ptl_ml_version++;
+
me->me_md = md;
md->md_me = me;
me->me_md = md;
md->md_me = me;
lnet_hdr_t *hdr = &msg->msg_hdr;
unsigned int rlength = hdr->payload_length;
unsigned int mlength = 0;
unsigned int offset = 0;
lnet_process_id_t src= {0};
lnet_libmd_t *md;
lnet_hdr_t *hdr = &msg->msg_hdr;
unsigned int rlength = hdr->payload_length;
unsigned int mlength = 0;
unsigned int offset = 0;
lnet_process_id_t src= {0};
lnet_libmd_t *md;
src.nid = hdr->src_nid;
src.pid = hdr->src_pid;
src.nid = hdr->src_nid;
src.pid = hdr->src_pid;
hdr->msg.put.offset = le32_to_cpu(hdr->msg.put.offset);
index = hdr->msg.put.ptl_index;
hdr->msg.put.offset = le32_to_cpu(hdr->msg.put.offset);
index = hdr->msg.put.ptl_index;
+ ptl = &the_lnet.ln_portals[index];
rc = lnet_match_md(index, LNET_MD_OP_PUT, src,
rlength, hdr->msg.put.offset,
hdr->msg.put.match_bits, msg,
rc = lnet_match_md(index, LNET_MD_OP_PUT, src,
rlength, hdr->msg.put.offset,
hdr->msg.put.match_bits, msg,
case LNET_MATCHMD_OK:
LNET_UNLOCK();
case LNET_MATCHMD_OK:
LNET_UNLOCK();
- lnet_recv_put(md, msg, 0, offset, mlength);
+ lnet_recv_put(md, msg, msg->msg_delayed, offset, mlength);
return 0;
case LNET_MATCHMD_NONE:
return 0;
case LNET_MATCHMD_NONE:
- rc = lnet_eager_recv_locked(msg);
- if (rc == 0 && !the_lnet.ln_shutdown) {
- list_add_tail(&msg->msg_list,
- &the_lnet.ln_portals[index].ptl_msgq);
+ version = ptl->ptl_ml_version;
+
+ rc = 0;
+ if (!msg->msg_delayed)
+ rc = lnet_eager_recv_locked(msg);
+
+ if (rc == 0 &&
+ !the_lnet.ln_shutdown &&
+ ((ptl->ptl_options & LNET_PTL_LAZY) != 0)) {
+ if (version != ptl->ptl_ml_version)
+ goto again;
- the_lnet.ln_portals[index].ptl_msgq_version++;
+ list_add_tail(&msg->msg_list, &ptl->ptl_msgq);
+ ptl->ptl_msgq_version++;
+ LNET_UNLOCK();
CDEBUG(D_NET, "Delaying PUT from %s portal %d match "
LPU64" offset %d length %d: no match \n",
libcfs_id2str(src), index,
hdr->msg.put.match_bits,
hdr->msg.put.offset, rlength);
CDEBUG(D_NET, "Delaying PUT from %s portal %d match "
LPU64" offset %d length %d: no match \n",
libcfs_id2str(src), index,
hdr->msg.put.match_bits,
hdr->msg.put.offset, rlength);
return 0;
}
/* fall through */
return 0;
}
/* fall through */