#define LNET_MATCHMD_NONE 0 /* Didn't match */
#define LNET_MATCHMD_OK 1 /* Matched OK */
-#define LNET_MATCHMD_DROP 2 /* Must be disarded */
+#define LNET_MATCHMD_DROP 2 /* Must be discarded */
static int
lnet_try_match_md (int index, int op_mask, lnet_process_id_t src,
lnet_libmd_t **md_out)
{
lnet_portal_t *ptl = &the_lnet.ln_portals[index];
- struct list_head *tmp;
lnet_me_t *me;
+ lnet_me_t *tmp;
lnet_libmd_t *md;
int rc;
return LNET_MATCHMD_DROP;
}
- list_for_each (tmp, &ptl->ptl_ml) {
- me = list_entry(tmp, lnet_me_t, me_list);
+ list_for_each_entry_safe (me, tmp, &ptl->ptl_ml, me_list) {
md = me->me_md;
- /* ME attached but MD not attached yet */
+ /* ME attached but MD not attached yet */
if (md == NULL)
continue;
LASSERT (!in_interrupt ());
LASSERT (ndiov > 0);
- while (doffset > diov->kiov_len) {
+ while (doffset >= diov->kiov_len) {
doffset -= diov->kiov_len;
diov++;
ndiov--;
}
LASSERT (nsiov > 0);
- while (soffset > siov->kiov_len) {
+ while (soffset >= siov->kiov_len) {
soffset -= siov->kiov_len;
siov++;
nsiov--;
LASSERT (!in_interrupt ());
LASSERT (niov > 0);
- while (iovoffset > iov->iov_len) {
+ while (iovoffset >= iov->iov_len) {
iovoffset -= iov->iov_len;
iov++;
niov--;
}
LASSERT (nkiov > 0);
- while (kiovoffset > kiov->kiov_len) {
+ while (kiovoffset >= kiov->kiov_len) {
kiovoffset -= kiov->kiov_len;
kiov++;
nkiov--;
LASSERT (!in_interrupt ());
LASSERT (nkiov > 0);
- while (kiovoffset > kiov->kiov_len) {
+ while (kiovoffset >= kiov->kiov_len) {
kiovoffset -= kiov->kiov_len;
kiov++;
nkiov--;
}
LASSERT (niov > 0);
- while (iovoffset > iov->iov_len) {
+ while (iovoffset >= iov->iov_len) {
iovoffset -= iov->iov_len;
iov++;
niov--;
}
if (msg->msg_peerrtrcredit) {
- /* give pack peer router credits */
+ /* give back peer router credits */
msg->msg_peerrtrcredit = 0;
LASSERT((rxpeer->lp_rtrcredits < 0) == !list_empty(&rxpeer->lp_rtrq));
return 0;
}
- CDEBUG(D_NET, "clearing portal %d lazy\n", portal);
+ if (the_lnet.ln_shutdown)
+ CWARN ("Active lazy portal %d on exit\n", portal);
+ else
+ CDEBUG (D_NET, "clearing portal %d lazy\n", portal);
/* grab all the blocked messages atomically */
list_add(&zombies, &ptl->ptl_msgq);
case LNET_MATCHMD_NONE:
rc = lnet_eager_recv_locked(msg);
- if (rc == 0) {
+ if (rc == 0 && !the_lnet.ln_shutdown) {
list_add_tail(&msg->msg_list,
&the_lnet.ln_portals[index].ptl_msgq);
/* fall through */
case LNET_MATCHMD_DROP:
- CWARN("Dropping PUT from %s portal %d match "LPU64
- " offset %d length %d: %d\n",
- libcfs_id2str(src), index,
- hdr->msg.put.match_bits,
- hdr->msg.put.offset, rlength, rc);
+ CDEBUG(D_NETERROR,
+ "Dropping PUT from %s portal %d match "LPU64
+ " offset %d length %d: %d\n",
+ libcfs_id2str(src), index,
+ hdr->msg.put.match_bits,
+ hdr->msg.put.offset, rlength, rc);
LNET_UNLOCK();
return ENOENT; /* +ve: OK but no match */
-
}
}
hdr->msg.get.match_bits, msg,
&mlength, &offset, &md);
if (rc == LNET_MATCHMD_DROP) {
- CWARN("Dropping GET from %s portal %d match "LPU64
- " offset %d length %d\n",
- libcfs_id2str(src),
- hdr->msg.get.ptl_index,
- hdr->msg.get.match_bits,
- hdr->msg.get.src_offset,
- hdr->msg.get.sink_length);
+ CDEBUG(D_NETERROR,
+ "Dropping GET from %s portal %d match "LPU64
+ " offset %d length %d\n",
+ libcfs_id2str(src),
+ hdr->msg.get.ptl_index,
+ hdr->msg.get.match_bits,
+ hdr->msg.get.src_offset,
+ hdr->msg.get.sink_length);
LNET_UNLOCK();
return ENOENT; /* +ve: OK but no match */
}
/* NB handles only looked up by creator (no flips) */
md = lnet_wire_handle2md(&hdr->msg.reply.dst_wmd);
if (md == NULL || md->md_threshold == 0) {
- CWARN("%s: Dropping REPLY from %s for %s "
- "MD "LPX64"."LPX64"\n",
- libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
- (md == NULL) ? "invalid" : "inactive",
- hdr->msg.reply.dst_wmd.wh_interface_cookie,
- hdr->msg.reply.dst_wmd.wh_object_cookie);
+ CDEBUG(D_NETERROR, "%s: Dropping REPLY from %s for %s "
+ "MD "LPX64"."LPX64"\n",
+ libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
+ (md == NULL) ? "invalid" : "inactive",
+ hdr->msg.reply.dst_wmd.wh_interface_cookie,
+ hdr->msg.reply.dst_wmd.wh_object_cookie);
LNET_UNLOCK();
return ENOENT; /* +ve: OK but no match */
if (mlength < rlength &&
(md->md_options & LNET_MD_TRUNCATE) == 0) {
- CERROR ("%s: Dropping REPLY from %s length %d "
- "for MD "LPX64" would overflow (%d)\n",
- libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
+ CDEBUG(D_NETERROR, "%s: Dropping REPLY from %s length %d "
+ "for MD "LPX64" would overflow (%d)\n",
+ libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
rlength, hdr->msg.reply.dst_wmd.wh_object_cookie,
mlength);
LNET_UNLOCK();
/* NB handles only looked up by creator (no flips) */
md = lnet_wire_handle2md(&hdr->msg.ack.dst_wmd);
if (md == NULL || md->md_threshold == 0) {
-#if 0
/* Don't moan; this is expected */
- CERROR ("%s: Dropping ACK from %s to %s MD "LPX64"."LPX64"\n",
- libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
- (md == NULL) ? "invalid" : "inactive",
- hdr->msg.ack.dst_wmd.wh_interface_cookie,
- hdr->msg.ack.dst_wmd.wh_object_cookie);
-#endif
+ CDEBUG(D_NET,
+ "%s: Dropping ACK from %s to %s MD "LPX64"."LPX64"\n",
+ libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
+ (md == NULL) ? "invalid" : "inactive",
+ hdr->msg.ack.dst_wmd.wh_interface_cookie,
+ hdr->msg.ack.dst_wmd.wh_object_cookie);
LNET_UNLOCK();
return ENOENT; /* +ve! */
}
msg = lnet_msg_alloc();
if (msg == NULL) {
CERROR("%s, src %s: Dropping %s (out of memory)\n",
- libcfs_nid2str(from_nid), libcfs_nid2str(src_nid)
- , lnet_msgtyp2str(type));
+ libcfs_nid2str(from_nid), libcfs_nid2str(src_nid),
+ lnet_msgtyp2str(type));
goto drop;
}
}
int
-LNetDist (lnet_nid_t dstnid, lnet_nid_t *srcnidp, int *orderp)
+LNetDist (lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp)
{
struct list_head *e;
lnet_ni_t *ni;
lnet_remotenet_t *rnet;
__u32 dstnet = LNET_NIDNET(dstnid);
int hops;
- int order = 2;
+ __u32 order = 2;
/* if !local_nid_dist_zero, I don't return a distance of 0 ever
* (when lustre sees a distance of 0, it substitutes 0@lo), so I