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, 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 "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 __u32 lct_peer_timeout; 43 __u32 lct_peer_tx_credits; 44 __u32 lct_peer_rtr_credits; 45 __u32 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_ioctl_config_lnd_tunables { 60 struct lnet_ioctl_config_lnd_cmn_tunables lt_cmn; 61 union { 62 struct lnet_ioctl_config_o2iblnd_tunables lt_o2ib; 63 } lt_tun_u; 64 }; 65 66 struct lnet_ioctl_net_config { 67 char ni_interfaces[LNET_MAX_INTERFACES][LNET_MAX_STR_LEN]; 68 __u32 ni_status; 69 __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT]; 70 char cfg_bulk[0]; 71 }; 72 73 #define LNET_TINY_BUF_IDX 0 74 #define LNET_SMALL_BUF_IDX 1 75 #define LNET_LARGE_BUF_IDX 2 76 77 /* # different router buffer pools */ 78 #define LNET_NRBPOOLS (LNET_LARGE_BUF_IDX + 1) 79 80 struct lnet_ioctl_pool_cfg { 81 struct { 82 __u32 pl_npages; 83 __u32 pl_nbuffers; 84 __u32 pl_credits; 85 __u32 pl_mincredits; 86 } pl_pools[LNET_NRBPOOLS]; 87 __u32 pl_routing; 88 }; 89 90 struct lnet_ioctl_config_data { 91 struct libcfs_ioctl_hdr cfg_hdr; 92 93 __u32 cfg_net; 94 __u32 cfg_count; 95 __u64 cfg_nid; 96 __u32 cfg_ncpts; 97 98 union { 99 struct { 100 __u32 rtr_hop; 101 __u32 rtr_priority; 102 __u32 rtr_flags; 103 } cfg_route; 104 struct { 105 char net_intf[LNET_MAX_STR_LEN]; 106 __s32 net_peer_timeout; 107 __s32 net_peer_tx_credits; 108 __s32 net_peer_rtr_credits; 109 __s32 net_max_tx_credits; 110 __u32 net_cksum_algo; 111 __u32 net_interface_count; 112 } cfg_net; 113 struct { 114 __u32 buf_enable; 115 __s32 buf_tiny; 116 __s32 buf_small; 117 __s32 buf_large; 118 } cfg_buffers; 119 } cfg_config_u; 120 121 char cfg_bulk[0]; 122 }; 123 124 struct lnet_ioctl_peer { 125 struct libcfs_ioctl_hdr pr_hdr; 126 __u32 pr_count; 127 __u32 pr_pad; 128 __u64 pr_nid; 129 130 union { 131 struct { 132 char cr_aliveness[LNET_MAX_STR_LEN]; 133 __u32 cr_refcount; 134 __u32 cr_ni_peer_tx_credits; 135 __u32 cr_peer_tx_credits; 136 __u32 cr_peer_rtr_credits; 137 __u32 cr_peer_min_rtr_credits; 138 __u32 cr_peer_tx_qnob; 139 __u32 cr_ncpt; 140 } pr_peer_credits; 141 } pr_lnd_u; 142 }; 143 144 struct lnet_ioctl_lnet_stats { 145 struct libcfs_ioctl_hdr st_hdr; 146 struct lnet_counters st_cntrs; 147 }; 148 149 #endif /* LNET_DLC_H */ 150