Disable gro for low bandwiths on ingress shaping

This commit is contained in:
hk 2017-01-31 23:59:59 +01:00
parent c7f448c972
commit 6de334210b
1 changed files with 14 additions and 0 deletions

View File

@ -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
@ -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