Whamcloud - gitweb
LU-6851 lnet: Ignore hops if not explicitly set
[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  * Copyright (c) 2014, Intel Corporation.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 3.0 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library.
20  *
21  * LGPL HEADER END
22  *
23  * Contributers:
24  *   Amir Shehata
25  */
26
27 #ifndef LNET_DLC_H
28 #define LNET_DLC_H
29
30 #include <libcfs/libcfs_ioctl.h>
31 #include <lnet/types.h>
32
33 #define MAX_NUM_SHOW_ENTRIES    32
34 #define LNET_MAX_STR_LEN        128
35 #define LNET_MAX_SHOW_NUM_CPT   128
36 #define LNET_UNDEFINED_HOPS     ((__u32) -1)
37
38 struct lnet_ioctl_net_config {
39         char ni_interfaces[LNET_MAX_INTERFACES][LNET_MAX_STR_LEN];
40         __u32 ni_status;
41         __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT];
42 };
43
44 #define LNET_TINY_BUF_IDX       0
45 #define LNET_SMALL_BUF_IDX      1
46 #define LNET_LARGE_BUF_IDX      2
47
48 /* # different router buffer pools */
49 #define LNET_NRBPOOLS           (LNET_LARGE_BUF_IDX + 1)
50
51 struct lnet_ioctl_pool_cfg {
52         struct {
53                 __u32 pl_npages;
54                 __u32 pl_nbuffers;
55                 __u32 pl_credits;
56                 __u32 pl_mincredits;
57         } pl_pools[LNET_NRBPOOLS];
58         __u32 pl_routing;
59 };
60
61 struct lnet_ioctl_config_data {
62         struct libcfs_ioctl_hdr cfg_hdr;
63
64         __u32 cfg_net;
65         __u32 cfg_count;
66         __u64 cfg_nid;
67         __u32 cfg_ncpts;
68
69         union {
70                 struct {
71                         __u32 rtr_hop;
72                         __u32 rtr_priority;
73                         __u32 rtr_flags;
74                 } cfg_route;
75                 struct {
76                         char net_intf[LNET_MAX_STR_LEN];
77                         __s32 net_peer_timeout;
78                         __s32 net_peer_tx_credits;
79                         __s32 net_peer_rtr_credits;
80                         __s32 net_max_tx_credits;
81                         __u32 net_cksum_algo;
82                         __u32 net_pad;
83                 } cfg_net;
84                 struct {
85                         __u32 buf_enable;
86                         __s32 buf_tiny;
87                         __s32 buf_small;
88                         __s32 buf_large;
89                 } cfg_buffers;
90         } cfg_config_u;
91
92         char cfg_bulk[0];
93 };
94
95 struct lnet_ioctl_peer {
96         struct libcfs_ioctl_hdr pr_hdr;
97         __u32 pr_count;
98         __u32 pr_pad;
99         __u64 pr_nid;
100
101         union {
102                 struct {
103                         char cr_aliveness[LNET_MAX_STR_LEN];
104                         __u32 cr_refcount;
105                         __u32 cr_ni_peer_tx_credits;
106                         __u32 cr_peer_tx_credits;
107                         __u32 cr_peer_rtr_credits;
108                         __u32 cr_peer_min_rtr_credits;
109                         __u32 cr_peer_tx_qnob;
110                         __u32 cr_ncpt;
111                 } pr_peer_credits;
112         } pr_lnd_u;
113 };
114
115 struct lnet_ioctl_lnet_stats {
116         struct libcfs_ioctl_hdr st_hdr;
117         struct lnet_counters st_cntrs;
118 };
119
120 #endif /* LNET_DLC_H */