2 * This file is part of Lustre, https://wiki.whamcloud.com/
4 * Portals is free software; you can redistribute it and/or
5 * modify it under the terms of version 2 of the GNU General Public
6 * License as published by the Free Software Foundation.
8 * Portals is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Portals; if not, write to the Free Software
15 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 * header for lnet ioctl
20 * Copyright (c) 2014, 2017, Intel Corporation.
22 #ifndef __UAPI_LNETCTL_H_
23 #define __UAPI_LNETCTL_H_
25 #include <linux/types.h>
27 * This is due to us being out of kernel and the way the OpenSFS branch
31 # include <uapi/linux/lnet/lnet-types.h>
33 # include <linux/lnet/lnet-types.h>
38 /** \addtogroup lnet_fault_simulation
52 #define LNET_ACK_BIT (1 << 0)
53 #define LNET_PUT_BIT (1 << 1)
54 #define LNET_GET_BIT (1 << 2)
55 #define LNET_REPLY_BIT (1 << 3)
57 #define HSTATUS_END 11
58 #define HSTATUS_LOCAL_INTERRUPT_BIT (1 << 1)
59 #define HSTATUS_LOCAL_DROPPED_BIT (1 << 2)
60 #define HSTATUS_LOCAL_ABORTED_BIT (1 << 3)
61 #define HSTATUS_LOCAL_NO_ROUTE_BIT (1 << 4)
62 #define HSTATUS_LOCAL_ERROR_BIT (1 << 5)
63 #define HSTATUS_LOCAL_TIMEOUT_BIT (1 << 6)
64 #define HSTATUS_REMOTE_ERROR_BIT (1 << 7)
65 #define HSTATUS_REMOTE_DROPPED_BIT (1 << 8)
66 #define HSTATUS_REMOTE_TIMEOUT_BIT (1 << 9)
67 #define HSTATUS_NETWORK_TIMEOUT_BIT (1 << 10)
68 #define HSTATUS_RANDOM 0xffffffff
70 /** ioctl parameter for LNet fault simulation */
71 struct lnet_fault_attr {
73 * source NID of drop rule
74 * LNET_NID_ANY is wildcard for all sources
75 * 255.255.255.255@net is wildcard for all addresses from @net
78 /** destination NID of drop rule, see \a dr_src for details */
80 /** local NID. In case of router this is the NID we're ceiving
83 lnet_nid_t fa_local_nid;
85 * Portal mask to drop, -1 means all portals, for example:
86 * fa_ptl_mask = (1 << _LDLM_CB_REQUEST_PORTAL ) |
87 * (1 << LDLM_CANCEL_REQUEST_PORTAL)
89 * If it is non-zero then only PUT and GET will be filtered, otherwise
90 * there is no portal filter, all matched messages will be checked.
94 * message types to drop, for example:
95 * dra_type = LNET_DROP_ACK_BIT | LNET_DROP_PUT_BIT
97 * If it is non-zero then only specified message types are filtered,
98 * otherwise all message types will be checked.
102 /** message drop simulation */
104 /** drop rate of this rule */
107 * time interval of message drop, it is exclusive
111 /** error type mask */
112 __u32 da_health_error_mask;
113 /** randomize error generation */
115 /** drop all messages if flag is set */
118 /** message latency simulation */
122 * time interval of message delay, it is exclusive
126 /** latency to delay */
134 /** fault simluation stats */
135 struct lnet_fault_stat {
136 /** total # matched messages */
138 /** # dropped LNET_MSG_PUT by this rule */
140 /** # dropped LNET_MSG_ACK by this rule */
142 /** # dropped LNET_MSG_GET by this rule */
144 /** # dropped LNET_MSG_REPLY by this rule */
148 /** total # dropped messages */
152 /** total # delayed messages */
159 /** @} lnet_fault_simulation */
161 #define LNET_DEV_ID 0
162 #define LNET_DEV_PATH "/dev/lnet"