1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright(c) 2018 Intel Corporation.
9 #include <linux/fault-inject.h>
10 #include <linux/dcache.h>
11 #include <linux/bitops.h>
12 #include <linux/kernel.h>
13 #include <rdma/rdma_vt.h>
19 #if defined(CONFIG_FAULT_INJECTION) && defined(CONFIG_FAULT_INJECTION_DEBUG_FS)
21 struct fault_attr attr
;
23 u64 n_rxfaults
[(1U << BITS_PER_BYTE
)];
24 u64 n_txfaults
[(1U << BITS_PER_BYTE
)];
28 unsigned long skip_usec
;
29 unsigned long opcodes
[(1U << BITS_PER_BYTE
) / BITS_PER_LONG
];
36 int hfi1_fault_init_debugfs(struct hfi1_ibdev
*ibd
);
37 bool hfi1_dbg_should_fault_tx(struct rvt_qp
*qp
, u32 opcode
);
38 bool hfi1_dbg_should_fault_rx(struct hfi1_packet
*packet
);
39 bool hfi1_dbg_fault_suppress_err(struct hfi1_ibdev
*ibd
);
40 void hfi1_fault_exit_debugfs(struct hfi1_ibdev
*ibd
);
44 static inline int hfi1_fault_init_debugfs(struct hfi1_ibdev
*ibd
)
49 static inline bool hfi1_dbg_should_fault_rx(struct hfi1_packet
*packet
)
54 static inline bool hfi1_dbg_should_fault_tx(struct rvt_qp
*qp
,
60 static inline bool hfi1_dbg_fault_suppress_err(struct hfi1_ibdev
*ibd
)
65 static inline void hfi1_fault_exit_debugfs(struct hfi1_ibdev
*ibd
)
69 #endif /* _HFI1_FAULT_H */