linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: linux-scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Boaz Harrosh <bharrosh@panasas.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Douglas
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Mike Christie <michaelc@cs.wisc.edu>,
	Hannes Reinecke <hare@suse.de>,
	James Bottomley <James.Bottomley@suse.de>,
	Nicholas Bellinger <nab@linux-iscsi.org>
Subject: [PATCH 0/2] tcm: Add WRITE_SAME_16 support w/ UNMAP=1 emulation
Date: Sat,  2 Oct 2010 17:53:32 -0700	[thread overview]
Message-ID: <1286067212-14449-1-git-send-email-nab@linux-iscsi.org> (raw)

From: Nicholas Bellinger <nab@linux-iscsi.org>

Greetings all,

This series adds initial support for WRITE_SAME_16 w/ UNMAP=1 emulation into
TCM/IBLOCK and TCM/FILEIO subsystem plugins using generic Block Discard logic.
This also includes proper TCM/pSCSI passthrough support to handle all possible
flavours of WRITE_SAME_16 for underlying HW that supports it.

The main items to note here for the IBLOCK+FILEIO emulated (eg: not passthrough)
case are:

	*) WRITE_SAME_16 w/ PBDATA and LBDATA will return INVALID_FIELD_IN_CDB
	*) WRITE_SAME_16 w/o UNMAP=1 will return INVALID_FIELD_IN_CDB
	*) WRITE_SAME_16 w/ UNMAP=1 will make IBLOCK+FILEIO call
	   transport_generic_write_same(), and not actually write the
	   received payload.

The first patch adds the main WRITE_SAME_16 pieces into TCM_Core, adds the new
emulate_tpws device attribute, and updates Block Limits VPD, Thin Provisioning
VPD and READ_CAPACITY_* to take emulate_tpws=1 into account to signal/handle
SBC-3 TPE=1 operation.

The second patch adds support into IBLOCK + FILEIO for using the TCM Core provided
transport_generic_write_same(), and will set both DEV_ATTRIB(dev)->emulate_tp[ws,u]=1
when blk_queue_discard()==1 signals underlying HW supports some flavour of TPE.

So far this series been tested with TCM_Loop -> (IBLOCK,FILEIO,pSCSI) -> scsi_debug
on v2.6.36-rc6 using explict 'sg_write_same -S' callers via SG_IO.

Once again, many thanks to mkp for sharing his knowledge of this area!

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>

Nicholas Bellinger (2):
  tcm: Add WRITE_SAME_16 emulation and passthrough support
  tcm/iblock,fileio: Add WRITE_SAME_16 w/ UNMAP=1 bit support

 drivers/target/target_core_configfs.c  |    4 +
 drivers/target/target_core_device.c    |   15 +++++-
 drivers/target/target_core_file.c      |   47 +++++++++++++++-
 drivers/target/target_core_iblock.c    |   21 +++++++-
 drivers/target/target_core_transport.c |   99 ++++++++++++++++++++++++++++++--
 include/target/target_core_base.h      |    5 +-
 include/target/target_core_device.h    |    1 +
 include/target/target_core_transport.h |    6 ++
 8 files changed, 189 insertions(+), 9 deletions(-)

                 reply	other threads:[~2010-10-03  0:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1286067212-14449-1-git-send-email-nab@linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=James.Bottomley@suse.de \
    --cc=bharrosh@panasas.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=hare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michaelc@cs.wisc.edu \
    /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;
as well as URLs for NNTP newsgroup(s).