Commit 0c30f421a7dba0a7ca9a3f67dad15d84d4d61e01

Authored by Nicholas Bellinger
1 parent 56dac14cd2

target/spc: Expose ATO bit in control mode page

This patch updates spc_modesense_control() to set the Application
Tag Owner (ATO) bit when when DIF emulation is enabled by the
backend device.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

Showing 1 changed file with 13 additions and 0 deletions Side-by-side Diff

drivers/target/target_core_spc.c
... ... @@ -858,6 +858,19 @@
858 858 * status (see SAM-4).
859 859 */
860 860 p[5] = (dev->dev_attrib.emulate_tas) ? 0x40 : 0x00;
  861 + /*
  862 + * From spc4r30, section 7.5.7 Control mode page
  863 + *
  864 + * Application Tag Owner (ATO) bit set to one.
  865 + *
  866 + * If the ATO bit is set to one the device server shall not modify the
  867 + * LOGICAL BLOCK APPLICATION TAG field and, depending on the protection
  868 + * type, shall not modify the contents of the LOGICAL BLOCK REFERENCE
  869 + * TAG field.
  870 + */
  871 + if (dev->dev_attrib.pi_prot_type)
  872 + p[5] |= 0x80;
  873 +
861 874 p[8] = 0xff;
862 875 p[9] = 0xff;
863 876 p[11] = 30;