Whamcloud - gitweb
Landing b_hd_newconfig on HEAD
[fs/lustre-release.git] / lnet / include / lnet / ptllnd_wire.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 2005 Cluster File Systems, Inc. All rights reserved.
5  *   Author: PJ Kirner <pjkirner@clusterfs.com>
6  *
7  *   This file is part of the Lustre file system, http://www.lustre.org
8  *   Lustre is a trademark of Cluster File Systems, Inc.
9  *
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.
13  *
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.
16  *
17  */
18  
19 /************************************************************************
20  * Tunable defaults that {u,k}lnds/ptllnd should have in common.
21  */
22
23 #define PTLLND_PORTAL           9          /* The same portal PTLPRC used when talking to cray portals */
24 #define PTLLND_PID              9          /* The Portals PID */
25 #define PTLLND_PEERCREDITS      8          /* concurrent sends to 1 peer */
26 #define PTLLND_MAX_MSG_SIZE     512        /* Maximum message size */
27
28
29 /************************************************************************
30  * Portals LNS Wire message format.
31  * These are sent in sender's byte order (i.e. receiver flips).
32  */
33
34 #define PTL_RESERVED_MATCHBITS  0x100   /* below this value is reserved
35                                          * above is for bulk data transfer */
36 #define LNET_MSG_MATCHBITS       0      /* the value for the message channel */
37
38 typedef struct
39 {
40         lnet_hdr_t        kptlim_hdr;             /* portals header */
41         char              kptlim_payload[0];      /* piggy-backed payload */
42 } WIRE_ATTR kptl_immediate_msg_t;
43
44 typedef struct
45 {
46         lnet_hdr_t        kptlrm_hdr;             /* portals header */
47         __u64             kptlrm_matchbits;       /* matchbits */
48 } WIRE_ATTR kptl_rdma_msg_t;
49
50 typedef struct
51 {
52         __u64             kptlhm_matchbits;       /* matchbits */
53         __u32             kptlhm_max_msg_size;    /* max message size */
54 } WIRE_ATTR kptl_hello_msg_t;
55
56 typedef struct
57 {
58         /* First 2 fields fixed FOR ALL TIME */
59         __u32           ptlm_magic;     /* I'm a Portals LND message */
60         __u16           ptlm_version;   /* this is my version number */
61         __u8            ptlm_type;      /* the message type */
62         __u8            ptlm_credits;   /* returned credits */
63         __u32           ptlm_nob;       /* # bytes in whole message */
64         __u32           ptlm_cksum;     /* checksum (0 == no checksum) */
65         __u64           ptlm_srcnid;    /* sender's NID */
66         __u64           ptlm_srcstamp;  /* sender's incarnation */
67         __u64           ptlm_dstnid;    /* destination's NID */
68         __u64           ptlm_dststamp;  /* destination's incarnation */
69         __u32           ptlm_srcpid;    /* sender's PID */
70         __u32           ptlm_dstpid;    /* destination's PID */
71
72          union {
73                 kptl_immediate_msg_t    immediate;
74                 kptl_rdma_msg_t         rdma;
75                 kptl_hello_msg_t        hello;
76         } WIRE_ATTR ptlm_u;
77
78 } kptl_msg_t;
79
80 #define PTLLND_MSG_MAGIC                LNET_PROTO_PTL_MAGIC
81 #define PTLLND_MSG_VERSION              0x04
82
83 #define PTLLND_RDMA_OK                  0x00
84 #define PTLLND_RDMA_FAIL                0x01
85
86 #define PTLLND_MSG_TYPE_INVALID         0x00
87 #define PTLLND_MSG_TYPE_PUT             0x01
88 #define PTLLND_MSG_TYPE_GET             0x02
89 #define PTLLND_MSG_TYPE_IMMEDIATE       0x03    /* No bulk data xfer*/
90 #define PTLLND_MSG_TYPE_NOOP            0x04
91 #define PTLLND_MSG_TYPE_HELLO           0x05
92 #define PTLLND_MSG_TYPE_NAK             0x06
93