Set RX/TX on boot before network.online

Check current RX TX values

ethtool -g enp0s31f6

The output

The output of this command should look like this:

Ring parameters for enp0s31f6:
Pre-set maximums:
RX:             4096
RX Mini:        0
RX Jumbo:       0
TX:             4096
Current hardware settings:
RX:             256
RX Mini:        0
RX Jumbo:       0
TX:             256

As you can se we shold set much higher values.

Create ethtool script

nano /usr/bin/network_rx_tx.sh

Add these lines to network_rx_tx.sh

#!/bin/bash
ethtool -G enp0s31f6 rx 4096 tx 4096
echo "RX TX has been set to 4096"

Create the startup script

You can use ifup.pre or other ways to run the script, but with systemd-networkd you should follow the next steps.

nano /lib/systemd/system/network-rx-tx.service

Add these lines to network-rx-tx.service

[Unit]
Description=NetworkRXTX Setter 

#Before=network-pre.target
#Wants=network-pre.target 

DefaultDependencies=no
Requires=local-fs.target
After=local-fs.target

[Service]
#Type=oneshot

ExecStart=/usr/bin/network_rx_tx.sh
RemainAfterExit=yes
[Install]
WantedBy=network.target

Enable the service

systemctl enable network-rx-tx.service

Revision #1
Created Mon, Jul 1, 2019 11:08 AM by Tamas Toth
Updated Mon, Jul 1, 2019 11:09 AM by Tamas Toth