weird USB test

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

 



Hi everyone,
I am experiencing a weird situation in my USB based communication test platform.
Test platform is composed of:
- a user application statically linked to user level libraries that handle basic communication with an external USB device (running on a PC)
- a custom USB device driver that interfaces the application to the external device (running on a PC)
- a firmware that receives requests from PC, and sends responses back (running on a 8051 based Silabs F340 device)
The communication is carried out by the CPU sending requests and receiving responses with a write system call, implemented by the driver, and then simply copying received responses from kernel to local application buffer with a read system call. So, only the write call communicates with the external USB device, which involves two urb submissions, one write and one read. Since the device supports Full speed mode, this communication is continuously initiated by the CPU every 2ms, which operates fine until the size of transfer within a frame is increased to 6*33=198 bytes(6 packets of 33 byte each). After that, the requests at the CPU application start accumulating and memory leak is observed at the CPU in a linear fashion, which is I guess something expected since the bandwidth reserved for the device is limited. (This test achieves about 1.72Mbps communication when two way communication is considered, where 6 "write to device" and 6 "read from device"
 requests are initiated within frame, "write to device" occuring in first frame, and "read from device" occuring in the next frame)

The weird situation is observed when more than one USB device is used for communication at the same time. We tried connecting up to 5 devices and a single device achieved up to 15*33=495 bytes of transfer without any leak, where 15 is the maximum amount of packets allowed in our own protocol within a frame (That makes about 4.3Mbps per device). So 5 devices add up to more than 20Mbps.

1) Isn't it strange that accumulation of requests occur when one device is used for communication, whereas no accumulation is observed with so many devices at the same time, consuming so much bandwidth?

2) How is it possible to add the total bandwidth in multi device test to 20Mpbs? Doesn't USB controller assign 12Mpbs of bandwidth at Full Speed? Is it possible that USB HC assigns 12Mpbs per each single device connected?

Just one more detail, the PC has two internal hubs, which allow up to 4 devices to be connected at the same time. For the 5 device case, an external hub is used. But all tests, whether external hub is used or not, give the same result that, HC looks to behave differently in scenarios where a single device communication is involved, and a multi device communication is involved.

The CPU runs Linux Kernel with version is 2.6.29, timer frequecy set to 1000Hz, and distribution is Ubuntu Ibex.
Thanks...
Cihan


      
--
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