From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: [RFC PATCH 1/8] AQM: Use CAKE as default qdisc where appropriate instead of fq_codel
Date: Thu, 02 Dec 2021 12:37:41 +0000 [thread overview]
Message-ID: <20211202123748.2525617-1-michael.tremer@ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2438 bytes --]
This script configures CAKE as default qdisc where appropriate:
* It is not suitable to use any queue management on bridges/GRE/VTI/tun
interfaces.
* On Internet-facing interfaces, CAKE is configured in "internet" mode
whereas on any zones except RED, it is configured in "metro" mode
Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
config/udev/enable_codel | 65 ++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 13 deletions(-)
diff --git a/config/udev/enable_codel b/config/udev/enable_codel
index 6cafd9b26..3ef9b0f59 100644
--- a/config/udev/enable_codel
+++ b/config/udev/enable_codel
@@ -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=$?
-
- if [ ${ret} -eq 0 ]; then
- log "Codel AQM has been enabled on '${INTERFACE}'."
- else
- log "Codel AQM could not be enabled on '${INTERFACE}'. Error code: ${ret}"
+ TYPE="$(</sys/class/net/${INTERFACE}/type)"
+
+ # Detect bridges
+ if [ -d "/sys/class/net/${INTERFACE}/bridge" ]; then
+ TYPE="bridge"
+ fi
+
+ args=()
+
+ # Configure some useful defaults depending on the interface
+ case "${INTERFACE},${TYPE}" in
+ # Ignore loopback
+ lo,*)
+ exit 0
+ ;;
+
+ # Ignore tun
+ tun*)
+ exit 0
+ ;;
+
+ # Ignore GRE/VTI
+ *,778|*,768)
+ exit 0
+ ;;
+
+ # Ignore bridges
+ *,bridge)
+ exit 0
+ ;;
+
+ # Handle RED PPPoE (default to VDSL2)
+ ppp*,512)
+ args+=( "cake" "internet" "pppoe-ptm" "ack-filter" )
+ ;;
+
+ # Treat any other interfaces as "Ethernet"
+ red*,*)
+ args+=( "cake" "internet" "ethernet" )
+ ;;
+
+ # All other interfaces are locally connected
+ *)
+ args+=( "cake" "ethernet" "metro" )
+ ;;
+ esac
+
+ # Change root qdisc to use cake
+ if ! tc qdisc replace root dev "${INTERFACE}" "${args[@]}"; then
+ log "Could not configure qdisc on ${INTERFACE} with parameters ${args[@]}"
exit ${ret}
fi
;;
--
2.30.2
next reply other threads:[~2021-12-02 12:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-02 12:37 Michael Tremer [this message]
2021-12-02 12:37 ` [RFC PATCH 2/8] udev: Rename enable_codel to network-aqm Michael Tremer
2021-12-02 12:37 ` [RFC PATCH 3/8] QoS: Replace fq_codel by CAKE Michael Tremer
2021-12-02 12:37 ` [RFC PATCH 4/8] network-hotplug-bridges: Fix warning when address doesn't exist Michael Tremer
2021-12-02 12:37 ` [RFC PATCH 5/8] qos.cgi: Reindent change bandwidth window Michael Tremer
2021-12-02 12:37 ` [RFC PATCH 6/8] qos.cgi: Add control to change link-layer encapsulation Michael Tremer
2021-12-02 12:37 ` [RFC PATCH 7/8] network-aqm: Use "conservative" setting for all PPP connections Michael Tremer
2021-12-02 12:37 ` [RFC PATCH 8/8] QoS: Add CAKE profile to commmand line Michael Tremer
2021-12-02 12:42 ` [RFC PATCH 1/8] AQM: Use CAKE as default qdisc where appropriate instead of fq_codel Michael Tremer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211202123748.2525617-1-michael.tremer@ipfire.org \
--to=michael.tremer@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox