[Stgt-devel] Question for pass-through target design

FUJITA Tomonori fujita.tomonori
Sun May 6 03:39:10 CEST 2007


From: Robert Jennings <rcj at linux.vnet.ibm.com>
Subject: Re: [Stgt-devel] Question for pass-through target design
Date: Fri, 4 May 2007 14:33:06 -0500

> * FUJITA Tomonori (fujita.tomonori at lab.ntt.co.jp) wrote:
> > From: Robert Jennings <rcj at linux.vnet.ibm.com>
> > Subject: [Stgt-devel] Question for pass-through target design
> > Date: Fri, 4 May 2007 11:07:12 -0500
> > 
> > > It looks like the pass-through target support is currently broken, at
> > > least as I've checked for ibmvstgt, but I think it's a general problem.
> > > I wanted to check my assumptions and get ideas.
> > 
> > Yeah, unfortunately, it works only with the iSCSI target driver (which
> > runs in user space).
> > 
> > 
> > > The code isn't allocating any memory to pass along to the sg code to store
> > > the result of a read or data for a write.  Currently, dxferp for sg_io_hdr
> > > or dout_xferp/din_xferp for sg_io_v4 are assigned to the value of uaddr,
> > > which is set to 0 in kern_queue_cmd.  With the pointer set to NULL,
> > > the pass-through target isn't going to function.  Even if we had memory
> > > allocated, there isn't a means of getting data to be written via sg down
> > > this code path.
> > > 
> > > What ideas are there as to how the data will get to user-space so that
> > > we can use sg?
> > 
> > For kernel-space drivers, we don't need to go to user-space. We can do
> > the pass-through in kernel space. I talked with James about this last
> > year and he said that if the code is implemented cleanly, he would
> > merges it into mainline.
> 
> That sounds fine, how can we make the lld in kernel space aware that the
> target is pass-through?  
> 
> Should the kernel driver operate as usual and queue the command to tgtd
> and then tgtd would see that it's a pass-through target and communicate
> back to the lld that the command should be processed in-kernel?

I guess that it's ok to add an interface (new operations to
scsi_tgt_if.h) to tell the pass-through configuration to the kernel
tgt code from user space.



More information about the stgt mailing list