[Stgt-devel] [PATCH 4/4] OSD command parser

Ming Zhang blackmagic02881
Mon Feb 19 16:05:28 CET 2007

On Mon, 2007-02-19 at 23:32 +0900, FUJITA Tomonori wrote:
> From: Pete Wyckoff <pw at osc.edu>
> Subject: Re: [Stgt-devel] [PATCH 4/4] OSD command parser
> Date: Tue, 23 Jan 2007 11:19:17 -0500
> > blackmagic02881 at gmail.com wrote on Mon, 22 Jan 2007 14:35 -0500:
> > > not a good idea. suggest to keep in a way like IET code, for each target
> > > type, call its foo_cmd_perform(), and make some common spc function as
> > > helper functions.
> > 
> > I think you're saying that I should duplicate the switch() logic for
> > the SPC commands in all the (osd|sbc|mmc|...)_cmd_perfom()
> > type-specific functions.  This would reduce scsi_cmd_perform() into
> > just a check on the target type, with no handling of SPC commands,
> > e.g. INQUIRY.
> > 
> > I'm not opposed to doing that, just don't have a good reason to do
> > so.  As the OSD work progresses this may become clear to me (PERFORM
> Very sorry for taking so long.
> I put a patch to support various device types:
> http://zaal.org/tgt/device-types.diff
> I don't merge it because:
> - only iscsi + AIO works (sg and ibmvio are broken).
> - there are still lots of things to implement
> - huge cleanup is necessary
> I took an approach discussed a long time ago in IET mailing list. Each
> device type has its own function array (like sbc_mode_sense). spc code
> exports some common functions. A LLD can cleanly replace functions in
> arrays (so we can kill dirty hack in tgt_driver struct). A transport
> class also needs that (though we don't implement yet).

i prefer this approach. spc provides common functions and other device
handlers are free to override it.

why call sbc_null instead of sbc_tur?

can we have rawio or sg to be implemented as bcc?
 Bridge Controller Commands (BCC)
{Date: 2004/09/21, Rev: 00, Status: Development, Project: 1528-D, File:
bcc-r00.pdf (329079 bytes)}
BCC describes the command set for SCSI protocol bridge controller
devices that bridge between various SCSI protocols like SPI, FCP, SRP,
and iSCSI.

target.c invokes "result = ops->cmd_exec(target->tid, target->lid,..."
without check if cmd_exec is NULL.



More information about the stgt mailing list