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_
33 * This is due to us being out of kernel and the way the OpenSFS branch
37 # include <uapi/linux/lnet/libcfs_ioctl.h>
38 # include <uapi/linux/lnet/lnet-types.h>
40 # include <linux/lnet/libcfs_ioctl.h>
41 # include <linux/lnet/lnet-types.h>
44 #define MAX_NUM_SHOW_ENTRIES 32
45 #define LNET_MAX_STR_LEN 128
46 #define LNET_MAX_SHOW_NUM_CPT 128
47 #define LNET_UNDEFINED_HOPS ((__u32) -1)
50 * To allow for future enhancements to extend the tunables
51 * add a hdr to this structure, so that the version can be set
52 * and checked for backwards compatibility. Newer versions of LNet
53 * can still work with older versions of lnetctl. The restriction is
54 * that the structure can be added to and not removed from in order
55 * to not invalidate older lnetctl utilities. Moreover, the order of
56 * fields must remain the same, and new fields appended to the structure
58 * That said all existing LND tunables will be added in this structure
59 * to avoid future changes.
61 struct lnet_ioctl_config_lnd_cmn_tunables {
63 __s32 lct_peer_timeout;
64 __s32 lct_peer_tx_credits;
65 __s32 lct_peer_rtr_credits;
66 __s32 lct_max_tx_credits;
69 struct lnet_ioctl_config_o2iblnd_tunables {
71 __u32 lnd_peercredits_hiw;
72 __u32 lnd_map_on_demand;
73 __u32 lnd_concurrent_sends;
74 __u32 lnd_fmr_pool_size;
75 __u32 lnd_fmr_flush_trigger;
77 __u16 lnd_conns_per_peer;
81 struct lnet_lnd_tunables {
83 struct lnet_ioctl_config_o2iblnd_tunables lnd_o2ib;
87 struct lnet_ioctl_config_lnd_tunables {
88 struct lnet_ioctl_config_lnd_cmn_tunables lt_cmn;
89 struct lnet_lnd_tunables lt_tun;
92 struct lnet_ioctl_net_config {
93 char ni_interfaces[LNET_INTERFACES_NUM][LNET_MAX_STR_LEN];
95 __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT];
99 #define LNET_TINY_BUF_IDX 0
100 #define LNET_SMALL_BUF_IDX 1
101 #define LNET_LARGE_BUF_IDX 2
103 /* # different router buffer pools */
104 #define LNET_NRBPOOLS (LNET_LARGE_BUF_IDX + 1)
106 struct lnet_ioctl_pool_cfg {
112 } pl_pools[LNET_NRBPOOLS];
116 struct lnet_ioctl_ping_data {
117 struct libcfs_ioctl_hdr ping_hdr;
123 struct lnet_process_id ping_id;
124 struct lnet_process_id __user *ping_buf;
127 struct lnet_ioctl_config_data {
128 struct libcfs_ioctl_hdr cfg_hdr;
142 char net_intf[LNET_MAX_STR_LEN];
143 __s32 net_peer_timeout;
144 __s32 net_peer_tx_credits;
145 __s32 net_peer_rtr_credits;
146 __s32 net_max_tx_credits;
147 __u32 net_cksum_algo;
148 __u32 net_interface_count;
161 struct lnet_ioctl_comm_count {
164 __u32 ico_reply_count;
166 __u32 ico_hello_count;
169 struct lnet_ioctl_element_stats {
170 __u32 iel_send_count;
171 __u32 iel_recv_count;
172 __u32 iel_drop_count;
175 enum lnet_health_type {
176 LNET_HEALTH_TYPE_LOCAL_NI = 0,
177 LNET_HEALTH_TYPE_PEER_NI,
180 struct lnet_ioctl_local_ni_hstats {
181 struct libcfs_ioctl_hdr hlni_hdr;
183 __u32 hlni_local_interrupt;
184 __u32 hlni_local_dropped;
185 __u32 hlni_local_aborted;
186 __u32 hlni_local_no_route;
187 __u32 hlni_local_timeout;
188 __u32 hlni_local_error;
189 __s32 hlni_health_value;
192 struct lnet_ioctl_peer_ni_hstats {
193 __u32 hlpni_remote_dropped;
194 __u32 hlpni_remote_timeout;
195 __u32 hlpni_remote_error;
196 __u32 hlpni_network_timeout;
197 __s32 hlpni_health_value;
200 struct lnet_ioctl_element_msg_stats {
201 struct libcfs_ioctl_hdr im_hdr;
203 struct lnet_ioctl_comm_count im_send_stats;
204 struct lnet_ioctl_comm_count im_recv_stats;
205 struct lnet_ioctl_comm_count im_drop_stats;
209 * lnet_ioctl_config_ni
210 * This structure describes an NI configuration. There are multiple components
211 * when configuring an NI: Net, Interfaces, CPT list and LND tunables
212 * A network is passed as a string to the DLC and translated using
214 * An interface is the name of the system configured interface
216 * CPT is the list of CPTS LND tunables are passed in the lic_bulk area
218 struct lnet_ioctl_config_ni {
219 struct libcfs_ioctl_hdr lic_cfg_hdr;
221 char lic_ni_intf[LNET_INTERFACES_NUM][LNET_MAX_STR_LEN];
222 char lic_legacy_ip2nets[LNET_MAX_STR_LEN];
223 __u32 lic_cpts[LNET_MAX_SHOW_NUM_CPT];
226 __u32 lic_tcp_bonding;
233 struct lnet_peer_ni_credit_info {
234 char cr_aliveness[LNET_MAX_STR_LEN];
236 __s32 cr_ni_peer_tx_credits;
237 __s32 cr_peer_tx_credits;
238 __s32 cr_peer_min_tx_credits;
239 __u32 cr_peer_tx_qnob;
240 __s32 cr_peer_rtr_credits;
241 __s32 cr_peer_min_rtr_credits;
245 struct lnet_ioctl_peer {
246 struct libcfs_ioctl_hdr pr_hdr;
252 struct lnet_peer_ni_credit_info pr_peer_credits;
256 struct lnet_ioctl_peer_cfg {
257 struct libcfs_ioctl_hdr prcfg_hdr;
258 lnet_nid_t prcfg_prim_nid;
259 lnet_nid_t prcfg_cfg_nid;
264 void __user *prcfg_bulk;
267 struct lnet_ioctl_reset_health_cfg {
268 struct libcfs_ioctl_hdr rh_hdr;
269 enum lnet_health_type rh_type;
275 struct lnet_ioctl_set_value {
276 struct libcfs_ioctl_hdr sv_hdr;
280 struct lnet_ioctl_lnet_stats {
281 struct libcfs_ioctl_hdr st_hdr;
282 struct lnet_counters st_cntrs;
285 #endif /* _LNET_DLC_H_ */