2 * This file is part of Lustre, https://wiki.hpdd.intel.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_
26 * This is due to us being out of kernel and the way the OpenSFS branch
30 # include <uapi/linux/lnet/lnet-types.h>
32 # include <linux/lnet/lnet-types.h>
37 /** \addtogroup lnet_fault_simulation
51 #define LNET_ACK_BIT (1 << 0)
52 #define LNET_PUT_BIT (1 << 1)
53 #define LNET_GET_BIT (1 << 2)
54 #define LNET_REPLY_BIT (1 << 3)
56 #define HSTATUS_END 11
57 #define HSTATUS_LOCAL_INTERRUPT_BIT (1 << 1)
58 #define HSTATUS_LOCAL_DROPPED_BIT (1 << 2)
59 #define HSTATUS_LOCAL_ABORTED_BIT (1 << 3)
60 #define HSTATUS_LOCAL_NO_ROUTE_BIT (1 << 4)
61 #define HSTATUS_LOCAL_ERROR_BIT (1 << 5)
62 #define HSTATUS_LOCAL_TIMEOUT_BIT (1 << 6)
63 #define HSTATUS_REMOTE_ERROR_BIT (1 << 7)
64 #define HSTATUS_REMOTE_DROPPED_BIT (1 << 8)
65 #define HSTATUS_REMOTE_TIMEOUT_BIT (1 << 9)
66 #define HSTATUS_NETWORK_TIMEOUT_BIT (1 << 10)
67 #define HSTATUS_RANDOM 0xffffffff
69 /** ioctl parameter for LNet fault simulation */
70 struct lnet_fault_attr {
72 * source NID of drop rule
73 * LNET_NID_ANY is wildcard for all sources
74 * 255.255.255.255@net is wildcard for all addresses from @net
77 /** destination NID of drop rule, see \a dr_src for details */
80 * Portal mask to drop, -1 means all portals, for example:
81 * fa_ptl_mask = (1 << _LDLM_CB_REQUEST_PORTAL ) |
82 * (1 << LDLM_CANCEL_REQUEST_PORTAL)
84 * If it is non-zero then only PUT and GET will be filtered, otherwise
85 * there is no portal filter, all matched messages will be checked.
89 * message types to drop, for example:
90 * dra_type = LNET_DROP_ACK_BIT | LNET_DROP_PUT_BIT
92 * If it is non-zero then only specified message types are filtered,
93 * otherwise all message types will be checked.
97 /** message drop simulation */
99 /** drop rate of this rule */
102 * time interval of message drop, it is exclusive
106 /** error type mask */
107 __u32 da_health_error_mask;
108 /** randomize error generation */
111 /** message latency simulation */
115 * time interval of message delay, it is exclusive
119 /** latency to delay */
127 /** fault simluation stats */
128 struct lnet_fault_stat {
129 /** total # matched messages */
131 /** # dropped LNET_MSG_PUT by this rule */
133 /** # dropped LNET_MSG_ACK by this rule */
135 /** # dropped LNET_MSG_GET by this rule */
137 /** # dropped LNET_MSG_REPLY by this rule */
141 /** total # dropped messages */
145 /** total # delayed messages */
152 /** @} lnet_fault_simulation */
154 #define LNET_DEV_ID 0
155 #define LNET_DEV_PATH "/dev/lnet"