From 254d51c195c2d77dd94d006a10a8b22817e3f81f Mon Sep 17 00:00:00 2001 From: pjkirner Date: Thu, 27 Oct 2005 21:05:15 +0000 Subject: [PATCH] * Fixed handling of NOOP message * Fixed dssstamp check to handle multple routers & incoming connections * Cleanup a few log messages + qkcc compiler warnings --- lnet/ulnds/ptllnd/ptllnd.c | 4 +++- lnet/ulnds/ptllnd/ptllnd.h | 4 ---- lnet/ulnds/ptllnd/ptllnd_cb.c | 22 +++++++++++++++++----- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/lnet/ulnds/ptllnd/ptllnd.c b/lnet/ulnds/ptllnd/ptllnd.c index e8b308b..dd5ad6f 100644 --- a/lnet/ulnds/ptllnd/ptllnd.c +++ b/lnet/ulnds/ptllnd/ptllnd.c @@ -56,16 +56,18 @@ ptllnd_get_tunables(lnet_ni_t *ni) int max_immediate; int msgs_per_buffer; int rc; + int temp; rc = ptllnd_parse_int_tunable(&plni->plni_portal, "PTLLND_PORTAL", PTLLND_PORTAL); if (rc != 0) return rc; - rc = ptllnd_parse_int_tunable(&plni->plni_pid, + rc = ptllnd_parse_int_tunable(&temp, "PTLLND_PID", PTLLND_PID); if (rc != 0) return rc; + plni->plni_pid = (ptl_pid_t)temp; rc = ptllnd_parse_int_tunable(&plni->plni_peer_credits, "PTLLND_PEERCREDITS", PTLLND_PEERCREDITS); diff --git a/lnet/ulnds/ptllnd/ptllnd.h b/lnet/ulnds/ptllnd/ptllnd.h index 276f5072..e0a46c5 100644 --- a/lnet/ulnds/ptllnd/ptllnd.h +++ b/lnet/ulnds/ptllnd/ptllnd.h @@ -237,12 +237,8 @@ lnet2ptlnid(lnet_nid_t lnet_nid) do{ \ lprintf("ptllnd:%-30s:",__FUNCTION__); \ lprintf(fmt,## a); \ - printf("ptllnd:%-30s:",__FUNCTION__); \ - printf(fmt,## a); \ }while(0) -// CDEBUG(D_TRACE,fmt,## a); - #define PJK_UT_MSG_SIMULATION(fmt, a...) PJK_UT_MSG_ALWAYS(fmt, ## a ) diff --git a/lnet/ulnds/ptllnd/ptllnd_cb.c b/lnet/ulnds/ptllnd/ptllnd_cb.c index ace8923..e7e369e 100644 --- a/lnet/ulnds/ptllnd/ptllnd_cb.c +++ b/lnet/ulnds/ptllnd/ptllnd_cb.c @@ -25,7 +25,7 @@ ptllnd_ptlid2str(ptl_process_id_t id) static int idx = 0; snprintf(strs[idx], sizeof(strs[0]), - "%d-"LPD64, id.pid, (__u64)id.nid); + "%d-"LPU64, id.pid, (__u64)id.nid); return strs[idx++]; } @@ -526,7 +526,8 @@ ptllnd_check_sends(ptllnd_peer_t *peer) list_del_init(&tx->tx_list); - PJK_UT_MSG("Sending at TX=%p type=%d\n",tx,tx->tx_type); + PJK_UT_MSG("Sending at TX=%p type=%s (%d)\n",tx, + get_msg_type_string(tx->tx_type),tx->tx_type); if (tx->tx_type == PTLLND_MSG_TYPE_NOOP && (!list_empty(&peer->plp_txq) || @@ -728,7 +729,7 @@ ptllnd_active_rdma(ptllnd_peer_t *peer, int type, int rc; PJK_UT_MSG(">>> peer=%p type=%d tx=%p\n",peer,type,tx); - PJK_UT_MSG("niov=%d offset=%d len=%d\n",niov,offset,len); + PJK_UT_MSG("niov=%u offset=%u len=%u\n",niov,offset,len); PJK_UT_MSG("matchbits " LPX64 "\n",matchbits); LASSERT (type == PTLLND_RDMA_READ || @@ -1080,7 +1081,12 @@ ptllnd_parse_request(lnet_ni_t *ni, ptl_process_id_t initiator, return; } - if (msg->ptlm_dststamp != plni->plni_stamp) { + /* + * Always allow dststamp of 0 because a 2nd router could + * be trying to connect (i.e a HELLO message), and it will + * ALWAYS use dststamp == 0 + */ + if (msg->ptlm_dststamp != 0 && msg->ptlm_dststamp != plni->plni_stamp) { CERROR("Bad dststamp "LPX64"("LPX64" expected) from %s\n", msg->ptlm_dststamp, plni->plni_stamp, libcfs_nid2str(msg->ptlm_srcnid)); @@ -1115,7 +1121,7 @@ ptllnd_parse_request(lnet_ni_t *ni, ptl_process_id_t initiator, break; case PTLLND_MSG_TYPE_HELLO: - PJK_UT_MSG_ALWAYS("PTLLND_MSG_TYPE_HELLO from %s(%s)\n", + PJK_UT_MSG("PTLLND_MSG_TYPE_HELLO from %s(%s)\n", libcfs_nid2str(msg->ptlm_srcnid), ptllnd_ptlid2str(initiator)); if (nob < basenob + sizeof(kptl_hello_msg_t)) { @@ -1129,6 +1135,12 @@ ptllnd_parse_request(lnet_ni_t *ni, ptl_process_id_t initiator, __swab32s(&msg->ptlm_u.hello.kptlhm_max_msg_size); } break; + + case PTLLND_MSG_TYPE_NOOP: + PJK_UT_MSG("PTLLND_MSG_TYPE_NOOP from %s(%s)\n", + libcfs_nid2str(msg->ptlm_srcnid), + ptllnd_ptlid2str(initiator)); + break; default: CERROR("Bad message type %d from %s(%s)\n", msg->ptlm_type, -- 1.8.3.1