X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Flnet%2Facceptor.c;h=5dd52ca256f17225af283d2a00df09c41f3a4ba2;hp=e4c54f55f5c21c8764b26954bf0eecf2e440a50c;hb=a862038b8eb1afb8f17429b8de353569234b9e0a;hpb=e992a95314f9d6721144d5521ebe795a72bb140a diff --git a/lnet/lnet/acceptor.c b/lnet/lnet/acceptor.c index e4c54f5..5dd52ca 100644 --- a/lnet/lnet/acceptor.c +++ b/lnet/lnet/acceptor.c @@ -28,6 +28,8 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2011, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -37,7 +39,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include -#if defined(__KERNEL__) || defined(HAVE_PTHREAD) +#if defined(__KERNEL__) || defined(HAVE_LIBPTHREAD) static int accept_port = 988; static int accept_backlog = 127; @@ -72,7 +74,6 @@ lnet_accept_magic(__u32 magic, __u32 constant) #define cfs_mt_wait_for_completion(c) cfs_wait_for_completion(c) #define cfs_mt_complete(c) cfs_complete(c) #define cfs_mt_fini_completion(c) cfs_fini_completion(c) -#define cfs_create_thread(func, a) cfs_kernel_thread(func, a, 0) EXPORT_SYMBOL(lnet_acceptor_port); @@ -113,25 +114,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" @@ -311,8 +311,6 @@ lnet_accept(cfs_socket_t *sock, __u32 magic) str = "'old' socknal/tcpnal"; else if (lnet_accept_magic(magic, LNET_PROTO_RA_MAGIC)) str = "'old' ranal"; - else if (lnet_accept_magic(magic, LNET_PROTO_OPENIB_MAGIC)) - str = "'old' openibnal"; else str = "unrecognised"; @@ -491,7 +489,7 @@ lnet_acceptor(void *arg) libcfs_sock_release(lnet_acceptor_state.pta_sock); lnet_acceptor_state.pta_sock = NULL; - LCONSOLE(0, "Acceptor stopping\n"); + CDEBUG(D_NET, "Acceptor stopping\n"); /* unblock lnet_acceptor_stop() */ cfs_mt_complete(&lnet_acceptor_state.pta_signal); @@ -545,7 +543,7 @@ lnet_acceptor_start(void) if (lnet_count_acceptor_nis() == 0) /* not required */ return 0; - rc2 = cfs_create_thread(lnet_acceptor, (void *)(ulong_ptr_t)secure); + rc2 = cfs_create_thread(lnet_acceptor, (void *)(ulong_ptr_t)secure, 0); if (rc2 < 0) { CERROR("Can't start acceptor thread: %d\n", rc); cfs_mt_fini_completion(&lnet_acceptor_state.pta_signal); @@ -594,4 +592,4 @@ void lnet_acceptor_stop(void) { } -#endif /* defined(__KERNEL__) || defined(HAVE_PTHREAD) */ +#endif /* defined(__KERNEL__) || defined(HAVE_LIBPTHREAD) */