Preferred Method to Make ethtool Changes Persistent Across Reboots and Updates?

mhayhurst

Renowned Member
Jul 21, 2016
111
7
83
44
Hello everyone!

I've had to make several configuration changes using ethtool in order to increase my network performance in Proxmox 7.1-10. What is the preferred method to make ethtool changes permanent so they will persist across reboots as well as updates?

Here are the changes I made using ethtool:

Bash:
ethtool -K enp1s0 rx-checksumming on

ethtool -K enp1s0 tx-checksumming on

ethtool -K enp1s0 tx-checksum-ip-generic on

ethtool -K enp1s0 scatter-gather on

ethtool -K enp1s0 tcp-segmentation-offload on
 
You could for example add the command to the crontab with something like this:
@reboot ethtool -K enp1s0 rx-checksumming on > /dev/null 2>&1

Or you can add the commands to your /etc/network/interfaces using the "pre-up" so the command will be run right before your enp1s0 NIC will be upped:
Code:
auto enp1s0
iface enp1s0 inet manual
    pre-up ethtool -K enp1s0 rx-checksumming on
    pre-up ethtool -K enp1s0 tx-checksumming on
    pre-up ethtool -K enp1s0 tx-checksum-ip-generic on
    pre-up ethtool -K enp1s0 scatter-gather on
    pre-up ethtool -K enp1s0 tcp-segmentation-offload on
 
Last edited:
if you use ifupdown2 (default on proxmox7),
it's already support some of ethtool options (mainly offloading)

https://github.com/CumulusNetworks/...2f78f2cc76a2bc507/ifupdown2/addons/ethtool.py

so /etc/network/interfaces
(and you can use "pre-up ethtool -k ..." for unsupported options)

Code:
auto enp1s0
iface enp1s0 inet manual
   tso-offload on
    pre-up ethtool -K $IFACE rx-checksumming on
    pre-up ethtool -K $IFACE tx-checksumming on
    pre-up ethtool -K $IFACE tx-checksum-ip-generic on
    pre-up ethtool -K $IFACE scatter-gather on
 
Last edited:
  • Like
Reactions: Stoiko Ivanov
I have two Linux Bridges: vmbr0 (enp2s0f0=LAN) and vmbr1 (enp1s0=WAN) so added this in /etc/network/interfaces:

Bash:
iface enp1s0 inet manual
    pre-up ethtool -K $IFACE rx-checksumming on
    pre-up ethtool -K $IFACE tx-checksumming on
    pre-up ethtool -K $IFACE tx-checksum-ip-generic on
    pre-up ethtool -K $IFACE scatter-gather on
    pre-up ethtool -K $IFACE tcp-segmentation-offload on

iface enp2s0f0 inet manual
    pre-up ethtool -K $IFACE rx-checksumming on
    pre-up ethtool -K $IFACE tx-checksumming on
    pre-up ethtool -K $IFACE tx-checksum-ip-generic on
    pre-up ethtool -K $IFACE scatter-gather on
    pre-up ethtool -K $IFACE tcp-segmentation-offload on

My throughput has greatly increased and it's back to how it use to be. However, I now have this weird issue with RDP sessions intermittently crashing. I have a 24x7 RDP session open on my laptop and this error did not start happening until after these network changes.

1645719531671.png
 
Its better to set many changes at once:

This:
Code:
pre-up ethtool -K $IFACE rx-checksumming on
pre-up ethtool -K $IFACE tx-checksumming on
pre-up ethtool -K $IFACE tx-checksum-ip-generic on

Could be:
Code:
pre-up ethtool -K $IFACE rx-checksumming on tx-checksumming on tx-checksum-ip-generic on

Good suggestion would be to format code eg.:
Code:
pre-up ethtool -K $IFACE rx-checksumming on\
tx-checksumming on\
tx-checksum-ip-generic on
 
  • Like
Reactions: mhayhurst
Its better to set many changes at once:

This:
Code:
pre-up ethtool -K $IFACE rx-checksumming on
pre-up ethtool -K $IFACE tx-checksumming on
pre-up ethtool -K $IFACE tx-checksum-ip-generic on

Could be:
Code:
pre-up ethtool -K $IFACE rx-checksumming on tx-checksumming on tx-checksum-ip-generic on

Good suggestion would be to format code eg.:
Code:
pre-up ethtool -K $IFACE rx-checksumming on\
tx-checksumming on\
tx-checksum-ip-generic on
Thank you for this suggestion!
 
Hello.

Maybe to consider to add at least a few mostly common options in the GUI form, for the network interfaces like:
1. Multiqueue numbers - info with
Code:
ethtool -l eth0
.
2. RSS (part of the Multiqueue for RX in most cases) - info with
Code:
ethtool -x eth0
.
3. LRO - info with
Code:
ethtool -k eth0 | grep large-receive-offload
.
4. GRO - info with
Code:
ethtool -k eth0 |grep generic-receive-offload
.
5. TSO - info with
Code:
ethtool -k eth0 |grep tcp-segmentation-offload
.
6. GSO - info with
Code:
ethtool -k eth0 |grep generic-segmentation-offload
.
7. Checksum offload - info with
Code:
ethtool -k eth0 |grep checksumming
.
8. Scatter-gather - info with
Code:
ethtool -k eth0 |grep scatter-gather
.
9. Optimization of Txqueuelen to show
Code:
ip link show TAP-INTF-NAME
- qlen value :
  • Per physical interface
  • Per all TAP interfaces (global option)

Can we make a voting for the neccesary options (lets not call it "Advanced" as we have it, but to add "Expert" features in the interfaces tab).

P.S. From experience of tuning 10+Gbps interfaces on Proxmox VE, at least those options above are crucial
 
Last edited:
  • Like
Reactions: yarii