Skip to content

Commit

Permalink
Disable gro for low bandwiths on ingress shaping
Browse files Browse the repository at this point in the history
  • Loading branch information
hkbakke committed Jan 31, 2017
1 parent c7f448c commit 6de3342
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tc-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,17 @@ get_tx_offloads () {
fi
}

get_rx_offloads () {
# Takes rate in kbit/s as parameter
local RATE=$1

if [[ ${RATE} -lt 40000 ]]; then
echo "gro off"
else
echo "gro on"
fi
}

get_limit () {
# Takes rate in kbit/s as parameter
local RATE=$1
Expand Down Expand Up @@ -314,6 +325,9 @@ apply_egress_shaping () {
}

apply_ingress_shaping () {
# Disable gro for lower bandwiths
${ETHTOOL} --offload ${IF_NAME} $(get_rx_offloads ${DOWN_RATE})

# Create ingress on interface
${TC} qdisc add dev ${IF_NAME} handle ffff: ingress

Expand Down

0 comments on commit 6de3342

Please sign in to comment.