From: Patrick Mansfield <patmans@us.ibm.com>
To: Luben Tuikov <luben@splentec.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] SCSI Core patches
Date: Tue, 7 Jan 2003 14:53:00 -0800 [thread overview]
Message-ID: <20030107145300.A16954@beaverton.ibm.com> (raw)
In-Reply-To: <20030107194445.GC11402@redhat.com>; from dledford@redhat.com on Tue, Jan 07, 2003 at 02:44:45PM -0500
On Tue, Jan 07, 2003 at 02:44:45PM -0500, Doug Ledford wrote:
> On Tue, Jan 07, 2003 at 10:21:27AM -0800, Patrick Mansfield wrote:
> > For use with multi-path, it is very useful to have the path in the
> > scsi_cmnd, and generally to not have the lldd's know about the scsi_device
> > at all, such that we can pick a path, and send a scsi_cmnd to a lldd.
> >
> > Putting path information only in scsi_device makes it hard to do
> > multi-path below (or even in) the block layer, and makes it hard to
> > multi-path non block devices (like tape).
>
> Not true at all. This is completely an implementation issue. If you
> implement scsi multipath in certain ways, then this is true. My preferred
> implementation for something like this wouldn't have this problem at all.
> My preferred implementation would have one scsi_device struct per path,
> but would only register the first/primary device with the block layer (or
> char layer as the case may be), and during scsi_scan detection the
> duplicate paths would be added to the primary path by using a list_struct
> item to link the devices. Then you pick the path by picking the device
> struct you need. The primary path goes away, you change the device
> registration to point to a new primary path scsi_device struct. So I
> don't see the difficulty at all myself.
The hard part is making sure all of the references to scsi_device values
are OK - that we correctly use and set the values across all of the
scsi_devices that represent a single scsi device. It would be easy for a
LLDD to screw this up, unless we have some sort of interface to get/set
every value in scsi_device.
Plus we have the overhead of redundant data for the fields: type,
scsi_level, inquiry, vendor, etc.
And the atomic device_active might have to be re-done with SMP locking.
I'm arguing for a linked list of structs that hold the minimum data we
need to use them as a path - much like a scsi_device with the redundant
fields removed (and if needed it can also point to the actual
scsi_device). And then plugging this data (or a pointer) into a scsi_cmnd
for use by the LLDD.
> > I would prefer we keep the current scsi_cmnd with its
> > host/channel/target[id]/lun.
>
> One of the goals of this change is to eliminate scsi_build_commandblocks()
> entirely and do away with keeping a per-device list of pre-allocated and
> pre-filled in commands. We could put the data items back into the struct,
> but that would then mean that scsi_get_command() would have to init the
> items from the device struct in question, then the lldd would init their
> command from these items. In short, it would save us having to change all
> the lldd (which Luben has already done), but would cost us double init'ing
> items for no real purpose. I would prefer to leave them out.
As long as we have an interface (function or macro), I'm not strongly
opposed to the above. We can keep the scsi_allocate_device (in dire need
of a new name), and just have it allocate and init (or not) any fields as
needed, so there is only one place to change the init of the allocated
scsi_cmnd.
Adding a new interface to get the host/channel/target/lun is not so easy,
but IMO worthwhile.
-- Patrick Mansfield
next prev parent reply other threads:[~2003-01-07 22:53 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-07 13:56 [PATCH] SCSI Core patches Luben Tuikov
2003-01-07 18:21 ` Patrick Mansfield
2003-01-07 19:23 ` Luben Tuikov
2003-01-07 20:33 ` Patrick Mansfield
2003-01-07 22:14 ` Luben Tuikov
2003-01-08 1:36 ` Patrick Mansfield
2003-01-08 5:13 ` Luben Tuikov
2003-01-11 18:12 ` Christoph Hellwig
2003-01-13 20:33 ` Patrick Mansfield
2003-01-13 21:30 ` Luben Tuikov
2003-01-14 18:49 ` Patrick Mansfield
2003-01-14 19:52 ` Luben Tuikov
2003-01-07 19:44 ` Doug Ledford
2003-01-07 22:53 ` Patrick Mansfield [this message]
2003-01-08 17:33 ` Luben Tuikov
2003-01-08 21:13 ` Mike Anderson
2003-01-10 12:35 ` Andre Hedrick
2003-01-10 17:06 ` James Bottomley
2003-01-10 19:23 ` Luben Tuikov
2003-01-10 20:05 ` James Bottomley
-- strict thread matches above, loose matches on Subject: below --
2003-01-14 16:19 Martin Peschke3
2003-01-14 16:51 ` Tony Battersby
2003-01-14 18:56 ` Patrick Mansfield
2003-01-14 20:01 Martin Peschke3
2003-01-14 20:17 ` Patrick Mansfield
2003-01-14 20:37 Martin Peschke3
2003-01-14 21:27 ` Patrick Mansfield
2003-01-14 21:29 Martin Peschke3
2003-01-14 22:16 ` Patrick Mansfield
2003-01-15 15:35 Martin Peschke3
2003-01-15 15:52 ` James Bottomley
2003-01-15 17:12 ` Mike Anderson
2003-01-15 17:40 ` Luben Tuikov
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=20030107145300.A16954@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=luben@splentec.com \
/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