X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Flnet%2Facceptor.c;h=a28da788af5205c0365e3969835e6672b1c8bb8b;hb=cf6334dedece61e31ebe1e6784ae8cf17f5398a5;hp=26d30e6e2889cc30197d390e2f8c7bd603ba09ae;hpb=c72335a45d56d1ad61a65c228a8aff0cf010b1dc;p=fs%2Flustre-release.git diff --git a/lnet/lnet/acceptor.c b/lnet/lnet/acceptor.c index 26d30e6..a28da78 100644 --- a/lnet/lnet/acceptor.c +++ b/lnet/lnet/acceptor.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +26,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/ @@ -72,7 +72,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 +112,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" @@ -199,7 +197,7 @@ lnet_connect(cfs_socket_t **sockp, lnet_nid_t peer_nid, if (the_lnet.ln_testprotocompat != 0) { /* single-shot proto check */ - LNET_LOCK(); + lnet_net_lock(LNET_LOCK_EX); if ((the_lnet.ln_testprotocompat & 4) != 0) { cr.acr_version++; the_lnet.ln_testprotocompat &= ~4; @@ -208,7 +206,7 @@ lnet_connect(cfs_socket_t **sockp, lnet_nid_t peer_nid, cr.acr_magic = LNET_PROTO_MAGIC; the_lnet.ln_testprotocompat &= ~8; } - LNET_UNLOCK(); + lnet_net_unlock(LNET_LOCK_EX); } rc = libcfs_sock_write(sock, &cr, sizeof(cr), @@ -311,8 +309,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 +487,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 +541,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);