Whamcloud - gitweb
LU-2456 lnet: Dynamic LNet Configuration (DLC) show command
[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) 2013, Intel Corporation, All rights reserved.
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/lib-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
37 struct lnet_ioctl_net_config {
38         char ni_interfaces[LNET_MAX_INTERFACES][LNET_MAX_STR_LEN];
39         __u32 ni_status;
40         __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT];
41 };
42
43 struct lnet_ioctl_pool_cfg {
44         struct {
45                 __u32 pl_npages;
46                 __u32 pl_nbuffers;
47                 __u32 pl_credits;
48                 __u32 pl_mincredits;
49         } pl_pools[LNET_NRBPOOLS];
50         __u32 pl_routing;
51 };
52
53 struct lnet_ioctl_config_data {
54         struct libcfs_ioctl_hdr cfg_hdr;
55
56         __u32 cfg_net;
57         __u32 cfg_count;
58         __u64 cfg_nid;
59         __u32 cfg_ncpts;
60
61         union {
62                 struct {
63                         __u32 rtr_hop;
64                         __u32 rtr_priority;
65                         __u32 rtr_flags;
66                 } cfg_route;
67                 struct {
68                         char net_intf[LNET_MAX_STR_LEN];
69                         __s32 net_peer_timeout;
70                         __s32 net_peer_tx_credits;
71                         __s32 net_peer_rtr_credits;
72                         __s32 net_max_tx_credits;
73                 } cfg_net;
74                 struct {
75                         __u32 buf_enable;
76                         __s32 buf_tiny;
77                         __s32 buf_small;
78                         __s32 buf_large;
79                 } cfg_buffers;
80         } cfg_config_u;
81
82         char cfg_bulk[0];
83 };
84
85 struct lnet_ioctl_peer {
86         struct libcfs_ioctl_hdr pr_hdr;
87         __u32 pr_count;
88         __u32 pr_pad;
89         __u64 pr_nid;
90
91         union {
92                 struct {
93                         char cr_aliveness[LNET_MAX_STR_LEN];
94                         __u32 cr_refcount;
95                         __u32 cr_ni_peer_tx_credits;
96                         __u32 cr_peer_tx_credits;
97                         __u32 cr_peer_rtr_credits;
98                         __u32 cr_peer_min_rtr_credits;
99                         __u32 cr_peer_tx_qnob;
100                         __u32 cr_ncpt;
101                 } pr_peer_credits;
102         } pr_lnd_u;
103 };
104
105 struct lnet_ioctl_lnet_stats {
106         struct libcfs_ioctl_hdr st_hdr;
107         struct lnet_counters st_cntrs;
108 };
109
110 #endif /* LNET_DLC_H */