Enabling USB 3.0 (5Gbps) UASP support

Peek

Cadet
Joined
Jan 4, 2021
Messages
9
Hi,

I'm stumped in trying to get USB 3.0 (5Gbps) with UASP support working in TrueNAS.

Disk performance remains at USB 2.0 (sub 60MBps) as TrueNAS only recognises an uHCI controller, despite the hypervisor reflecting an xHCI controller with supporting UAS driver.

The host only has the option to "Enable legacy USB support" within the EFI which does not make a difference. Neither does setting "xhci_load" to "YES" under the TrueNAS tunables change anything either.

It's frustrating as I've noticed other tinkers achieving data transfers in excess of 120MBps with lesser SBC setups. So I'm hoping some samarathan could show me what I could possibly be missing ...

The details:

Host : Intel NUC7i3BNH - firmware : BNKBL357.86A.0083.2020.0714.1344
Hypervisor : XCP-NG 8.2.0
VM : TrueNAS 12.0-U2

In XCP-NG:

[xcp ~]# lsusb -t /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M |__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M |__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M |__ Port 4: Dev 4, If 0, Class=Mass Storage, Driver=uas, 5000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M |__ Port 8: Dev 3, If 1, Class=Wireless, Driver=, 12M |__ Port 8: Dev 3, If 0, Class=Wireless, Driver=, 12M


** Other USB 3.0 enclosures I've tried that apparently supports UASP reflects a "usb-storage" driver. I understand that the "usb-storage" driver is a clear indication for USB 2.0, whereas the "uas" driver is for USB3.0 with UASP (5Gbps) support.

TransImp X3 MUKii - ASMedia ASM1051 SATA 3Gb/s bridge

Code:
[ 4345.875260] usb 2-4: new SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[ 4345.896253] usb 2-4: New USB device found, idVendor=174c, idProduct=5106, bcdDevice= 1.00
[ 4345.896255] usb 2-4: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 4345.896257] usb 2-4: Product: U3 Device
[ 4345.896258] usb 2-4: Manufacturer: MUKii Technology INC.
[ 4345.896259] usb 2-4: SerialNumber: 000000900049
[ 4345.897422] usb-storage 2-4:1.0: USB Mass Storage device detected
[ 4345.897695] scsi host3: usb-storage 2-4:1.0
[ 4356.994728] scsi 3:0:0:0: Direct-Access MUKii Storage SC60 PQ: 0 ANSI: 5
[ 4356.995240] sd 3:0:0:0: Attached scsi generic sg1 type 0
[ 4356.995520] sd 3:0:0:0: [sdb] Very big device. Trying to use READ CAPACITY(16).
[ 4356.995748] sd 3:0:0:0: [sdb] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[ 4356.996046] sd 3:0:0:0: [sdb] Write Protect is off
[ 4356.996049] sd 3:0:0:0: [sdb] Mode Sense: 23 00 00 00
[ 4356.996302] sd 3:0:0:0: [sdb] No Caching mode page found
[ 4356.996318] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 4357.057942] sdb: sdb1
[ 4357.059104] sd 3:0:0:0: [sdb] Attached SCSI disk



Volans VL-UE35 - ASMedia ASM1153 SATA 3Gb/s bridge

Code:
[ 4449.996143] usb 2-2: new SuperSpeed Gen 1 USB device number 6 using xhci_hcd
[ 4450.017675] usb 2-2: New USB device found, idVendor=174c, idProduct=1153, bcdDevice= 0.01
[ 4450.017678] usb 2-2: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 4450.017679] usb 2-2: Product: AS2115
[ 4450.017681] usb 2-2: Manufacturer: ASMedia
[ 4450.017682] usb 2-2: SerialNumber: 00000000000000000000
[ 4450.018926] usb-storage 2-2:1.0: USB Mass Storage device detected
[ 4450.019109] scsi host4: usb-storage 2-2:1.0
[ 4451.028834] scsi 4:0:0:0: Direct-Access ASMT 2115 0 PQ: 0 ANSI: 6
[ 4451.029260] sd 4:0:0:0: Attached scsi generic sg2 type 0
[ 4461.277648] sd 4:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).
[ 4461.277970] sd 4:0:0:0: [sdc] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[ 4461.277972] sd 4:0:0:0: [sdc] 4096-byte physical blocks
[ 4461.278320] sd 4:0:0:0: [sdc] Write Protect is off
[ 4461.278322] sd 4:0:0:0: [sdc] Mode Sense: 43 00 00 00
[ 4461.278580] sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 4461.340487] sdc: sdc1 sdc2
[ 4461.341630] sd 4:0:0:0: [sdc] Attached SCSI disk


Simplecom SE328 - JMicron JMS567 SATA 6Gb/s bridge

Code:
[ 5139.097722] usb 2-1: new SuperSpeed Gen 1 USB device number 8 using xhci_hcd
[ 5139.119231] usb 2-1: New USB device found, idVendor=152d, idProduct=0578, bcdDevice= 5.08
[ 5139.119233] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5139.119234] usb 2-1: Product: USB
[ 5139.119236] usb 2-1: Manufacturer: jmicron
[ 5139.119237] usb 2-1: SerialNumber: 0000000000080
[ 5139.123469] scsi host5: uas
[ 5139.124037] scsi 5:0:0:0: Direct-Access USB 3.0 0508 PQ: 0 ANSI: 6
[ 5139.124869] sd 5:0:0:0: Attached scsi generic sg3 type 0
[ 5243.811307] sd 5:0:0:0: [sdd] Read Capacity(16) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 5243.812741] sd 5:0:0:0: [sdd] Assuming drive cache: write through
[ 5243.816648] sd 5:0:0:0: [sdd] Attached SCSI disk


In TrueNAS:

Code:
#usbconfig

ugen0.1: <Intel UHCI root HUB> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen0.2: <QEMU 0.10.2 QEMU USB Tablet> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)


As noticed, 12Mbps (Full Speed USB) is a far cry from 5Gbps (Super Speed USB) ...
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Loader tunables only take effect on boot. Regardless, I don't think upstream FreeBSD supports UASP, so neither will downstream TrueNAS Core/FreeNAS. On my system, there is support for xHCI Super Speed connections. I can't speak for whatever gyrations you'll need to get the hypervisor to pass through USB 3.0 support to your VM, though.
 

Peek

Cadet
Joined
Jan 4, 2021
Messages
9
Wise man stated:"Never underestimate your own stupidity"

... and for some reason I believed XCP-ng was based on FreeBSD ... until I realised that would be the pfSense VM.

... and transfering 3.5TB of data from an USB attached ext4 drive to an ZFS pool controlled by a VM ain't gonna happen easily.
 

Constantin

Vampire Pig
Joined
May 19, 2017
Messages
1,829
I found VMs like Win10 running on my system to work sort of, but not great. Undoubtedly, smarter folk than I could get the system to work better than I did, and besides, BlueIris likely needs something more dedicated than a a bunch of relatively slow cores.

As for your disks, I'd consider a few alternative approaches such as adding a eSATA port or two to the back of your server with a connection to a or multiple SATA3 port(s) on the motherboard and hence "plug" the backup drives directly into the motherboard. It ain't going to go faster than that for any device using SATA and it eliminates the issues associated with USB-SATA bridgeboards also.
 

Peek

Cadet
Joined
Jan 4, 2021
Messages
9
Yet ... /boot/kernel/xhci.ko exists on the TrueNAS VM ...

and

#kldload xhci.ko kldload: can't load xhci.ko: module already loaded or in kernel

with

#pciconf -l hostb0@pci0:0:0:0: class=0x060000 card=0x11001af4 chip=0x12378086 rev=0x02 hdr=0x00 isab0@pci0:0:1:0: class=0x060100 card=0x11001af4 chip=0x70008086 rev=0x00 hdr=0x00 atapci0@pci0:0:1:1: class=0x010180 card=0x00015853 chip=0x70108086 rev=0x00 hdr=0x00 uhci0@pci0:0:1:2: class=0x0c0300 card=0x00015853 chip=0x70208086 rev=0x01 hdr=0x00 intsmb0@pci0:0:1:3: class=0x068000 card=0x11001af4 chip=0x71138086 rev=0x01 hdr=0x00 vgapci0@pci0:0:2:0: class=0x030000 card=0x00015853 chip=0x00b81013 rev=0x00 hdr=0x00 xenpci0@pci0:0:3:0: class=0x010000 card=0x00015853 chip=0x00015853 rev=0x01 hdr=0x00


How to swop out uhci for xhci .... ?
 
Last edited:

Peek

Cadet
Joined
Jan 4, 2021
Messages
9
... I'd consider a few alternative approaches such as adding a eSATA port or two to the back of your server ...

Unfortunately not possible in this test rig.

Yet I wanna soldier on, as the experience and knowledge would surely be beneficial later down the road.
 

Peek

Cadet
Joined
Jan 4, 2021
Messages
9
Too much time and too little progress... with a rig that does not support ECC memory.

As such, the idea is being abandoned.
 
Top