public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] [tgt]: Add proper CDB passthrough for SG_IO backstores
@ 2010-05-18  5:13 Nicholas A. Bellinger
  2010-05-30  9:36 ` Boaz Harrosh
  0 siblings, 1 reply; 6+ messages in thread
From: Nicholas A. Bellinger @ 2010-05-18  5:13 UTC (permalink / raw)
  To: stgt-devel, linux-scsi, FUJITA Tomonori, Mike Christie
  Cc: James Bottomley, Douglas Gilbert, Nicholas Bellinger

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

This patch updates usr/bs_sg.c:bs_sg_cmd_submit() to process incoming scsi-generic IO
of type SG_DXFER_TO_DEV and SG_DXFER_FROM_DEV using a single new struct scsi_cmnd->sg_iovec
set using existing scsi_cmd.h scsi_get_[out,in]_[buffer,length]() macros.

It also makes set_cmd_failed() properly return SAM_STAT_CHECK_CONDITION, which is expected
by the bs_sg_cmd_submit() caller in usr/scsi.c:scsi_cmd_perform()

Finally, this patch adds struct backingstore_template->bs_passthrough=1 that is used by
bs_sg.c here and the next patch to hand off struct scsi_cmd for CDB passthrough.

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 usr/bs_sg.c     |   31 ++++++++++++++++++++++++-------
 usr/scsi_cmnd.h |    4 ++++
 usr/tgtd.h      |    1 +
 3 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/usr/bs_sg.c b/usr/bs_sg.c
index 8baa480..9696392 100644
--- a/usr/bs_sg.c
+++ b/usr/bs_sg.c
@@ -82,7 +82,7 @@ static int graceful_write(int fd, void *p_write, int to_write)
 	return 0;
 }
 
-static void set_cmd_failed(struct scsi_cmd *cmd)
+static int set_cmd_failed(struct scsi_cmd *cmd)
 {
 	int result = SAM_STAT_CHECK_CONDITION;
 	uint16_t asc = ASC_READ_ERROR;
@@ -90,11 +90,14 @@ static void set_cmd_failed(struct scsi_cmd *cmd)
 
 	scsi_set_result(cmd, result);
 	sense_data_build(cmd, key, asc);
+
+	return result;
 }
 
 static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
 {
 	struct scsi_lu *dev = cmd->dev;
+	struct sg_iovec *iov = &cmd->sg_iovec;
 	int fd = dev->fd;
 	struct sg_io_hdr io_hdr;
 	int err = 0;
@@ -104,14 +107,27 @@ static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
 	io_hdr.cmd_len = cmd->scb_len;
 	io_hdr.cmdp = cmd->scb;
 
+	if (scsi_get_data_dir(cmd) == DATA_BIDIRECTIONAL) {
+		eprintf("Unable to process DATA_BIDIRECTIONAL to"
+			" SG_IO backstore\n");
+		return set_cmd_failed(cmd);
+	}
+
 	if (scsi_get_data_dir(cmd) == DATA_WRITE) {
 		io_hdr.dxfer_direction = SG_DXFER_TO_DEV;
-		io_hdr.dxfer_len = scsi_get_out_length(cmd);
-		io_hdr.dxferp = (void *)scsi_get_out_buffer(cmd);
-	} else {
+		io_hdr.dxfer_len = iov->iov_len = scsi_get_out_length(cmd);
+		iov->iov_base = (void *)scsi_get_out_buffer(cmd);
+		io_hdr.dxferp = &cmd->sg_iovec;
+		io_hdr.iovec_count = 1;
+	} else if (scsi_get_data_dir(cmd) == DATA_READ) {
 		io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
-		io_hdr.dxfer_len = scsi_get_in_length(cmd);
-		io_hdr.dxferp = (void *)scsi_get_in_buffer(cmd);
+		io_hdr.dxfer_len = iov->iov_len = scsi_get_in_length(cmd);
+		iov->iov_base = (void *)scsi_get_in_buffer(cmd);
+		io_hdr.dxferp = &cmd->sg_iovec;
+		io_hdr.iovec_count = 1;
+	} else {
+		io_hdr.dxfer_direction = SG_DXFER_NONE;
+		io_hdr.dxfer_len = 0;
 	}
 	io_hdr.mx_sb_len = sizeof(cmd->sense_buffer);
 	io_hdr.sbp = cmd->sense_buffer;
@@ -125,7 +141,7 @@ static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
 		set_cmd_async(cmd);
 	else {
 		eprintf("failed to start cmd 0x%p\n", cmd);
-		set_cmd_failed(cmd);
+		return set_cmd_failed(cmd);
 	}
 	return 0;
 }
@@ -238,6 +254,7 @@ static int bs_sg_cmd_done(struct scsi_cmd *cmd)
 static struct backingstore_template sg_bst = {
 	.bs_name		= "sg",
 	.bs_datasize		= 0,
+	.bs_passthrough		= 1,
 	.bs_open		= bs_sg_open,
 	.bs_close		= bs_sg_close,
 	.bs_cmd_submit		= bs_sg_cmd_submit,
diff --git a/usr/scsi_cmnd.h b/usr/scsi_cmnd.h
index 011f3e6..776ffb3 100644
--- a/usr/scsi_cmnd.h
+++ b/usr/scsi_cmnd.h
@@ -17,6 +17,8 @@ struct scsi_data_buffer {
 	uint64_t buffer;
 };
 
+#include <scsi/sg.h>
+
 struct scsi_cmd {
 	struct target *c_target;
 	/* linked it_nexus->cmd_hash_list */
@@ -31,6 +33,8 @@ struct scsi_cmd {
 	enum data_direction data_dir;
 	struct scsi_data_buffer in_sdb;
 	struct scsi_data_buffer out_sdb;
+	/* used for bs_sg.c:bs_sg_cmd_submit() */
+	struct sg_iovec sg_iovec;
 
 	uint64_t cmd_itn_id;
 	uint64_t offset;
diff --git a/usr/tgtd.h b/usr/tgtd.h
index 3323a9b..4f26a29 100644
--- a/usr/tgtd.h
+++ b/usr/tgtd.h
@@ -117,6 +117,7 @@ struct device_type_template {
 struct backingstore_template {
 	const char *bs_name;
 	int bs_datasize;
+	int bs_passthrough;
 	int (*bs_open)(struct scsi_lu *dev, char *path, int *fd, uint64_t *size);
 	void (*bs_close)(struct scsi_lu *dev);
 	int (*bs_init)(struct scsi_lu *dev);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] [tgt]: Add proper CDB passthrough for SG_IO backstores
  2010-05-18  5:13 [PATCH 1/2] [tgt]: Add proper CDB passthrough for SG_IO backstores Nicholas A. Bellinger
@ 2010-05-30  9:36 ` Boaz Harrosh
  2010-05-31  2:45   ` Nicholas A. Bellinger
  2010-05-31  3:32   ` FUJITA Tomonori
  0 siblings, 2 replies; 6+ messages in thread
From: Boaz Harrosh @ 2010-05-30  9:36 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: stgt-devel, linux-scsi, FUJITA Tomonori, Mike Christie,
	James Bottomley, Douglas Gilbert

On 05/18/2010 08:13 AM, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
> 
> This patch updates usr/bs_sg.c:bs_sg_cmd_submit() to process incoming scsi-generic IO
> of type SG_DXFER_TO_DEV and SG_DXFER_FROM_DEV using a single new struct scsi_cmnd->sg_iovec
> set using existing scsi_cmd.h scsi_get_[out,in]_[buffer,length]() macros.
> 
> It also makes set_cmd_failed() properly return SAM_STAT_CHECK_CONDITION, which is expected
> by the bs_sg_cmd_submit() caller in usr/scsi.c:scsi_cmd_perform()
> 
> Finally, this patch adds struct backingstore_template->bs_passthrough=1 that is used by
> bs_sg.c here and the next patch to hand off struct scsi_cmd for CDB passthrough.
> 
> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
> ---
>  usr/bs_sg.c     |   31 ++++++++++++++++++++++++-------

Why not add a new bs_bsg.c backing store that goes through BSG and not SG
and do it properly for all type of targets and commands?

Just a thought.

>  usr/scsi_cmnd.h |    4 ++++
>  usr/tgtd.h      |    1 +
>  3 files changed, 29 insertions(+), 7 deletions(-)
> 
> diff --git a/usr/bs_sg.c b/usr/bs_sg.c
> index 8baa480..9696392 100644
> --- a/usr/bs_sg.c
> +++ b/usr/bs_sg.c
> @@ -82,7 +82,7 @@ static int graceful_write(int fd, void *p_write, int to_write)
>  	return 0;
>  }
>  
> -static void set_cmd_failed(struct scsi_cmd *cmd)
> +static int set_cmd_failed(struct scsi_cmd *cmd)
>  {
>  	int result = SAM_STAT_CHECK_CONDITION;
>  	uint16_t asc = ASC_READ_ERROR;
> @@ -90,11 +90,14 @@ static void set_cmd_failed(struct scsi_cmd *cmd)
>  
>  	scsi_set_result(cmd, result);
>  	sense_data_build(cmd, key, asc);
> +
> +	return result;
>  }
>  
>  static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
>  {
>  	struct scsi_lu *dev = cmd->dev;
> +	struct sg_iovec *iov = &cmd->sg_iovec;
>  	int fd = dev->fd;
>  	struct sg_io_hdr io_hdr;
>  	int err = 0;
> @@ -104,14 +107,27 @@ static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
>  	io_hdr.cmd_len = cmd->scb_len;
>  	io_hdr.cmdp = cmd->scb;
>  
> +	if (scsi_get_data_dir(cmd) == DATA_BIDIRECTIONAL) {

Using bsg just really cleans this all function up.
IN_CMD => IN_HDR
OUT_CMD => OUT_HDR

no ifs and buts. The tgt's cmd looks like struct sg_io_v4 as if they
are twins ;-)

> +		eprintf("Unable to process DATA_BIDIRECTIONAL to"
> +			" SG_IO backstore\n");
> +		return set_cmd_failed(cmd);
> +	}
> +
>  	if (scsi_get_data_dir(cmd) == DATA_WRITE) {
>  		io_hdr.dxfer_direction = SG_DXFER_TO_DEV;
> -		io_hdr.dxfer_len = scsi_get_out_length(cmd);
> -		io_hdr.dxferp = (void *)scsi_get_out_buffer(cmd);

dxferp is already void* why do you need the cast?

> -	} else {
> +		io_hdr.dxfer_len = iov->iov_len = scsi_get_out_length(cmd);
> +		iov->iov_base = (void *)scsi_get_out_buffer(cmd);
> +		io_hdr.dxferp = &cmd->sg_iovec;
> +		io_hdr.iovec_count = 1;
> +	} else if (scsi_get_data_dir(cmd) == DATA_READ) {
>  		io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
> -		io_hdr.dxfer_len = scsi_get_in_length(cmd);
> -		io_hdr.dxferp = (void *)scsi_get_in_buffer(cmd);
> +		io_hdr.dxfer_len = iov->iov_len = scsi_get_in_length(cmd);
> +		iov->iov_base = (void *)scsi_get_in_buffer(cmd);
> +		io_hdr.dxferp = &cmd->sg_iovec;
> +		io_hdr.iovec_count = 1;
> +	} else {
> +		io_hdr.dxfer_direction = SG_DXFER_NONE;
> +		io_hdr.dxfer_len = 0;
>  	}
>  	io_hdr.mx_sb_len = sizeof(cmd->sense_buffer);
>  	io_hdr.sbp = cmd->sense_buffer;

You might want to look into the new SG_FLAG_Q_AT_TAIL but this is available
only in new Kernels so it'll be a little hack

> @@ -125,7 +141,7 @@ static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
>  		set_cmd_async(cmd);
>  	else {
>  		eprintf("failed to start cmd 0x%p\n", cmd);
> -		set_cmd_failed(cmd);
> +		return set_cmd_failed(cmd);
>  	}
>  	return 0;
>  }
> @@ -238,6 +254,7 @@ static int bs_sg_cmd_done(struct scsi_cmd *cmd)
>  static struct backingstore_template sg_bst = {
>  	.bs_name		= "sg",
>  	.bs_datasize		= 0,
> +	.bs_passthrough		= 1,
>  	.bs_open		= bs_sg_open,
>  	.bs_close		= bs_sg_close,
>  	.bs_cmd_submit		= bs_sg_cmd_submit,

And again the Second patch should just fold into this one. And the final disposition will
just set the .bs_cmd_submit to the proper one.

[BTW if you want to keep struct backingstore_template sg_bst const (Which it is not, but
 should be) then just have two of them and switch between them]

Boaz
> diff --git a/usr/scsi_cmnd.h b/usr/scsi_cmnd.h
> index 011f3e6..776ffb3 100644
> --- a/usr/scsi_cmnd.h
> +++ b/usr/scsi_cmnd.h
> @@ -17,6 +17,8 @@ struct scsi_data_buffer {
>  	uint64_t buffer;
>  };
>  
> +#include <scsi/sg.h>
> +
>  struct scsi_cmd {
>  	struct target *c_target;
>  	/* linked it_nexus->cmd_hash_list */
> @@ -31,6 +33,8 @@ struct scsi_cmd {
>  	enum data_direction data_dir;
>  	struct scsi_data_buffer in_sdb;
>  	struct scsi_data_buffer out_sdb;
> +	/* used for bs_sg.c:bs_sg_cmd_submit() */
> +	struct sg_iovec sg_iovec;
>  
>  	uint64_t cmd_itn_id;
>  	uint64_t offset;
> diff --git a/usr/tgtd.h b/usr/tgtd.h
> index 3323a9b..4f26a29 100644
> --- a/usr/tgtd.h
> +++ b/usr/tgtd.h
> @@ -117,6 +117,7 @@ struct device_type_template {
>  struct backingstore_template {
>  	const char *bs_name;
>  	int bs_datasize;
> +	int bs_passthrough;
>  	int (*bs_open)(struct scsi_lu *dev, char *path, int *fd, uint64_t *size);
>  	void (*bs_close)(struct scsi_lu *dev);
>  	int (*bs_init)(struct scsi_lu *dev);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] [tgt]: Add proper CDB passthrough for SG_IO backstores
  2010-05-30  9:36 ` Boaz Harrosh
@ 2010-05-31  2:45   ` Nicholas A. Bellinger
  2010-05-31  3:32   ` FUJITA Tomonori
  1 sibling, 0 replies; 6+ messages in thread
From: Nicholas A. Bellinger @ 2010-05-31  2:45 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: stgt-devel, linux-scsi, FUJITA Tomonori, Mike Christie,
	James Bottomley, Douglas Gilbert, Hannes Reinecke, Gerd Hoffmann,
	Kevin Wolf

On Sun, 2010-05-30 at 12:36 +0300, Boaz Harrosh wrote:
> On 05/18/2010 08:13 AM, Nicholas A. Bellinger wrote:
> > From: Nicholas Bellinger <nab@linux-iscsi.org>
> > 
> > This patch updates usr/bs_sg.c:bs_sg_cmd_submit() to process incoming scsi-generic IO
> > of type SG_DXFER_TO_DEV and SG_DXFER_FROM_DEV using a single new struct scsi_cmnd->sg_iovec
> > set using existing scsi_cmd.h scsi_get_[out,in]_[buffer,length]() macros.
> > 
> > It also makes set_cmd_failed() properly return SAM_STAT_CHECK_CONDITION, which is expected
> > by the bs_sg_cmd_submit() caller in usr/scsi.c:scsi_cmd_perform()
> > 
> > Finally, this patch adds struct backingstore_template->bs_passthrough=1 that is used by
> > bs_sg.c here and the next patch to hand off struct scsi_cmd for CDB passthrough.
> > 
> > Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
> > ---
> >  usr/bs_sg.c     |   31 ++++++++++++++++++++++++-------
> 
> Why not add a new bs_bsg.c backing store that goes through BSG and not SG
> and do it properly for all type of targets and commands?
> 
> Just a thought.

Greetings Boaz,

I completely agree with you here and think that BSG is the next logical
direction for expanding our target capabilities and for adding some
manner of I_T nexus auto-configuration between STGT userspace fabric
modules <-> TCM_Loop multi-fabric target port LUNs.  That said, I will
start groking BSG and look at adding a new bs_bsg backstore for STGT
soon for extended user -> kernel passthrough ops soon.

Also, the BSG direction is going to make alot of sense with the QEMU-KVM
HBA Emulation <-> TCM_Loop efforts too.   However I believe at least for
megraid_sas that TMRs are handled in the driver for LDs and not
processed directly by the 8708EM2 PowerPC Core firmware. ;)

Best,

--nab



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] [tgt]: Add proper CDB passthrough for SG_IO backstores
  2010-05-30  9:36 ` Boaz Harrosh
  2010-05-31  2:45   ` Nicholas A. Bellinger
@ 2010-05-31  3:32   ` FUJITA Tomonori
  2010-05-31  4:06     ` Nicholas A. Bellinger
  1 sibling, 1 reply; 6+ messages in thread
From: FUJITA Tomonori @ 2010-05-31  3:32 UTC (permalink / raw)
  To: bharrosh
  Cc: nab, stgt, linux-scsi, fujita.tomonori, michaelc, James.Bottomley,
	dgilbert

On Sun, 30 May 2010 12:36:18 +0300
Boaz Harrosh <bharrosh@panasas.com> wrote:

> > @@ -125,7 +141,7 @@ static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
> >  		set_cmd_async(cmd);
> >  	else {
> >  		eprintf("failed to start cmd 0x%p\n", cmd);
> > -		set_cmd_failed(cmd);
> > +		return set_cmd_failed(cmd);
> >  	}
> >  	return 0;
> >  }
> > @@ -238,6 +254,7 @@ static int bs_sg_cmd_done(struct scsi_cmd *cmd)
> >  static struct backingstore_template sg_bst = {
> >  	.bs_name		= "sg",
> >  	.bs_datasize		= 0,
> > +	.bs_passthrough		= 1,
> >  	.bs_open		= bs_sg_open,
> >  	.bs_close		= bs_sg_close,
> >  	.bs_cmd_submit		= bs_sg_cmd_submit,
> 
> And again the Second patch should just fold into this one. And the final disposition will
> just set the .bs_cmd_submit to the proper one.

Hmm, that means this patchset adds new I/O code with sg (or
bsg). That's not passthrough..

I think that passthrough needs to overwrite some of struct
device_type_template and modify target_cmd_queue().

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] [tgt]: Add proper CDB passthrough for SG_IO backstores
  2010-05-31  3:32   ` FUJITA Tomonori
@ 2010-05-31  4:06     ` Nicholas A. Bellinger
  2010-05-31  4:25       ` FUJITA Tomonori
  0 siblings, 1 reply; 6+ messages in thread
From: Nicholas A. Bellinger @ 2010-05-31  4:06 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: bharrosh, stgt, linux-scsi, michaelc, James.Bottomley, dgilbert

On Mon, 2010-05-31 at 12:32 +0900, FUJITA Tomonori wrote:
> On Sun, 30 May 2010 12:36:18 +0300
> Boaz Harrosh <bharrosh@panasas.com> wrote:
> 
> > > @@ -125,7 +141,7 @@ static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
> > >  		set_cmd_async(cmd);
> > >  	else {
> > >  		eprintf("failed to start cmd 0x%p\n", cmd);
> > > -		set_cmd_failed(cmd);
> > > +		return set_cmd_failed(cmd);
> > >  	}
> > >  	return 0;
> > >  }
> > > @@ -238,6 +254,7 @@ static int bs_sg_cmd_done(struct scsi_cmd *cmd)
> > >  static struct backingstore_template sg_bst = {
> > >  	.bs_name		= "sg",
> > >  	.bs_datasize		= 0,
> > > +	.bs_passthrough		= 1,
> > >  	.bs_open		= bs_sg_open,
> > >  	.bs_close		= bs_sg_close,
> > >  	.bs_cmd_submit		= bs_sg_cmd_submit,
> > 
> > And again the Second patch should just fold into this one. And the final disposition will
> > just set the .bs_cmd_submit to the proper one.
> 
> Hmm, that means this patchset adds new I/O code with sg (or
> bsg). That's not passthrough..
> 
> I think that passthrough needs to overwrite some of struct
> device_type_template and modify target_cmd_queue().

Indeed.  Expecting the passthrough to bypass the STGT port and CDB
emulation at the top of scsi_cmd_perform() would probably make sense
AFAICT.

So that said, at which spot in target_cmd_queue() would it make sense
for incoming struct scsi_cmd to be handled off for passthrough..?

Best,

--nab



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] [tgt]: Add proper CDB passthrough for SG_IO backstores
  2010-05-31  4:06     ` Nicholas A. Bellinger
@ 2010-05-31  4:25       ` FUJITA Tomonori
  0 siblings, 0 replies; 6+ messages in thread
From: FUJITA Tomonori @ 2010-05-31  4:25 UTC (permalink / raw)
  To: nab
  Cc: fujita.tomonori, bharrosh, stgt, linux-scsi, michaelc,
	James.Bottomley, dgilbert

On Sun, 30 May 2010 21:06:40 -0700
"Nicholas A. Bellinger" <nab@linux-iscsi.org> wrote:

> On Mon, 2010-05-31 at 12:32 +0900, FUJITA Tomonori wrote:
> > On Sun, 30 May 2010 12:36:18 +0300
> > Boaz Harrosh <bharrosh@panasas.com> wrote:
> > 
> > > > @@ -125,7 +141,7 @@ static int bs_sg_cmd_submit(struct scsi_cmd *cmd)
> > > >  		set_cmd_async(cmd);
> > > >  	else {
> > > >  		eprintf("failed to start cmd 0x%p\n", cmd);
> > > > -		set_cmd_failed(cmd);
> > > > +		return set_cmd_failed(cmd);
> > > >  	}
> > > >  	return 0;
> > > >  }
> > > > @@ -238,6 +254,7 @@ static int bs_sg_cmd_done(struct scsi_cmd *cmd)
> > > >  static struct backingstore_template sg_bst = {
> > > >  	.bs_name		= "sg",
> > > >  	.bs_datasize		= 0,
> > > > +	.bs_passthrough		= 1,
> > > >  	.bs_open		= bs_sg_open,
> > > >  	.bs_close		= bs_sg_close,
> > > >  	.bs_cmd_submit		= bs_sg_cmd_submit,
> > > 
> > > And again the Second patch should just fold into this one. And the final disposition will
> > > just set the .bs_cmd_submit to the proper one.
> > 
> > Hmm, that means this patchset adds new I/O code with sg (or
> > bsg). That's not passthrough..
> > 
> > I think that passthrough needs to overwrite some of struct
> > device_type_template and modify target_cmd_queue().
> 
> Indeed.  Expecting the passthrough to bypass the STGT port and CDB
> emulation at the top of scsi_cmd_perform() would probably make sense
> AFAICT.
> 
> So that said, at which spot in target_cmd_queue() would it make sense
> for incoming struct scsi_cmd to be handled off for passthrough..?

Yeah, surely, scsi_cmd_perform() is too late since we need to avoid
cmd_enabled() checking. So you need to modify target_cmd_queue() or
modify cmd_enabled() to return true for passthrough commands at all
times.

Another issue is that you need to skip some checking (such as UA) in
scsi_cmd_perform(). I don't have a clear idea how we can implement
passthough support cleanly. I guess that we need to try some
implementations.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-31  4:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18  5:13 [PATCH 1/2] [tgt]: Add proper CDB passthrough for SG_IO backstores Nicholas A. Bellinger
2010-05-30  9:36 ` Boaz Harrosh
2010-05-31  2:45   ` Nicholas A. Bellinger
2010-05-31  3:32   ` FUJITA Tomonori
2010-05-31  4:06     ` Nicholas A. Bellinger
2010-05-31  4:25       ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox