[stgt] VSCSI Target Driver

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Thu May 27 09:09:53 CEST 2010


On Wed, 26 May 2010 13:06:34 -0300
Erlon Cruz <sombrafam at gmail.com> wrote:

>       Im working in a project aimed to port Linux virtio to Power

you are talking about drivers/virtio?


> Platform, and also documenting vscsi underling operation. While
> reading ibmvstgt.c driver, I found something I cant understand:
>       The SCSI command is extracted from this transport frame (SRP)
> and then pushed to the user space daemon 'tgtd' which process it,
> right?

Right.

>        In the case of read/write commands incoming from the initiator
> (vscsiclient), I guess the command is converted in a new read/write
> operation which is performed in the physical disk, is it?

Yeah.


>        I couldn't understand how and who calls the read/write function
> ibmvstgt_rdma() (which effectively put the data from/into the disk)

ibmvstgt_rdma() is called by tgt_write(). So tgtd daemon calls
ibmvstgt_rdma() in kernel mode.


> and why this function seems to be called after  ibmvstgt_cmd_done()
> function. Why there isn't a queuecommand function like in
> ibmvscsiclient.c used by SCSI?

Let's suppose that the user space daemon (tgtd) exports /tmp/disk file
to an initiator.

When tgtd gets READ command from the initiator, tgtd calls mmap()
against /tmp/disk to map the data (to send) in the virtual address
space of tgtd. That is, page frames including data are mapped.

After that, tgtd executes ibmvstgt_cmd_done() in kernel mode. Then the
data in the mapped page frames are sent to the initiator.

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list