Message ID | 20230124190308.127318-3-niklas.cassel@wdc.com |
---|---|
State | New |
Headers | show |
Series | Add Command Duration Limits support | expand |
On 1/24/23 11:02, Niklas Cassel wrote: > Introduce the new block IO status BLK_STS_DURATION_LIMIT for LLDDs to > report command that failed due to a command duration limit being > exceeded. This new status is mapped to the ETIME error code to allow > users to differentiate "soft" duration limit failures from other more > serious hardware related errors. What makes exceeding the duration limit different from an I/O timeout (BLK_STS_TIMEOUT)? Why is it important to tell the difference between an I/O timeout and exceeding the command duration limit? Thanks, Bart.
On Tue, Jan 24, 2023 at 11:29:10AM -0800, Bart Van Assche wrote: > On 1/24/23 11:02, Niklas Cassel wrote: > > Introduce the new block IO status BLK_STS_DURATION_LIMIT for LLDDs to > > report command that failed due to a command duration limit being > > exceeded. This new status is mapped to the ETIME error code to allow > > users to differentiate "soft" duration limit failures from other more > > serious hardware related errors. > > What makes exceeding the duration limit different from an I/O timeout > (BLK_STS_TIMEOUT)? Why is it important to tell the difference between an I/O > timeout and exceeding the command duration limit? BLK_STS_TIMEOUT should be used if the target device doesn't provide any response to the command. The DURATION_LIMIT status is used when the device completes a command with that status.
On 1/25/23 04:59, Keith Busch wrote: > On Tue, Jan 24, 2023 at 11:29:10AM -0800, Bart Van Assche wrote: >> On 1/24/23 11:02, Niklas Cassel wrote: >>> Introduce the new block IO status BLK_STS_DURATION_LIMIT for LLDDs to >>> report command that failed due to a command duration limit being >>> exceeded. This new status is mapped to the ETIME error code to allow >>> users to differentiate "soft" duration limit failures from other more >>> serious hardware related errors. >> >> What makes exceeding the duration limit different from an I/O timeout >> (BLK_STS_TIMEOUT)? Why is it important to tell the difference between an I/O >> timeout and exceeding the command duration limit? > > BLK_STS_TIMEOUT should be used if the target device doesn't provide any > response to the command. The DURATION_LIMIT status is used when the device > completes a command with that status. Yes, exactly :)
diff --git a/block/blk-core.c b/block/blk-core.c index 46d12b3344c9..9ca31b779fc1 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -170,6 +170,9 @@ static const struct { [BLK_STS_ZONE_OPEN_RESOURCE] = { -ETOOMANYREFS, "open zones exceeded" }, [BLK_STS_ZONE_ACTIVE_RESOURCE] = { -EOVERFLOW, "active zones exceeded" }, + /* Command duration limit device-side timeout */ + [BLK_STS_DURATION_LIMIT] = { -ETIME, "duration limit exceeded" }, + /* everything else not covered above: */ [BLK_STS_IOERR] = { -EIO, "I/O" }, }; diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 99be590f952f..cde997590765 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -166,6 +166,12 @@ typedef u16 blk_short_t; */ #define BLK_STS_OFFLINE ((__force blk_status_t)17) +/* + * BLK_STS_DURATION_LIMIT is returned from the driver when the target device + * aborted the command because it exceeded one of its Command Duration Limits. + */ +#define BLK_STS_DURATION_LIMIT ((__force blk_status_t)18) + /** * blk_path_error - returns true if error may be path related * @error: status the request was completed with