On 2019-03-14 11:19 a.m., Bart Van Assche wrote:
On Wed, 2019-03-13 at 23:52 -0400, Douglas Gilbert wrote:
On 2019-03-13 10:39 p.m., Bart Van Assche wrote:
On 3/13/19 6:32 PM, Douglas Gilbert wrote:
I agree that scsi_ioctl_reset() should be taught how to produce a request
that doesn't blow up intermediate code expecting all requests to be well
made with respect to mq.
Hi Doug,
Do you perhaps have a proposal for how to do that without allocating a new
request from the error handler and without reserving a request for error
handling purposes.
Well yes. The SCSI ML could tell the block layer that the LU/device
was unavailable (temporarily) and then the ML would communicate
directly with the LLD. A block layer/mq bypass ...
Probably don't like that one. Why rule out reserving a request (e.g. one
per host)?
The lowest supported queue depth is one so we reserving a request may break
some SCSI LLDs. Additionally, reserving one request may have a performance
impact.
Then the SCSI ML could copy the scsi_debug driver and give itself a pseudo
host and hold a couple of well known (wn) scsi_cmnd objects (fakes) that
are repurposed for resets. Then when the ML/LLD is finished with that wn
request, it is placed back in the ML pool.
BTW, it is not clear to me why a struct scsi_cmnd pointer is passed to the
eh_*_reset_handler() callbacks. Has it ever been considered to pass a struct
scsi_device pointer to these callback functions instead? In other words, are
there any eh_*_reset_handler() callbacks that use more information from struct
scsi_cmnd than the device pointer?
Looks like an OO paradigm giving that set of eh_* functions the same
signature where the common argument can be reduced to the appropriate
object. Perhaps new signatures could be added to struct scsi_host_template:
int (* eh_act_lu_reset_handler)(struct scsi_device *);
int (* eh_act_target_reset_handler)(struct scsi_host *);
int (* eh_act_bus_reset_handler)(struct scsi_host *);
int (* eh_act_host_reset_handler)(struct scsi_host *);
or collapse the last 3 into:
int (* eh_host_managed_reset_handler)(struct scsi_host *,
enum shost_man_reset);
Doug Gilbert