4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library.
23 * Copyright (c) 2014, 2017, Intel Corporation.
26 * Author: Amir Shehata <amir.shehata@intel.com>
29 #ifndef __UAPI_LNET_DLC_H_
30 #define __UAPI_LNET_DLC_H_
32 #include <linux/types.h>
33 #include <linux/lnet/libcfs_ioctl.h>
34 #include <linux/lnet/lnet-types.h>
36 #define MAX_NUM_SHOW_ENTRIES 32
37 #define LNET_MAX_STR_LEN 128
38 #define LNET_MAX_SHOW_NUM_CPT 128
39 #define LNET_MAX_SHOW_NUM_NID 128
40 #define LNET_UNDEFINED_HOPS ((__u32) -1)
42 #define LNET_RT_ALIVE (1 << 0)
43 #define LNET_RT_MULTI_HOP (1 << 1)
46 * sparse kernel source annotations
53 * To allow for future enhancements to extend the tunables
54 * add a hdr to this structure, so that the version can be set
55 * and checked for backwards compatibility. Newer versions of LNet
56 * can still work with older versions of lnetctl. The restriction is
57 * that the structure can be added to and not removed from in order
58 * to not invalidate older lnetctl utilities. Moreover, the order of
59 * fields must remain the same, and new fields appended to the structure
61 * That said all existing LND tunables will be added in this structure
62 * to avoid future changes.
64 struct lnet_ioctl_config_lnd_cmn_tunables {
66 __s32 lct_peer_timeout;
67 __s32 lct_peer_tx_credits;
68 __s32 lct_peer_rtr_credits;
69 __s32 lct_max_tx_credits;
72 struct lnet_ioctl_config_o2iblnd_tunables {
74 __u32 lnd_peercredits_hiw;
75 __u32 lnd_map_on_demand;
76 __u32 lnd_concurrent_sends;
77 __u32 lnd_fmr_pool_size;
78 __u32 lnd_fmr_flush_trigger;
80 __u16 lnd_conns_per_peer;
84 struct lnet_lnd_tunables {
86 struct lnet_ioctl_config_o2iblnd_tunables lnd_o2ib;
90 struct lnet_ioctl_config_lnd_tunables {
91 struct lnet_ioctl_config_lnd_cmn_tunables lt_cmn;
92 struct lnet_lnd_tunables lt_tun;
95 struct lnet_ioctl_net_config {
96 char ni_interfaces[LNET_INTERFACES_NUM][LNET_MAX_STR_LEN];
98 __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT];
102 #define LNET_TINY_BUF_IDX 0
103 #define LNET_SMALL_BUF_IDX 1
104 #define LNET_LARGE_BUF_IDX 2
106 /* # different router buffer pools */
107 #define LNET_NRBPOOLS (LNET_LARGE_BUF_IDX + 1)
109 struct lnet_ioctl_pool_cfg {
115 } pl_pools[LNET_NRBPOOLS];
119 struct lnet_ioctl_ping_data {
120 struct libcfs_ioctl_hdr ping_hdr;
126 struct lnet_process_id ping_id;
127 struct lnet_process_id __user *ping_buf;
130 struct lnet_ioctl_config_data {
131 struct libcfs_ioctl_hdr cfg_hdr;
143 __u32 rtr_sensitivity;
146 char net_intf[LNET_MAX_STR_LEN];
147 __s32 net_peer_timeout;
148 __s32 net_peer_tx_credits;
149 __s32 net_peer_rtr_credits;
150 __s32 net_max_tx_credits;
151 __u32 net_cksum_algo;
152 __u32 net_interface_count;
165 struct lnet_ioctl_comm_count {
168 __u32 ico_reply_count;
170 __u32 ico_hello_count;
173 struct lnet_ioctl_element_stats {
174 __u32 iel_send_count;
175 __u32 iel_recv_count;
176 __u32 iel_drop_count;
179 enum lnet_health_type {
180 LNET_HEALTH_TYPE_LOCAL_NI = 0,
181 LNET_HEALTH_TYPE_PEER_NI,
184 struct lnet_ioctl_local_ni_hstats {
185 struct libcfs_ioctl_hdr hlni_hdr;
187 __u32 hlni_local_interrupt;
188 __u32 hlni_local_dropped;
189 __u32 hlni_local_aborted;
190 __u32 hlni_local_no_route;
191 __u32 hlni_local_timeout;
192 __u32 hlni_local_error;
193 __s32 hlni_health_value;
196 struct lnet_ioctl_peer_ni_hstats {
197 __u32 hlpni_remote_dropped;
198 __u32 hlpni_remote_timeout;
199 __u32 hlpni_remote_error;
200 __u32 hlpni_network_timeout;
201 __s32 hlpni_health_value;
204 struct lnet_ioctl_element_msg_stats {
205 struct libcfs_ioctl_hdr im_hdr;
207 struct lnet_ioctl_comm_count im_send_stats;
208 struct lnet_ioctl_comm_count im_recv_stats;
209 struct lnet_ioctl_comm_count im_drop_stats;
213 * lnet_ioctl_config_ni
214 * This structure describes an NI configuration. There are multiple components
215 * when configuring an NI: Net, Interfaces, CPT list and LND tunables
216 * A network is passed as a string to the DLC and translated using
218 * An interface is the name of the system configured interface
220 * CPT is the list of CPTS LND tunables are passed in the lic_bulk area
222 struct lnet_ioctl_config_ni {
223 struct libcfs_ioctl_hdr lic_cfg_hdr;
225 char lic_ni_intf[LNET_INTERFACES_NUM][LNET_MAX_STR_LEN];
226 char lic_legacy_ip2nets[LNET_MAX_STR_LEN];
227 __u32 lic_cpts[LNET_MAX_SHOW_NUM_CPT];
230 __u32 lic_tcp_bonding;
237 struct lnet_peer_ni_credit_info {
238 char cr_aliveness[LNET_MAX_STR_LEN];
240 __s32 cr_ni_peer_tx_credits;
241 __s32 cr_peer_tx_credits;
242 __s32 cr_peer_min_tx_credits;
243 __u32 cr_peer_tx_qnob;
244 __s32 cr_peer_rtr_credits;
245 __s32 cr_peer_min_rtr_credits;
249 struct lnet_ioctl_peer {
250 struct libcfs_ioctl_hdr pr_hdr;
256 struct lnet_peer_ni_credit_info pr_peer_credits;
260 struct lnet_ioctl_peer_cfg {
261 struct libcfs_ioctl_hdr prcfg_hdr;
262 lnet_nid_t prcfg_prim_nid;
263 lnet_nid_t prcfg_cfg_nid;
268 void __user *prcfg_bulk;
271 struct lnet_ioctl_reset_health_cfg {
272 struct libcfs_ioctl_hdr rh_hdr;
273 enum lnet_health_type rh_type:32;
279 struct lnet_ioctl_recovery_list {
280 struct libcfs_ioctl_hdr rlst_hdr;
281 enum lnet_health_type rlst_type:32;
283 lnet_nid_t rlst_nid_array[LNET_MAX_SHOW_NUM_NID];
286 struct lnet_ioctl_set_value {
287 struct libcfs_ioctl_hdr sv_hdr;
291 struct lnet_ioctl_lnet_stats {
292 struct libcfs_ioctl_hdr st_hdr;
293 struct lnet_counters st_cntrs;
296 #endif /* _LNET_DLC_H_ */