1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2005 Cluster File Systems, Inc. All rights reserved.
5 * Author: PJ Kirner <pjkirner@clusterfs.com>
7 * This file is part of the Lustre file system, http://www.lustre.org
8 * Lustre is a trademark of Cluster File Systems, Inc.
10 * This file is confidential source code owned by Cluster File Systems.
11 * No viewing, modification, compilation, redistribution, or any other
12 * form of use is permitted except through a signed license agreement.
14 * If you have not signed such an agreement, then you have no rights to
15 * this file. Please destroy it immediately and contact CFS.
19 /* Minimum buffer size that any peer will post to receive ptllnd messages */
20 #define PTLLND_MIN_BUFFER_SIZE 256
22 /************************************************************************
23 * Tunable defaults that {u,k}lnds/ptllnd should have in common.
26 #define PTLLND_PORTAL 9 /* The same portal PTLPRC used when talking to cray portals */
27 #define PTLLND_PID 9 /* The Portals PID */
28 #define PTLLND_PEERCREDITS 8 /* concurrent sends to 1 peer */
30 /* Default buffer size for kernel ptllnds (guaranteed eager) */
31 #define PTLLND_MAX_KLND_MSG_SIZE 512
33 /* Default buffer size for catamount ptllnds (not guaranteed eager) - large
34 * enough to avoid RDMA for anything sent while control is not in liblustre */
35 #define PTLLND_MAX_ULND_MSG_SIZE 512
38 /************************************************************************
39 * Portals LND Wire message format.
40 * These are sent in sender's byte order (i.e. receiver flips).
43 #define PTL_RESERVED_MATCHBITS 0x100 /* below this value is reserved
44 * above is for bulk data transfer */
45 #define LNET_MSG_MATCHBITS 0 /* the value for the message channel */
49 lnet_hdr_t kptlim_hdr; /* portals header */
50 char kptlim_payload[0]; /* piggy-backed payload */
51 } WIRE_ATTR kptl_immediate_msg_t;
55 lnet_hdr_t kptlrm_hdr; /* portals header */
56 __u64 kptlrm_matchbits; /* matchbits */
57 } WIRE_ATTR kptl_rdma_msg_t;
61 __u64 kptlhm_matchbits; /* matchbits */
62 __u32 kptlhm_max_msg_size; /* max message size */
63 } WIRE_ATTR kptl_hello_msg_t;
67 /* First 2 fields fixed FOR ALL TIME */
68 __u32 ptlm_magic; /* I'm a Portals LND message */
69 __u16 ptlm_version; /* this is my version number */
70 __u8 ptlm_type; /* the message type */
71 __u8 ptlm_credits; /* returned credits */
72 __u32 ptlm_nob; /* # bytes in whole message */
73 __u32 ptlm_cksum; /* checksum (0 == no checksum) */
74 __u64 ptlm_srcnid; /* sender's NID */
75 __u64 ptlm_srcstamp; /* sender's incarnation */
76 __u64 ptlm_dstnid; /* destination's NID */
77 __u64 ptlm_dststamp; /* destination's incarnation */
78 __u32 ptlm_srcpid; /* sender's PID */
79 __u32 ptlm_dstpid; /* destination's PID */
82 kptl_immediate_msg_t immediate;
84 kptl_hello_msg_t hello;
89 #define PTLLND_MSG_MAGIC LNET_PROTO_PTL_MAGIC
90 #define PTLLND_MSG_VERSION 0x04
92 #define PTLLND_RDMA_OK 0x00
93 #define PTLLND_RDMA_FAIL 0x01
95 #define PTLLND_MSG_TYPE_INVALID 0x00
96 #define PTLLND_MSG_TYPE_PUT 0x01
97 #define PTLLND_MSG_TYPE_GET 0x02
98 #define PTLLND_MSG_TYPE_IMMEDIATE 0x03 /* No bulk data xfer*/
99 #define PTLLND_MSG_TYPE_NOOP 0x04
100 #define PTLLND_MSG_TYPE_HELLO 0x05
101 #define PTLLND_MSG_TYPE_NAK 0x06