• D
    IB/hfi1: Add receive fault injection feature · 0181ce31
    Don Hiatt 提交于
    Add fault injection capability:
      - Drop packets unconditionally (fault_by_packet)
      - Drop packets based on opcode (fault_by_opcode)
    
    This feature reacts to the global FAULT_INJECTION
    config flag.
    
    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.
    Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
    Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
    Signed-off-by: NDon Hiatt <don.hiatt@intel.com>
    Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
    Signed-off-by: NDoug Ledford <dledford@redhat.com>
    0181ce31
driver.c 37.0 KB