[Bug 244356] Writing to a USB 3.0 stick is very slow

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 17 Jan 2023 11:35:40 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244356

icarus.m+freebsdbugzilla@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |icarus.m+freebsdbugzilla@gm
                   |                            |ail.com

--- Comment #92 from icarus.m+freebsdbugzilla@gmail.com ---
Just wanted to add another data point as I _suspect_ I was hit by this very
issue.

I'm using a USB 3.0 disk case: ICY BOX IB-AC703-U3 , which the vendor claims
can reach 6GB/s. I put a 1TB Patriot P200 2,5`` SSD SATA disk in the case. The
disc spec says 530MB/s read, 460MB/s write. On a Linux system I can reliably
get 440MB/s write.

On a system installed with:
`FreeBSD 12.2-RELEASE-p10 b26f74b5984(HEAD) TRUENAS`
I get varying behaviour. The motherboard I use has USB 2.0 and USB 3.0 ports.
No other USB devices are connected. I only connect the drive to USB 3.0 ports.
I connect the drive after the machine boots fully. About 90% of times I get the
following message in dmesg:
```
ugen0.2: <USB 3.0 Device USB 3.0 Device> at usbus0
umass0 on uhub1
umass0: <USB 3.0 Device USB 3.0 Device, class 0/0, rev 2.10/3.01, addr 10> on
usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x8100
(... redacted...)
da0: <IB-AC703 -U3 0301> Fixed Direct Access SPC-4 SCSI device
(... redacted...)
da0: 40.000MB/s transfers
(... redacted...)
```
and indeed the speed is < 40MB/s. 500GB of files of varying sizes was written
at 20MB/s.


About 10% of times I get the following message in dmesg:
```
ugen0.2: <USB 3.0 Device USB 3.0 Device> at usbus0
umass0 on uhub1
umass0: <USB 3.0 Device USB 3.0 Device, class 0/0, rev 3.00/3.01, addr 11> on
usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x8100
(... redacted...)
da0: <IB-AC703 -U3 0301> Fixed Direct Access SPC-4 SCSI device
(... redacted...)
da0: 400.000MB/s transfers
(... redacted...)
```
and the speed is < 400MB/s. The same 500GB of files were written at 160MB/s and
the bottleneck was on the source (i.e. the source was at max read capacity).

Notice in the slow case, the message says: `rev 2.10/3.01` , whereas in the
fast case it says: `rev 3.00/3.01`

There's nothing additional that I do between disconnecting and connecting the
drive. I just  do it multiple times until I see the right message.

Let me know if I can provide any further diagnostics.

-- 
You are receiving this mail because:
You are the assignee for the bug.