I finally found the issue!! 
Well,
issues.
...five days later... [In French accent]
I tried everything I could think of, from different Ethernet-USB-C adapters to a multitude of adjustments to the code, to different packet sizes, to examining the iperf protocol (the iperf2 code is hard to go through, and there's no documentation about the protocol that I could find; I went through it a bit when I first wrote the IPerfServer example). So then I got the bright idea of trying out something similar to the simple "just read data" code that Paul showed. And wouldn't you know it...
...I started seeing 10Mbps speeds (via wireless->eero node->Teensy; more on that later). So that's the first problem. Something's up with the IPerfServer example. When I first wrote it, it worked great. Then the protocol started changing as the future became the present. It's on my to-do list to fix this. But for now, I'm not doing something correctly there, and I was seeing mostly "0" speeds because of how I'm doing the state machine for the iperf2 protocol. I didn't dive too deeply into that.
It's not really "next"; more "concurrently", I was testing in two different ways:
1. Teensy->eero node->wireless->Intel Mac laptop w/15.7.3 (this is where I started seeing the 10+Mbps speeds, sometimes up to ~13.3Mbps)
2. Teensy->Belkin Ethernet USB-C adapter (F2CU040) ->laptop
The second configuration was what I was using for my "major speed tests", thinking that traffic<->wireless would be lots slower than a direct connection. When I had, in the past and a while back, compared the two using the Teensy 4.1's native ethernet, this assumption was correct. I was seeing ~95Mbps with that adapter and < 20Mbps over wireless. But...
...here's where it gets more interesting. Now that I thought I found the problem, I switched over to setup #2, and lo and behold... I was seeing those 350kbps numbers again! Aha! It's the adapter! I tried rebooting, finding new drivers (I didn't), and finally two other adapters: An Anker one and a CalDigit TS3 Plus dock. Both exhibited the same behaviour as the Belkin adapter: 'round about 350-400kbps or so. I also tried rebooting and leaving the Belkin connector plugged in, thinking something needed "a good shaking out". But I was still seeing sub-1Mbps speeds.
It also turned out that my driver was mostly fine. I still improved it some, though.
I also found a mistake in how I was using the
iperf command. I thought that the
-l 1460 set the maximum packet payload size. Well, it doesn't. For TCP, it sets the read/write buffer size. I think the default is 128k, so after I removed that
-l option, the speed-over-wireless jumped by about 3Mbps to ~13Mbps. Niiiicccce.
TLDR:
1. The IPerfServer example is faulty; a simple "read all the data from the socket" program showed much higher speeds than "mostly zero".
2. It was the USB-C network adapter(s) (I tried three different ones). They had over 10x
worse performance than over wireless, which is usually slower than a direct connection: ~350-450kbps; wireless was getting > 10Mbps.
3. The driver was fine; I still improved it over this process, though.
4. I'm going to include a new
SimpleIPerfServer example that just reads from the socket until closed.
5. I can get
even better performance by not setting the TCP write buffer to 1460 bytes.
I have an ask:
Surprisingly, I don't have near me any machines with a direct Ethernet connection. Would someone be willing to try the new
SimpleIPerfServer example with iperf (not iperf3) and see what speeds you're getting without using an Ethernet adapter? Note that you may need to set a static IP; to do this, just initialize the `kStaticIP`, `kSubnet`, and `kGateway` IPAddresses to something. The `iperf` command:
Bash:
iperf -c <IP_address> -i 1
You can simply get the latest on GitHub (
https://github.com/ssilverman/QNEthernet) and overwrite everything in the Arduino libraries/ folder. I haven't yet released a v0.35.0 that you could get via the Arduino IDE.
Thanks for reading all this!