Re: [PATCH v7 00/19] Add Command Duration Limits support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023/05/11 13:22, Douglas Gilbert wrote:
> On 2023-05-10 21:13, Niklas Cassel wrote:
>> From: Niklas Cassel <niklas.cassel@xxxxxxx>
>>
>> Hello,
>>
>> This series adds support for Command Duration Limits.
>> The series is based on linux tag: v6.4-rc1
>> The series can also be found in git:
>> https://github.com/floatious/linux/commits/cdl-v7
>>
>>
>> =================
>> CDL in ATA / SCSI
>> =================
>> Command Duration Limits is defined in:
>> T13 ATA Command Set - 5 (ACS-5) and
>> T10 SCSI Primary Commands - 6 (SPC-6) respectively
>> (a simpler version of CDL is defined in T10 SPC-5).
>>
>> CDL defines Duration Limits Descriptors (DLD).
>> 7 DLDs for read commands and 7 DLDs for write commands.
>> Simply put, a DLD contains a limit and a policy.
>>
>> A command can specify that a certain limit should be applied by setting
>> the DLD index field (3 bits, so 0-7) in the command itself.
>>
>> The DLD index points to one of the 7 DLDs.
>> DLD index 0 means no descriptor, so no limit.
>> DLD index 1-7 means DLD 1-7.
>>
>> A DLD can have a few different policies, but the two major ones are:
>> -Policy 0xF (abort), command will be completed with command aborted error
>> (ATA) or status CHECK CONDITION (SCSI), with sense data indicating that
>> the command timed out.
>> -Policy 0xD (complete-unavailable), command will be completed without
>> error (ATA) or status GOOD (SCSI), with sense data indicating that the
>> command timed out. Note that the command will not have transferred any
>> data to/from the device when the command timed out, even though the
>> command returned success.
>>
>> Regardless of the CDL policy, in case of a CDL timeout, the I/O will
>> result in a -ETIME error to user-space.
>>
>> The DLDs are defined in the CDL log page(s) and are readable and writable.
> 
> The above sentence may be correct for ATA disks, but for SCSI disks the CDL log
> page is for statistics. Those statistics counters can be reset (to zero) but
> are not writable in the normal sense. To "define" (or change from the default
> values) CDL settings in SCSI, the CDL _mode_ pages are provided. Confusingly

Yes, indeed, for SCSI, CDL descriptors are defined in mode pages.

> there are four such mode pages (A, B, T2A and T2B). Which one(s) do you
> support/use?

All of them (see patch 8). For the ATA devices, the mode sense translation can
only report support for T2A/T2B (see patch 17).

Note that the kernel does not handle directly the CDL descriptor mode pages.
These need to be set by the user using passthrough tools such as sg3utils or
cdl-tools.

-- 
Damien Le Moal
Western Digital Research




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux