Skip to contentSkip to conversation

wifi: cfg80211: map LE DSCP to UP 1

PATCH New Nick Hainke 1 participant 1 message Oct 16 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: cfg80211: map LE DSCP to UP 1

RFC 8622 [1] updates RFC 8325 [2] and recommends to map Low-Priority Data marked with the Lower Effort DSCP (LE, 000001, 1) to User Priority 1 and AC_BK (Background), the same as the legacy CS1 marking.

cfg80211_classify8021d() takes the three most significant bits of the DSCP as User Priority and corrects some DSCP values in a switch statement afterwards. LE is not handled there. For LE the DS field without the ECN bits is 0x04, so:

ret = dscp >> 5; /* 0x04 >> 5 = 0 */
switch (dscp >> 2) /* 0x04 >> 2 = 1, no case for 1 */

As a result, LE ends up in User Priority 0 and AC_BE (Best Effort) instead of User Priority 1 and AC_BK. Add a case for LE to the switch statement.

OpenWrt already sets a QoS Map by default that maps LE to User Priority 1 [3].

[1] https://www.rfc-editor.org/rfc/rfc8622#section-11
[2] https://www.rfc-editor.org/rfc/rfc8325#section-4.2.10
[3] https://github.com/openwrt/openwrt/commit/a5e3def18224

Fixes 6fdb8b8781d5 ("wifi: cfg80211: Update the default DSCP-to-UP mapping")
Assisted-by Claude:claude-opus-5-5
---
 net/wireless/util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/wireless/util.c +5 -1
index 59912f4a93c8..3f8648b94179 100644
@@ -1154,13 +1154,17 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb,
 	 * value. See section 4 in RFC8325. Specifically, for the following
 	 * Diffserv Service Classes no update is needed:
 	 * - Standard: DF
-	 * - Low Priority Data: CS1
+	 * - Low Priority Data: CS1 (legacy)
 	 * - Multimedia Conferencing: AF41, AF42, AF43
 	 * - Network Control Traffic: CS7
 	 * - Real-Time Interactive: CS4
 	 * - Signaling: CS5
 	 */
 	switch (dscp >> 2) {
+	case 1:
+		/* Low Priority Data: LE, see section 11 in RFC8622 */
+		ret = 1;
+		break;
 	case 10:
 	case 12:
 	case 14:
Signature · 1 line
2.56.0