Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-11 Thread Sagi Grimberg
On 6/11/2014 12:17 AM, Quinn Tran wrote: SNIP QT Instead of using existing value within cmd-data_length, can we calculated data_length based on secstors blocksize. cmd-data_length = sectors * dev-dev_attrib.block_size; We can do that I suppose... Although it seems weird that the core

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-11 Thread Nicholas A. Bellinger
On Wed, 2014-06-11 at 10:24 +0300, Sagi Grimberg wrote: On 6/11/2014 12:17 AM, Quinn Tran wrote: SNIP QT Instead of using existing value within cmd-data_length, can we calculated data_length based on secstors blocksize. cmd-data_length = sectors * dev-dev_attrib.block_size; We

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-11 Thread Quinn Tran
On 6/11/14 2:30 PM, Nicholas A. Bellinger n...@linux-iscsi.org wrote: On Wed, 2014-06-11 at 10:24 +0300, Sagi Grimberg wrote: On 6/11/2014 12:17 AM, Quinn Tran wrote: SNIP QT Instead of using existing value within cmd-data_length, can we calculated data_length based on secstors

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-11 Thread Martin K. Petersen
nab == Nicholas A Bellinger n...@linux-iscsi.org writes: nab Hard to say. Discarding the transport length in v2 doesn't seem nab like a good idea, but subtracting from cmd-prot_length in v1 is nab using the sector count from the CDB anyways, so it's essentially nab the same tradeoff of

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-11 Thread Nicholas A. Bellinger
On Wed, 2014-06-11 at 22:32 +, Quinn Tran wrote: On 6/11/14 2:30 PM, Nicholas A. Bellinger n...@linux-iscsi.org wrote: On Wed, 2014-06-11 at 10:24 +0300, Sagi Grimberg wrote: On 6/11/2014 12:17 AM, Quinn Tran wrote: SNIP QT Instead of using existing value within

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-10 Thread Nicholas A. Bellinger
Hi Sagi Co, On Sun, 2014-06-08 at 13:27 +0300, Sagi Grimberg wrote: In various areas of the code, it is assumed that se_cmd-data_length describes pure data. In case that protection information exists over the wire (protect bits is are on) the target core decrease the protection length from

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-10 Thread Paolo Bonzini
Il 10/06/2014 10:04, Nicholas A. Bellinger ha scritto: That said, there is one other small qla2xxx change to enable per-session PI that is currently missing in Quinn's patch in scsi/for-next code. Sooo, I'll go ahead and include Sagi's patches with the vhost-scsi change below if there are no

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-10 Thread Quinn Tran
All, Comments inline. Regards, Quinn Tran On 6/10/14 1:04 AM, Nicholas A. Bellinger n...@linux-iscsi.org wrote: Hi Sagi Co, On Sun, 2014-06-08 at 13:27 +0300, Sagi Grimberg wrote: In various areas of the code, it is assumed that se_cmd-data_length describes pure data. In case that

[PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-08 Thread Sagi Grimberg
In various areas of the code, it is assumed that se_cmd-data_length describes pure data. In case that protection information exists over the wire (protect bits is are on) the target core decrease the protection length from the data length (instead of each transport peeking in the cdb). Modify