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 */
81 * Portal mask to drop, -1 means all portals, for example:
82 * fa_ptl_mask = (1 << _LDLM_CB_REQUEST_PORTAL ) |
83 * (1 << LDLM_CANCEL_REQUEST_PORTAL)
85 * If it is non-zero then only PUT and GET will be filtered, otherwise
86 * there is no portal filter, all matched messages will be checked.
90 * message types to drop, for example:
91 * dra_type = LNET_DROP_ACK_BIT | LNET_DROP_PUT_BIT
93 * If it is non-zero then only specified message types are filtered,
94 * otherwise all message types will be checked.
98 /** message drop simulation */
100 /** drop rate of this rule */
103 * time interval of message drop, it is exclusive
107 /** error type mask */
108 __u32 da_health_error_mask;
109 /** randomize error generation */
112 /** message latency simulation */
116 * time interval of message delay, it is exclusive
120 /** latency to delay */
128 /** fault simluation stats */
129 struct lnet_fault_stat {
130 /** total # matched messages */
132 /** # dropped LNET_MSG_PUT by this rule */
134 /** # dropped LNET_MSG_ACK by this rule */
136 /** # dropped LNET_MSG_GET by this rule */
138 /** # dropped LNET_MSG_REPLY by this rule */
142 /** total # dropped messages */
146 /** total # delayed messages */
153 /** @} lnet_fault_simulation */
155 #define LNET_DEV_ID 0
156 #define LNET_DEV_PATH "/dev/lnet"