Whamcloud - gitweb
b=20805 rate limit D_NETERR messages
authorCliff White <cliff.white@oracle.com>
Tue, 2 Nov 2010 17:02:23 +0000 (10:02 -0700)
committerVitaly Fertman <vitaly.fertman@sun.com>
Thu, 4 Nov 2010 18:07:08 +0000 (21:07 +0300)
i=isaac
i=liang

change CDEBUG(D_NETERROR) to CNETERR in various places. Port of 1_8 to master.
Cleans up klnds, libcfs

14 files changed:
libcfs/libcfs/darwin/darwin-tcpip.c
libcfs/libcfs/linux/linux-tcpip.c
lnet/klnds/mxlnd/mxlnd.c
lnet/klnds/mxlnd/mxlnd_cb.c
lnet/klnds/o2iblnd/o2iblnd_cb.c
lnet/klnds/qswlnd/qswlnd_cb.c
lnet/klnds/ralnd/ralnd.c
lnet/klnds/socklnd/socklnd_cb.c
lnet/klnds/socklnd/socklnd_proto.c
lnet/lnet/acceptor.c
lnet/lnet/lib-move.c
lnet/lnet/router.c
lnet/selftest/rpc.c
lustre/ptlrpc/client.c

index 57e159f..1f3503c 100644 (file)
@@ -699,7 +699,7 @@ libcfs_sock_connect (cfs_socket_t **sockp, int *fatal,
         }
 
         *fatal = !(rc == -EADDRNOTAVAIL || rc == -EADDRINUSE);
-        CDEBUG(*fatal ? D_NETERROR : D_NET,
+        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);
 
@@ -1311,8 +1311,7 @@ libcfs_sock_connect (struct socket **sockp, int *fatal,
         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,
+                        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;
         }
@@ -1325,8 +1324,7 @@ libcfs_sock_connect (struct socket **sockp, int *fatal,
                 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,
+                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;
         }
index d623e2f..9d673f0 100644 (file)
@@ -679,7 +679,7 @@ libcfs_sock_connect (struct socket **sockp, int *fatal,
          * port... */
         *fatal = !(rc == -EADDRNOTAVAIL);
 
-        CDEBUG(*fatal ? D_NETERROR : D_NET,
+        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);
 
index 31c55ed..fb80d3e 100644 (file)
@@ -348,7 +348,7 @@ mxlnd_init_mx(lnet_ni_t *ni)
                            MXLND_MSG_MAGIC, MXLND_CONNECT_TIMEOUT/CFS_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;
         }
 
index 0eafbcd..057a34d 100644 (file)
@@ -186,16 +186,16 @@ mxlnd_get_idle_rx(kmx_conn_t *conn)
 
 #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", !cfs_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", !cfs_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);
@@ -237,7 +237,7 @@ mxlnd_get_idle_tx(void)
         cfs_spin_lock(&kmxlnd_data.kmx_tx_idle_lock);
 
         if (cfs_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);
                 cfs_spin_unlock(&kmxlnd_data.kmx_tx_idle_lock);
                 return NULL;
         }
@@ -431,7 +431,7 @@ mxlnd_conn_cancel_pending_rxs(kmx_conn_t *conn)
                                                   &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;
@@ -588,7 +588,7 @@ mxlnd_conn_alloc_locked(kmx_conn_t **connp, kmx_peer_t *peer)
 
         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);
@@ -738,8 +738,8 @@ mxlnd_deq_pending_ctx(kmx_ctx_t *ctx)
                 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 (!cfs_list_empty(&ctx->mxc_list)) {
@@ -880,7 +880,7 @@ mxlnd_peer_alloc(kmx_peer_t **peerp, lnet_nid_t nid, u32 board, u32 ep_id, u64 n
 
         MXLND_ALLOC(peer, sizeof (*peer));
         if (peer == NULL) {
-                CDEBUG(D_NETERROR, "Cannot allocate peer for NID 0x%llx\n",
+                CNETERR("Cannot allocate peer for NID 0x%llx\n",
                        nid);
                 return -ENOMEM;
         }
@@ -974,7 +974,7 @@ mxlnd_find_peer_by_nid(lnet_nid_t nid, int create)
                                 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 */
@@ -1124,7 +1124,7 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
 
         /* 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;
         }
 
@@ -1133,24 +1133,24 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
         } 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;
         }
 
@@ -1159,7 +1159,7 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
         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;
@@ -1177,13 +1177,13 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
         }
 
         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:
@@ -1191,7 +1191,7 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
 
         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;
                 }
@@ -1199,7 +1199,7 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
 
         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;
                 }
@@ -1209,7 +1209,7 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
 
         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;
                 }
@@ -1221,7 +1221,7 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
 
         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;
                 }
@@ -1233,7 +1233,7 @@ mxlnd_unpack_msg(kmx_msg_t *msg, int nob)
         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;
                 }
@@ -1282,8 +1282,8 @@ mxlnd_recv_msg(lnet_msg_t *lntmsg, kmx_ctx_t *rx, u8 msg_type, u64 cookie, u32 l
                           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;
@@ -1328,7 +1328,7 @@ mxlnd_unexpected_recv(void *context, mx_endpoint_addr_t source,
 
         /* 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
@@ -1362,8 +1362,8 @@ mxlnd_unexpected_recv(void *context, mx_endpoint_addr_t source,
 
                 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;
                 }
@@ -1371,8 +1371,8 @@ mxlnd_unexpected_recv(void *context, mx_endpoint_addr_t source,
                 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;
                 }
@@ -1389,12 +1389,11 @@ mxlnd_unexpected_recv(void *context, mx_endpoint_addr_t source,
 
                 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);
@@ -1404,7 +1403,7 @@ mxlnd_unexpected_recv(void *context, mx_endpoint_addr_t source,
                         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 {
@@ -1429,9 +1428,9 @@ mxlnd_unexpected_recv(void *context, mx_endpoint_addr_t source,
                 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);
                 }
 
@@ -1441,7 +1440,7 @@ mxlnd_unexpected_recv(void *context, mx_endpoint_addr_t source,
                         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);
                 }
         }
@@ -1453,12 +1452,12 @@ mxlnd_unexpected_recv(void *context, mx_endpoint_addr_t source,
         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;
@@ -1652,7 +1651,7 @@ mxlnd_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg)
                 break;
         }
         default:
-                CDEBUG(D_NETERROR, "unknown ctl(%d)\n", cmd);
+                CNETERR("unknown ctl(%d)\n", cmd);
                 break;
         }
 
@@ -1809,7 +1808,7 @@ mxlnd_setup_iov(kmx_ctx_t *ctx, u32 niov, struct iovec *iov, u32 offset, u32 nob
 
         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));
@@ -1878,7 +1877,7 @@ mxlnd_setup_kiov(kmx_ctx_t *ctx, u32 niov, lnet_kiov_t *kiov, u32 offset, u32 no
 
         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));
@@ -1952,7 +1951,7 @@ mxlnd_send_data(lnet_ni_t *ni, lnet_msg_t *lntmsg, kmx_peer_t *peer, u8 msg_type
 
         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;
@@ -1970,8 +1969,8 @@ mxlnd_send_data(lnet_ni_t *ni, lnet_msg_t *lntmsg, kmx_peer_t *peer, u8 msg_type
         /* 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);
@@ -1979,8 +1978,8 @@ mxlnd_send_data(lnet_ni_t *ni, lnet_msg_t *lntmsg, kmx_peer_t *peer, u8 msg_type
                 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;
         }
@@ -1993,7 +1992,7 @@ failed_1:
         return;
 
 failed_0:
-        CDEBUG(D_NETERROR, "no tx avail\n");
+        CNETERR("no tx avail\n");
         lnet_finalize(ni, lntmsg, -EIO);
         return;
 }
@@ -2056,13 +2055,13 @@ mxlnd_recv_data(lnet_ni_t *ni, lnet_msg_t *lntmsg, kmx_ctx_t *rx, u8 msg_type, u
         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;
@@ -2081,8 +2080,8 @@ mxlnd_recv_data(lnet_ni_t *ni, lnet_msg_t *lntmsg, kmx_ctx_t *rx, u8 msg_type, u
                 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;
         }
 
@@ -2185,9 +2184,9 @@ mxlnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
 
                 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;
                 }
@@ -2207,8 +2206,8 @@ mxlnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
 
                 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;
@@ -2224,7 +2223,7 @@ mxlnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
                 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);
@@ -2250,15 +2249,15 @@ mxlnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
                  * 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;
@@ -2271,8 +2270,8 @@ mxlnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
 
                 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... */
@@ -2305,8 +2304,8 @@ mxlnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
 
         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;
         }
@@ -2382,8 +2381,8 @@ mxlnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed,
                 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;
                 }
@@ -2410,7 +2409,7 @@ mxlnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed,
 
                 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;
@@ -2447,8 +2446,8 @@ mxlnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed,
 
                 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;
@@ -2480,8 +2479,8 @@ mxlnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed,
                          * 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);
@@ -2712,7 +2711,7 @@ mxlnd_iconnect(kmx_peer_t *peer, u8 msg_type)
                 cfs_spin_lock(&conn->mxk_lock);
                 mxlnd_set_conn_status(conn, MXLND_CONN_FAIL);
                 cfs_spin_unlock(&conn->mxk_lock);
-                CDEBUG(D_NETERROR, "mx_iconnect() failed with %s (%d) to %s\n",
+                CNETERR("mx_iconnect() failed with %s (%d) to %s\n",
                        mx_strerror(mxret), mxret, libcfs_nid2str(peer->mxp_nid));
                 mxlnd_conn_decref(conn);
         }
@@ -2761,7 +2760,7 @@ mxlnd_check_sends(kmx_peer_t *peer)
 
         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;
         }
 
@@ -2995,8 +2994,8 @@ mxlnd_check_sends(kmx_peer_t *peer)
                         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. */
@@ -3114,8 +3113,7 @@ mxlnd_handle_tx_completion(kmx_ctx_t *tx)
                 }
         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));
@@ -3131,7 +3129,7 @@ mxlnd_handle_tx_completion(kmx_ctx_t *tx)
                 break;
 
         default:
-                CDEBUG(D_NETERROR, "Unknown msg type of %d\n", type);
+                CNETERR("Unknown msg type of %d\n", type);
                 LBUG();
         }
 
@@ -3212,10 +3210,10 @@ mxlnd_handle_rx_completion(kmx_ctx_t *rx)
 
         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;
         }
@@ -3230,8 +3228,8 @@ mxlnd_handle_rx_completion(kmx_ctx_t *rx)
                         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;
                 }
         }
@@ -3250,8 +3248,8 @@ mxlnd_handle_rx_completion(kmx_ctx_t *rx)
 
         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;
@@ -3259,7 +3257,7 @@ mxlnd_handle_rx_completion(kmx_ctx_t *rx)
 
         if (rx->mxc_nid != msg->mxm_srcnid ||
             kmxlnd_data.kmx_ni->ni_nid != msg->mxm_dstnid) {
-                CDEBUG(D_NETERROR, "rx with mismatched NID (type %s) (my nid is "
+                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);
@@ -3268,7 +3266,7 @@ mxlnd_handle_rx_completion(kmx_ctx_t *rx)
 
         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 "
+                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),
@@ -3287,8 +3285,8 @@ mxlnd_handle_rx_completion(kmx_ctx_t *rx)
                 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);
@@ -3317,8 +3315,8 @@ mxlnd_handle_rx_completion(kmx_ctx_t *rx)
         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 {
@@ -3336,8 +3334,8 @@ mxlnd_handle_rx_completion(kmx_ctx_t *rx)
                 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;
         }
@@ -3406,8 +3404,8 @@ mxlnd_handle_connect_msg(kmx_peer_t *peer, u8 msg_type, mx_status_t status)
         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),
@@ -3420,7 +3418,7 @@ mxlnd_handle_connect_msg(kmx_peer_t *peer, u8 msg_type, mx_status_t status)
 
                 if (cfs_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);
                 }
 
@@ -3448,7 +3446,7 @@ mxlnd_handle_connect_msg(kmx_peer_t *peer, u8 msg_type, mx_status_t status)
         /* 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",
+                CNETERR("Can't obtain %s tx for %s\n",
                        mxlnd_msgtype_to_str(type),
                        libcfs_nid2str(peer->mxp_nid));
                 cfs_spin_lock(&conn->mxk_lock);
@@ -3535,10 +3533,10 @@ mxlnd_request_waitd(void *arg)
                        (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);
@@ -3575,7 +3573,7 @@ mxlnd_request_waitd(void *arg)
                                 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;
                         }
@@ -3680,22 +3678,22 @@ mxlnd_passive_connect(kmx_connparams_t *cp)
         ret = mxlnd_unpack_msg(msg, cp->mxr_nob);
         if (ret != 0) {
                 if (peer) {
-                        CDEBUG(D_NETERROR, "Error %d unpacking CONN_REQ from %s\n",
+                        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 "
+                        CNETERR("Error %d unpacking CONN_REQ from "
                                "unknown host with nic_id 0x%llx\n", ret, nic_id);
                 }
                 goto cleanup;
         }
         if (kmxlnd_data.kmx_ni->ni_nid != msg->mxm_dstnid) {
-                CDEBUG(D_NETERROR, "Can't accept %s: bad dst nid %s\n",
+                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 "
+                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,
@@ -3703,7 +3701,7 @@ mxlnd_passive_connect(kmx_connparams_t *cp)
                 incompatible = 1;
         }
         if (msg->mxm_u.conn_req.mxcrm_eager_size != MXLND_MSG_SIZE) {
-                CDEBUG(D_NETERROR, "Can't accept %s: incompatible EAGER 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,
@@ -3750,7 +3748,7 @@ mxlnd_passive_connect(kmx_connparams_t *cp)
                         mxlnd_peer_decref(peer); /* drop ref taken above */
                         cfs_write_unlock(g_lock);
                         if (ret != 0) {
-                                CDEBUG(D_NETERROR, "Cannot allocate mxp_conn\n");
+                                CNETERR("Cannot allocate mxp_conn\n");
                                 goto cleanup;
                         }
                 }
@@ -3769,7 +3767,7 @@ mxlnd_passive_connect(kmx_connparams_t *cp)
                         * 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
@@ -3817,10 +3815,10 @@ mxlnd_check_conn_ack(kmx_connparams_t *cp)
         ret = mxlnd_unpack_msg(msg, cp->mxr_nob);
         if (ret != 0) {
                 if (peer) {
-                        CDEBUG(D_NETERROR, "Error %d unpacking CONN_ACK from %s\n",
+                        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 "
+                        CNETERR("Error %d unpacking CONN_ACK from "
                                "unknown host with nic_id 0x%llx\n", ret, nic_id);
                 }
                 ret = -1;
@@ -3828,14 +3826,14 @@ mxlnd_check_conn_ack(kmx_connparams_t *cp)
                 goto failed;
         }
         if (kmxlnd_data.kmx_ni->ni_nid != msg->mxm_dstnid) {
-                CDEBUG(D_NETERROR, "Can't accept CONN_ACK from %s: "
+                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: "
+                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,
@@ -3845,8 +3843,8 @@ mxlnd_check_conn_ack(kmx_connparams_t *cp)
                 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);
@@ -3988,7 +3986,7 @@ mxlnd_connd(void *arg)
                 cfs_spin_lock(g_conn_lock);
                 if (cfs_list_empty(conn_reqs)) {
                         if (ret == 0)
-                                CDEBUG(D_NETERROR, "connd woke up but did not "
+                                CNETERR("connd woke up but did not "
                                        "find a kmx_connparams_t or zombie conn\n");
                         cfs_spin_unlock(g_conn_lock);
                         continue;
index a05f13e..167005f 100644 (file)
@@ -458,8 +458,8 @@ kiblnd_rx_complete (kib_rx_t *rx, int status, int nob)
                 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;
         }
 
@@ -958,11 +958,11 @@ kiblnd_tx_complete (kib_tx_t *tx, int status)
 
         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 {
@@ -1787,7 +1787,7 @@ kiblnd_close_conn_locked (kib_conn_t *conn, int error)
                 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",
+                CNETERR("Closing conn to %s: error %d%s%s%s%s\n",
                        libcfs_nid2str(peer->ibp_nid), error,
                        cfs_list_empty(&conn->ibc_tx_queue) ? "" : "(sending)",
                        cfs_list_empty(&conn->ibc_tx_queue_rsrvd) ? "" : "(sending_rsrvd)",
@@ -1961,7 +1961,7 @@ kiblnd_peer_connect_failed (kib_peer_t *peer, int active, int error)
         if (cfs_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);
@@ -2392,13 +2392,13 @@ kiblnd_reconnect (kib_conn_t *conn, int version,
                 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);
 }
@@ -2418,9 +2418,9 @@ kiblnd_rejected (kib_conn_t *conn, int reason, void *priv, int priv_nob)
                 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:
@@ -2530,8 +2530,8 @@ kiblnd_rejected (kib_conn_t *conn, int reason, void *priv, int priv_nob)
                 }
                 /* 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;
         }
 
@@ -2724,7 +2724,7 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
                 
        case RDMA_CM_EVENT_ADDR_ERROR:
                 peer = (kib_peer_t *)cmid->context;
-                CDEBUG(D_NETERROR, "%s: ADDR ERROR %d\n",
+                CNETERR("%s: ADDR ERROR %d\n",
                        libcfs_nid2str(peer->ibp_nid), event->status);
                 kiblnd_peer_connect_failed(peer, 1, -EHOSTUNREACH);
                 kiblnd_peer_decref(peer);
@@ -2737,8 +2737,8 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
                        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(
@@ -2755,8 +2755,8 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
 
        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 */
@@ -2769,7 +2769,7 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
                 if (event->status == 0)
                         return kiblnd_active_connect(cmid);
 
-                CDEBUG(D_NETERROR, "Can't resolve route for %s: %d\n",
+                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);
@@ -2779,7 +2779,7 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
                 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",
+                CNETERR("%s: UNREACHABLE %d\n",
                        libcfs_nid2str(conn->ibc_peer->ibp_nid), event->status);
                 kiblnd_connreq_done(conn, -ENETDOWN);
                 kiblnd_conn_decref(conn);
@@ -2789,8 +2789,8 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
                 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;
@@ -3129,8 +3129,8 @@ kiblnd_complete (struct ib_wc *wc)
                  * 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:
index 124ebb7..0a6c249 100644 (file)
@@ -537,7 +537,7 @@ kqswnal_txhandler(EP_TXD *txd, void *arg, int status)
 
         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;
@@ -677,7 +677,7 @@ kqswnal_launch (kqswnal_tx_t *ktx)
                 return (0);
 
         default: /* fatal error */
-                CDEBUG (D_NETERROR, "Tx to %s failed: %d\n",
+                CNETERR ("Tx to %s failed: %d\n",
                         libcfs_nid2str(ktx->ktx_nid), rc);
                 kqswnal_notify_peer_down(ktx);
                 return (-EHOSTUNREACH);
@@ -1223,23 +1223,23 @@ kqswnal_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
 #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) {
index f48d83d..d992541 100644 (file)
@@ -382,9 +382,9 @@ kranal_close_conn_locked (kra_conn_t *conn, int error)
 {
         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 (!cfs_in_interrupt());
         LASSERT (conn->rac_state == RANAL_CONN_ESTABLISHED);
@@ -850,8 +850,8 @@ kranal_connect (kra_peer_t *peer)
         if (cfs_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 = cfs_list_entry(zombies.next, kra_tx_t, tx_list);
index 39dbbee..0a74d3e 100644 (file)
@@ -414,13 +414,13 @@ ksocknal_txlist_done (lnet_ni_t *ni, cfs_list_t *txlist, int error)
                 tx = cfs_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");
                 }
 
                 cfs_list_del (&tx->tx_list);
@@ -920,7 +920,7 @@ ksocknal_launch_packet (lnet_ni_t *ni, ksock_tx_t *tx, lnet_process_id_t id)
         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);
 }
 
@@ -2160,28 +2160,28 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer)
 
                         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;
                         }
 
@@ -2193,14 +2193,14 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer)
                                      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);
                 }
 
@@ -2211,12 +2211,11 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer)
                         /* 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);
                 }
         }
index 503f18f..9e2e456 100644 (file)
@@ -493,10 +493,10 @@ ksocknal_send_hello_v1 (ksock_conn_t *conn, ksock_hello_msg_t *hello)
         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;
         }
@@ -512,7 +512,7 @@ ksocknal_send_hello_v1 (ksock_conn_t *conn, ksock_hello_msg_t *hello)
                                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);
         }
@@ -545,7 +545,7 @@ ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello)
                                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;
         }
@@ -557,7 +557,7 @@ ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello)
                                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);
         }
index cf0a56a..56d264d 100644 (file)
@@ -113,25 +113,24 @@ lnet_connect_console_error (int rc, lnet_nid_t peer_nid,
         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"
index 1a4d395..95b4985 100644 (file)
@@ -1030,8 +1030,8 @@ lnet_post_send_locked (lnet_msg_t *msg, int do_send)
             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);
 
@@ -1864,12 +1864,11 @@ lnet_parse_put(lnet_ni_t *ni, lnet_msg_t *msg)
                 /* 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 */
@@ -1903,14 +1902,13 @@ lnet_parse_get(lnet_ni_t *ni, lnet_msg_t *msg, int rdma_get)
                            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 */
         }
@@ -1973,12 +1971,12 @@ lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg)
         /* 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);
@@ -1994,9 +1992,9 @@ lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg)
 
         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();
index 9daa4ca..7fe9a0d 100644 (file)
@@ -546,8 +546,8 @@ lnet_router_down_ni(lnet_peer_t *rtr, __u32 net)
         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;
         }
 
@@ -555,8 +555,8 @@ lnet_router_down_ni(lnet_peer_t *rtr, __u32 net)
                 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;
         }
 
@@ -565,8 +565,8 @@ lnet_router_down_ni(lnet_peer_t *rtr, __u32 net)
                 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;
                 }
 
@@ -582,8 +582,8 @@ lnet_router_down_ni(lnet_peer_t *rtr, __u32 net)
                 }
 
                 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;
                 }
 
@@ -1500,9 +1500,9 @@ lnet_router_checker (void)
         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 */
index 24af911..570e0e2 100644 (file)
@@ -516,8 +516,7 @@ srpc_finish_service (srpc_service_t *sv)
                 if (!cfs_list_empty(&sv->sv_active_rpcq)) {
                         rpc = cfs_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),
@@ -762,7 +761,7 @@ srpc_server_rpc_done (srpc_server_rpc_t *rpc, int status)
 
         rpc->srpc_status = status;
 
-        CDEBUG (status == 0 ? D_NET : D_NETERROR,
+        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.swi_state), status);
@@ -1004,7 +1003,7 @@ srpc_client_rpc_done (srpc_client_rpc_t *rpc, int status)
 
         srpc_del_client_rpc_timer(rpc);
 
-        CDEBUG ((status == 0) ? D_NET : D_NETERROR,
+        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->swi_state), rpc->crpc_aborted, status);
index 06b313f..565f3f3 100644 (file)
@@ -75,7 +75,7 @@ struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid)
 
         err = ptlrpc_uuid_to_peer(uuid, &peer, &self);
         if (err != 0) {
-                CDEBUG(D_NETERROR, "cannot find peer %s!\n", uuid->uuid);
+                CNETERR("cannot find peer %s!\n", uuid->uuid);
                 return NULL;
         }