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, 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>
35 /** \addtogroup lnet_fault_simulation
49 #define LNET_ACK_BIT (1 << 0)
50 #define LNET_PUT_BIT (1 << 1)
51 #define LNET_GET_BIT (1 << 2)
52 #define LNET_REPLY_BIT (1 << 3)
54 /** ioctl parameter for LNet fault simulation */
55 struct lnet_fault_attr {
57 * source NID of drop rule
58 * LNET_NID_ANY is wildcard for all sources
59 * 255.255.255.255@net is wildcard for all addresses from @net
62 /** destination NID of drop rule, see \a dr_src for details */
65 * Portal mask to drop, -1 means all portals, for example:
66 * fa_ptl_mask = (1 << _LDLM_CB_REQUEST_PORTAL ) |
67 * (1 << LDLM_CANCEL_REQUEST_PORTAL)
69 * If it is non-zero then only PUT and GET will be filtered, otherwise
70 * there is no portal filter, all matched messages will be checked.
74 * message types to drop, for example:
75 * dra_type = LNET_DROP_ACK_BIT | LNET_DROP_PUT_BIT
77 * If it is non-zero then only specified message types are filtered,
78 * otherwise all message types will be checked.
82 /** message drop simulation */
84 /** drop rate of this rule */
87 * time interval of message drop, it is exclusive
92 /** message latency simulation */
96 * time interval of message delay, it is exclusive
100 /** latency to delay */
108 /** fault simluation stats */
109 struct lnet_fault_stat {
110 /** total # matched messages */
112 /** # dropped LNET_MSG_PUT by this rule */
114 /** # dropped LNET_MSG_ACK by this rule */
116 /** # dropped LNET_MSG_GET by this rule */
118 /** # dropped LNET_MSG_REPLY by this rule */
122 /** total # dropped messages */
126 /** total # delayed messages */
133 /** @} lnet_fault_simulation */
135 #define LNET_DEV_ID 0
136 #define LNET_DEV_PATH "/dev/lnet"
137 #define LNET_DEV_MAJOR 10
138 #define LNET_DEV_MINOR 240