]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: cfg80211: Update the default DSCP-to-UP mapping
authorIlan Peer <ilan.peer@intel.com>
Mon, 18 Dec 2023 09:30:05 +0000 (11:30 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 3 Jan 2024 14:35:26 +0000 (15:35 +0100)
The default DSCP-to-UP mapping method defined in RFC8325
applied to packets marked per recommendations in RFC4594 and
destined to 802.11 WLAN clients will yield a number of inconsistent
QoS mappings.

To handle this, modify the mapping of specific DSCP values for
which the default mapping will create inconsistencies, based on
the recommendations in section 4 in RFC8325.

Note: RFC8235 is used as it referenced by both IEEE802.11Revme_D4.0
and WFA QoS Management Specification.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231218093005.3064013-1-ilan.peer@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/util.c

index 626b858b4b35c5a93e343b9a2ee1a19649a9672f..d1ce3bee279735c5c9aa45cf5d0db68ecf8b9418 100644 (file)
@@ -980,7 +980,63 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb,
                }
        }
 
+       /* The default mapping as defined Section 2.3 in RFC8325: The three
+        * Most Significant Bits (MSBs) of the DSCP are used as the
+        * corresponding L2 markings.
+        */
        ret = dscp >> 5;
+
+       /* Handle specific DSCP values for which the default mapping (as
+        * described above) doesn't adhere to the intended usage of the DSCP
+        * value. See section 4 in RFC8325. Specifically, for the following
+        * Diffserv Service Classes no update is needed:
+        * - Standard: DF
+        * - Low Priority Data: CS1
+        * - Multimedia Streaming: AF31, AF32, AF33
+        * - Multimedia Conferencing: AF41, AF42, AF43
+        * - Network Control Traffic: CS7
+        * - Real-Time Interactive: CS4
+        */
+       switch (dscp >> 2) {
+       case 10:
+       case 12:
+       case 14:
+               /* High throughput data: AF11, AF12, AF13 */
+               ret = 0;
+               break;
+       case 16:
+               /* Operations, Administration, and Maintenance and Provisioning:
+                * CS2
+                */
+               ret = 0;
+               break;
+       case 18:
+       case 20:
+       case 22:
+               /* Low latency data: AF21, AF22, AF23 */
+               ret = 3;
+               break;
+       case 24:
+               /* Broadcasting video: CS3 */
+               ret = 4;
+               break;
+       case 40:
+               /* Signaling: CS5 */
+               ret = 5;
+               break;
+       case 44:
+               /* Voice Admit: VA */
+               ret = 6;
+               break;
+       case 46:
+               /* Telephony traffic: EF */
+               ret = 6;
+               break;
+       case 48:
+               /* Network Control Traffic: CS6 */
+               ret = 7;
+               break;
+       }
 out:
        return array_index_nospec(ret, IEEE80211_NUM_TIDS);
 }