nvme-fcloop: add sysfs attribute to inject command drop
authorJames Smart <james.smart@broadcom.com>
Fri, 16 Oct 2020 21:28:38 +0000 (14:28 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 1 Dec 2020 19:36:34 +0000 (20:36 +0100)
commit03d99e5d63dabe2c0cea0d8fe1cb89bde33f7939
tree07f011f5af355adcaa8a557a643d291eda0cd1bb
parent48332ff295878b3f4268782f25894dfa44b1f6c1
nvme-fcloop: add sysfs attribute to inject command drop

Add sysfs attribute to specify parameters for dropping a command.  The
attribute takes a string of:

  <opcode>:<starting a what instance>:<number of times>

Opcode is formatted as lower 8 bits are opcode.  If a fabrics opcode, a
bit above bits 7:0 will be set.

Once set, each sqe is looked at. If the opcode matches the running
instance count is updated. If the instance count is in the range of where
to drop (based on starting and # of times), then drop the command by not
passing it to the target layer.

Signed-off-by: James Smart <james.smart@broadcom.com>
drivers/nvme/target/fcloop.c