On Sun, 2017-02-12 at 19:42 +0200, Leon Romanovsky wrote: > On Wed, Feb 08, 2017 at 05:28:01AM -0800, Dennis Dalessandro wrote: > > > > From: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxx> > > > > Add fault injection capability: > > - Drop packets unconditionally (fault_by_packet) > > - Drop packets based on opcode (fault_by_opcode) > > > > This feature is disabled by default and can be > > enabled using the HFI1_FAULT_INJECTION Kconfig. > > > > The faulting traces have been added: > > - misc/fault_opcode > > - misc/fault_packet > > > > See 'Documentation/fault-injection/fault-injection.txt' > > for details. > > > > Examples: > > - Dropping packets by opcode: > > /sys/kernel/debug/hfi1/hfi1_X/fault_opcode > > # Enable fault > > echo Y > fault_by_opcode > > # Setprobability of dropping (0-100%) > > # echo 25 > probability > > # Set opcode > > echo 0x64 > opcode > > # Number of times to fault > > echo 3 > times > > # An optional mask allows you to fault > > # a range of opcodes > > echo 0xf0 > mask > > /sys/kernel/debug/hfi1/hfi1_X/fault_stats > > contains a value in parentheses to indicate > > number of each opcode dropped. > > > > - Dropping packets unconditionally > > /sys/kernel/debug/hfi1/hfi1_X/fault_packet > > # Enable fault > > echo Y > fault_by_packet > > /sys/kernel/debug/hfi1/hfi1_X/fault_packet/fault_stats > > contains the number of packets dropped. > > > > Signed-off-by: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxx> > > Signed-off-by: Don Hiatt <don.hiatt@xxxxxxxxx> > > Signed-off-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx> > > --- > > drivers/infiniband/hw/hfi1/Kconfig | 6 + > > drivers/infiniband/hw/hfi1/debugfs.c | 222 > > +++++++++++++++++++++++++++++++ > > drivers/infiniband/hw/hfi1/debugfs.h | 35 +++++ > > drivers/infiniband/hw/hfi1/driver.c | 8 + > > drivers/infiniband/hw/hfi1/trace_misc.h | 48 +++++++ > > drivers/infiniband/hw/hfi1/verbs.c | 6 + > > drivers/infiniband/hw/hfi1/verbs.h | 4 + > > 7 files changed, 329 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/infiniband/hw/hfi1/Kconfig > > b/drivers/infiniband/hw/hfi1/Kconfig > > index f6ea088..7465595 100644 > > --- a/drivers/infiniband/hw/hfi1/Kconfig > > +++ b/drivers/infiniband/hw/hfi1/Kconfig > > @@ -27,3 +27,9 @@ config SDMA_VERBOSITY > > ---help--- > > This is a configuration flag to enable verbose > > SDMA debug > > +config HFI1_FAULT_INJECTION > > + bool "Fault-injection capability" > > + depends on FAULT_INJECTION && FAULT_INJECTION_DEBUG_FS > > + default n > > First no need to set default to "n", it is already default. > Second, we got NAK from Doug while we proposed to add new Kconfig to > our > driver (mlx5) to improve debug. > > Doug, > I would like to know if your statement do not add new Kconfigs to IB > is > still relevant. As much as is possible, yes. Kconfig bloat is something I very much want to avoid. I would be more willing to have a single, global CONFIG_INFINIBAND_DEBUG option that turned on debugging stack wide than I would for individual drivers to each have their own debug configs. -- Doug Ledford <dledford@xxxxxxxxxx> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Attachment:
signature.asc
Description: This is a digitally signed message part