From: liangzhen Date: Wed, 7 Jan 2009 08:09:24 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_140~33 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=2c2100329b3a57ee8fc3dff9e7cef18768a6f788 Branch HEAD lnet_parse_put() should re-match after lnet_eager_recv_locked() b=17537 i=isaac i=maxim --- diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index 0714d6f..3fa3d8d 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -477,6 +477,7 @@ typedef struct { 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; diff --git a/lnet/lnet/lib-md.c b/lnet/lnet/lib-md.c index b99e3aa..6c988f2 100644 --- a/lnet/lnet/lib-md.c +++ b/lnet/lnet/lib-md.c @@ -244,6 +244,8 @@ LNetMDAttach(lnet_handle_me_t meh, lnet_md_t umd, } 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; diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 5b207da..0d443a7 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1605,12 +1605,14 @@ lnet_parse_put(lnet_ni_t *ni, lnet_msg_t *msg) { int rc; int index; + __u64 version; 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_portal_t *ptl; src.nid = hdr->src_nid; src.pid = hdr->src_pid; @@ -1621,9 +1623,11 @@ lnet_parse_put(lnet_ni_t *ni, lnet_msg_t *msg) hdr->msg.put.offset = le32_to_cpu(hdr->msg.put.offset); index = hdr->msg.put.ptl_index; + ptl = &the_lnet.ln_portals[index]; LNET_LOCK(); + again: rc = lnet_match_md(index, LNET_MD_OP_PUT, src, rlength, hdr->msg.put.offset, hdr->msg.put.match_bits, msg, @@ -1634,24 +1638,31 @@ lnet_parse_put(lnet_ni_t *ni, lnet_msg_t *msg) 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: - 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); - - LNET_UNLOCK(); return 0; } /* fall through */