←back to thread

289 points zdw | 6 comments | | HN request time: 1.342s | source | bottom
Show context
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 #
1. 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 #
2. 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 #
3. 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.
4. mianos ◴[] No.42743848[source]
I am confused by this, I worked on a Linux USB driver that used DMA in 2003.
replies(1): >>42743983 #
5. ComputerGuru ◴[] No.42743983{3}[source]
DMA from device to host directly rather than from host USB controller to host memory.
replies(1): >>42744081 #
6. mianos ◴[] No.42744081{4}[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.