usbip port number limits

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

 



Hi, 

My name is Juan, and I work for Qindel, a small IT company based in Spain. I'm currently trying to do some development for our main product QVD. Specifically, I'm trying to get usbip to work with a great number of LXC containers. Due to the nature of LXC, all usbip ports are shared among the containers, and I would need to increase the limit in the number of ports drastically. 

Having a look at the code of the VHCI driver at https://github.com/torvalds/linux/tree/master/drivers/usb/usbip , I found these two parameters: USBIP_VHCI_HC_PORTS and USBIP_VHCI_NR_HCS 

I've compiled VHCI driver from latest source above, altering both parameters to get higher number of controllers and ports per controller (not only the driver, but also the usbip cli tool at https://github.com/torvalds/linux/tree/master/tools/usb/usbip ), and run into several problems: 

1. USBIP_VHCI_HC_PORTS x USBIP_VHCI_NR_HCS <= 128 
It seems, whatever the combination of both parameters, usbip command line tool won't accept that your driver is compiled with numbers violating the above rule. Is this a problem of the tool code or is there a reason behind this? As far as I 've researched, the 127 devices limit in Linux is per controller, so increasing the number of controllers in usbip driver shouldn't be limited this way, am I wrong? 

2. I've compiled with 4 ports per controller and 32 controllers. Given that the drivers creates an usb2 and an usb3 controller, it results in 64 controllers with four ports each: 128 ports. Here, usbip cli tool works. But... if you try to attach a device, the kernel dumps a trace that starts with this: 
Oct 30 10 :43:14 test-mononode-ubuntu-16 kernel: [ 44.138068] usbcore: failed to get bus number 
Oct 30 10 :43:14 test-mononode-ubuntu-16 kernel: [ 44.138813] vhci_hcd: usb_add_hcd hs failed -7 
Oct 30 10 :43:14 test-mononode-ubuntu-16 kernel: [ 44.139559] vhci_hcd: probe of vhci_hcd.31 failed with error -7 
Oct 30 10 :44:23 test-mononode-ubuntu-16 kernel: [ 113.345824] BUG: unable to handle kernel NULL pointer dereference at 0000000000000230 
Oct 30 10 :44:23 test-mononode-ubuntu-16 kernel: [ 113.347584] IP: status_show+0x13c/0x360 [vhci_hcd] 
Oct 30 10 :44:23 test-mononode-ubuntu-16 kernel: [ 113.348592] PGD 1398cc067 
Oct 30 10 :44:23 test-mononode-ubuntu-16 kernel: [ 113.348593] PUD 136a96067 
Oct 30 10 :44:23 test-mononode-ubuntu-16 kernel: [ 113.349119] PMD 0 

This leads me to thinking there is some problem with such a big number of controllers, although the controller number parameters is supposed to have a max value of 128. Could this be related to the kernel I'm using? Maybe I should compile the full kernel to get higher numbers working? 

3. For this last test, I compiled with smaller numbers, just to test how the several controllers thing works. Specifically, one port per controller, 16 controllers in total. This leads to the module loading, the controllers listable with lsusb, and no problems in kernel log. I attach one device, and it goes to the first controller. Working... no problem at all. But, if you attach a second device, the command hangs and I get this in syslog: 

Oct 30 11 :07:14 test-mononode-ubuntu-16 kernel: [ 1078.239613] vhci_hcd vhci_hcd.0: port 0 already used 

This message was repeated for more than 7000 times before I could stop the command. So... my conclusion is that usbip won't work correctly if compiled with more than one controller. Is this related to the usbip cli tool or is there any problem at the driver? 


Please excuse me for the big mail, and thanks in advance, 
Juan 

Juan Antonio Zea Herranz 
Proyectos y consultoría | Qindel Group 
E: juan.zea@xxxxxxxxxx 
T: +34 91 766 24 21 
M: +34 637 74 63 09 
W: qindel.com 

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