public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladislav Bolkhovitin <vst@vlnb.net>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Bart Van Assche <bart.vanassche@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	linux-scsi@vger.kernel.org, scst-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: SCSI target subsystem
Date: Fri, 02 May 2008 22:17:28 +0400	[thread overview]
Message-ID: <481B5AB8.5030108@vlnb.net> (raw)
In-Reply-To: <1209745084.3121.39.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 3728 bytes --]

James Bottomley wrote:
> On Fri, 2008-05-02 at 18:06 +0200, Bart Van Assche wrote:
>> James Bottomley clearly expressed in that thread that he doesn't want
>> to maintain two SCSI target frameworks. So what I propose is that SCST
>> is included in the mainline and afterwards that it is evaluated
>> whether or not it is desirable to keep other target code in the
>> mainline kernel.
> 
> That's hardly sufficient.  STGT is already in use.  Their either has to
> be a migration path or, the preferred option, take the pieces of SCST
> that are actual improvements and embed them in STGT.

Actually, between SCSI initiator and target subsystems there is almost 
*nothing* in common. This claim, at first glance, looks pretty wrong, 
because both serve SCSI, so they must have a lot common. But look deeper 
and you quickly find out that the majority of functionality as well as 
data they use are dedicated for each subsystem, not shared.

Just look at SCST/qla2x00t/(changes done in the initiator qla2xxx driver 
to support target mode, patch attached): 90% of changes is adding 
callbacks for external target add-on, the rest is support for older, 
than 2.6.17, kernels and sysfs magic. Note, no data are common between 
initiator and target parts in the meaning that they both use them.

Then look at SCST (http://scst.sf.net). It implements complete 
pass-through SCSI support and look how it interacts with initiator SCSI 
subsystem. It calls only 2 functions: FIFO version of 
scsi_execute_async() (original scsi_execute_async() provides 
unacceptable LIFO commands order) and scsi_reset_provider() for task 
management. And there is only one common variable: struct scsi_device. 
That's all! In other storage modes (FILEIO/BLOCKIO) there is nothing 
common with SCSI initiator subsystem at all.

Finally, try to find out in SCST any duplicated functionality.

Now, let's look how SCSI target/initiator integration currently done in 
the kernel. For me it looks pretty artificial. For example, if I make a 
general purpose kernel, for which 1% of users would run target mode, I 
would have to enable as module "SCSI target support" as well as SCSI 
target support for transport attributes. Now 99% of users of my kernel, 
who don't need SCSI target, but need SCSI initiator drivers, would have 
to have scsi_tgt loaded, because transport attribute drivers would 
depend on it:

# lsmod
Module                  Size  Used by
qla2xxx               130844  0
firmware_class          8064  1 qla2xxx
scsi_transport_fc      40900  1 qla2xxx
scsi_tgt               12196  1 scsi_transport_fc
brd                     6924  0
xfs                   511280  1
dm_mirror              24368  0
dm_mod                 51148  1 dm_mirror
uhci_hcd               21400  0
sg                     31784  0
e1000                 114536  0
pcspkr                  3328  0

No target functionality needed, but target mode subsystem is needed. Is 
it a good design?

I wrote all above to support my at first glance shocking conclusion that 
SCSI target subsystem is completely new subsystem of the kernel and it 
should live on its own with its own maintainer! This is the same as with 
the current interaction between SCSI and block subsystems in the kernel: 
SCSI uses block's functionality, but that doesn't mean that block and 
SCSI are the same subsystem.

Thus, how IMHO initiator and target drivers should be written:

  - All initiator drivers should live in the SCSI initiator subsystem 
(aka current SCSI subsystem) only, the same as today.

  - All target drivers should live in the SCSI target subsystem only and 
be either add-ons to initiator drivers, like, e.g., qla2x00t, or be a 
complete driver, like, e.g., iSCSI-SCST.

Vlad


[-- Attachment #2: qla2x00t.diff.gz --]
[-- Type: application/x-gzip, Size: 17294 bytes --]

  parent reply	other threads:[~2008-05-02 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200805021638.42972.bart.vanassche@gmail.com>
     [not found] ` <20080502153306.GB7376@infradead.org>
     [not found]   ` <e2e108260805020853r4c21fb98y3d4434a7fc95989c@mail.gmail.com>
     [not found]     ` <20080502155525.GA16353@infradead.org>
     [not found]       ` <e2e108260805020906w7f5e92bev46b8d0f96aa7b4d6@mail.gmail.com>
     [not found]         ` <1209745084.3121.39.camel@localhost.localdomain>
2008-05-02 18:09           ` [PATCH 2.6.25.1] Add scsi_execute_async_fifo() Vladislav Bolkhovitin
2008-05-02 18:17           ` Vladislav Bolkhovitin [this message]
2008-05-03  9:41             ` SCSI target subsystem Bart Van Assche
2008-05-03  9:53               ` Matthew Wilcox
2008-05-03 10:39                 ` Bart Van Assche
2008-05-03 13:28                   ` Matthew Wilcox
2008-05-03 14:48                     ` Bart Van Assche
2008-05-04 15:53                   ` Bart Van Assche
2008-05-04 11:35                 ` Vladislav Bolkhovitin
2008-05-04 15:23             ` Vladislav Bolkhovitin

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=481B5AB8.5030108@vlnb.net \
    --to=vst@vlnb.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bart.vanassche@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=scst-devel@lists.sourceforge.net \
    /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