USB stack getting confused

O'Connor, Daniel darius at dons.net.au
Thu Mar 14 13:31:17 UTC 2019



> On 14 Mar 2019, at 23:30, Hans Petter Selasky <hps at selasky.org> wrote:
> On 3/11/19 2:41 PM, Hans Petter Selasky wrote:
>>> 
>>> I have the source code and I can see what the issue is so I'll fix that, although I am surprised the limit for USB devices is so much lower than the system limit for file descriptors generally.
>>> 
>> Hi,
>> USB has a limit on open FD's per USB device, (USB_FIFO_MAX = 128) / 2 = 64.
>> --HPS
> 
> There can be up to 127 devices per USB controller, so 127 * 64 FDs is the maximum allowed. I think the limit is reasonable, given that non-admin users can have access to such devices.

I suppose that makes sense, but the failure mode was pretty surprising to me. I didn't realise that usbconfig has to open each device to get information on it - I had assumed that it got it via /dev/usbctl or similar.

> Did you get any further on this issue?

Sorry - yes I found the leak in my code. I thought I already said so but obviously not.

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum




More information about the freebsd-hackers mailing list