Re: VMware ESXi 5 and LIO target: "WRITE_SAME w/o UNMAP bit not supported for Block Discard Emulation"

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

 



On Mon, 2012-02-06 at 13:25 +0100, Martin Svec wrote:
> Hello Nicholas,
> 
> is there any follow-up regarding the WRITE SAME support required by
> ESXi 5? Although it is possible to globally disable hardware I/O
> acceleration on ESXi hosts, this is not a solution if we want to
> use LIO and enterprise arrays in the same environment.
> 
> Yesterday, I played with ESXi 5 for a while and tried a workaround that
> seems to fix it. If transport_generic_cmd_sequencer() returns sense
> reason TCM_UNSUPPORTED_SCSI_OPCODE instead of TCM_INVALID_CDB_FIELD,
> ESXi sends WRITE SAME only once and then (probably) falls back to
> non-accelerated block zeroing. The patch is below.
> 

Hi Martin,

Just a heads up that your patch to return TCM_INVALID_CDB_FIELD sense
for unsupported WRITE_SAME is the proper fix here.  It has been included
into 3.3-rc-fixes.

Also wrt to WRITE_SAME support.  mkp has been working on this as a v3.4
generic block layer item here:

http://marc.info/?l=linux-scsi&m=132797009631971&w=2

So target-core will be able to use generic block layer logic for doing
this in a future kernel release.

> 
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -2665,7 +2665,7 @@ static int transport_generic_cmd_sequencer(
>                          cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
> 
>                          if (target_check_write_same_discard(&cdb[10], dev) < 0)
> -                               goto out_invalid_cdb_field;
> +                               goto out_unsupported_cdb;
>                          if (!passthrough)
>                                  cmd->execute_task = target_emulate_write_same;
>                          break;
> @@ -2948,7 +2948,7 @@ static int transport_generic_cmd_sequencer(
>                  cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
> 
>                  if (target_check_write_same_discard(&cdb[1], dev) < 0)
> -                       goto out_invalid_cdb_field;
> +                       goto out_unsupported_cdb;
>                  if (!passthrough)
>                          cmd->execute_task = target_emulate_write_same;
>                  break;
> @@ -2971,7 +2971,7 @@ static int transport_generic_cmd_sequencer(
>                   * of byte 1 bit 3 UNMAP instead of original reserved field
>                   */
>                  if (target_check_write_same_discard(&cdb[1], dev) < 0)
> -                       goto out_invalid_cdb_field;
> +                       goto out_unsupported_cdb;
>                  if (!passthrough)
>                          cmd->execute_task = target_emulate_write_same;
>                  break;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe target-devel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux