OrangePi 3 LTS の USB3.0 ポートが遅い

# なんか OrangePi 3 LTS の USB3.0 ポート遅くない……？
- USB2.0 と USB3.0 ポートで違いは出るけど、なんか遅いな……
- UAS 無効化しても変わらん……
- なんだろう、`lsusb` 的に hub の先にあるように見えてるのがダメなのか？
    - でも NVMe-USB でも遅いから関係ないか？
    - OrangePi 自身の USB コントローラの処理能力？？？？ 


# 実験
## HDD (DAS)
- DAS: Terramaster D4-300
- HDD: MN08ACA16T x4
- mdadm: RAID10
- USB ケーブル: Anker PowerLine+ A-to-C

## OrangePi
```zsh:lsusb -t
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 12, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 13, If 0, Class=Mass Storage, Driver=uas, 5000M
        |__ Port 2: Dev 14, If 0, Class=Mass Storage, Driver=uas, 5000M
        |__ Port 3: Dev 15, If 0, Class=Mass Storage, Driver=uas, 5000M
        |__ Port 4: Dev 16, If 0, Class=Mass Storage, Driver=uas, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
    |__ Port 1: Dev 10, If 0, Class=Hub, Driver=hub/4p, 480M
```

```zsh:bench
% sudo mount /dev/md0p1 /mnt
% sudo dd if=/dev/zero of=/mnt/test2.img bs=4K count=$(( 4*1024*1024*1024/4096 ))
1048576+0 records in
1048576+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 101.402 s, 42.4 MB/s
```

- 念のため USB 2.0 ポートに挿してみる
```zsh:lsusb -t
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=uas, 480M
        |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=uas, 480M
        |__ Port 3: Dev 5, If 0, Class=Mass Storage, Driver=uas, 480M
        |__ Port 4: Dev 6, If 0, Class=Mass Storage, Driver=uas, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
```

```zsh:bench
% sudo mount /dev/md0p1 /mnt
% sudo dd if=/dev/zero of=/mnt/test2.img bs=4K count=$(( 4*1024*1024*1024/4096 ))
1048576+0 records in
1048576+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 199.739 s, 21.5 MB/s
```

### UAS 無効化してみる
```zsh:lsusb -tv
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hub
        |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=uas, 480M
            ID 0480:a006 Toshiba America Inc External Disk 1.5TB
        |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=uas, 480M
            ID 0480:a006 Toshiba America Inc External Disk 1.5TB
        |__ Port 3: Dev 5, If 0, Class=Mass Storage, Driver=uas, 480M
            ID 0480:a006 Toshiba America Inc External Disk 1.5TB
        |__ Port 4: Dev 6, If 0, Class=Mass Storage, Driver=uas, 480M
            ID 0480:a006 Toshiba America Inc External Disk 1.5TB
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
```

```zsh
% sudo orangepi-config
  -> System
  -> Bootenv
  Append:
      usbstoragequirks=0480:a006:u  
% sudo update-initramfs -u
```

```zsh:lsusb -tv
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hub
        |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            ID 0480:a006 Toshiba America Inc External Disk 1.5TB
        |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            ID 0480:a006 Toshiba America Inc External Disk 1.5TB
        |__ Port 3: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            ID 0480:a006 Toshiba America Inc External Disk 1.5TB
        |__ Port 4: Dev 6, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            ID 0480:a006 Toshiba America Inc External Disk 1.5TB
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
```

### 再テスト
- USB 3.0
```zsh:lsusb -t
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 3: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 4: Dev 6, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
```

```zsh:bench
% sudo mount /dev/md0p1 /mnt
% sudo dd if=/dev/zero of=/mnt/test2.img bs=4K count=$(( 4*1024*1024*1024/4096 ))
1048576+0 records in
1048576+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 101.535 s, 42.3 MB/s
```

- USB 2.0
```zsh:lsusb -t
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        |__ Port 3: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        |__ Port 4: Dev 6, If 0, Class=Mass Storage, Driver=usb-storage, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
```

```zsh:bench
% sudo mount /dev/md0p1 /mnt
% sudo dd if=/dev/zero of=/mnt/test2.img bs=4K count=$(( 4*1024*1024*1024/4096 ))
1048576+0 records in
1048576+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 188.834 s, 22.7 MB/s
```

## ESXi 仮想マシン
```zsh:lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    |__ Port 1: Dev 13, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    |__ Port 2: Dev 15, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    |__ Port 3: Dev 16, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    |__ Port 4: Dev 2, If 0, Class=Hub, Driver=hub/7p, 10000M
        |__ Port 1: Dev 14, If 0, Class=Mass Storage, Driver=usb-storage, 5000M/Tx1+Rx2
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 3: Dev 3, If 0, Class=Hub, Driver=hub/7p, 12M
    |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/7p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/7p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
```

```zsh:bench
% sudo mount /dev/md0p1 /mnt
% sudo dd if=/dev/zero of=/mnt/test2.img bs=4K count=$(( 4*1024*1024*1024/4096 ))
1048576+0 records in
1048576+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 10.751 s, 399 MB/s
```


## USB-NVMe
### OrangePi
```zsh:lsusb -t
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
```

```zsh:bench
% sudo dd if=/dev/zero of=/mnt/test2.img bs=4K count=$(( 4*1024*1024*1024/4096 ))
1048576+0 records in
1048576+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 57.1997 s, 75.1 MB/s
```

### ESXi
```zsh:lsusb
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    |__ Port 1: Dev 17, If 0, Class=Mass Storage, Driver=usb-storage, 10000M
    |__ Port 4: Dev 2, If 0, Class=Hub, Driver=hub/7p, 10000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 3: Dev 3, If 0, Class=Hub, Driver=hub/7p, 12M
    |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/7p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/7p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
```

```zsh:bench
% sudo dd if=/dev/zero of=/mnt/test2.img bs=4K count=$(( 4*1024*1024*1024/4096 ))
1048576+0 records in
1048576+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 10.1404 s, 424 MB/s
```