Re: UAS host driver implementation question - parallel command execution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 16, 2011 at 03:44:33PM +0300, Tanya Brokhman wrote:
> Hi Sarah,
> 
> I have a question about UAS host driver implementation. Perhaps you're not
> the one to bother with it. If so, could you please refer me to the
> developer? 

Matthew was the main developer of the UAS driver, so you probably want
to ask him.  I'm pretty sure he's listed in the MAINTAINERS file.

> Anyway, I was going over the implementation of the UAS host driver and got
> the impression that in the current version of the code the command execution
> is serial, when one of the advantages of UAS is that we can issue several
> commands in parallel. Is this correct or am I missing something?

I've seen the UAS driver create many outstanding commands, and have them
completed out-of-order by the device, so I'm pretty sure the UAS driver
handles commands in parallel.  Maybe you're confused because much of the
parallelization is done in the SCSI layer.  The UAS driver just has to
define how many outstanding command it can handle, by setting the
.can_queue field of the scsi_host_template structure:

static struct scsi_host_template uas_host_template = {
        .module = THIS_MODULE,
        .name = "uas",
        .queuecommand = uas_queuecommand,
        .slave_alloc = uas_slave_alloc,
        .slave_configure = uas_slave_configure,
        .eh_abort_handler = uas_eh_abort_handler,
        .eh_device_reset_handler = uas_eh_device_reset_handler,
        .eh_target_reset_handler = uas_eh_target_reset_handler,
        .eh_bus_reset_handler = uas_eh_bus_reset_handler,
        .can_queue = 65536,     /* Is there a limit on the _host_ ? */
        .this_id = -1,
        .sg_tablesize = SG_NONE,
        .cmd_per_lun = 1,       /* until we override it */
        .skip_settle_delay = 1,
        .ordered_tag = 1,
};

I'm not sure if it's possible for the UAS driver to dynamically change
the can_queue field once it allocates streams and knows how many streams
the device and host can handle.

> The thing that made me come to this conclusion is the struct scsi_cmnd
> *current_cmnd field of the scsi_device structure that if is not null, in
> uas_queuecommand_lck() you return SCSI_MLQUEUE_DEVICE_BUSY. 

I don't know enough about that piece of code to comment.  Matthew?

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux