1 // SPDX-License-Identifier: GPL-2.0
3 /* Copyright (c) 2014, 2017, Intel Corporation. */
5 /* This file is part of Lustre, http://www.lustre.org/
7 * header for lnet ioctl
10 #ifndef __UAPI_LNETCTL_H_
11 #define __UAPI_LNETCTL_H_
13 #include <linux/types.h>
14 #include <linux/lnet/lnet-types.h>
16 /** \addtogroup lnet_fault_simulation
30 #define LNET_ACK_BIT (1 << 0)
31 #define LNET_PUT_BIT (1 << 1)
32 #define LNET_GET_BIT (1 << 2)
33 #define LNET_REPLY_BIT (1 << 3)
35 #define HSTATUS_END 11
36 #define HSTATUS_LOCAL_INTERRUPT_BIT (1 << 1)
37 #define HSTATUS_LOCAL_DROPPED_BIT (1 << 2)
38 #define HSTATUS_LOCAL_ABORTED_BIT (1 << 3)
39 #define HSTATUS_LOCAL_NO_ROUTE_BIT (1 << 4)
40 #define HSTATUS_LOCAL_ERROR_BIT (1 << 5)
41 #define HSTATUS_LOCAL_TIMEOUT_BIT (1 << 6)
42 #define HSTATUS_REMOTE_ERROR_BIT (1 << 7)
43 #define HSTATUS_REMOTE_DROPPED_BIT (1 << 8)
44 #define HSTATUS_REMOTE_TIMEOUT_BIT (1 << 9)
45 #define HSTATUS_NETWORK_TIMEOUT_BIT (1 << 10)
46 #define HSTATUS_RANDOM 0xffffffff
48 /** ioctl parameter for LNet fault simulation */
49 struct lnet_fault_attr {
51 * source NID of drop rule
52 * LNET_NID_ANY is wildcard for all sources
53 * 255.255.255.255@net is wildcard for all addresses from @net
56 /** destination NID of drop rule, see \a dr_src for details */
58 /** local NID. In case of router this is the NID we're ceiving
61 lnet_nid_t fa_local_nid;
63 * Portal mask to drop, -1 means all portals, for example:
64 * fa_ptl_mask = (1 << _LDLM_CB_REQUEST_PORTAL ) |
65 * (1 << LDLM_CANCEL_REQUEST_PORTAL)
67 * If it is non-zero then only PUT and GET will be filtered, otherwise
68 * there is no portal filter, all matched messages will be checked.
72 * message types to drop, for example:
73 * dra_type = LNET_DROP_ACK_BIT | LNET_DROP_PUT_BIT
75 * If it is non-zero then only specified message types are filtered,
76 * otherwise all message types will be checked.
80 /** message drop simulation */
82 /** drop rate of this rule */
85 * time interval of message drop, it is exclusive
89 /** error type mask */
90 __u32 da_health_error_mask;
91 /** randomize error generation */
93 /** drop all messages if flag is set */
96 /** message latency simulation */
100 * time interval of message delay, it is exclusive
104 /** latency to delay */
112 /** fault simluation stats */
113 struct lnet_fault_stat {
114 /** total # matched messages */
116 /** # dropped LNET_MSG_PUT by this rule */
118 /** # dropped LNET_MSG_ACK by this rule */
120 /** # dropped LNET_MSG_GET by this rule */
122 /** # dropped LNET_MSG_REPLY by this rule */
126 /** total # dropped messages */
130 /** total # delayed messages */
137 /** @} lnet_fault_simulation */
139 #define LNET_DEV_ID 0
140 #define LNET_DEV_PATH "/dev/lnet"