public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Boot <bootc@bootc.net>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	Thomas Glanzmann <thomas@glanzmann.de>
Cc: Douglas Gilbert <dgilbert@interlog.com>,
	target-devel <target-devel@vger.kernel.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Hannes Reinecke <mail@hannes-reinecke.de>
Subject: Re: xcopy testing with ddpt
Date: Tue, 08 Oct 2013 00:07:33 +0100	[thread overview]
Message-ID: <52533EB5.9060505@bootc.net> (raw)
In-Reply-To: <1381185489.19256.315.camel@haakon3.risingtidesystems.com>

On 07/10/2013 23:38, Nicholas A. Bellinger wrote:
> On Mon, 2013-10-07 at 15:18 -0700, Nicholas A. Bellinger wrote:
>> On Mon, 2013-10-07 at 06:03 +0200, Thomas Glanzmann wrote:
>>> Hello Doug,
>>>
>>> * Douglas Gilbert <dgilbert@interlog.com> [2013-10-07 00:58]:
>>>> Great, another one working.
>>
>> (CC'ing Hannes)
>>
>>>> BTW list_id=0 has a special meaning in some context
>>>> (buried deep in T10 documents: spc4r36j.pdf). That is
>>>> probably why Hannes Reinecke defaulted that list_id to
>>>> 1. I could understand the target XCOPY implementation
>>>> only accepting one xcopy sequence at a time, but why
>>>> restrict it to list_id=0 ? A question for NaB ...
>>>
>>> Nab, do you have any input for us?
>>>
>>
>> It was my original understanding that when OPERATING_PARAMETERS is
>> reporting SNLID=1 (Supports No ListID), the initiator is expected to
>> send EXTENDED_COPY parameter lists with ListID Usage 11b + ListID=0.
>> Since we're ignoring the value of ListID for now anyways, I agree that
>> it doesn't make much sense to fail for a non zero value here..
>>
>> However, the main concern that made me add this check to begin with was
>> the case with ListID Usage 00b + 10b, where the copy server is expected
>> to keep a per I_T list of in-use ListIDs, and return CHECK_CONDITION +
>> ILLEGAL REQUEST/OPERATION IN PROGRESS for a ListID for a copy sequence
>> already in progress.
>>
> 
> How about the following patch to allow non zero ListIDs, but only when
> ListID Usage is set to 11b..?
> 
> diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
> index 6b9774c..3a3ea31 100644
> --- a/drivers/target/target_core_xcopy.c
> +++ b/drivers/target/target_core_xcopy.c
> @@ -911,11 +911,12 @@ sense_reason_t target_do_xcopy(struct se_cmd *se_cmd)
>         }
>  
>         list_id = p[0];
> -       if (list_id != 0x00) {
> -               pr_err("XCOPY with non zero list_id: 0x%02x\n", list_id);
> +       list_id_usage = (p[1] & 0x18);
> +       if (list_id != 0x00 && list_id_usage != 0x11) {
> +               pr_err("XCOPY with non zero list_id: 0x%02x, and list_id_usage:"
> +                      " 0x%02x\n", list_id, list_id_usage);
>                 goto out;
>         }
> -       list_id_usage = (p[1] & 0x18);
>         /*
>          * Determine TARGET DESCRIPTOR LIST LENGTH + SEGMENT DESCRIPTOR LIST LENGTH
>          */
> 
> AFAICT this should make ddpt happy, as it's already be setting ListID
> Usage = 11b when it gets OPERATING PARAMETERS -> HELD_DATA = 0.

0x11 != 11b (but == 11h)

If 0x18 is the correct mask I think you want to compare against 0x18,
otherwise you probably want to shift down by 3 bits and compare against
0x03 or 0b11...

HTH,
Chris

-- 
Chris Boot
bootc@bootc.net

  reply	other threads:[~2013-10-07 23:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20131003160033.GC5273@glanzmann.de>
     [not found] ` <524DA6EC.6000900@interlog.com>
     [not found]   ` <20131005182206.GA9781@glanzmann.de>
     [not found]     ` <5250E0D6.8000404@interlog.com>
     [not found]       ` <20131006090005.GB12340@glanzmann.de>
     [not found]         ` <52519FA8.9050905@interlog.com>
     [not found]           ` <20131006184355.GC27090@glanzmann.de>
     [not found]             ` <5251D179.8020405@interlog.com>
     [not found]               ` <20131006213213.GA30637@glanzmann.de>
     [not found]                 ` <5251EAF3.8090500@interlog.com>
2013-10-07  4:03                   ` xcopy testing with ddpt Thomas Glanzmann
2013-10-07 22:18                     ` Nicholas A. Bellinger
2013-10-07 22:38                       ` Nicholas A. Bellinger
2013-10-07 23:07                         ` Chris Boot [this message]
2013-10-08  0:24                           ` Nicholas A. Bellinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52533EB5.9060505@bootc.net \
    --to=bootc@bootc.net \
    --cc=dgilbert@interlog.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mail@hannes-reinecke.de \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    --cc=thomas@glanzmann.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox