Whamcloud - gitweb
1213eb728e25931ad541c06f0c9d77a21a2a1280
[fs/lustre-release.git] / lnet / include / lnet / lib-dlc.h
1 /*
2  * LGPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library.
18  *
19  * LGPL HEADER END
20  *
21  */
22 /*
23  * Copyright (c) 2014, 2016, Intel Corporation.
24  */
25 /*
26  * Author: Amir Shehata <amir.shehata@intel.com>
27  */
28
29 #ifndef LNET_DLC_H
30 #define LNET_DLC_H
31
32 #include <libcfs/libcfs_ioctl.h>
33 #include <lnet/types.h>
34
35 #define MAX_NUM_SHOW_ENTRIES    32
36 #define LNET_MAX_STR_LEN        128
37 #define LNET_MAX_SHOW_NUM_CPT   128
38 #define LNET_UNDEFINED_HOPS     ((__u32) -1)
39
40 struct lnet_ioctl_config_lnd_cmn_tunables {
41         __u32 lct_version;
42         __s32 lct_peer_timeout;
43         __s32 lct_peer_tx_credits;
44         __s32 lct_peer_rtr_credits;
45         __s32 lct_max_tx_credits;
46 };
47
48 struct lnet_ioctl_config_o2iblnd_tunables {
49         __u32 lnd_version;
50         __u32 lnd_peercredits_hiw;
51         __u32 lnd_map_on_demand;
52         __u32 lnd_concurrent_sends;
53         __u32 lnd_fmr_pool_size;
54         __u32 lnd_fmr_flush_trigger;
55         __u32 lnd_fmr_cache;
56         __u32 pad;
57 };
58
59 struct lnet_lnd_tunables {
60         union {
61                 struct lnet_ioctl_config_o2iblnd_tunables lnd_o2ib;
62         } lnd_tun_u;
63 };
64
65 struct lnet_ioctl_config_lnd_tunables {
66         struct lnet_ioctl_config_lnd_cmn_tunables lt_cmn;
67         struct lnet_lnd_tunables lt_tun;
68 };
69
70 struct lnet_ioctl_net_config {
71         char ni_interfaces[LNET_MAX_INTERFACES][LNET_MAX_STR_LEN];
72         __u32 ni_status;
73         __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT];
74         char cfg_bulk[0];
75 };
76
77 #define LNET_TINY_BUF_IDX       0
78 #define LNET_SMALL_BUF_IDX      1
79 #define LNET_LARGE_BUF_IDX      2
80
81 /* # different router buffer pools */
82 #define LNET_NRBPOOLS           (LNET_LARGE_BUF_IDX + 1)
83
84 struct lnet_ioctl_pool_cfg {
85         struct {
86                 __u32 pl_npages;
87                 __u32 pl_nbuffers;
88                 __u32 pl_credits;
89                 __u32 pl_mincredits;
90         } pl_pools[LNET_NRBPOOLS];
91         __u32 pl_routing;
92 };
93
94 struct lnet_ioctl_config_data {
95         struct libcfs_ioctl_hdr cfg_hdr;
96
97         __u32 cfg_net;
98         __u32 cfg_count;
99         __u64 cfg_nid;
100         __u32 cfg_ncpts;
101
102         union {
103                 struct {
104                         __u32 rtr_hop;
105                         __u32 rtr_priority;
106                         __u32 rtr_flags;
107                 } cfg_route;
108                 struct {
109                         char net_intf[LNET_MAX_STR_LEN];
110                         __s32 net_peer_timeout;
111                         __s32 net_peer_tx_credits;
112                         __s32 net_peer_rtr_credits;
113                         __s32 net_max_tx_credits;
114                         __u32 net_cksum_algo;
115                         __u32 net_interface_count;
116                 } cfg_net;
117                 struct {
118                         __u32 buf_enable;
119                         __s32 buf_tiny;
120                         __s32 buf_small;
121                         __s32 buf_large;
122                 } cfg_buffers;
123         } cfg_config_u;
124
125         char cfg_bulk[0];
126 };
127
128 struct lnet_peer_ni_credit_info {
129         char cr_aliveness[LNET_MAX_STR_LEN];
130         __u32 cr_refcount;
131         __s32 cr_ni_peer_tx_credits;
132         __s32 cr_peer_tx_credits;
133         __s32 cr_peer_rtr_credits;
134         __s32 cr_peer_min_rtr_credits;
135         __u32 cr_peer_tx_qnob;
136         __u32 cr_ncpt;
137 };
138
139 struct lnet_ioctl_peer {
140         struct libcfs_ioctl_hdr pr_hdr;
141         __u32 pr_count;
142         __u32 pr_pad;
143         lnet_nid_t pr_nid;
144
145         union {
146                 struct lnet_peer_ni_credit_info  pr_peer_credits;
147         } pr_lnd_u;
148 };
149
150 struct lnet_ioctl_peer_cfg {
151         struct libcfs_ioctl_hdr prcfg_hdr;
152         lnet_nid_t prcfg_key_nid;
153         lnet_nid_t prcfg_cfg_nid;
154         __u32 prcfg_idx;
155         char prcfg_bulk[0];
156 };
157
158 struct lnet_ioctl_lnet_stats {
159         struct libcfs_ioctl_hdr st_hdr;
160         struct lnet_counters st_cntrs;
161 };
162
163 #endif /* LNET_DLC_H */