mbox series

[v2,00/35] Allow scsi_execute users to control retries

Message ID 20220929025407.119804-1-michael.christie@oracle.com (mailing list archive)
Headers show
Series Allow scsi_execute users to control retries | expand

Message

Mike Christie Sept. 29, 2022, 2:53 a.m. UTC
The following patches made over a combo of linus's tree and Martin's
6.1-queue tree (they are both missing patches so I couldn't build
against just one) allow scsi_execute* users to control exactly which
errors are retried, so we can reduce the sense/sshdr handling they have 
to do.

The patches allow scsi_execute* users to pass in an array of failures
which they want retried and also specify how many times they want them
retried. If we hit an error that the user did not specify then we drop
down to the default behavior. This allows us to remove almost all the
retry logic from scsi_execute* users.

We then only need to drive retries from the caller for:

1. wants to sleep between retries or had strict timings like in
sd_spinup_disk or ufs.
2. needed to set some internal state between retries like in
scsi_test_unit_ready)
3. retried based on the error code and it's internal state like in the
alua rtpg handling.

v2:
- Rename scsi_prep_sense
- Change scsi_check_passthrough's loop and added some fixes
- Modified scsi_execute* so it uses a struct to pass in args

Comments

Martin Wilck Sept. 29, 2022, 2:36 p.m. UTC | #1
On Wed, 2022-09-28 at 21:53 -0500, Mike Christie wrote:
> The following patches made over a combo of linus's tree and Martin's
> 6.1-queue tree (they are both missing patches so I couldn't build
> against just one) allow scsi_execute* users to control exactly which
> errors are retried, so we can reduce the sense/sshdr handling they
> have 
> to do.
> 
> The patches allow scsi_execute* users to pass in an array of failures
> which they want retried and also specify how many times they want
> them
> retried. If we hit an error that the user did not specify then we
> drop
> down to the default behavior. This allows us to remove almost all the
> retry logic from scsi_execute* users.
> 
> We then only need to drive retries from the caller for:
> 
> 1. wants to sleep between retries or had strict timings like in
> sd_spinup_disk or ufs.
> 2. needed to set some internal state between retries like in
> scsi_test_unit_ready)
> 3. retried based on the error code and it's internal state like in
> the
> alua rtpg handling.

In theory, 2) and 3) could be handled by callbacks, but that would seem
over-engineered for the few callers that are affected.

> 
> v2:
> - Rename scsi_prep_sense
> - Change scsi_check_passthrough's loop and added some fixes
> - Modified scsi_execute* so it uses a struct to pass in args
> 
> 
> 

For the series, except 02/35, 21/35, and 23/35:

Reviewed-by: Martin Wilck <mwilck@suse.com>