mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-16 05:53:00 +02:00
QoS: Make fq_codel queues smaller and remove HTB qdisc when QoS stops.
http://patchwork.openwrt.org/patch/2681/
This commit is contained in:
@@ -58,6 +58,7 @@ my $subclassfile = "/var/ipfire/qos/subclasses";
|
||||
my $level7file = "/var/ipfire/qos/level7config";
|
||||
my $portfile = "/var/ipfire/qos/portconfig";
|
||||
my $tosfile = "/var/ipfire/qos/tosconfig";
|
||||
my $fqcodel_options = "noecn limit 800 quantum 500";
|
||||
|
||||
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
|
||||
|
||||
@@ -70,13 +71,11 @@ $qossettings{'DEF_INC_SPD'} = '';
|
||||
$qossettings{'DEFCLASS_INC'} = '';
|
||||
$qossettings{'DEFCLASS_OUT'} = '';
|
||||
$qossettings{'ACK'} = '';
|
||||
$qossettings{'MTU'} = '1492';
|
||||
$qossettings{'RED_DEV'} = `cat /var/ipfire/red/iface`;
|
||||
$qossettings{'IMQ_DEV'} = 'imq0';
|
||||
$qossettings{'TOS'} = '';
|
||||
$qossettings{'VALID'} = 'yes';
|
||||
$qossettings{'IMQ_MODE'} = 'PREROUTING';
|
||||
$qossettings{'QLENGTH'} = '1000';
|
||||
|
||||
&General::readhash("${General::swroot}/qos/settings", \%qossettings);
|
||||
|
||||
@@ -161,10 +160,6 @@ case "\$1" in
|
||||
### INIT KERNEL
|
||||
modprobe sch_htb
|
||||
|
||||
### SET QUEUE LENGTH & MTU - has just to be tested!!! IMPORTANT
|
||||
ip link set dev $qossettings{'RED_DEV'} qlen $qossettings{'QLENGTH'}
|
||||
#ip link set dev $qossettings{'RED_DEV'} mtu $qossettings{'MTU'}
|
||||
|
||||
### ADD HTB QDISC FOR $qossettings{'RED_DEV'}
|
||||
tc qdisc del dev $qossettings{'RED_DEV'} root >/dev/null 2>&1
|
||||
tc qdisc add dev $qossettings{'RED_DEV'} root handle 1: htb default $qossettings{'DEFCLASS_OUT'}
|
||||
@@ -225,7 +220,7 @@ foreach $classentry (sort @classes)
|
||||
if ($qossettings{'RED_DEV'} eq $classline[0]) {
|
||||
$qossettings{'DEVICE'} = $classline[0];
|
||||
$qossettings{'CLASS'} = $classline[1];
|
||||
print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'CLASS'} handle $qossettings{'CLASS'}: fq_codel\n";
|
||||
print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'CLASS'} handle $qossettings{'CLASS'}: fq_codel $fqcodel_options\n";
|
||||
}
|
||||
}
|
||||
foreach $subclassentry (sort @subclasses) {
|
||||
@@ -233,7 +228,7 @@ foreach $subclassentry (sort @subclasses) {
|
||||
if ($qossettings{'RED_DEV'} eq $subclassline[0]) {
|
||||
$qossettings{'DEVICE'} = $subclassline[0];
|
||||
$qossettings{'SCLASS'} = $subclassline[2];
|
||||
print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'SCLASS'} handle $qossettings{'SCLASS'}: fq_codel\n";
|
||||
print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'SCLASS'} handle $qossettings{'SCLASS'}: fq_codel $fqcodel_options\n";
|
||||
}
|
||||
}
|
||||
print "\n\t### FILTER TRAFFIC INTO CLASSES\n";
|
||||
@@ -419,10 +414,6 @@ print <<END
|
||||
modprobe imq numdevs=1
|
||||
ip link set $qossettings{'IMQ_DEV'} up
|
||||
|
||||
### SET QUEUE LENGTH & MTU - has just to be tested!!! IMPORTANT
|
||||
ip link set dev $qossettings{'IMQ_DEV'} qlen $qossettings{'QLENGTH'}
|
||||
# ip link set dev $qossettings{'IMQ_DEV'} mtu $qossettings{'MTU'}
|
||||
|
||||
### ADD HTB QDISC FOR $qossettings{'IMQ_DEV'}
|
||||
tc qdisc del dev $qossettings{'IMQ_DEV'} root >/dev/null 2>&1
|
||||
tc qdisc add dev $qossettings{'IMQ_DEV'} root handle 2: htb default $qossettings{'DEFCLASS_INC'}
|
||||
@@ -483,7 +474,7 @@ foreach $classentry (sort @classes)
|
||||
if ($qossettings{'IMQ_DEV'} eq $classline[0]) {
|
||||
$qossettings{'DEVICE'} = $classline[0];
|
||||
$qossettings{'CLASS'} = $classline[1];
|
||||
print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 2:$qossettings{'CLASS'} handle $qossettings{'CLASS'}: fq_codel\n";
|
||||
print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 2:$qossettings{'CLASS'} handle $qossettings{'CLASS'}: fq_codel $fqcodel_options\n";
|
||||
}
|
||||
}
|
||||
foreach $subclassentry (sort @subclasses) {
|
||||
@@ -491,7 +482,7 @@ foreach $subclassentry (sort @subclasses) {
|
||||
if ($qossettings{'IMQ_DEV'} eq $subclassline[0]) {
|
||||
$qossettings{'DEVICE'} = $subclassline[0];
|
||||
$qossettings{'SCLASS'} = $subclassline[2];
|
||||
print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 2:$qossettings{'SCLASS'} handle $qossettings{'SCLASS'}: fq_codel\n";
|
||||
print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 2:$qossettings{'SCLASS'} handle $qossettings{'SCLASS'}: fq_codel $fqcodel_options\n";
|
||||
}
|
||||
}
|
||||
print "\n\t### FILTER TRAFFIC INTO CLASSES\n";
|
||||
@@ -695,6 +686,7 @@ print <<END
|
||||
killall qosd >/dev/null 2>&1
|
||||
(sleep 3 && killall -9 qosd &>/dev/null) &
|
||||
# DELETE QDISCS
|
||||
tc qdisc del dev $qossettings{'RED_DEV'} root >/dev/null 2>&1
|
||||
tc qdisc add root dev $qossettings{'RED_DEV'} fq_codel >/dev/null 2>&1
|
||||
tc qdisc del dev $qossettings{'IMQ_DEV'} root >/dev/null 2>&1
|
||||
tc qdisc add root dev $qossettings{'IMQ_DEV'} fq_codel >/dev/null 2>&1
|
||||
|
||||
Reference in New Issue
Block a user