Issue with Ethernet cards acting up under heavy load (Freenas and virtualized Mojave, and older cards on physical machines)

Hi everyone,

Posting this to potentially avoid countless headaches and nightmares to other people who would experience similar issues, as I've been working on identifying the problem for 3 weeks and finally found something that seems to work. Fix at the bottom of the post (has been working fine today so far, persistent through reboots)

Setup:

OS: Mojave 10.14.4 on Virtual Machine (Qemu / KVM)

Hypervisor: Proxmox 5.4-3

NAS: Freenas (latest stable release)

Router: Asus RT-AC88U

Issues:

Original posts in Proxmox forum and r/freenas :

https://forum.proxmox.com/threads/osx-vm-unable-to-write-data-to-nas-properly.56407/

https://www.reddit.com/r/freenas/comments/cik2ex/transfering_up_fails_and_drops_paquets/

Since I finalized my setup with my good friend Morgonaut (check her youtube by the way and consider joining her Patreon, amazing help from her!) and completed the build of my NAS (Freenas), I have been experiencing silly issues with File transfers. Anything from other computers (including native iMacs and MB Pros) over wifi or ethernet just works fine, EXCEPT with my new Mojave Virtual Machine.

I can read and copy from the NAS to the VM at perfect speeds, but as soon as I try to send files to it from the VM, the VM hangs, become irresponsive or makes it unable to use internet (any internet related apps, NAS and SMB, etc).

I had tried iperf3 tests from every machine to every machine (including Hypervisor > Freenas) and the only one problematic was OSX VM > Freenas, EXCEPT when reducing potential connection (either acting as 100BaseTX, or setting a max of 80MB/s on vmxnet on my hypervisor). I tried the built-in ethernet port bridged (vmxnet/vmbr0 on Hypervisor), I tried add-in cards (Intel pro/1000), NOTHING would fix it.

Note that I changed for an Intel pro/1000 NIC passed through directly to the VM as I thought it was simply an issue of the Hypervisor not managing properly the speed of my Mac VM, and still was experiencing the same exact problems (actually worse, as it would now kill the network card and needed a reboot to regain any internet access). I had tried absolutely everything possible until my brain went back to useable, and searched potential side problems.

Since overloading or saturation seemed to be the issue, I researched further on that. It appears the issue is from OSX itself (who would have thought... ;-)), and TSO no less (TCP Segmentation Offload) which seems to overload any NIC not properly configured, especially on Hackintoshs and MacOS VMs.

In other words... It was NEITHER a Freenas issue, NOR a proxmox/qemu/KVM issue, but a MacOs one... Potentially related to the age of my inboard card, but probably not as I was also experiencing it when using virtualized one.

So for posterity, steps for the fix:

Verify that your TSO is actually on (on by default in Mojave apparently)

sudo sysctl -a | grep net.inet.tcp.tso

This should output:

net.inet.tcp.tso: 1

Run this command in OSX terminal (to set TSO off temporarly):

sudo sysctl -w net.inet.tcp.tso=0

Check if the problem persists.

If it is fixed, you can add that command to run at startup by either editing your sysctl.conf or creating a new one (works with any text editor, or via command line), adding the following line, and saving it to /private/etc/sysctl.conf :

net.inet.tcp.tso: 0

Hope it will save the life of other Hackintoshers down the line!

(Or be fixed in Catalina? Seriously Apple, this issue appears on old Mac Pros too, fix your sh*t!)

submitted by /u/riskoph
[link] [comments]
Share: