Alan,
Thanks for your great help!
I used Linux_2.4.20, usb OHC(Intel XScale PX27x), USB1.1 full speed. The device 
is my cell phone(Intel XScale PX255).

For Bulk_IN transfer model, we can send the first IN_URB from prob func. just 
like my codes. And then we can send the next IN_URB in the complete_callback 
func. is it right?

if we send the next IN_URB before the last IN_URB complete_callback, will we 
happen an "urb already in use" issue? Anyway, i will try your suggestions.

Thanks a lot again!
^_^
Regards,
Levis
-----Original Message-----
From: Alan Stern [mailto:[EMAIL PROTECTED]
Sent: Friday, November 12, 2004 5:19 AM
To: Xu Levis-Q16136
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: An usb host transfer speed issue, could anybodies help me or give 
me some advice?


On Thu, 11 Nov 2004, Xu Levis-Q16136 wrote:

> Dear all,
> I have written a simple bulkusb driver to test the usb transfer speed. Just 
> transfer 256bytes*1000 between host and client. The test result is following:
>                   transfer data           transfer speed
> host--->client   256bytes*1000      256K bytes/second
> client--->host   256bytes*1000       62K bytes/second
> 
> I'm very confused of this transfer speed(client--->host) result. From the usb 
> analyzer snap data, the time is almost spent on "Waitting for next IN Token". 
> My bulkusb codes is the following: 
> ...
> bulkusb_probe()
> {...
>       /*Build a read urb and send a IN token first time*/
>       FILL_BULK_URB(&bulkusb->readurb, usbdev, usb_rcvbulkpipe(usbdev, 
> bulkusb->bulk_in_ep),
>                       bulkusb->ibuf, readsize, bulkusb_readback, bulkusb);
>               bulkusb->readurb.transfer_flags |= USB_ASYNC_UNLINK;    
>              
>       /*send a IN token first time*/
>       bulkusb->readurb.dev = bulkusb->bulkusb_dev;
>       if(usb_submit_urb(&bulkusb->readurb))
>       {
>               printk("bulkusb_probe: usb_submit_urb(read) failed!\n");
>       }
> ...
> }
> 
> bulkusb_readback(struct urb *urb)
> {...
>       urb->actual_length = 0;
>       urb->dev = bulkusb->bulkusb_dev;
>       if (usb_submit_urb(urb))
>       {
>               printk("failed resubmitting read urb\n");
>       }       
> ...
> }
> 
> Usb analyzer snap data:
>  <<...OLE_Obj...>> 
> 
> Could anybodies help me analyze or give me some advice? Thanks a lot!

You didn't say what version of Linux you used or what type of host 
controller.  You didn't even say what speed, although it looks like full 
speed from the numbers.  And you didn't say what device you are using for 
testing.

To get optimal performance you should queue more than one URB at a time so 
that the bus is always kept busy.  But don't queue more than about 50 ms 
worth of data at once.

For the conditions you described, you could try keeping 3 URBs in the
queue, each of size 4096.  If the throughput improves you can try 
increasing either the number of URBs or their size.

Alan Stern


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to