From 366cc4c8e719d793fb73f542c809c0284dbef7f1 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Wed, 5 Jun 2024 10:45:00 +0200 Subject: [PATCH] board/common: Disable priority reclassification when forwarding IPv4 By default, Linux will map an IP packet's TOS field into skb->priority when acting as a router. Unfortunately this is only globally configurable (per network namespace), which leaves us with the following dilemma: If we keep reclassification enabled, then a setup like this... vlan1 vlan2 \ / br0 / \ e1 e2 ...would likely not work as expected because any priority information from hardware, that might be mapped to skb->priority via vlan1's ingress-qos-map, would then be replaced by the standard TOS-mapping on the routing boundary. On the other hand, if we disable reclassification, then we won't be able to source priority information from the TOS field when no other source is available, as is the case when the source interface is a regular NIC. Given that the primary use-case is to run on switchdev ports, we will most likely always have priority information available from hardware, which is why we opt to disable the reclassification. If this ever becomes configurable per interface, then we could open up the configuration to let users define the policy of which layer's priority should take precedence. --- board/common/rootfs/etc/sysctl.d/forwarding.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/board/common/rootfs/etc/sysctl.d/forwarding.conf b/board/common/rootfs/etc/sysctl.d/forwarding.conf index c24ade96..c939635d 100644 --- a/board/common/rootfs/etc/sysctl.d/forwarding.conf +++ b/board/common/rootfs/etc/sysctl.d/forwarding.conf @@ -1,2 +1,3 @@ net.ipv4.ip_forward=1 +net.ipv4.ip_forward_update_priority=0 net.ipv6.conf.all.forwarding=1