Whamcloud - gitweb
LU-6613 lnet: change lib-dlc.h to LGPLv2.1 license
[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, 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_net_config {
41         char ni_interfaces[LNET_MAX_INTERFACES][LNET_MAX_STR_LEN];
42         __u32 ni_status;
43         __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT];
44 };
45
46 #define LNET_TINY_BUF_IDX       0
47 #define LNET_SMALL_BUF_IDX      1
48 #define LNET_LARGE_BUF_IDX      2
49
50 /* # different router buffer pools */
51 #define LNET_NRBPOOLS           (LNET_LARGE_BUF_IDX + 1)
52
53 struct lnet_ioctl_pool_cfg {
54         struct {
55                 __u32 pl_npages;
56                 __u32 pl_nbuffers;
57                 __u32 pl_credits;
58                 __u32 pl_mincredits;
59         } pl_pools[LNET_NRBPOOLS];
60         __u32 pl_routing;
61 };
62
63 struct lnet_ioctl_config_data {
64         struct libcfs_ioctl_hdr cfg_hdr;
65
66         __u32 cfg_net;
67         __u32 cfg_count;
68         __u64 cfg_nid;
69         __u32 cfg_ncpts;
70
71         union {
72                 struct {
73                         __u32 rtr_hop;
74                         __u32 rtr_priority;
75                         __u32 rtr_flags;
76                 } cfg_route;
77                 struct {
78                         char net_intf[LNET_MAX_STR_LEN];
79                         __s32 net_peer_timeout;
80                         __s32 net_peer_tx_credits;
81                         __s32 net_peer_rtr_credits;
82                         __s32 net_max_tx_credits;
83                         __u32 net_cksum_algo;
84                         __u32 net_pad;
85                 } cfg_net;
86                 struct {
87                         __u32 buf_enable;
88                         __s32 buf_tiny;
89                         __s32 buf_small;
90                         __s32 buf_large;
91                 } cfg_buffers;
92         } cfg_config_u;
93
94         char cfg_bulk[0];
95 };
96
97 struct lnet_ioctl_peer {
98         struct libcfs_ioctl_hdr pr_hdr;
99         __u32 pr_count;
100         __u32 pr_pad;
101         __u64 pr_nid;
102
103         union {
104                 struct {
105                         char cr_aliveness[LNET_MAX_STR_LEN];
106                         __u32 cr_refcount;
107                         __u32 cr_ni_peer_tx_credits;
108                         __u32 cr_peer_tx_credits;
109                         __u32 cr_peer_rtr_credits;
110                         __u32 cr_peer_min_rtr_credits;
111                         __u32 cr_peer_tx_qnob;
112                         __u32 cr_ncpt;
113                 } pr_peer_credits;
114         } pr_lnd_u;
115 };
116
117 struct lnet_ioctl_lnet_stats {
118         struct libcfs_ioctl_hdr st_hdr;
119         struct lnet_counters st_cntrs;
120 };
121
122 #endif /* LNET_DLC_H */