File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 11IFACE ?= lo
22
33.PHONY : all help \
4+ net-tune \
45 net-apply net-clear net-status net-verify \
56 net-good-home-wifi net-congested-wifi net-stable-mobile net-lte-1bar \
67 net-cross-continent net-unusable
78
89all : help
910
11+ net-tune :
12+ @echo " Applying socket tuning for interface $( NIC) ..."
13+ @sudo sysctl -w net.core.wmem_max=134217728
14+ @sudo sysctl -w net.core.rmem_max=134217728
15+ # Enable hardware GRO (or hypervisor-assisted)
16+ @sudo ethtool -K $(NIC ) rx-gro-hw on || true
17+ # Enable software GRO as fallback
18+ @sudo ethtool -K $(NIC ) gro on || true
19+ # Use fragment-based skbs (lower latency, safer in virtio/cloud)
20+ @sudo ethtool -K $(NIC ) rx-gro-list off || true
21+ @sudo ethtool -K $(NIC ) rx-udp-gro-forwarding on || true
22+ # Enable generic segmentation offload for TCP/UDP GSO
23+ @sudo ethtool -K $(NIC ) gso on || true
24+ @sudo ethtool -K $(NIC ) tx-gso-partial on || true
25+ @echo " Current GRO/GSO settings for $( NIC) :"
26+ @ethtool -k $(NIC ) | grep -E " gro|gso|segmentation|scatter"
27+ @echo " ✅ Socket tuning applied successfully."
28+
1029# net-apply: Applies network simulation with AUTOMATIC handling of localhost double-counting
1130# Presets should specify TARGET_RTT and jitter as if measuring end-to-end
1231# This function divides by 2 automatically for localhost since packets traverse rules twice
You can’t perform that action at this time.
0 commit comments