Dynamic USB buffer sizes (Was: Option driver enhancement)

Indan Zupancic indan at nul.nu
Thu Oct 4 09:51:11 UTC 2007


Hello,

On Thu, October 4, 2007 02:30, Matthias Urlichs wrote:
> * The number and size of the USB buffers which the Option driver uses
>   are chosen very conservatively, so as not to overwhelm some of the
>   older cards which it supports. Needless to say, that means that the
>   driver can't keep up with UMTS data rates.
>
>   Its list of device IDs needs to be enhanced (in a blacklist-style sort
>   of way) so that the driver can pick the limits from there, instead of
>   having to use some sort of global pessimum.
>
> * ... or from a couple of module parameters, so that people can
>   test whether their device supports larger limits without recompiling.
>

This seems to be a generic problem, more or less randomly chosen USB
buffer sizes and count. So what about providing a generic solution?

E.g. some mechanism where the buffer size and buffer count is chosen
dynamically depending on how fast the device turns out to be, and some
latency constraints. For number of buffers it's easy to do, e.g. new buffers
could be allocated up to nr_bufs_in_flight * 2. Doing the buffer sizes
dynamically is a bit trickier, but at first some default sizes can be chosen
which make sense for the USB layer and the device using it.

Defining a nice interface and integrating it well with the USB layer
would be the task here, as wel as converting a bunch of drivers to use
this interface.

USB experts, what do you think, is this a good and useful beginners project
or not?

Greetings,

Indan





More information about the devel mailing list