#define CWARN(format, a...) CDEBUG_LIMIT(D_WARNING, format, ## a)
#define CERROR(format, a...) CDEBUG_LIMIT(D_ERROR, format, ## a)
+#define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a)
#define CEMERG(format, a...) CDEBUG_LIMIT(D_EMERG, format, ## a)
#define LCONSOLE(mask, format, a...) CDEBUG(D_CONSOLE | (mask), format, ## a)
return;
case GM_SEND_DROPPED:
- CDEBUG(D_NETERROR, "Dropped tx %p to %s\n",
- tx, libcfs_nid2str(tx->tx_nid));
+ CNETERR("Dropped tx %p to %s\n",
+ tx, libcfs_nid2str(tx->tx_nid));
/* Another tx failed and called gm_drop_sends() which made this
* one complete immediately */
gmnal_tx_done(tx, -EIO);
default:
/* Some error; NB don't complete tx yet; we need its credit for
* gm_drop_sends() */
- CDEBUG(D_NETERROR, "tx %p error %d(%s), nid %s\n",
- tx, status, gmnal_gmstatus2str(status),
- libcfs_nid2str(tx->tx_nid));
+ CNETERR("tx %p error %d(%s), nid %s\n",
+ tx, status, gmnal_gmstatus2str(status),
+ libcfs_nid2str(tx->tx_nid));
gmnal_notify_peer_down(tx);
IB_LOCAL_DATASEGMENT *gl = &tx->tx_gl[0];
lnet_msg_t *lntmsg = tx->tx_lntmsg[0];
#endif
- CDEBUG(D_NETERROR, "tx -> %s type %x cookie "LPX64
- " sending %d waiting %d failed %d nwrk %d\n",
- libcfs_nid2str(conn->ibc_peer->ibp_nid),
- tx->tx_msg->ibm_type, tx->tx_cookie,
- tx->tx_sending, tx->tx_waiting, wc->Status,
- tx->tx_nwrq);
+ CNETERR("tx -> %s type %x cookie "LPX64
+ " sending %d waiting %d failed %d nwrk %d\n",
+ libcfs_nid2str(conn->ibc_peer->ibp_nid),
+ tx->tx_msg->ibm_type, tx->tx_cookie,
+ tx->tx_sending, tx->tx_waiting, wc->Status,
+ tx->tx_nwrq);
#if KIBLND_DETAILED_DEBUG
for (i = 0; i < tx->tx_nwrq; i++, wrq++, gl++) {
switch (wrq->Operation) {
default:
- CDEBUG(D_NETERROR, " [%3d] Addr %p Next %p OP %d "
- "DSList %p(%p)/%d: "LPX64"/%d K %x\n",
- i, wrq, wrq->Next, wrq->Operation,
- wrq->DSList, gl, wrq->DSListDepth,
- gl->Address, gl->Length, gl->Lkey);
+ CNETERR(" [%3d] Addr %p Next %p OP %d "
+ "DSList %p(%p)/%d: "LPX64"/%d K %x\n",
+ i, wrq, wrq->Next, wrq->Operation,
+ wrq->DSList, gl, wrq->DSListDepth,
+ gl->Address, gl->Length, gl->Lkey);
break;
case WROpSend:
- CDEBUG(D_NETERROR, " [%3d] Addr %p Next %p SEND "
- "DSList %p(%p)/%d: "LPX64"/%d K %x\n",
- i, wrq, wrq->Next,
- wrq->DSList, gl, wrq->DSListDepth,
- gl->Address, gl->Length, gl->Lkey);
+ CNETERR(" [%3d] Addr %p Next %p SEND "
+ "DSList %p(%p)/%d: "LPX64"/%d K %x\n",
+ i, wrq, wrq->Next,
+ wrq->DSList, gl, wrq->DSListDepth,
+ gl->Address, gl->Length, gl->Lkey);
break;
case WROpRdmaWrite:
- CDEBUG(D_NETERROR, " [%3d] Addr %p Next %p DMA "
- "DSList: %p(%p)/%d "LPX64"/%d K %x -> "
- LPX64" K %x\n",
- i, wrq, wrq->Next,
- wrq->DSList, gl, wrq->DSListDepth,
- gl->Address, gl->Length, gl->Lkey,
- wrq->Req.SendRC.RemoteDS.Address,
- wrq->Req.SendRC.RemoteDS.Rkey);
+ CNETERR(" [%3d] Addr %p Next %p DMA "
+ "DSList: %p(%p)/%d "LPX64"/%d K %x -> "
+ LPX64" K %x\n",
+ i, wrq, wrq->Next,
+ wrq->DSList, gl, wrq->DSListDepth,
+ gl->Address, gl->Length, gl->Lkey,
+ wrq->Req.SendRC.RemoteDS.Address,
+ wrq->Req.SendRC.RemoteDS.Rkey);
break;
}
}
-
+
switch (tx->tx_msg->ibm_type) {
default:
- CDEBUG(D_NETERROR, " msg type %x %p/%d, No RDMA\n",
- tx->tx_msg->ibm_type,
- tx->tx_msg, tx->tx_msg->ibm_nob);
+ CNETERR(" msg type %x %p/%d, No RDMA\n",
+ tx->tx_msg->ibm_type,
+ tx->tx_msg, tx->tx_msg->ibm_nob);
break;
case IBNAL_MSG_PUT_DONE:
case IBNAL_MSG_GET_DONE:
- CDEBUG(D_NETERROR, " msg type %x %p/%d, RDMA key %x frags %d...\n",
- tx->tx_msg->ibm_type,
+ CNETERR(" msg type %x %p/%d, RDMA key %x frags %d..\n",
+ tx->tx_msg->ibm_type,
tx->tx_msg, tx->tx_msg->ibm_nob,
tx->tx_rd->rd_key, tx->tx_rd->rd_nfrag);
for (i = 0; i < tx->tx_rd->rd_nfrag; i++)
- CDEBUG(D_NETERROR, " [%d] "LPX64"/%d\n", i,
- tx->tx_rd->rd_frags[i].rf_addr,
- tx->tx_rd->rd_frags[i].rf_nob);
+ CNETERR(, " [%d] "LPX64"/%d\n", i,
+ tx->tx_rd->rd_frags[i].rf_addr,
+ tx->tx_rd->rd_frags[i].rf_nob);
if (lntmsg == NULL) {
- CDEBUG(D_NETERROR, " No lntmsg\n");
+ CNETERR(" No lntmsg\n");
} else if (lntmsg->msg_iov != NULL) {
- CDEBUG(D_NETERROR, " lntmsg in %d VIRT frags...\n",
- lntmsg->msg_niov);
+ CNETERR(" lntmsg in %d VIRT frags...\n",
+ lntmsg->msg_niov);
for (i = 0; i < lntmsg->msg_niov; i++)
- CDEBUG(D_NETERROR, " [%d] %p/%d\n", i,
- lntmsg->msg_iov[i].iov_base,
- lntmsg->msg_iov[i].iov_len);
+ CNETERR(" [%d] %p/%d\n", i,
+ lntmsg->msg_iov[i].iov_base,
+ lntmsg->msg_iov[i].iov_len);
} else if (lntmsg->msg_kiov != NULL) {
- CDEBUG(D_NETERROR, " lntmsg in %d PAGE frags...\n",
- lntmsg->msg_niov);
+ CNETERR(" lntmsg in %d PAGE frags...\n",
+ lntmsg->msg_niov);
for (i = 0; i < lntmsg->msg_niov; i++)
- CDEBUG(D_NETERROR, " [%d] %p+%d/%d\n", i,
- lntmsg->msg_kiov[i].kiov_page,
- lntmsg->msg_kiov[i].kiov_offset,
- lntmsg->msg_kiov[i].kiov_len);
+ CNETERR(" [%d] %p+%d/%d\n", i,
+ lntmsg->msg_kiov[i].kiov_page,
+ lntmsg->msg_kiov[i].kiov_offset,
+ lntmsg->msg_kiov[i].kiov_len);
} else {
- CDEBUG(D_NETERROR, " lntmsg in %d frags\n",
- lntmsg->msg_niov);
+ CNETERR(" lntmsg in %d frags\n",
+ lntmsg->msg_niov);
}
break;
list_empty(&conn->ibc_tx_queue_nocred) &&
list_empty(&conn->ibc_active_txs)) {
CDEBUG(D_NET, "closing conn to %s"
- " rx# "LPD64" tx# "LPD64"\n",
+ " rx# "LPD64" tx# "LPD64"\n",
libcfs_nid2str(peer->ibp_nid),
conn->ibc_txseq, conn->ibc_rxseq);
} else {
- CDEBUG(D_NETERROR, "Closing conn to %s: error %d%s%s%s%s"
- " rx# "LPD64" tx# "LPD64"\n",
- libcfs_nid2str(peer->ibp_nid), error,
- list_empty(&conn->ibc_tx_queue) ? "" : "(sending)",
- list_empty(&conn->ibc_tx_queue_rsrvd) ? "" : "(sending_rsrvd)",
- list_empty(&conn->ibc_tx_queue_nocred) ? "" : "(sending_nocred)",
- list_empty(&conn->ibc_active_txs) ? "" : "(waiting)",
- conn->ibc_txseq, conn->ibc_rxseq);
+ CNETERR("Closing conn to %s: error %d%s%s%s%s"
+ " rx# "LPD64" tx# "LPD64"\n",
+ libcfs_nid2str(peer->ibp_nid), error,
+ list_empty(&conn->ibc_tx_queue) ? "" : "(sending)",
+ list_empty(&conn->ibc_tx_queue_rsrvd) ?
+ "" : "(sending_rsrvd)",
+ list_empty(&conn->ibc_tx_queue_nocred) ?
+ "" : "(sending_nocred)",
+ list_empty(&conn->ibc_active_txs) ? "" : "(waiting)",
+ conn->ibc_txseq, conn->ibc_rxseq);
#if 0
- /* can't skip down the queue without holding ibc_lock (see above) */
+ /* can't skip down queue without holding ibc_lock (see above) */
list_for_each(tmp, &conn->ibc_tx_queue) {
kib_tx_t *tx = list_entry(tmp, kib_tx_t, tx_list);
-
+
CERROR(" queued tx type %x cookie "LPX64
- " sending %d waiting %d ticks %ld/%d\n",
- tx->tx_msg->ibm_type, tx->tx_cookie,
+ " sending %d waiting %d ticks %ld/%d\n",
+ tx->tx_msg->ibm_type, tx->tx_cookie,
tx->tx_sending, tx->tx_waiting,
(long)(tx->tx_deadline - jiffies), HZ);
}
list_for_each(tmp, &conn->ibc_active_txs) {
kib_tx_t *tx = list_entry(tmp, kib_tx_t, tx_list);
-
+
CERROR(" active tx type %x cookie "LPX64
- " sending %d waiting %d ticks %ld/%d\n",
- tx->tx_msg->ibm_type, tx->tx_cookie,
+ " sending %d waiting %d ticks %ld/%d\n",
+ tx->tx_msg->ibm_type, tx->tx_cookie,
tx->tx_sending, tx->tx_waiting,
(long)(tx->tx_deadline - jiffies), HZ);
}
}
peer->ibp_error = error;
-
+
write_unlock_irqrestore(&kibnal_data.kib_global_lock, flags);
kibnal_peer_notify(peer);
if (list_empty (&zombies))
return;
-
- CDEBUG (D_NETERROR, "Deleting messages for %s: connection failed\n",
+
+ CNETERR("Deleting messages for %s: connection failed\n",
libcfs_nid2str(peer->ibp_nid));
kibnal_txlist_done (&zombies, -EHOSTUNREACH);
CM_REQUEST_INFO *req = &conn->ibc_cvars->cv_cmci.Info.Request;
PATH_RESULTS *path = (PATH_RESULTS *)qrslt->QueryResult;
FSTATUS frc;
-
- if (qrslt->Status != FSUCCESS ||
+
+ if (qrslt->Status != FSUCCESS ||
qrslt->ResultDataSize < sizeof(*path)) {
- CDEBUG (D_NETERROR, "pathreq %s failed: status %d data size %d\n",
+ CNETERR("pathreq %s failed: status %d data size %d\n",
libcfs_nid2str(conn->ibc_peer->ibp_nid),
qrslt->Status, qrslt->ResultDataSize);
kibnal_connreq_done(conn, IBNAL_CONN_ACTIVE, -EHOSTUNREACH);
}
if (path->NumPathRecords < 1) {
- CDEBUG (D_NETERROR, "pathreq %s failed: no path records\n",
+ CNETERR("pathreq %s failed: no path records\n",
libcfs_nid2str(conn->ibc_peer->ibp_nid));
kibnal_connreq_done(conn, IBNAL_CONN_ACTIVE, -EHOSTUNREACH);
return;
}
void
-kibnal_service_get_callback (void *arg, QUERY *qry,
+kibnal_service_get_callback (void *arg, QUERY *qry,
QUERY_RESULT_VALUES *qrslt)
{
kib_conn_t *conn = arg;
SERVICE_RECORD_RESULTS *svc;
FSTATUS frc;
- if (qrslt->Status != FSUCCESS ||
+ if (qrslt->Status != FSUCCESS ||
qrslt->ResultDataSize < sizeof(*svc)) {
- CDEBUG (D_NETERROR, "Lookup %s failed: status %d data size %d\n",
+ CNETERR("Lookup %s failed: status %d data size %d\n",
libcfs_nid2str(conn->ibc_peer->ibp_nid),
qrslt->Status, qrslt->ResultDataSize);
kibnal_connreq_done(conn, IBNAL_CONN_ACTIVE, -EHOSTUNREACH);
svc = (SERVICE_RECORD_RESULTS *)qrslt->QueryResult;
if (svc->NumServiceRecords < 1) {
- CDEBUG (D_NETERROR, "lookup %s failed: no service records\n",
+ CNETERR("lookup %s failed: no service records\n",
libcfs_nid2str(conn->ibc_peer->ibp_nid));
kibnal_connreq_done(conn, IBNAL_CONN_ACTIVE, -EHOSTUNREACH);
return;
mxret = mx_connect(kmxlnd_data.kmx_endpt, nic_id, ep_id, MXLND_MSG_MAGIC,
MXLND_CONNECT_TIMEOUT/HZ*1000, &kmxlnd_data.kmx_epa);
if (mxret != MX_SUCCESS) {
- CDEBUG(D_NETERROR, "unable to connect to myself (%s)\n", mx_strerror(mxret));
+ CNETERR("unable to connect to myself (%s)\n", mx_strerror(mxret));
goto failed_with_endpoint;
}
#if MXLND_DEBUG
if (rx->mxc_get != rx->mxc_put) {
- CDEBUG(D_NETERROR, "*** RX get (%llu) != put (%llu) ***\n", rx->mxc_get, rx->mxc_put);
- CDEBUG(D_NETERROR, "*** incarnation= %lld ***\n", rx->mxc_incarnation);
- CDEBUG(D_NETERROR, "*** deadline= %ld ***\n", rx->mxc_deadline);
- CDEBUG(D_NETERROR, "*** state= %s ***\n", mxlnd_ctxstate_to_str(rx->mxc_state));
- CDEBUG(D_NETERROR, "*** listed?= %d ***\n", !list_empty(&rx->mxc_list));
- CDEBUG(D_NETERROR, "*** nid= 0x%llx ***\n", rx->mxc_nid);
- CDEBUG(D_NETERROR, "*** peer= 0x%p ***\n", rx->mxc_peer);
- CDEBUG(D_NETERROR, "*** msg_type= %s ***\n", mxlnd_msgtype_to_str(rx->mxc_msg_type));
- CDEBUG(D_NETERROR, "*** cookie= 0x%llx ***\n", rx->mxc_cookie);
- CDEBUG(D_NETERROR, "*** nob= %d ***\n", rx->mxc_nob);
+ CNETERR("*** RX get (%llu) != put (%llu) ***\n", rx->mxc_get, rx->mxc_put);
+ CNETERR("*** incarnation= %lld ***\n", rx->mxc_incarnation);
+ CNETERR("*** deadline= %ld ***\n", rx->mxc_deadline);
+ CNETERR("*** state= %s ***\n", mxlnd_ctxstate_to_str(rx->mxc_state));
+ CNETERR("*** listed?= %d ***\n", !list_empty(&rx->mxc_list));
+ CNETERR("*** nid= 0x%llx ***\n", rx->mxc_nid);
+ CNETERR("*** peer= 0x%p ***\n", rx->mxc_peer);
+ CNETERR("*** msg_type= %s ***\n", mxlnd_msgtype_to_str(rx->mxc_msg_type));
+ CNETERR("*** cookie= 0x%llx ***\n", rx->mxc_cookie);
+ CNETERR("*** nob= %d ***\n", rx->mxc_nob);
}
#endif
LASSERT (rx->mxc_get == rx->mxc_put);
spin_lock(&kmxlnd_data.kmx_tx_idle_lock);
if (list_empty (&kmxlnd_data.kmx_tx_idle)) {
- CDEBUG(D_NETERROR, "%d txs in use\n", kmxlnd_data.kmx_tx_used);
+ CNETERR("%d txs in use\n", kmxlnd_data.kmx_tx_used);
spin_unlock(&kmxlnd_data.kmx_tx_idle_lock);
return NULL;
}
&ctx->mxc_mxreq,
&result);
if (mxret != MX_SUCCESS) {
- CDEBUG(D_NETERROR, "mx_cancel() returned %s (%d)\n", mx_strerror(mxret), mxret);
+ CNETERR("mx_cancel() returned %s (%d)\n", mx_strerror(mxret), mxret);
}
if (result == 1) {
ctx->mxc_errno = -ECONNABORTED;
MXLND_ALLOC(conn, sizeof (*conn));
if (conn == NULL) {
- CDEBUG(D_NETERROR, "Cannot allocate conn\n");
+ CNETERR("Cannot allocate conn\n");
return -ENOMEM;
}
CDEBUG(D_NET, "allocated conn 0x%p for peer 0x%p\n", conn, peer);
ctx->mxc_state == MXLND_CTX_COMPLETED);
if (ctx->mxc_state != MXLND_CTX_PENDING &&
ctx->mxc_state != MXLND_CTX_COMPLETED) {
- CDEBUG(D_NETERROR, "deq ctx->mxc_state = %s\n",
- mxlnd_ctxstate_to_str(ctx->mxc_state));
+ CNETERR("deq ctx->mxc_state = %s\n",
+ mxlnd_ctxstate_to_str(ctx->mxc_state));
}
ctx->mxc_state = MXLND_CTX_COMPLETED;
if (!list_empty(&ctx->mxc_list)) {
MXLND_ALLOC(peer, sizeof (*peer));
if (peer == NULL) {
- CDEBUG(D_NETERROR, "Cannot allocate peer for NID 0x%llx\n", nid);
+ CNETERR("Cannot allocate peer for NID 0x%llx\n", nid);
return -ENOMEM;
}
CDEBUG(D_NET, "allocated peer 0x%p for NID 0x%llx\n", peer, nid);
if (ret != 0) {
/* we tried, return the peer only.
* the caller needs to see if the conn exists */
- CDEBUG(D_NETERROR, "%s: %s could not alloc conn\n",
+ CNETERR("%s: %s could not alloc conn\n",
__func__, libcfs_nid2str(peer->mxp_nid));
} else {
/* drop extra conn ref */
/* 6 bytes are enough to have received magic + version */
if (nob < 6) {
- CDEBUG(D_NETERROR, "not enough bytes for magic + hdr: %d\n", nob);
+ CNETERR("not enough bytes for magic + hdr: %d\n", nob);
return -EPROTO;
}
} else if (msg->mxm_magic == __swab32(MXLND_MSG_MAGIC)) {
flip = 1;
} else {
- CDEBUG(D_NETERROR, "Bad magic: %08x\n", msg->mxm_magic);
+ CNETERR("Bad magic: %08x\n", msg->mxm_magic);
return -EPROTO;
}
if (msg->mxm_version !=
(flip ? __swab16(MXLND_MSG_VERSION) : MXLND_MSG_VERSION)) {
- CDEBUG(D_NETERROR, "Bad version: %d\n", msg->mxm_version);
+ CNETERR("Bad version: %d\n", msg->mxm_version);
return -EPROTO;
}
if (nob < hdr_size) {
- CDEBUG(D_NETERROR, "not enough for a header: %d\n", nob);
+ CNETERR("not enough for a header: %d\n", nob);
return -EPROTO;
}
msg_nob = flip ? __swab32(msg->mxm_nob) : msg->mxm_nob;
if (msg_nob > nob) {
- CDEBUG(D_NETERROR, "Short message: got %d, wanted %d\n", nob, msg_nob);
+ CNETERR("Short message: got %d, wanted %d\n", nob, msg_nob);
return -EPROTO;
}
msg_cksum = flip ? __swab32(msg->mxm_cksum) : msg->mxm_cksum;
msg->mxm_cksum = 0;
if (msg_cksum != 0 && msg_cksum != mxlnd_cksum(msg, msg_nob)) {
- CDEBUG(D_NETERROR, "Bad checksum\n");
+ CNETERR("Bad checksum\n");
return -EPROTO;
}
msg->mxm_cksum = msg_cksum;
}
if (msg->mxm_srcnid == LNET_NID_ANY) {
- CDEBUG(D_NETERROR, "Bad src nid: %s\n", libcfs_nid2str(msg->mxm_srcnid));
+ CNETERR("Bad src nid: %s\n", libcfs_nid2str(msg->mxm_srcnid));
return -EPROTO;
}
switch (msg->mxm_type) {
default:
- CDEBUG(D_NETERROR, "Unknown message type %x\n", msg->mxm_type);
+ CNETERR("Unknown message type %x\n", msg->mxm_type);
return -EPROTO;
case MXLND_MSG_NOOP:
case MXLND_MSG_EAGER:
if (msg_nob < offsetof(kmx_msg_t, mxm_u.eager.mxem_payload[0])) {
- CDEBUG(D_NETERROR, "Short EAGER: %d(%d)\n", msg_nob,
+ CNETERR("Short EAGER: %d(%d)\n", msg_nob,
(int)offsetof(kmx_msg_t, mxm_u.eager.mxem_payload[0]));
return -EPROTO;
}
case MXLND_MSG_PUT_REQ:
if (msg_nob < hdr_size + sizeof(msg->mxm_u.put_req)) {
- CDEBUG(D_NETERROR, "Short PUT_REQ: %d(%d)\n", msg_nob,
+ CNETERR("Short PUT_REQ: %d(%d)\n", msg_nob,
(int)(hdr_size + sizeof(msg->mxm_u.put_req)));
return -EPROTO;
}
case MXLND_MSG_PUT_ACK:
if (msg_nob < hdr_size + sizeof(msg->mxm_u.put_ack)) {
- CDEBUG(D_NETERROR, "Short PUT_ACK: %d(%d)\n", msg_nob,
+ CNETERR("Short PUT_ACK: %d(%d)\n", msg_nob,
(int)(hdr_size + sizeof(msg->mxm_u.put_ack)));
return -EPROTO;
}
case MXLND_MSG_GET_REQ:
if (msg_nob < hdr_size + sizeof(msg->mxm_u.get_req)) {
- CDEBUG(D_NETERROR, "Short GET_REQ: %d(%d)\n", msg_nob,
+ CNETERR("Short GET_REQ: %d(%d)\n", msg_nob,
(int)(hdr_size + sizeof(msg->mxm_u.get_req)));
return -EPROTO;
}
case MXLND_MSG_CONN_REQ:
case MXLND_MSG_CONN_ACK:
if (msg_nob < hdr_size + sizeof(msg->mxm_u.conn_req)) {
- CDEBUG(D_NETERROR, "Short connreq/ack: %d(%d)\n", msg_nob,
+ CNETERR("Short connreq/ack: %d(%d)\n", msg_nob,
(int)(hdr_size + sizeof(msg->mxm_u.conn_req)));
return -EPROTO;
}
cookie, mask, (void *) rx, &rx->mxc_mxreq);
if (mxret != MX_SUCCESS) {
mxlnd_deq_pending_ctx(rx);
- CDEBUG(D_NETERROR, "mx_kirecv() failed with %s (%d)\n",
- mx_strerror(mxret), (int) mxret);
+ CNETERR("mx_kirecv() failed with %s (%d)\n",
+ mx_strerror(mxret), (int) mxret);
return -1;
}
return 0;
/* TODO this will change to the net struct */
if (context != NULL) {
- CDEBUG(D_NETERROR, "non-NULL context\n");
+ CNETERR("non-NULL context\n");
}
#if MXLND_DEBUG
if (conn) mxlnd_conn_decref(conn); /* drop ref taken above */
if (unlikely(length != expected || !data_if_available)) {
- CDEBUG(D_NETERROR, "received invalid CONN_REQ from %llx "
- "length=%d (expected %d)\n", nic_id, length, expected);
+ CNETERR("received invalid CONN_REQ from %llx "
+ "length=%d (expected %d)\n", nic_id, length, expected);
mxlnd_send_message(source, MXLND_MSG_CONN_ACK, EPROTO, 0);
return MX_RECV_FINISHED;
}
ret = mxlnd_connparams_alloc(&cp, context, source, match_value, length,
conn, peer, data_if_available);
if (unlikely(ret != 0)) {
- CDEBUG(D_NETERROR, "unable to alloc CONN_REQ from %llx:%d\n",
- nic_id, ep_id);
+ CNETERR("unable to alloc CONN_REQ from %llx:%d\n",
+ nic_id, ep_id);
mxlnd_send_message(source, MXLND_MSG_CONN_ACK, ENOMEM, 0);
return MX_RECV_FINISHED;
}
LASSERT(conn);
if (unlikely(error != 0)) {
- CDEBUG(D_NETERROR, "received CONN_ACK from %s "
- "with error -%d\n",
+ CNETERR("received CONN_ACK from %s with error -%d\n",
libcfs_nid2str(peer->mxp_nid), (int) error);
mxlnd_conn_disconnect(conn, 1, 0);
} else if (unlikely(length != expected || !data_if_available)) {
- CDEBUG(D_NETERROR, "received %s CONN_ACK from %s "
+ CNETERR("received %s CONN_ACK from %s "
"length=%d (expected %d)\n",
data_if_available ? "short" : "missing",
libcfs_nid2str(peer->mxp_nid), length, expected);
ret = mxlnd_connparams_alloc(&cp, context, source, match_value, length,
conn, peer, data_if_available);
if (unlikely(ret != 0)) {
- CDEBUG(D_NETERROR, "unable to alloc kmx_connparams_t"
+ CNETERR("unable to alloc kmx_connparams_t"
" from %llx:%d\n", nic_id, ep_id);
mxlnd_conn_disconnect(conn, 1, 1);
} else {
if (length <= MXLND_MSG_SIZE) {
ret = mxlnd_recv_msg(NULL, rx, msg_type, match_value, length);
} else {
- CDEBUG(D_NETERROR, "unexpected large receive with "
- "match_value=0x%llx length=%d\n",
- match_value, length);
+ CNETERR("unexpected large receive with "
+ "match_value=0x%llx length=%d\n",
+ match_value, length);
ret = mxlnd_recv_msg(NULL, rx, msg_type, match_value, 0);
}
rx->mxc_peer = peer;
rx->mxc_nid = peer->mxp_nid;
} else {
- CDEBUG(D_NETERROR, "could not post receive\n");
+ CNETERR("could not post receive\n");
mxlnd_put_idle_rx(rx);
}
}
if (rx == NULL || ret != 0) {
mxlnd_conn_decref(conn); /* drop ref taken above */
if (rx == NULL) {
- CDEBUG(D_NETERROR, "no idle rxs available - dropping rx"
- " 0x%llx from %s\n", match_value,
- libcfs_nid2str(peer->mxp_nid));
+ CNETERR("no idle rxs available - dropping rx"
+ " 0x%llx from %s\n", match_value,
+ libcfs_nid2str(peer->mxp_nid));
} else {
/* ret != 0 */
- CDEBUG(D_NETERROR, "disconnected peer - dropping rx\n");
+ CNETERR("disconnected peer - dropping rx\n");
}
seg.segment_ptr = 0ULL;
seg.segment_length = 0;
break;
}
default:
- CDEBUG(D_NETERROR, "unknown ctl(%d)\n", cmd);
+ CNETERR("unknown ctl(%d)\n", cmd);
break;
}
MXLND_ALLOC(seg, nseg * sizeof(*seg));
if (seg == NULL) {
- CDEBUG(D_NETERROR, "MXLND_ALLOC() failed\n");
+ CNETERR("MXLND_ALLOC() failed\n");
return -1;
}
memset(seg, 0, nseg * sizeof(*seg));
MXLND_ALLOC(seg, nseg * sizeof(*seg));
if (seg == NULL) {
- CDEBUG(D_NETERROR, "MXLND_ALLOC() failed\n");
+ CNETERR("MXLND_ALLOC() failed\n");
return -1;
}
memset(seg, 0, niov * sizeof(*seg));
tx = mxlnd_get_idle_tx();
if (tx == NULL) {
- CDEBUG(D_NETERROR, "Can't allocate %s tx for %s\n",
+ CNETERR("Can't allocate %s tx for %s\n",
msg_type == MXLND_MSG_PUT_DATA ? "PUT_DATA" : "GET_DATA",
libcfs_nid2str(target.nid));
goto failed_0;
/* This setups up the mx_ksegment_t to send the DATA payload */
if (nob == 0) {
/* do not setup the segments */
- CDEBUG(D_NETERROR, "nob = 0; why didn't we use an EAGER reply "
- "to %s?\n", libcfs_nid2str(target.nid));
+ CNETERR("nob = 0; why didn't we use an EAGER reply "
+ "to %s?\n", libcfs_nid2str(target.nid));
ret = 0;
} else if (kiov == NULL) {
ret = mxlnd_setup_iov(tx, niov, iov, offset, nob);
ret = mxlnd_setup_kiov(tx, niov, kiov, offset, nob);
}
if (ret != 0) {
- CDEBUG(D_NETERROR, "Can't setup send DATA for %s\n",
- libcfs_nid2str(target.nid));
+ CNETERR("Can't setup send DATA for %s\n",
+ libcfs_nid2str(target.nid));
tx->mxc_errno = -EIO;
goto failed_1;
}
return;
failed_0:
- CDEBUG(D_NETERROR, "no tx avail\n");
+ CNETERR("no tx avail\n");
lnet_finalize(ni, lntmsg, -EIO);
return;
}
if (msg_type == MXLND_MSG_GET_DATA) {
rx->mxc_lntmsg[1] = lnet_create_reply_msg(kmxlnd_data.kmx_ni, lntmsg);
if (rx->mxc_lntmsg[1] == NULL) {
- CDEBUG(D_NETERROR, "Can't create reply for GET -> %s\n",
- libcfs_nid2str(target.nid));
+ CNETERR("Can't create reply for GET -> %s\n",
+ libcfs_nid2str(target.nid));
ret = -1;
}
}
if (ret != 0) {
- CDEBUG(D_NETERROR, "Can't setup %s rx for %s\n",
+ CNETERR("Can't setup %s rx for %s\n",
msg_type == MXLND_MSG_PUT_DATA ? "PUT_DATA" : "GET_DATA",
libcfs_nid2str(target.nid));
return -1;
if (rx->mxc_conn != NULL) {
mxlnd_deq_pending_ctx(rx);
}
- CDEBUG(D_NETERROR, "mx_kirecv() failed with %d for %s\n",
- (int) mxret, libcfs_nid2str(target.nid));
+ CNETERR("mx_kirecv() failed with %d for %s\n",
+ (int) mxret, libcfs_nid2str(target.nid));
return -1;
}
tx = mxlnd_get_idle_tx();
if (unlikely(tx == NULL)) {
- CDEBUG(D_NETERROR, "Can't allocate %s tx for %s\n",
- type == LNET_MSG_PUT ? "PUT" : "REPLY",
- libcfs_nid2str(nid));
+ CNETERR("Can't allocate %s tx for %s\n",
+ type == LNET_MSG_PUT ? "PUT" : "REPLY",
+ libcfs_nid2str(nid));
if (conn) mxlnd_conn_decref(conn);
return -ENOMEM;
}
rx = mxlnd_get_idle_rx(conn);
if (unlikely(rx == NULL)) {
- CDEBUG(D_NETERROR, "Can't allocate rx for PUT_ACK for %s\n",
- libcfs_nid2str(nid));
+ CNETERR("Can't allocate rx for PUT_ACK for %s\n",
+ libcfs_nid2str(nid));
mxlnd_put_idle_tx(tx);
if (conn) mxlnd_conn_decref(conn); /* for the ref taken above */
return -ENOMEM;
length = offsetof(kmx_msg_t, mxm_u) + sizeof(kmx_putack_msg_t);
ret = mxlnd_recv_msg(lntmsg, rx, MXLND_MSG_PUT_ACK, rx->mxc_match, length);
if (unlikely(ret != 0)) {
- CDEBUG(D_NETERROR, "recv_msg() failed for PUT_ACK for %s\n",
+ CNETERR("recv_msg() failed for PUT_ACK for %s\n",
libcfs_nid2str(nid));
rx->mxc_lntmsg[0] = NULL;
mxlnd_put_idle_rx(rx);
* then post GET_REQ tx */
tx = mxlnd_get_idle_tx();
if (unlikely(tx == NULL)) {
- CDEBUG(D_NETERROR, "Can't allocate GET tx for %s\n",
- libcfs_nid2str(nid));
+ CNETERR("Can't allocate GET tx for %s\n",
+ libcfs_nid2str(nid));
mxlnd_conn_decref(conn); /* for the ref taken above */
return -ENOMEM;
}
rx_data = mxlnd_get_idle_rx(conn);
if (unlikely(rx_data == NULL)) {
- CDEBUG(D_NETERROR, "Can't allocate DATA rx for %s\n",
- libcfs_nid2str(nid));
+ CNETERR("Can't allocate DATA rx for %s\n",
+ libcfs_nid2str(nid));
mxlnd_put_idle_tx(tx);
mxlnd_conn_decref(conn); /* for the ref taken above */
return -ENOMEM;
ret = mxlnd_recv_data(ni, lntmsg, rx_data, MXLND_MSG_GET_DATA, tx->mxc_cookie);
if (unlikely(ret != 0)) {
- CDEBUG(D_NETERROR, "Can't setup GET sink for %s\n",
- libcfs_nid2str(nid));
+ CNETERR("Can't setup GET sink for %s\n",
+ libcfs_nid2str(nid));
mxlnd_put_idle_rx(rx_data);
mxlnd_put_idle_tx(tx);
mxlnd_conn_decref(conn); /* for the rx_data... */
tx = mxlnd_get_idle_tx();
if (unlikely(tx == NULL)) {
- CDEBUG(D_NETERROR, "Can't send %s to %s: tx descs exhausted\n",
- mxlnd_lnetmsg_to_str(type), libcfs_nid2str(nid));
+ CNETERR("Can't send %s to %s: tx descs exhausted\n",
+ mxlnd_lnetmsg_to_str(type), libcfs_nid2str(nid));
mxlnd_conn_decref(conn); /* drop ref taken above */
return -ENOMEM;
}
nob = offsetof(kmx_msg_t, mxm_u.eager.mxem_payload[rlen]);
len = rx->mxc_status.xfer_length;
if (unlikely(nob > len)) {
- CDEBUG(D_NETERROR, "Eager message from %s too big: %d(%d)\n",
- libcfs_nid2str(nid), nob, len);
+ CNETERR("Eager message from %s too big: %d(%d)\n",
+ libcfs_nid2str(nid), nob, len);
ret = -EPROTO;
break;
}
tx = mxlnd_get_idle_tx();
if (unlikely(tx == NULL)) {
- CDEBUG(D_NETERROR, "Can't allocate tx for %s\n", libcfs_nid2str(nid));
+ CNETERR("Can't allocate tx for %s\n", libcfs_nid2str(nid));
/* Not replying will break the connection */
ret = -ENOMEM;
break;
if (unlikely(ret != 0)) {
/* Notify peer that it's over */
- CDEBUG(D_NETERROR, "Can't setup PUT_DATA rx for %s: %d\n",
- libcfs_nid2str(nid), ret);
+ CNETERR("Can't setup PUT_DATA rx for %s: %d\n",
+ libcfs_nid2str(nid), ret);
mxlnd_ctx_init(tx);
tx->mxc_state = MXLND_CTX_PREP;
tx->mxc_peer = peer;
* Send the error in bits 52-59 and the cookie in bits 0-51 */
tx = mxlnd_get_idle_tx();
if (unlikely(tx == NULL)) {
- CDEBUG(D_NETERROR, "Can't get tx for GET NAK for %s\n",
- libcfs_nid2str(nid));
+ CNETERR("Can't get tx for GET NAK for %s\n",
+ libcfs_nid2str(nid));
/* we can't get a tx, notify the peer that the GET failed */
mxlnd_send_message(conn->mxk_epa, MXLND_MSG_GET_DATA,
ENODATA, cookie);
spin_lock(&conn->mxk_lock);
mxlnd_set_conn_status(conn, MXLND_CONN_FAIL);
spin_unlock(&conn->mxk_lock);
- CDEBUG(D_NETERROR, "mx_iconnect() failed with %s (%d) to %s\n",
- mx_strerror(mxret), mxret, libcfs_nid2str(peer->mxp_nid));
+ CNETERR("mx_iconnect() failed with %s (%d) to %s\n",
+ mx_strerror(mxret), mxret, libcfs_nid2str(peer->mxp_nid));
mxlnd_conn_decref(conn);
}
mx_set_request_timeout(kmxlnd_data.kmx_endpt, request, MXLND_CONNECT_TIMEOUT/HZ*1000);
if (conn == NULL) {
/* we do not have any conns */
- CDEBUG(D_NETERROR, "peer %s has no conn\n", libcfs_nid2str(peer->mxp_nid));
+ CNETERR("peer %s has no conn\n", libcfs_nid2str(peer->mxp_nid));
return -1;
}
if (likely(mxret == MX_SUCCESS)) {
ret = 0;
} else {
- CDEBUG(D_NETERROR, "mx_kisend() failed with %s (%d) "
- "sending to %s\n", mx_strerror(mxret), (int) mxret,
+ CNETERR("mx_kisend() failed with %s (%d) "
+ "sending to %s\n", mx_strerror(mxret), (int) mxret,
libcfs_nid2str(peer->mxp_nid));
/* NOTE mx_kisend() only fails if there are not enough
* resources. Do not change the connection status. */
}
case MXLND_MSG_CONN_REQ:
if (failed) {
- CDEBUG(D_NETERROR, "%s failed with %s (%d) (errno = %d)"
- " to %s\n",
+ CNETERR("%s failed with %s (%d) (errno = %d) to %s\n",
type == MXLND_MSG_CONN_REQ ? "CONN_REQ" : "CONN_ACK",
mx_strstatus(code), code, tx->mxc_errno,
libcfs_nid2str(tx->mxc_nid));
break;
default:
- CDEBUG(D_NETERROR, "Unknown msg type of %d\n", type);
+ CNETERR("Unknown msg type of %d\n", type);
LBUG();
}
if (rx->mxc_status.code != MX_STATUS_SUCCESS &&
rx->mxc_status.code != MX_STATUS_TRUNCATED) {
- CDEBUG(D_NETERROR, "rx from %s failed with %s (%d)\n",
- libcfs_nid2str(rx->mxc_nid),
- mx_strstatus(rx->mxc_status.code),
- rx->mxc_status.code);
+ CNETERR("rx from %s failed with %s (%d)\n",
+ libcfs_nid2str(rx->mxc_nid),
+ mx_strstatus(rx->mxc_status.code),
+ rx->mxc_status.code);
credit = 0;
goto cleanup;
}
goto cleanup;
} else {
/* we had a rx complete with 0 bytes (no hdr, nothing) */
- CDEBUG(D_NETERROR, "rx from %s returned with 0 bytes\n",
- libcfs_nid2str(rx->mxc_nid));
+ CNETERR("rx from %s returned with 0 bytes\n",
+ libcfs_nid2str(rx->mxc_nid));
goto cleanup;
}
}
ret = mxlnd_unpack_msg(msg, nob);
if (ret != 0) {
- CDEBUG(D_NETERROR, "Error %d unpacking rx from %s\n",
- ret, libcfs_nid2str(rx->mxc_nid));
+ CNETERR("Error %d unpacking rx from %s\n",
+ ret, libcfs_nid2str(rx->mxc_nid));
goto cleanup;
}
rx->mxc_nob = nob;
if (!lnet_ptlcompat_matchnid(rx->mxc_nid, msg->mxm_srcnid) ||
!lnet_ptlcompat_matchnid(kmxlnd_data.kmx_ni->ni_nid, msg->mxm_dstnid)) {
- CDEBUG(D_NETERROR, "rx with mismatched NID (type %s) (my nid is "
- "0x%llx and rx msg dst is 0x%llx)\n",
- mxlnd_msgtype_to_str(type), kmxlnd_data.kmx_ni->ni_nid,
- msg->mxm_dstnid);
+ CNETERR("rx with mismatched NID (type %s) (my nid is "
+ "0x%llx and rx msg dst is 0x%llx)\n",
+ mxlnd_msgtype_to_str(type), kmxlnd_data.kmx_ni->ni_nid,
+ msg->mxm_dstnid);
goto cleanup;
}
if ((conn != NULL && msg->mxm_srcstamp != conn->mxk_incarnation) ||
msg->mxm_dststamp != kmxlnd_data.kmx_incarnation) {
- CDEBUG(D_NETERROR, "Stale rx from %s with type %s "
- "(mxm_srcstamp (%lld) != mxk_incarnation (%lld) "
- "|| mxm_dststamp (%lld) != kmx_incarnation (%lld))\n",
- libcfs_nid2str(rx->mxc_nid), mxlnd_msgtype_to_str(type),
- msg->mxm_srcstamp, conn->mxk_incarnation,
- msg->mxm_dststamp, kmxlnd_data.kmx_incarnation);
+ CNETERR("Stale rx from %s with type %s "
+ "(mxm_srcstamp (%lld) != mxk_incarnation (%lld) "
+ "|| mxm_dststamp (%lld) != kmx_incarnation (%lld))\n",
+ libcfs_nid2str(rx->mxc_nid), mxlnd_msgtype_to_str(type),
+ msg->mxm_srcstamp, conn->mxk_incarnation,
+ msg->mxm_dststamp, kmxlnd_data.kmx_incarnation);
credit = 0;
goto cleanup;
}
if (msg->mxm_srcstamp == conn->mxk_incarnation) {
if ((conn->mxk_credits + msg->mxm_credits) >
*kmxlnd_tunables.kmx_peercredits) {
- CDEBUG(D_NETERROR, "mxk_credits %d mxm_credits %d\n",
- conn->mxk_credits, msg->mxm_credits);
+ CNETERR("mxk_credits %d mxm_credits %d\n",
+ conn->mxk_credits, msg->mxm_credits);
}
conn->mxk_credits += msg->mxm_credits;
LASSERT(conn->mxk_credits >= 0);
case MXLND_MSG_PUT_ACK: {
u64 cookie = (u64) msg->mxm_u.put_ack.mxpam_dst_cookie;
if (cookie > MXLND_MAX_COOKIE) {
- CDEBUG(D_NETERROR, "NAK for msg_type %d from %s\n", rx->mxc_msg_type,
- libcfs_nid2str(rx->mxc_nid));
+ CNETERR("NAK for msg_type %d from %s\n", rx->mxc_msg_type,
+ libcfs_nid2str(rx->mxc_nid));
result = -((u32) MXLND_ERROR_VAL(cookie));
lntmsg[0] = rx->mxc_lntmsg[0];
} else {
break;
default:
- CDEBUG(D_NETERROR, "Bad MXLND message type %x from %s\n", msg->mxm_type,
- libcfs_nid2str(rx->mxc_nid));
+ CNETERR("Bad MXLND message type %x from %s\n", msg->mxm_type,
+ libcfs_nid2str(rx->mxc_nid));
ret = -EPROTO;
break;
}
if (status.code != MX_STATUS_SUCCESS) {
int send_bye = (msg_type == MXLND_MSG_ICON_REQ ? 0 : 1);
- CDEBUG(D_NETERROR, "mx_iconnect() failed for %s with %s (%d) "
- "to %s mxp_nid = 0x%llx mxp_nic_id = 0x%0llx mxp_ep_id = %d\n",
+ CNETERR("mx_iconnect() failed for %s with %s (%d) "
+ "to %s mxp_nid = 0x%llx mxp_nic_id = 0x%0llx mxp_ep_id = %d\n",
mxlnd_msgtype_to_str(msg_type),
mx_strstatus(status.code), status.code,
libcfs_nid2str(peer->mxp_nid),
spin_unlock(&conn->mxk_lock);
if (time_after(jiffies, peer->mxp_reconnect_time + MXLND_CONNECT_TIMEOUT)) {
- CDEBUG(D_NETERROR, "timeout, calling conn_disconnect()\n");
+ CNETERR("timeout, calling conn_disconnect()\n");
mxlnd_conn_disconnect(conn, 0, send_bye);
}
/* we are still using the conn ref from iconnect() - do not take another */
tx = mxlnd_get_idle_tx();
if (tx == NULL) {
- CDEBUG(D_NETERROR, "Can't obtain %s tx for %s\n",
- mxlnd_msgtype_to_str(type),
- libcfs_nid2str(peer->mxp_nid));
+ CNETERR("Can't obtain %s tx for %s\n",
+ mxlnd_msgtype_to_str(type),
+ libcfs_nid2str(peer->mxp_nid));
spin_lock(&conn->mxk_lock);
mxlnd_set_conn_status(conn, MXLND_CONN_FAIL);
spin_unlock(&conn->mxk_lock);
(u64) status.match_info, status.msg_length);
if (status.code != MX_STATUS_SUCCESS) {
- CDEBUG(D_NETERROR, "wait_any() failed with %s (%d) with "
- "match_info 0x%llx and length %d\n",
- mx_strstatus(status.code), status.code,
- (u64) status.match_info, status.msg_length);
+ CNETERR("wait_any() failed with %s (%d) with "
+ "match_info 0x%llx and length %d\n",
+ mx_strstatus(status.code), status.code,
+ (u64) status.match_info, status.msg_length);
}
msg_type = MXLND_MSG_TYPE(status.match_info);
mxlnd_handle_rx_completion(ctx);
break;
default:
- CDEBUG(D_NETERROR, "Unknown ctx type %d\n", req_type);
+ CNETERR("Unknown ctx type %d\n", req_type);
LBUG();
break;
}
ret = mxlnd_unpack_msg(msg, cp->mxr_nob);
if (ret != 0) {
if (peer) {
- CDEBUG(D_NETERROR, "Error %d unpacking CONN_REQ from %s\n",
- ret, libcfs_nid2str(peer->mxp_nid));
+ CNETERR("Error %d unpacking CONN_REQ from %s\n",
+ ret, libcfs_nid2str(peer->mxp_nid));
} else {
- CDEBUG(D_NETERROR, "Error %d unpacking CONN_REQ from "
- "unknown host with nic_id 0x%llx\n", ret, nic_id);
+ CNETERR("Error %d unpacking CONN_REQ from "
+ "unknown host with nic_id 0x%llx\n", ret, nic_id);
}
goto cleanup;
}
if (!lnet_ptlcompat_matchnid(kmxlnd_data.kmx_ni->ni_nid, msg->mxm_dstnid)) {
- CDEBUG(D_NETERROR, "Can't accept %s: bad dst nid %s\n",
- libcfs_nid2str(msg->mxm_srcnid),
- libcfs_nid2str(msg->mxm_dstnid));
+ CNETERR("Can't accept %s: bad dst nid %s\n",
+ libcfs_nid2str(msg->mxm_srcnid),
+ libcfs_nid2str(msg->mxm_dstnid));
goto cleanup;
}
if (msg->mxm_u.conn_req.mxcrm_queue_depth != *kmxlnd_tunables.kmx_peercredits) {
- CDEBUG(D_NETERROR, "Can't accept %s: incompatible queue depth "
- "%d (%d wanted)\n",
- libcfs_nid2str(msg->mxm_srcnid),
- msg->mxm_u.conn_req.mxcrm_queue_depth,
- *kmxlnd_tunables.kmx_peercredits);
+ CNETERR("Can't accept %s: incompatible queue depth "
+ "%d (%d wanted)\n",
+ libcfs_nid2str(msg->mxm_srcnid),
+ msg->mxm_u.conn_req.mxcrm_queue_depth,
+ *kmxlnd_tunables.kmx_peercredits);
incompatible = 1;
}
if (msg->mxm_u.conn_req.mxcrm_eager_size != MXLND_MSG_SIZE) {
- CDEBUG(D_NETERROR, "Can't accept %s: incompatible EAGER size "
- "%d (%d wanted)\n",
- libcfs_nid2str(msg->mxm_srcnid),
- msg->mxm_u.conn_req.mxcrm_eager_size,
- (int) MXLND_MSG_SIZE);
+ CNETERR("Can't accept %s: incompatible EAGER size "
+ "%d (%d wanted)\n",
+ libcfs_nid2str(msg->mxm_srcnid),
+ msg->mxm_u.conn_req.mxcrm_eager_size,
+ (int) MXLND_MSG_SIZE);
incompatible = 1;
}
mxlnd_peer_decref(peer); /* drop ref taken above */
write_unlock(g_lock);
if (ret != 0) {
- CDEBUG(D_NETERROR, "Cannot allocate mxp_conn\n");
+ CNETERR("Cannot allocate mxp_conn\n");
goto cleanup;
}
}
* conn_decref() which will eventually free it. */
ret = mxlnd_conn_alloc(&conn, peer);
if (ret != 0) {
- CDEBUG(D_NETERROR, "Cannot allocate peer->mxp_conn\n");
+ CNETERR("Cannot allocate peer->mxp_conn\n");
goto cleanup;
}
/* conn_alloc() adds one ref for the peer and one
ret = mxlnd_unpack_msg(msg, cp->mxr_nob);
if (ret != 0) {
if (peer) {
- CDEBUG(D_NETERROR, "Error %d unpacking CONN_ACK from %s\n",
- ret, libcfs_nid2str(peer->mxp_nid));
+ CNETERR("Error %d unpacking CONN_ACK from %s\n",
+ ret, libcfs_nid2str(peer->mxp_nid));
} else {
- CDEBUG(D_NETERROR, "Error %d unpacking CONN_ACK from "
- "unknown host with nic_id 0x%llx\n", ret, nic_id);
+ CNETERR("Error %d unpacking CONN_ACK from "
+ "unknown host with nic_id 0x%llx\n", ret, nic_id);
}
ret = -1;
incompatible = 1;
goto failed;
}
if (!lnet_ptlcompat_matchnid(kmxlnd_data.kmx_ni->ni_nid, msg->mxm_dstnid)) {
- CDEBUG(D_NETERROR, "Can't accept CONN_ACK from %s: "
- "bad dst nid %s\n", libcfs_nid2str(msg->mxm_srcnid),
+ CNETERR("Can't accept CONN_ACK from %s: "
+ "bad dst nid %s\n", libcfs_nid2str(msg->mxm_srcnid),
libcfs_nid2str(msg->mxm_dstnid));
ret = -1;
goto failed;
}
if (msg->mxm_u.conn_req.mxcrm_queue_depth != *kmxlnd_tunables.kmx_peercredits) {
- CDEBUG(D_NETERROR, "Can't accept CONN_ACK from %s: "
- "incompatible queue depth %d (%d wanted)\n",
+ CNETERR("Can't accept CONN_ACK from %s: "
+ "incompatible queue depth %d (%d wanted)\n",
libcfs_nid2str(msg->mxm_srcnid),
msg->mxm_u.conn_req.mxcrm_queue_depth,
*kmxlnd_tunables.kmx_peercredits);
goto failed;
}
if (msg->mxm_u.conn_req.mxcrm_eager_size != MXLND_MSG_SIZE) {
- CDEBUG(D_NETERROR, "Can't accept CONN_ACK from %s: "
- "incompatible EAGER size %d (%d wanted)\n",
+ CNETERR("Can't accept CONN_ACK from %s: "
+ "incompatible EAGER size %d (%d wanted)\n",
libcfs_nid2str(msg->mxm_srcnid),
msg->mxm_u.conn_req.mxcrm_eager_size,
(int) MXLND_MSG_SIZE);
spin_lock(g_conn_lock);
if (list_empty(conn_reqs)) {
if (ret == 0)
- CDEBUG(D_NETERROR, "connd woke up but did not "
- "find a kmx_connparams_t or zombie conn\n");
+ CNETERR("connd woke up but did not find a "
+ "kmx_connparams_t or zombie conn\n");
spin_unlock(g_conn_lock);
continue;
}
goto ignore;
if (status != IB_WC_SUCCESS) {
- CDEBUG(D_NETERROR, "Rx from %s failed: %d\n",
- libcfs_nid2str(conn->ibc_peer->ibp_nid), status);
+ CNETERR("Rx from %s failed: %d\n",
+ libcfs_nid2str(conn->ibc_peer->ibp_nid), status);
goto failed;
}
if (failed) {
if (conn->ibc_state == IBLND_CONN_ESTABLISHED)
- CDEBUG(D_NETERROR, "Tx -> %s cookie "LPX64
- " sending %d waiting %d: failed %d\n",
- libcfs_nid2str(conn->ibc_peer->ibp_nid),
- tx->tx_cookie, tx->tx_sending, tx->tx_waiting,
- status);
+ CNETERR("Tx -> %s cookie "LPX64
+ " sending %d waiting %d: failed %d\n",
+ libcfs_nid2str(conn->ibc_peer->ibp_nid),
+ tx->tx_cookie, tx->tx_sending, tx->tx_waiting,
+ status);
kiblnd_close_conn(conn, -EIO);
} else {
list_empty(&conn->ibc_tx_queue_rsrvd) &&
list_empty(&conn->ibc_tx_queue_nocred) &&
list_empty(&conn->ibc_active_txs)) {
- CDEBUG(D_NET, "closing conn to %s\n",
+ CDEBUG(D_NET, "closing conn to %s\n",
libcfs_nid2str(peer->ibp_nid));
} else {
- CDEBUG(D_NETERROR, "Closing conn to %s: error %d%s%s%s%s\n",
- libcfs_nid2str(peer->ibp_nid), error,
- list_empty(&conn->ibc_tx_queue) ? "" : "(sending)",
- list_empty(&conn->ibc_tx_queue_rsrvd) ? "" : "(sending_rsrvd)",
- list_empty(&conn->ibc_tx_queue_nocred) ? "" : "(sending_nocred)",
- list_empty(&conn->ibc_active_txs) ? "" : "(waiting)");
+ CNETERR("Closing conn to %s: error %d%s%s%s%s\n",
+ libcfs_nid2str(peer->ibp_nid), error,
+ list_empty(&conn->ibc_tx_queue) ? "" : "(sending)",
+ list_empty(&conn->ibc_tx_queue_rsrvd) ?
+ "" : "(sending_rsrvd)",
+ list_empty(&conn->ibc_tx_queue_nocred) ?
+ "" : "(sending_nocred)",
+ list_empty(&conn->ibc_active_txs) ? "" : "(waiting)");
}
list_del(&conn->ibc_list);
if (list_empty (&zombies))
return;
- CDEBUG (D_NETERROR, "Deleting messages for %s: connection failed\n",
+ CNETERR("Deleting messages for %s: connection failed\n",
libcfs_nid2str(peer->ibp_nid));
kiblnd_txlist_done(peer->ibp_ni, &zombies, -EHOSTUNREACH);
break;
}
- CDEBUG(D_NETERROR, "%s: retrying (%s), %x, %x, "
- "queue_dep: %d, max_frag: %d, msg_size: %d\n",
- libcfs_nid2str(peer->ibp_nid),
- reason, IBLND_MSG_VERSION, version,
- cp != NULL ? cp->ibcp_queue_depth : IBLND_MSG_QUEUE_SIZE(version),
- cp != NULL ? cp->ibcp_max_frags : IBLND_RDMA_FRAGS(version),
- cp != NULL ? cp->ibcp_max_msg_size: IBLND_MSG_SIZE);
+ CNETERR("%s: retrying (%s), %x, %x, "
+ "queue_dep: %d, max_frag: %d, msg_size: %d\n",
+ libcfs_nid2str(peer->ibp_nid),
+ reason, IBLND_MSG_VERSION, version,
+ cp != NULL? cp->ibcp_queue_depth :IBLND_MSG_QUEUE_SIZE(version),
+ cp != NULL? cp->ibcp_max_frags : IBLND_RDMA_FRAGS(version),
+ cp != NULL? cp->ibcp_max_msg_size: IBLND_MSG_SIZE);
kiblnd_connect_peer(peer);
}
break;
case IB_CM_REJ_INVALID_SERVICE_ID:
- CDEBUG(D_NETERROR, "%s rejected: no listener at %d\n",
- libcfs_nid2str(peer->ibp_nid),
- *kiblnd_tunables.kib_service);
+ CNETERR("%s rejected: no listener at %d\n",
+ libcfs_nid2str(peer->ibp_nid),
+ *kiblnd_tunables.kib_service);
break;
case IB_CM_REJ_CONSUMER_DEFINED:
}
/* fall through */
default:
- CDEBUG(D_NETERROR, "%s rejected: reason %d, size %d\n",
- libcfs_nid2str(peer->ibp_nid), reason, priv_nob);
+ CNETERR("%s rejected: reason %d, size %d\n",
+ libcfs_nid2str(peer->ibp_nid), reason, priv_nob);
break;
}
case RDMA_CM_EVENT_CONNECT_REQUEST:
/* destroy cmid on failure */
- rc = kiblnd_passive_connect(cmid,
+ rc = kiblnd_passive_connect(cmid,
(void *)KIBLND_CONN_PARAM(event),
KIBLND_CONN_PARAM_LEN(event));
CDEBUG(D_NET, "connreq: %d\n", rc);
return rc;
-
+
case RDMA_CM_EVENT_ADDR_ERROR:
peer = (kib_peer_t *)cmid->context;
- CDEBUG(D_NETERROR, "%s: ADDR ERROR %d\n",
- libcfs_nid2str(peer->ibp_nid), event->status);
+ CNETERR("%s: ADDR ERROR %d\n",
+ libcfs_nid2str(peer->ibp_nid), event->status);
kiblnd_peer_connect_failed(peer, 1, -EHOSTUNREACH);
kiblnd_peer_decref(peer);
return -EHOSTUNREACH; /* rc != 0 destroys cmid */
libcfs_nid2str(peer->ibp_nid), event->status);
if (event->status != 0) {
- CDEBUG(D_NETERROR, "Can't resolve address for %s: %d\n",
- libcfs_nid2str(peer->ibp_nid), event->status);
+ CNETERR("Can't resolve address for %s: %d\n",
+ libcfs_nid2str(peer->ibp_nid), event->status);
rc = event->status;
} else {
rc = rdma_resolve_route(
case RDMA_CM_EVENT_ROUTE_ERROR:
peer = (kib_peer_t *)cmid->context;
- CDEBUG(D_NETERROR, "%s: ROUTE ERROR %d\n",
- libcfs_nid2str(peer->ibp_nid), event->status);
+ CNETERR("%s: ROUTE ERROR %d\n",
+ libcfs_nid2str(peer->ibp_nid), event->status);
kiblnd_peer_connect_failed(peer, 1, -EHOSTUNREACH);
kiblnd_peer_decref(peer);
return -EHOSTUNREACH; /* rc != 0 destroys cmid */
if (event->status == 0)
return kiblnd_active_connect(cmid);
- CDEBUG(D_NETERROR, "Can't resolve route for %s: %d\n",
- libcfs_nid2str(peer->ibp_nid), event->status);
+ CNETERR("Can't resolve route for %s: %d\n",
+ libcfs_nid2str(peer->ibp_nid), event->status);
kiblnd_peer_connect_failed(peer, 1, event->status);
kiblnd_peer_decref(peer);
return event->status; /* rc != 0 destroys cmid */
-
+
case RDMA_CM_EVENT_UNREACHABLE:
conn = (kib_conn_t *)cmid->context;
LASSERT(conn->ibc_state == IBLND_CONN_ACTIVE_CONNECT ||
conn->ibc_state == IBLND_CONN_PASSIVE_WAIT);
- CDEBUG(D_NETERROR, "%s: UNREACHABLE %d\n",
- libcfs_nid2str(conn->ibc_peer->ibp_nid), event->status);
+ CNETERR("%s: UNREACHABLE %d\n",
+ libcfs_nid2str(conn->ibc_peer->ibp_nid), event->status);
kiblnd_connreq_done(conn, -ENETDOWN);
kiblnd_conn_decref(conn);
return 0;
conn = (kib_conn_t *)cmid->context;
LASSERT(conn->ibc_state == IBLND_CONN_ACTIVE_CONNECT ||
conn->ibc_state == IBLND_CONN_PASSIVE_WAIT);
- CDEBUG(D_NETERROR, "%s: CONNECT ERROR %d\n",
- libcfs_nid2str(conn->ibc_peer->ibp_nid), event->status);
+ CNETERR("%s: CONNECT ERROR %d\n",
+ libcfs_nid2str(conn->ibc_peer->ibp_nid), event->status);
kiblnd_connreq_done(conn, -ENOTCONN);
kiblnd_conn_decref(conn);
return 0;
* failing RDMA because 'tx' might be back on the idle list or
* even reused already if we didn't manage to post all our work
* items */
- CDEBUG(D_NETERROR, "RDMA (tx: %p) failed: %d\n",
- kiblnd_wreqid2ptr(wc->wr_id), wc->status);
+ CNETERR("RDMA (tx: %p) failed: %d\n",
+ kiblnd_wreqid2ptr(wc->wr_id), wc->status);
return;
case IBLND_WID_TX:
if (e->status != IB_COMPLETION_STATUS_SUCCESS &&
tx->tx_status == 0)
tx->tx_status = -ECONNABORTED;
-
+
spin_unlock_irqrestore(&conn->ibc_lock, flags);
if (idle)
kibnal_tx_done (tx);
if (e->status != IB_COMPLETION_STATUS_SUCCESS) {
- CDEBUG (D_NETERROR, "Tx completion to %s failed: %d\n",
+ CNETERR("Tx completion to %s failed: %d\n",
libcfs_nid2str(conn->ibc_peer->ibp_nid), e->status);
kibnal_close_conn (conn, -ENETDOWN);
} else {
* Caller holds kib_global_lock exclusively in irq context */
kib_peer_t *peer = conn->ibc_peer;
- CDEBUG (error == 0 ? D_NET : D_NETERROR,
- "closing conn to %s: error %d\n",
- libcfs_nid2str(peer->ibp_nid), error);
-
+ CDEBUG_LIMIT(error == 0 ? D_NET : D_NETERROR,
+ "closing conn to %s: error %d\n",
+ libcfs_nid2str(peer->ibp_nid), error);
+
LASSERT (conn->ibc_state == IBNAL_CONN_ESTABLISHED ||
conn->ibc_state == IBNAL_CONN_CONNECTING);
/* Can't have blocked transmits if there are connections */
LASSERT (list_empty(&peer->ibp_tx_queue));
}
-
+
write_unlock_irqrestore (&kibnal_data.kib_global_lock, flags);
kibnal_peer_notify(peer);
-
+
if (!list_empty (&zombies))
- CDEBUG (D_NETERROR, "Deleting messages for %s: connection failed\n",
+ CNETERR("Deleting messages for %s: connection failed\n",
libcfs_nid2str(peer->ibp_nid));
kibnal_txlist_done(&zombies, -EHOSTUNREACH);
switch (event) {
default:
- CDEBUG(D_NETERROR, "Connection %p -> %s ERROR %d\n",
- conn, libcfs_nid2str(conn->ibc_peer->ibp_nid), event);
+ CNETERR("Connection %p -> %s ERROR %d\n",
+ conn, libcfs_nid2str(conn->ibc_peer->ibp_nid), event);
kibnal_close_conn (conn, -ECONNABORTED);
break;
-
+
case TS_IB_CM_DISCONNECTED:
- CDEBUG(D_NETERROR, "Connection %p -> %s DISCONNECTED.\n",
- conn, libcfs_nid2str(conn->ibc_peer->ibp_nid));
+ CNETERR("Connection %p -> %s DISCONNECTED.\n",
+ conn, libcfs_nid2str(conn->ibc_peer->ibp_nid));
kibnal_close_conn (conn, 0);
break;
return TS_IB_CM_CALLBACK_PROCEED;
case TS_IB_CM_IDLE:
- CDEBUG(D_NETERROR, "Connection %p -> %s IDLE\n",
- conn, libcfs_nid2str(conn->ibc_peer->ibp_nid));
+ CNETERR("Connection %p -> %s IDLE\n",
+ conn, libcfs_nid2str(conn->ibc_peer->ibp_nid));
/* I assume this connection attempt was rejected because the
* peer found a stale QP; I'll just try again */
write_lock_irqsave(&kibnal_data.kib_global_lock, flags);
return TS_IB_CM_CALLBACK_ABORT;
default:
- CDEBUG(D_NETERROR, "Connection %p -> %s ERROR %d\n",
- conn, libcfs_nid2str(conn->ibc_peer->ibp_nid), event);
+ CNETERR("Connection %p -> %s ERROR %d\n",
+ conn, libcfs_nid2str(conn->ibc_peer->ibp_nid), event);
kibnal_connreq_done(conn, 1, -ECONNABORTED);
kibnal_conn_decref(conn); /* drop CM's ref */
return TS_IB_CM_CALLBACK_ABORT;
kib_msg_t *msg = &conn->ibc_connreq->cr_msg;
if (status != 0) {
- CDEBUG (D_NETERROR, "Pathreq %p -> %s failed: %d\n",
+ CNETERR("Pathreq %p -> %s failed: %d\n",
conn, libcfs_nid2str(peer->ibp_nid), status);
kibnal_connreq_done(conn, 1, status);
kibnal_conn_decref(conn); /* drop callback's ref */
kibnal_init_msg(msg, IBNAL_MSG_CONNREQ, sizeof(msg->ibm_u.connparams));
msg->ibm_u.connparams.ibcp_queue_depth = IBNAL_MSG_QUEUE_SIZE;
- kibnal_pack_msg(msg, conn->ibc_version, 0,
+ kibnal_pack_msg(msg, conn->ibc_version, 0,
peer->ibp_nid, conn->ibc_incarnation);
conn->ibc_connreq->cr_connparam = (struct ib_cm_active_param) {
if (status != EP_SUCCESS) {
- CDEBUG (D_NETERROR, "Tx completion to %s failed: %d\n",
+ CNETERR("Tx completion to %s failed: %d\n",
libcfs_nid2str(ktx->ktx_nid), status);
status = -EHOSTDOWN;
return (0);
default: /* fatal error */
- CDEBUG (D_NETERROR, "Tx to %s failed: %d\n", libcfs_nid2str(ktx->ktx_nid), rc);
+ CNETERR("Tx to %s failed: %d\n", libcfs_nid2str(ktx->ktx_nid),
+ rc);
kqswnal_notify_peer_down(ktx);
return (-EHOSTUNREACH);
}
#endif
nob += payload_nob;
}
-
+
ktx->ktx_port = (nob <= KQSW_SMALLMSG) ?
EP_MSG_SVC_PORTALS_SMALL : EP_MSG_SVC_PORTALS_LARGE;
rc = kqswnal_launch (ktx);
out:
- CDEBUG(rc == 0 ? D_NET : D_NETERROR, "%s %d bytes to %s%s: rc %d\n",
- routing ? (rc == 0 ? "Routed" : "Failed to route") :
- (rc == 0 ? "Sent" : "Failed to send"),
- nob, libcfs_nid2str(target.nid),
- target_is_router ? "(router)" : "", rc);
+ CDEBUG_LIMIT(rc == 0? D_NET :D_NETERROR, "%s %d bytes to %s%s: rc %d\n",
+ routing ? (rc == 0 ? "Routed" : "Failed to route") :
+ (rc == 0 ? "Sent" : "Failed to send"),
+ nob, libcfs_nid2str(target.nid),
+ target_is_router ? "(router)" : "", rc);
if (rc != 0) {
lnet_msg_t *repmsg = (lnet_msg_t *)ktx->ktx_args[2];
int state = ktx->ktx_state;
-
+
kqswnal_put_idle_tx (ktx);
if (state == KTX_GETTING && repmsg != NULL) {
{
kra_peer_t *peer = conn->rac_peer;
- CDEBUG(error == 0 ? D_NET : D_NETERROR,
- "closing conn to %s: error %d\n",
- libcfs_nid2str(peer->rap_nid), error);
+ CDEBUG_LIMIT(error == 0 ? D_NET : D_NETERROR,
+ "closing conn to %s: error %d\n",
+ libcfs_nid2str(peer->rap_nid), error);
LASSERT (!in_interrupt());
LASSERT (conn->rac_state == RANAL_CONN_ESTABLISHED);
if (list_empty(&zombies))
return;
- CDEBUG(D_NETERROR, "Dropping packets for %s: connection failed\n",
- libcfs_nid2str(peer->rap_nid));
+ CNETERR("Dropping packets for %s: connection failed\n",
+ libcfs_nid2str(peer->rap_nid));
do {
tx = list_entry(zombies.next, kra_tx_t, tx_list);
tx = list_entry (txlist->next, ksock_tx_t, tx_list);
if (error && tx->tx_lnetmsg != NULL) {
- CDEBUG (D_NETERROR, "Deleting packet type %d len %d %s->%s\n",
+ CNETERR("Deleting packet type %d len %d %s->%s\n",
le32_to_cpu (tx->tx_lnetmsg->msg_hdr.type),
le32_to_cpu (tx->tx_lnetmsg->msg_hdr.payload_length),
libcfs_nid2str(le64_to_cpu(tx->tx_lnetmsg->msg_hdr.src_nid)),
libcfs_nid2str(le64_to_cpu(tx->tx_lnetmsg->msg_hdr.dest_nid)));
} else if (error) {
- CDEBUG (D_NETERROR, "Deleting noop packet\n");
+ CNETERR("Deleting noop packet\n");
}
list_del (&tx->tx_list);
cfs_write_unlock_bh (g_lock);
/* NB Routes may be ignored if connections to them failed recently */
- CDEBUG(D_NETERROR, "No usable routes to %s\n", libcfs_id2str(id));
+ CNETERR("No usable routes to %s\n", libcfs_id2str(id));
return (-EHOSTUNREACH);
}
switch (error) {
case ECONNRESET:
- CDEBUG(D_NETERROR, "A connection with %s "
- "(%u.%u.%u.%u:%d) was reset; "
- "it may have rebooted.\n",
- libcfs_id2str(peer->ksnp_id),
- HIPQUAD(conn->ksnc_ipaddr),
- conn->ksnc_port);
+ CNETERR("A connection with %s "
+ "(%u.%u.%u.%u:%d) was reset; "
+ "it may have rebooted.\n",
+ libcfs_id2str(peer->ksnp_id),
+ HIPQUAD(conn->ksnc_ipaddr),
+ conn->ksnc_port);
break;
case ETIMEDOUT:
- CDEBUG(D_NETERROR, "A connection with %s "
- "(%u.%u.%u.%u:%d) timed out; the "
- "network or node may be down.\n",
- libcfs_id2str(peer->ksnp_id),
- HIPQUAD(conn->ksnc_ipaddr),
- conn->ksnc_port);
+ CNETERR("A connection with %s "
+ "(%u.%u.%u.%u:%d) timed out; the "
+ "network or node may be down.\n",
+ libcfs_id2str(peer->ksnp_id),
+ HIPQUAD(conn->ksnc_ipaddr),
+ conn->ksnc_port);
break;
default:
- CDEBUG(D_NETERROR, "An unexpected network error %d "
- "occurred with %s "
- "(%u.%u.%u.%u:%d\n", error,
- libcfs_id2str(peer->ksnp_id),
- HIPQUAD(conn->ksnc_ipaddr),
- conn->ksnc_port);
+ CNETERR("An unexpected network error %d "
+ "occurred with %s "
+ "(%u.%u.%u.%u:%d\n", error,
+ libcfs_id2str(peer->ksnp_id),
+ HIPQUAD(conn->ksnc_ipaddr),
+ conn->ksnc_port);
break;
}
conn->ksnc_rx_deadline)) {
/* Timed out incomplete incoming message */
ksocknal_conn_addref(conn);
- CDEBUG(D_NETERROR, "Timeout receiving from %s "
- "(%u.%u.%u.%u:%d), state %d wanted %d left %d\n",
- libcfs_id2str(peer->ksnp_id),
- HIPQUAD(conn->ksnc_ipaddr),
- conn->ksnc_port,
- conn->ksnc_rx_state,
- conn->ksnc_rx_nob_wanted,
- conn->ksnc_rx_nob_left);
+ CNETERR("Timeout receiving from %s (%u.%u.%u.%u:%d), "
+ "state %d wanted %d left %d\n",
+ libcfs_id2str(peer->ksnp_id),
+ HIPQUAD(conn->ksnc_ipaddr),
+ conn->ksnc_port,
+ conn->ksnc_rx_state,
+ conn->ksnc_rx_nob_wanted,
+ conn->ksnc_rx_nob_left);
return (conn);
}
/* Timed out messages queued for sending or
* buffered in the socket's send buffer */
ksocknal_conn_addref(conn);
- CDEBUG(D_NETERROR, "Timeout sending data to %s "
- "(%u.%u.%u.%u:%d) the network or that "
- "node may be down.\n",
- libcfs_id2str(peer->ksnp_id),
- HIPQUAD(conn->ksnc_ipaddr),
- conn->ksnc_port);
+ CNETERR("Timeout sending data to %s (%u.%u.%u.%u:%d) "
+ "the network or that node may be down.\n",
+ libcfs_id2str(peer->ksnp_id),
+ HIPQUAD(conn->ksnc_ipaddr),
+ conn->ksnc_port);
return (conn);
}
}
hdr->msg.hello.type = cpu_to_le32 (hello->kshm_ctype);
hdr->msg.hello.incarnation = cpu_to_le64 (hello->kshm_src_incarnation);
- rc = libcfs_sock_write(sock, hdr, sizeof(*hdr), lnet_acceptor_timeout());
+ rc = libcfs_sock_write(sock, hdr, sizeof(*hdr),lnet_acceptor_timeout());
if (rc != 0) {
- CDEBUG (D_NETERROR, "Error %d sending HELLO hdr to %u.%u.%u.%u/%d\n",
+ CNETERR("Error %d sending HELLO hdr to %u.%u.%u.%u/%d\n",
rc, HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port);
goto out;
}
hello->kshm_nips * sizeof(__u32),
lnet_acceptor_timeout());
if (rc != 0) {
- CDEBUG (D_NETERROR, "Error %d sending HELLO payload (%d)"
+ CNETERR("Error %d sending HELLO payload (%d)"
" to %u.%u.%u.%u/%d\n", rc, hello->kshm_nips,
HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port);
}
lnet_acceptor_timeout());
if (rc != 0) {
- CDEBUG (D_NETERROR, "Error %d sending HELLO hdr to %u.%u.%u.%u/%d\n",
+ CNETERR("Error %d sending HELLO hdr to %u.%u.%u.%u/%d\n",
rc, HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port);
return rc;
}
hello->kshm_nips * sizeof(__u32),
lnet_acceptor_timeout());
if (rc != 0) {
- CDEBUG (D_NETERROR, "Error %d sending HELLO payload (%d)"
+ CNETERR("Error %d sending HELLO payload (%d)"
" to %u.%u.%u.%u/%d\n", rc, hello->kshm_nips,
HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port);
}
int failed = (vvrc != vv_comp_status_success);
int idle;
- CDEBUG(D_NET, "tx %p conn %p sending %d nwrq %d vvrc %d\n",
+ CDEBUG(D_NET, "tx %p conn %p sending %d nwrq %d vvrc %d\n",
tx, conn, tx->tx_sending, tx->tx_nwrq, vvrc);
LASSERT (tx->tx_sending > 0);
if (failed &&
tx->tx_status == 0 &&
conn->ibc_state == IBNAL_CONN_ESTABLISHED)
- CDEBUG(D_NETERROR, "tx -> %s type %x cookie "LPX64
- "sending %d waiting %d: failed %d\n",
+ CNETERR("tx -> %s type %x cookie "LPX64
+ "sending %d waiting %d: failed %d\n",
libcfs_nid2str(conn->ibc_peer->ibp_nid),
tx->tx_msg->ibm_type, tx->tx_cookie,
tx->tx_sending, tx->tx_waiting, vvrc);
libcfs_nid2str(peer->ibp_nid),
conn->ibc_txseq, conn->ibc_rxseq);
} else {
- CDEBUG(D_NETERROR, "Closing conn to %s: error %d%s%s%s%s"
- " rx# "LPD64" tx# "LPD64"\n",
- libcfs_nid2str(peer->ibp_nid), error,
- list_empty(&conn->ibc_tx_queue) ? "" : "(sending)",
- list_empty(&conn->ibc_tx_queue_rsrvd) ? "" : "(sending_rsrvd)",
- list_empty(&conn->ibc_tx_queue_nocred) ? "" : "(sending_nocred)",
- list_empty(&conn->ibc_active_txs) ? "" : "(waiting)",
- conn->ibc_txseq, conn->ibc_rxseq);
+ CNETERR("Closing conn to %s: error %d%s%s%s%s"
+ " rx# "LPD64" tx# "LPD64"\n",
+ libcfs_nid2str(peer->ibp_nid), error,
+ list_empty(&conn->ibc_tx_queue) ? "" : "(sending)",
+ list_empty(&conn->ibc_tx_queue_rsrvd) ?
+ "" : "(sending_rsrvd)",
+ list_empty(&conn->ibc_tx_queue_nocred) ?
+ "" : "(sending_nocred)",
+ list_empty(&conn->ibc_active_txs) ? "" : "(waiting)",
+ conn->ibc_txseq, conn->ibc_rxseq);
}
list_del (&conn->ibc_list);
if (list_empty (&zombies))
return;
- CDEBUG (D_NETERROR, "Deleting messages for %s: connection failed\n",
+ CNETERR("Deleting messages for %s: connection failed\n",
libcfs_nid2str(peer->ibp_nid));
kibnal_txlist_done(&zombies, -EHOSTUNREACH);
kibnal_reconnect(conn, -ESTALE);
return;
} else {
- CDEBUG(D_NETERROR, "conn -> %s rejected: reason %d\n",
- libcfs_nid2str(peer->ibp_nid),
- cv->cv_conndata.data.reject.reason);
+ CNETERR("conn -> %s rejected: reason %d\n",
+ libcfs_nid2str(peer->ibp_nid),
+ cv->cv_conndata.data.reject.reason);
kibnal_connreq_done(conn, 1, -ECONNREFUSED);
return;
}
/* NOT REACHED */
}
- CDEBUG(D_NETERROR, "conn -> %s failed: %d\n",
- libcfs_nid2str(peer->ibp_nid), cv->cv_conndata.status);
+ CNETERR("conn -> %s failed: %d\n",
+ libcfs_nid2str(peer->ibp_nid), cv->cv_conndata.status);
kibnal_connreq_done(conn, 1, -ECONNABORTED);
}
LASSERT (peer->ibp_arp_count > 0);
if (cv->cv_arprc != ibat_stat_ok) {
- CDEBUG(D_NETERROR, "Arp %s @ %u.%u.%u.%u failed: %d\n",
- libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip),
- cv->cv_arprc);
+ CNETERR("Arp %s @ %u.%u.%u.%u failed: %d\n",
+ libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip),
+ cv->cv_arprc);
goto failed;
}
/* final ARP attempt failed */
write_unlock_irqrestore(&kibnal_data.kib_global_lock,
flags);
- CDEBUG(D_NETERROR, "Arp %s @ %u.%u.%u.%u failed (final attempt)\n",
- libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip));
+ CNETERR("Arp %s @ %u.%u.%u.%u failed (final attempt)\n",
+ libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip));
} else {
/* Retry ARP: ibp_connecting++ so terminating conn
* doesn't end peer's connection attempt */
peer->ibp_connecting++;
write_unlock_irqrestore(&kibnal_data.kib_global_lock,
flags);
- CDEBUG(D_NETERROR, "Arp %s @ %u.%u.%u.%u failed (%d attempts left)\n",
- libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip),
- peer->ibp_arp_count);
+ CNETERR("Arp %s @ %u.%u.%u.%u failed (%d attempts left)\n",
+ libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip),
+ peer->ibp_arp_count);
kibnal_schedule_peer_arp(peer);
}
peer = conn->ibc_peer;
if (arprc != ibat_stat_ok)
- CDEBUG(D_NETERROR, "Arp %s at %u.%u.%u.%u failed: %d\n",
- libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip), arprc);
+ CNETERR("Arp %s at %u.%u.%u.%u failed: %d\n",
+ libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip),
+ arprc);
else
CDEBUG(D_NET, "Arp %s at %u.%u.%u.%u OK: LID %s PATH %s\n",
libcfs_nid2str(peer->ibp_nid), HIPQUAD(peer->ibp_ip),
* I give a scheduler on another CPU a chance
* to get the final SEND completion, so the tx
* descriptor can get freed as I inspect it. */
- CDEBUG(D_NETERROR, "RDMA failed: %d\n",
- wc.completion_status);
+ CNETERR("RDMA failed: %d\n",
+ wc.completion_status);
break;
default:
}
*fatal = !(rc == -EADDRNOTAVAIL || rc == -EADDRINUSE);
- CDEBUG(*fatal ? D_NETERROR : D_NET,
- "Error %d connecting %u.%u.%u.%u/%d -> %u.%u.%u.%u/%d\n", rc,
- HIPQUAD(local_ip), local_port, HIPQUAD(peer_ip), peer_port);
+ CDEBUG_LIMIT(*fatal ? D_NETERROR : D_NET,
+ "Error %d connecting %u.%u.%u.%u/%d -> %u.%u.%u.%u/%d\n",
+ rc, HIPQUAD(local_ip), local_port, HIPQUAD(peer_ip),
+ peer_port);
libcfs_sock_release(sock);
return rc;
if (rc != 0) {
CFS_NET_EX;
if (rc != EADDRNOTAVAIL && rc != EADDRINUSE)
- CDEBUG(D_NETERROR,
- "Error %d connecting %u.%u.%u.%u/%d -> %u.%u.%u.%u/%d\n", rc,
- HIPQUAD(local_ip), local_port, HIPQUAD(peer_ip), peer_port);
+ CNETERR("Error %d connecting %u.%u.%u.%u/%d -> "
+ "%u.%u.%u.%u/%d\n", rc, HIPQUAD(local_ip),
+ local_port, HIPQUAD(peer_ip), peer_port);
goto out;
}
s = splnet();
so->so_error = 0;
splx(s);
CFS_NET_EX;
- CDEBUG(D_NETERROR,
- "Error %d connecting %u.%u.%u.%u/%d -> %u.%u.%u.%u/%d\n", rc,
- HIPQUAD(local_ip), local_port, HIPQUAD(peer_ip), peer_port);
+ CNETERR("Error %d connecting %u.%u.%u.%u/%d -> "
+ "%u.%u.%u.%u/%d\n", rc, HIPQUAD(local_ip),
+ local_port, HIPQUAD(peer_ip), peer_port);
goto out;
}
LASSERT(so->so_state & SS_ISCONNECTED);
* port... */
*fatal = !(rc == -EADDRNOTAVAIL);
- CDEBUG(*fatal ? D_NETERROR : D_NET,
- "Error %d connecting %u.%u.%u.%u/%d -> %u.%u.%u.%u/%d\n", rc,
- HIPQUAD(local_ip), local_port, HIPQUAD(peer_ip), peer_port);
+ CDEBUG_LIMIT(*fatal ? D_NETERROR : D_NET,
+ "Error %d connecting %u.%u.%u.%u/%d -> %u.%u.%u.%u/%d\n",
+ rc, HIPQUAD(local_ip), local_port, HIPQUAD(peer_ip),
+ peer_port);
sock_release(*sockp);
return rc;
switch (rc) {
/* "normal" errors */
case -ECONNREFUSED:
- CDEBUG(D_NETERROR, "Connection to %s at host %u.%u.%u.%u "
- "on port %d was refused: "
- "check that Lustre is running on that node.\n",
- libcfs_nid2str(peer_nid),
- HIPQUAD(peer_ip), peer_port);
+ CNETERR("Connection to %s at host %u.%u.%u.%u on port %d was "
+ "refused: check that Lustre is running on that node.\n",
+ libcfs_nid2str(peer_nid),
+ HIPQUAD(peer_ip), peer_port);
break;
case -EHOSTUNREACH:
case -ENETUNREACH:
- CDEBUG(D_NETERROR, "Connection to %s at host %u.%u.%u.%u "
- "was unreachable: the network or that node may "
- "be down, or Lustre may be misconfigured.\n",
- libcfs_nid2str(peer_nid), HIPQUAD(peer_ip));
+ CNETERR("Connection to %s at host %u.%u.%u.%u "
+ "was unreachable: the network or that node may "
+ "be down, or Lustre may be misconfigured.\n",
+ libcfs_nid2str(peer_nid), HIPQUAD(peer_ip));
break;
case -ETIMEDOUT:
- CDEBUG(D_NETERROR, "Connection to %s at host %u.%u.%u.%u on "
- "port %d took too long: that node may be hung "
- "or experiencing high load.\n",
- libcfs_nid2str(peer_nid),
- HIPQUAD(peer_ip), peer_port);
+ CNETERR("Connection to %s at host %u.%u.%u.%u on "
+ "port %d took too long: that node may be hung "
+ "or experiencing high load.\n",
+ libcfs_nid2str(peer_nid),
+ HIPQUAD(peer_ip), peer_port);
break;
case -ECONNRESET:
LCONSOLE_ERROR_MSG(0x11b, "Connection to %s at host %u.%u.%u.%u"
lnet_peer_alive_locked(lp) == 0) {
LNET_UNLOCK();
- CDEBUG(D_NETERROR, "Dropping message for %s: peer not alive\n",
- libcfs_id2str(msg->msg_target));
+ CNETERR("Dropping message for %s: peer not alive\n",
+ libcfs_id2str(msg->msg_target));
if (do_send)
lnet_finalize(ni, msg, -EHOSTUNREACH);
/* fall through */
case LNET_MATCHMD_DROP:
- 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);
+ CNETERR("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) {
- 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);
+ CNETERR("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 || md->md_me != NULL) {
- 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);
+ CNETERR("%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);
if (md != NULL && md->md_me != NULL)
CERROR("REPLY MD also attached to portal %d\n",
md->md_me->me_portal);
if (mlength < rlength &&
(md->md_options & LNET_MD_TRUNCATE) == 0) {
- 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),
+ CNETERR("%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();
if (info->pi_magic == __swab32(LNET_PROTO_PING_MAGIC)) {
lnet_swap_pinginfo(info);
} else if (info->pi_magic != LNET_PROTO_PING_MAGIC) {
- CDEBUG(D_NETERROR, "%s: Unexpected magic %08x\n",
- libcfs_nid2str(rtr->lp_nid), info->pi_magic);
+ CNETERR("%s: Unexpected magic %08x\n",
+ libcfs_nid2str(rtr->lp_nid), info->pi_magic);
return -EPROTO;
}
return -ENOENT; /* v1 doesn't carry NI status info */
if (info->pi_version != LNET_PROTO_PING_VERSION) {
- CDEBUG(D_NETERROR, "%s: Unexpected version 0x%x\n",
- libcfs_nid2str(rtr->lp_nid), info->pi_version);
+ CNETERR("%s: Unexpected version 0x%x\n",
+ libcfs_nid2str(rtr->lp_nid), info->pi_version);
return -EPROTO;
}
lnet_nid_t nid = stat->ns_nid;
if (nid == LNET_NID_ANY) {
- CDEBUG(D_NETERROR, "%s: unexpected LNET_NID_ANY\n",
- libcfs_nid2str(rtr->lp_nid));
+ CNETERR("%s: unexpected LNET_NID_ANY\n",
+ libcfs_nid2str(rtr->lp_nid));
return -EPROTO;
}
}
if (stat->ns_status != LNET_NI_STATUS_UP) {
- CDEBUG(D_NETERROR, "%s: Unexpected status 0x%x\n",
- libcfs_nid2str(rtr->lp_nid), stat->ns_status);
+ CNETERR("%s: Unexpected status 0x%x\n",
+ libcfs_nid2str(rtr->lp_nid), stat->ns_status);
return -EPROTO;
}
if (last != 0 &&
interval > MAX(live_router_check_interval,
dead_router_check_interval))
- CDEBUG(D_NETERROR, "Checker(%d/%d) not called for %d seconds\n",
- live_router_check_interval, dead_router_check_interval,
- interval);
+ CNETERR("Checker(%d/%d) not called for %d seconds\n",
+ live_router_check_interval, dead_router_check_interval,
+ interval);
LNET_LOCK();
LASSERT (!running); /* recursion check */
if (!list_empty(&sv->sv_active_rpcq)) {
rpc = list_entry(sv->sv_active_rpcq.next,
srpc_server_rpc_t, srpc_list);
- CDEBUG (D_NETERROR,
- "Active RPC %p on shutdown: sv %s, peer %s, "
+ CNETERR("Active RPC %p on shutdown: sv %s, peer %s, "
"wi %s scheduled %d running %d, "
"ev fired %d type %d status %d lnet %d\n",
rpc, sv->sv_name, libcfs_id2str(rpc->srpc_peer),
rpc->srpc_status = status;
- CDEBUG (status == 0 ? D_NET : D_NETERROR,
- "Server RPC %p done: service %s, peer %s, status %s:%d\n",
- rpc, sv->sv_name, libcfs_id2str(rpc->srpc_peer),
- swi_state2str(rpc->srpc_wi.wi_state), status);
+ CDEBUG_LIMIT(status == 0 ? D_NET : D_NETERROR,
+ "Server RPC %p done: service %s, peer %s, status %s:%d\n",
+ rpc, sv->sv_name, libcfs_id2str(rpc->srpc_peer),
+ swi_state2str(rpc->srpc_wi.wi_state), status);
if (status != 0) {
spin_lock(&srpc_data.rpc_glock);
srpc_del_client_rpc_timer(rpc);
- CDEBUG ((status == 0) ? D_NET : D_NETERROR,
- "Client RPC done: service %d, peer %s, status %s:%d:%d\n",
- rpc->crpc_service, libcfs_id2str(rpc->crpc_dest),
- swi_state2str(wi->wi_state), rpc->crpc_aborted, status);
+ CDEBUG_LIMIT((status == 0) ? D_NET : D_NETERROR,
+ "Client RPC done: service %d, peer %s, status %s:%d:%d\n",
+ rpc->crpc_service, libcfs_id2str(rpc->crpc_dest),
+ swi_state2str(wi->wi_state), rpc->crpc_aborted, status);
/*
* No one can schedule me now since:
int level = D_ERROR;
if (rc == -ENOSPC)
level = D_INODE;
- CDEBUG(level, "error creating objects for "
- "inode %lu: rc = %d\n",
- inode->i_ino, rc);
+ CDEBUG_LIMIT(level, "error creating objects for "
+ "inode %lu: rc = %d\n", inode->i_ino, rc);
if (rc > 0) {
CERROR("obd_create returned invalid "
"rc %d\n", rc);