1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2004 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #define DEBUG_SUBSYSTEM S_LNET
23 #include <lnet/lib-lnet.h>
26 lolnd_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
28 LASSERT (!lntmsg->msg_routing);
29 LASSERT (!lntmsg->msg_target_is_router);
31 return lnet_parse(ni, &lntmsg->msg_hdr, ni->ni_nid, lntmsg, 0);
35 lolnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg,
36 int delayed, unsigned int niov,
37 struct iovec *iov, lnet_kiov_t *kiov,
38 unsigned int offset, unsigned int mlen, unsigned int rlen)
40 lnet_msg_t *sendmsg = private;
42 if (lntmsg != NULL) { /* not discarding */
43 if (sendmsg->msg_iov != NULL) {
45 lnet_copy_iov2iov(niov, iov, offset,
48 sendmsg->msg_offset, mlen);
50 lnet_copy_iov2kiov(niov, kiov, offset,
53 sendmsg->msg_offset, mlen);
56 lnet_copy_kiov2iov(niov, iov, offset,
59 sendmsg->msg_offset, mlen);
61 lnet_copy_kiov2kiov(niov, kiov, offset,
64 sendmsg->msg_offset, mlen);
67 lnet_finalize(ni, lntmsg, 0);
70 lnet_finalize(ni, sendmsg, 0);
74 static int lolnd_instanced;
77 lolnd_shutdown(lnet_ni_t *ni)
79 CDEBUG (D_NET, "shutdown\n");
80 LASSERT (lolnd_instanced);
86 lolnd_startup (lnet_ni_t *ni)
88 LASSERT (ni->ni_lnd == &the_lolnd);
89 LASSERT (!lolnd_instanced);
96 /* .lnd_list = */ {&the_lolnd.lnd_list, &the_lolnd.lnd_list},
97 /* .lnd_refcount = */ 0,
98 /* .lnd_type = */ LOLND,
99 /* .lnd_startup = */ lolnd_startup,
100 /* .lnd_shutdown = */ lolnd_shutdown,
101 /* .lnt_ctl = */ NULL,
102 /* .lnd_send = */ lolnd_send,
103 /* .lnd_recv = */ lolnd_recv,
104 /* .lnd_eager_recv = */ NULL,
105 /* .lnd_notify = */ NULL,
107 /* .lnd_accept = */ NULL
109 /* .lnd_wait = */ NULL