aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/include/linux/lnet/socklnd.h
blob: 6bd1bca190a378193de56a8f3d12790b3f0ecd55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// SPDX-License-Identifier: GPL-2.0
/*
 * GPL HEADER START
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 only,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License version 2 for more details (a copy is included
 * in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU General Public License
 * version 2 along with this program; If not, see
 * http://www.gnu.org/licenses/gpl-2.0.html
 *
 * GPL HEADER END
 */
/*
 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 * Use is subject to license terms.
 *
 * Copyright (c) 2012 - 2015, Intel Corporation.
 */
/*
 * This file is part of Lustre, http://www.lustre.org/
 * Lustre is a trademark of Seagate, Inc.
 *
 * lnet/include/lnet/socklnd.h
 */
#ifndef __LNET_LNET_SOCKLND_H__
#define __LNET_LNET_SOCKLND_H__

#include <uapi/linux/lnet/lnet-types.h>
#include <uapi/linux/lnet/socklnd.h>

struct ksock_hello_msg {
	__u32		kshm_magic;	/* magic number of socklnd message */
	__u32		kshm_version;	/* version of socklnd message */
	lnet_nid_t      kshm_src_nid;	/* sender's nid */
	lnet_nid_t	kshm_dst_nid;	/* destination nid */
	lnet_pid_t	kshm_src_pid;	/* sender's pid */
	lnet_pid_t	kshm_dst_pid;	/* destination pid */
	__u64		kshm_src_incarnation; /* sender's incarnation */
	__u64		kshm_dst_incarnation; /* destination's incarnation */
	__u32		kshm_ctype;	/* connection type */
	__u32		kshm_nips;	/* # IP addrs */
	__u32		kshm_ips[0];	/* IP addrs */
} WIRE_ATTR;

struct ksock_lnet_msg {
	struct lnet_hdr	ksnm_hdr;	/* lnet hdr */

	/*
	 * ksnm_payload is removed because of winnt compiler's limitation:
	 * zero-sized array can only be placed at the tail of [nested]
	 * structure definitions. lnet payload will be stored just after
	 * the body of structure ksock_lnet_msg_t
	 */
} WIRE_ATTR;

struct ksock_msg {
	__u32	ksm_type;		/* type of socklnd message */
	__u32	ksm_csum;		/* checksum if != 0 */
	__u64	ksm_zc_cookies[2];	/* Zero-Copy request/ACK cookie */
	union {
		struct ksock_lnet_msg lnetmsg; /* lnet message, it's empty if
						* it's NOOP
						*/
	} WIRE_ATTR ksm_u;
} WIRE_ATTR;

#define KSOCK_MSG_NOOP	0xC0	/* ksm_u empty */
#define KSOCK_MSG_LNET	0xC1	/* lnet msg */

/*
 * We need to know this number to parse hello msg from ksocklnd in
 * other LND (usocklnd, for example)
 */
#define KSOCK_PROTO_V2	2
#define KSOCK_PROTO_V3	3

#endif