linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 3/3] tcm ibmvscsis driver
Date: Mon, 14 Feb 2011 01:01:12 -0800	[thread overview]
Message-ID: <1297674072.7114.46.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <20110214122649N.fujita.tomonori@lab.ntt.co.jp>

On Mon, 2011-02-14 at 12:26 +0900, FUJITA Tomonori wrote:
> On Thu, 10 Feb 2011 11:03:11 -0800
> "Nicholas A. Bellinger" <nab@linux-iscsi.org> wrote:
> 
> > > +static int ibmvscsis_queue_data_in(struct se_cmd *se_cmd)
> > > +{
> > > +	struct ibmvscsis_cmnd *cmd = container_of(se_cmd,
> > > +			struct ibmvscsis_cmnd, se_cmd);
> > > +	struct scsi_cmnd *sc = &cmd->sc;
> > > +	/*
> > > +	 * Check for overflow residual count
> > > +	 */
> > > +	if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT)
> > > +		scsi_set_resid(sc, se_cmd->residual_count);
> > > +
> > > +	sc->sdb.length = se_cmd->data_length;
> > > +
> > > +	/*
> > > +	 * Setup the struct se_task->task_sg[] chained SG list
> > > +	 */
> > > +	if ((se_cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB) ||
> > > +	    (se_cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB)) {
> > > +		transport_do_task_sg_chain(se_cmd);
> > > +
> > > +		sc->sdb.table.nents = T_TASK(se_cmd)->t_tasks_sg_chained_no;
> > > +		sc->sdb.table.sgl = T_TASK(se_cmd)->t_tasks_sg_chained;
> > > +	} else if (se_cmd->se_cmd_flags & SCF_SCSI_CONTROL_NONSG_IO_CDB) {
> > > +		/*
> > > +		 * Use T_TASK(se_cmd)->t_tasks_sg_bounce for control CDBs
> > > +		 * using a contigious buffer
> > > +		 */
> > > +		sg_init_table(&T_TASK(se_cmd)->t_tasks_sg_bounce, 1);
> > > +		sg_set_buf(&T_TASK(se_cmd)->t_tasks_sg_bounce,
> > > +			T_TASK(se_cmd)->t_task_buf, se_cmd->data_length);
> > > +
> > > +		sc->sdb.table.nents = 1;
> > > +		sc->sdb.table.sgl = &T_TASK(se_cmd)->t_tasks_sg_bounce;
> > > +	}
> > > +	/*
> > > +	 * Perform the SCSI READ data transfer from sc->sdb.table into
> > > +	 * VIO LPAR memory.  This will occur via libsrp in the
> > > +	 * ibmvscsis_rdma() callback
> 
> btw, can we kill the non scatter/gather data path? I think that we
> should always use the scatter/gather data transfer.

Unfortuately it's not that easy.  The main reason why CDB type
SCF_SCSI_CONTROL_NONSG_IO_CDB was originally added (back in 2.2/2.4
days) was because certain LLDs had a problem with basic control CDBs
using SGLs..

Obviously we are way past that point with drivers/scsi today, but the
main reason today why SCF_SCSI_CONTROL_NONSG_IO_CDB still exists is
because of CDB emulation for complex stuff in target_core_cdb.c.  It has
historically proven much easier to code complex CDB emulation using a
contigious buffer, than with walking SGL formatted memory.

Converting over the more complex CDB emulation stuff to SGLs would
somewhat painful, at least without adding an extra location allocation +
copy into SGLs (not a big deal for CONTROL CDB stuff), or something else
to obtain a virtually contigious buffer for building the emulated
response.

--nab



  reply	other threads:[~2011-02-14  9:07 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10 12:21 [PATCH 0/3] ibmvscsis driver rewrite FUJITA Tomonori
2011-02-10 12:21 ` [PATCH 1/3] libsrp: add srp_data_length helper function FUJITA Tomonori
2011-02-10 12:21 ` [PATCH 2/3] libsrp: fix dma_unmap_sg FUJITA Tomonori
2011-02-10 12:21 ` [PATCH 3/3] tcm ibmvscsis driver FUJITA Tomonori
2011-02-10 19:03   ` Nicholas A. Bellinger
2011-02-14  1:36     ` FUJITA Tomonori
2011-02-14  3:26     ` FUJITA Tomonori
2011-02-14  9:01       ` Nicholas A. Bellinger [this message]
2011-02-14  9:29         ` FUJITA Tomonori
2011-02-14  9:27           ` Nicholas A. Bellinger
2011-02-14  9:46             ` FUJITA Tomonori
2011-02-14  9:51               ` Nicholas A. Bellinger
2011-02-10 19:15   ` Brian King
2011-02-10 19:38     ` Nicholas A. Bellinger
2011-02-11 21:13       ` Brian King
2011-02-12 20:27         ` James Bottomley
2011-03-07  4:41           ` FUJITA Tomonori
2011-03-07  6:17             ` Nicholas A. Bellinger
2011-03-07  6:24               ` FUJITA Tomonori
2011-03-07  6:55                 ` Nicholas A. Bellinger
2011-03-07 14:40             ` James Bottomley
2011-03-18 16:57               ` James Bottomley
2011-03-18 20:58               ` Brian King
2011-03-18 22:09                 ` Nicholas A. Bellinger
2011-03-19 14:32                 ` James Bottomley
2011-03-21  1:09                 ` FUJITA Tomonori
2011-03-21 12:56                   ` Brian King
2011-03-21 21:01                   ` Brian King
2011-03-21 21:01                     ` Nicholas A. Bellinger
2011-03-21 21:24                       ` Brian King
2011-03-21 22:29                         ` Nicholas A. Bellinger
2011-03-21 23:20                         ` FUJITA Tomonori
2011-03-21 23:50                           ` Nicholas A. Bellinger
2011-03-21 23:55                             ` FUJITA Tomonori
2011-03-22  0:26                               ` Nicholas A. Bellinger
2011-03-22  0:32                                 ` FUJITA Tomonori
2011-03-22  2:28                                   ` Nicholas A. Bellinger
2011-03-22  3:26                                     ` FUJITA Tomonori
2011-03-21 21:05                     ` James Bottomley
2011-03-21 22:37                       ` Brian King
2011-03-21 22:22                   ` Brian King
2011-03-21 22:31                     ` Brian King
2011-03-21 22:48                       ` Nicholas A. Bellinger
2011-03-22 12:53                         ` Brian King
2011-03-22 22:06                           ` Nicholas A. Bellinger
2011-03-22 22:49                             ` FUJITA Tomonori
2011-03-23  1:35                               ` Nicholas A. Bellinger
2011-03-23  5:12                                 ` FUJITA Tomonori
2011-03-23  8:26                                   ` Nicholas A. Bellinger
2011-03-23  8:48                                     ` FUJITA Tomonori
2011-03-23 10:00                                       ` Nicholas A. Bellinger
2011-03-23 12:04                                         ` FUJITA Tomonori
2011-03-23 21:17                                           ` Nicholas A. Bellinger
2011-03-24  1:54                                             ` FUJITA Tomonori
2011-03-24  7:29                                               ` Nicholas A. Bellinger
2011-03-23 15:19                             ` Brian King
2011-03-23 20:34                               ` Nicholas A. Bellinger
2011-03-25 14:33                                 ` Brian King
2011-03-25 20:13                                   ` Nicholas A. Bellinger
2011-03-21 22:34                     ` Nicholas A. Bellinger
2011-03-21 23:06                       ` FUJITA Tomonori
2011-03-21 23:13                         ` Nicholas A. Bellinger
2011-03-21 23:22                           ` FUJITA Tomonori
2011-03-22  0:03                             ` Nicholas A. Bellinger
2011-03-21 23:30                     ` FUJITA Tomonori
2011-02-14  1:42       ` FUJITA Tomonori
2011-02-14  1:42     ` FUJITA Tomonori
2011-02-14  7:16   ` Bart Van Assche
2011-02-14  9:11     ` FUJITA Tomonori
2011-02-14  9:18       ` Nicholas A. Bellinger
2011-02-14  9:19         ` Nicholas A. Bellinger
2011-02-14  9:31           ` FUJITA Tomonori
2011-02-14  9:29             ` Nicholas A. Bellinger
2011-02-14 11:50       ` Bart Van Assche
2011-02-15  3:42         ` FUJITA Tomonori
2011-02-15 19:20           ` Bart Van Assche
2011-02-15 23:21             ` FUJITA Tomonori
2011-02-10 18:34 ` [PATCH 0/3] ibmvscsis driver rewrite Nicholas A. Bellinger
2011-02-14  1:36   ` FUJITA Tomonori
2011-02-14  8:48     ` Nicholas A. Bellinger
     [not found] ` <4D53DE96.2020502@suse.de>
     [not found]   ` <1297363312.18212.153.camel@haakon2.linux-iscsi.org>
2011-02-10 21:22     ` Bart Van Assche

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=1297674072.7114.46.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    /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).