←back to thread

289 points zdw | 10 comments | | HN request time: 0.215s | source | bottom
1. walrus01 ◴[] No.42743231[source]
On the general topic of USB to 1000BASE-T (and now 2.5 GBaseT) dongles, for people who care about performance, it's good to know about the distinction between those that are USB devices and those that are PCI-Express devices.

Basically, what do you get if you hotplug it into a laptop running a current linux kernel and do "sudo lsusb -v" vs "sudo lspci -v"?

The ones that are native PCIE devices offer much better performance, up to 2.5 GBASET line rate, and will communicate with the host over the implementation of thunderbolt over USB.

The ones that are USB only might work okay, but there's a reason they're cheap.

Of course a cheaper laptop also won't have any implementation of thunderbolt on it, so that's something to consider as well.

replies(4): >>42743476 #>>42743639 #>>42744549 #>>42745212 #
2. Tijdreiziger ◴[] No.42743476[source]
Could you elaborate on why the USB ones are worse?

Per Wikipedia, USB 3.0 (from 2008) can reach 5 Gbit/s, so (naively?) one would expect them to reach 2.5 GbE line rate easily, right?

replies(2): >>42743591 #>>42743627 #
3. ComputerGuru ◴[] No.42743591[source]
USB doesn’t provide any DMA (until USB 4) and requires more host cpu resources to meet the same bandwidth. It also has less consistent performance by virtue of the USB protocol itself.
replies(1): >>42743848 #
4. d_k_f ◴[] No.42743627[source]
I've only got superficial knowledge in this regard, so please take it with a grain of salt, but: the way I understand it is that PCIE has full direct memory access, so devices connected through it can use zero copy and similar techniques to access and process data much faster, especially with lower latencies than over regular USB. Using USB might/will require copying the data to transfer/read from and to different buffers, between user/kernel space, etc.
5. toast0 ◴[] No.42743639[source]
I'm guessing if I accidentally got a pci-e one, it wouldn't work in any of the USB ports I would connect it to (as, to my knowledge, I only have USB ports), or do they generally fall back to working as a USB device?
6. mianos ◴[] No.42743848{3}[source]
I am confused by this, I worked on a Linux USB driver that used DMA in 2003.
replies(1): >>42743983 #
7. ComputerGuru ◴[] No.42743983{4}[source]
DMA from device to host directly rather than from host USB controller to host memory.
replies(1): >>42744081 #
8. mianos ◴[] No.42744081{5}[source]
When I worked on it, the USB controller was just a pci bus device that once set up, the incoming data, from a USB ADC, streamed the data in blocks directly to memory. Maybe they took all that back out.
9. kiririn ◴[] No.42744549[source]
Realtek RTL8156 (USB 2.5G ethernet) is fast and rock solid, even for server use cases. I’d take it over an i225 any day
10. comex ◴[] No.42745212[source]
Not only 2.5GBaseT. I have a 10GBase-T Thunderbolt dongle (from [1]). Okay, it's a little bigger than a normal dongle, and it has a USB-C female port instead of a builtin cable, and it gets warm. But it's basically a dongle, and I can get 9.4Gbit/s through it with iperf3 on my Mac.

Unsurprisingly, it shows up as a PCIe device.

[1] https://www.amazon.com/gp/product/B0DHSWSSBY