diff --git a/config/qos/makeqosscripts.pl b/config/qos/makeqosscripts.pl index 3234ab366..cc91124df 100644 --- a/config/qos/makeqosscripts.pl +++ b/config/qos/makeqosscripts.pl @@ -54,7 +54,10 @@ my $classfile = "/var/ipfire/qos/classes"; my $level7file = "/var/ipfire/qos/level7config"; my $portfile = "/var/ipfire/qos/portconfig"; my $tosfile = "/var/ipfire/qos/tosconfig"; -my $fqcodel_options = "limit 10240 quantum 1514"; +my @cake_options = ( + # RED is by default connected to the Internet + "internet" +); # Define iptables MARKs my $QOS_INC_MASK = 0x0000ff00; @@ -81,6 +84,12 @@ $qossettings{'VALID'} = 'yes'; &General::readhash("${General::swroot}/qos/settings", \%qossettings); +# Default to "conservative +unless (defined $qossettings{'CAKE_PROFILE'}) { + $qossettings{'CAKE_PROFILE'} = "conservative"; +} +push(@cake_options, $qossettings{'CAKE_PROFILE'}); + my $DEF_OUT_MARK = ($qossettings{'DEFCLASS_OUT'} << $QOS_OUT_SHIFT) . "/$QOS_OUT_MASK"; my $DEF_INC_MARK = ($qossettings{'DEFCLASS_INC'} << $QOS_INC_SHIFT) . "/$QOS_INC_MASK"; @@ -200,7 +209,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 $fqcodel_options\n"; + print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'CLASS'} handle $qossettings{'CLASS'}: cake @cake_options\n"; } } print "\n\t### FILTER TRAFFIC INTO CLASSES\n"; @@ -371,7 +380,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 $fqcodel_options\n"; + print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 2:$qossettings{'CLASS'} handle $qossettings{'CLASS'}: cake @cake_options\n"; } } print "\n\t### FILTER TRAFFIC INTO CLASSES\n"; @@ -494,10 +503,7 @@ print </dev/null 2>&1 tc qdisc del dev $qossettings{'RED_DEV'} ingress >/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 del dev $qossettings{'IMQ_DEV'} ingress >/dev/null 2>&1 - tc qdisc add root dev $qossettings{'IMQ_DEV'} fq_codel >/dev/null 2>&1 + INTERFACE="$qossettings{'RED_DEV'}" ACTION="add" /lib/udev/network-aqm &>/dev/null # STOP IMQ-DEVICE ip link set $qossettings{'IMQ_DEV'} down >/dev/null 2>&1 ip link del $qossettings{'IMQ_DEV'} >/dev/null 2>&1 diff --git a/config/rootfiles/common/udev b/config/rootfiles/common/udev index 4a01f3eef..5c1267abe 100644 --- a/config/rootfiles/common/udev +++ b/config/rootfiles/common/udev @@ -31,9 +31,9 @@ lib/udev lib/udev/ata_id lib/udev/cdrom_id lib/udev/collect -lib/udev/enable_codel lib/udev/init-net-rules.sh lib/udev/mtd_probe +lib/udev/network-aqm lib/udev/network-hotplug-bridges lib/udev/network-hotplug-rename lib/udev/network-hotplug-vlan @@ -64,7 +64,7 @@ lib/udev/rules.d/75-probe_mtd.rules lib/udev/rules.d/78-sound-card.rules lib/udev/rules.d/80-drivers.rules lib/udev/rules.d/90-hwrng.rules -lib/udev/rules.d/99-codel.rules +lib/udev/rules.d/99-aqm.rules lib/udev/rules.d/99-offloading.rules lib/udev/scsi_id lib/udev/v4l_id diff --git a/config/udev/99-aqm.rules b/config/udev/99-aqm.rules new file mode 100644 index 000000000..69c909da7 --- /dev/null +++ b/config/udev/99-aqm.rules @@ -0,0 +1,2 @@ +# Call the AQM script +SUBSYSTEM=="net", RUN+="/lib/udev/network-aqm" diff --git a/config/udev/99-codel.rules b/config/udev/99-codel.rules deleted file mode 100644 index d6747ba04..000000000 --- a/config/udev/99-codel.rules +++ /dev/null @@ -1,2 +0,0 @@ -# Call the enable codel script. -SUBSYSTEM=="net", RUN+="/lib/udev/enable_codel" diff --git a/config/udev/enable_codel b/config/udev/network-aqm similarity index 65% rename from config/udev/enable_codel rename to config/udev/network-aqm index 6cafd9b26..d51c6fbde 100644 --- a/config/udev/enable_codel +++ b/config/udev/network-aqm @@ -21,9 +21,9 @@ # # ############################################################################ -LOG_FACILITY="codel" +LOG_FACILITY="aqm" -function log() { +log() { logger -t "${LOG_FACILITY}" $@ } @@ -32,19 +32,58 @@ if [ -z "${INTERFACE}" ]; then exit 1 fi -# Do nothing for the loopback device. -[ "${INTERFACE}" = "lo" ] && exit 0 - case "${ACTION}" in add|register) - # Change root qdisc to use fq_codel. - /sbin/tc qdisc add root dev ${INTERFACE} fq_codel - ret=$? + TYPE="$( $Lang::tr{'cake profile ethernet 38'}, + "ethernet ether-vlan" => $Lang::tr{'cake profile ethernet vlan 42'}, + "raw" => $Lang::tr{'cake profile raw 0'}, + "conservative" => $Lang::tr{'cake profile conservative 48'}, + "docsis" => $Lang::tr{'cake profile docsis 18'}, + "bridged-ptm" => $Lang::tr{'cake profile bridged-ptm 19'}, + "pppoe-ptm" => $Lang::tr{'cake profile pppoe-ptm 27'}, + "pppoe-llcsnap" => $Lang::tr{'cake profile pppoe-llcsnap 40'}, + "pppoe-vcmux" => $Lang::tr{'cake profile pppoe-vcmux 32'}, + "pppoa-llc" => $Lang::tr{'cake profile pppoa-llc 14'}, + "pppoa-vcmux" => $Lang::tr{'cake profile pppoa-vcmux 10'}, + "bridged-llcsnap" => $Lang::tr{'cake profile bridged-llcsnap 32'}, + "bridged-vcmux" => $Lang::tr{'cake profile bridged-vcmux 24'}, + "ipoa-llcsnap" => $Lang::tr{'cake profile ipoa-llcsnap 16'}, + "ipoa-vcmux" => $Lang::tr{'cake profile ipoa-vcmux 8'}, +); &General::readhash("${General::swroot}/qos/settings", \%qossettings); &Header::getcgihash(\%qossettings); @@ -110,6 +128,12 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color); +$selected{'CAKE_PROFILE'} = (); +foreach my $key (keys %CAKE_PROFILES) { + $selected{'CAKE_PROFILE'}{$key} = ''; +} +$selected{'CAKE_PROFILE'}{$qossettings{'CAKE_PROFILE'}} = 'selected'; + &Header::showhttpheaders(); &Header::openpage('QoS', 1, ''); @@ -749,26 +773,69 @@ END sub changebandwidth { &Header::openbox('100%', 'center', $Lang::tr{'bandwidthsettings'}); + if ($qossettings{'ENABLED'} eq 'on') { print "$Lang::tr{'bandwidtherror'}"; print "$Lang::tr{'back'}"; } else { - print < - - - - - - - - -
$Lang::tr{'down and up speed'}
$Lang::tr{'downlink speed'}:

$Lang::tr{'uplink speed'}:
- - $Lang::tr{'template warning'} + print < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
$Lang::tr{'down and up speed'}
$Lang::tr{'downlink speed'}: + +
$Lang::tr{'uplink speed'}: + +
 
$Lang::tr{'link-layer encapsulation'}: +
 
+ + + +
+ + $Lang::tr{'template warning'} END -; } + &Header::closebox(); } diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 2f7038fb1..46092534f 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -529,6 +529,21 @@ 'cached' => 'cached', 'cached memory' => 'Cached Memory ', 'cached swap' => 'Cached Swap', +'cake profile bridged-llcsnap 32' => 'Bridged LLC SNAP (32 bytes)', +'cake profile bridged-ptm 19' => 'Bridged PTM (19 bytes)', +'cake profile bridged-vcmux 24' => 'Bridged VC-MUX (24 bytes)', +'cake profile conservative 48' => 'Conservative (should work on all connections, 48 bytes)', +'cake profile docsis 18' => 'DOCSIS (18 bytes)', +'cake profile ethernet 38' => 'Ethernet (38 bytes)', +'cake profile ethernet vlan 42' => 'Ethernet with VLAN (42 bytes)', +'cake profile ipoa-llcsnap 16' => 'IP over ATM LLC SNAP (16 bytes)', +'cake profile ipoa-vcmux 8' => 'IP over ATM VC-MUX (8 bytes)', +'cake profile pppoa-llc 14' => 'PPPoA LLC (14 bytes)', +'cake profile pppoa-vcmux 10' => 'PPPoA VC-MUX (10 bytes)', +'cake profile pppoe-llcsnap 40' => 'PPPoE LLC SNAP (40 bytes)', +'cake profile pppoe-ptm 27' => 'PPPoE PTM (27 bytes)', +'cake profile pppoe-vcmux 32' => 'PPPoE VC-MUX (32 bytes)', +'cake profile raw 0' => 'Raw (no overhead compensation)', 'calamaris available reports' => 'Available reports', 'calamaris byte unit' => 'Byte unit', 'calamaris create report' => 'Create report', @@ -1596,6 +1611,7 @@ 'length' => 'Length', 'lifetime' => 'Lifetime:', 'line' => 'Line', +'link-layer encapsulation' => 'Link-Layer Encapsulation', 'linkq' => 'Link Quality', 'load printer' => 'Load Printer', 'loaded modules' => 'Loaded modules:', diff --git a/lfs/udev b/lfs/udev index cfad0398b..3f526a3fa 100644 --- a/lfs/udev +++ b/lfs/udev @@ -126,11 +126,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) install -v -m 644 $(DIR_SRC)/config/udev/90-hwrng.rules \ /lib/udev/rules.d - # Install codel rules. - install -v -m 644 $(DIR_SRC)/config/udev/99-codel.rules \ + # Install AQM rules + install -v -m 644 $(DIR_SRC)/config/udev/99-aqm.rules \ /lib/udev/rules.d - install -m 755 $(DIR_SRC)/config/udev/enable_codel \ - /lib/udev/enable_codel + install -m 755 $(DIR_SRC)/config/udev/network-aqm \ + /lib/udev/network-aqm # Install offloading rules install -v -m 644 $(DIR_SRC)/config/udev/99-offloading.rules \