Refactor SDAP adaptation work for QoS
This MR is an adaptation of the code introduced in !2703 (closed).
The goal is a cleanup and functional refactor of the SDAP/PDCP integration, that is:
- centralize SDAP configuration logic
- simplify entity creation
- improve robustness of role-based SDAP handling
- prepare the codebase for clean support of DRB reconfiguration and teardown flows
Namely:
- New
sdap_config_tandget_sdap_Config()
- Introduced an internal struct
sdap_config_tto abstract SDAP config input - Centralized SDAP config parsing into new
get_sdap_Config()function that translates ASN.1NR_SDAP_Configinto this internal representation. This is called during RRC triggered (re)configuration procedures. - Enable mapping of number of QoS flows > 1
- Unified role handling with bitmasks
- Added a bitmask-based
entity_rolefield to track SDAP directions:SDAP_UL_RX, SDAP_UL_TX, SDAP_DL_RX, SDAP_DL_TX: header presence was determined by simple direction (UE vs gNB) and individualis_sdap_rx/tx()checks, howevernr_sdap_rx_entitybehaves differently depending on the direction of the RX entity (DL/UL), therefore this change can help enable a more accurate SDAP header handling across directions and node types. - Replaces old helpers
is_sdap_rx()/is_sdap_tx()with internal checks against the role bitfield - QFI-to-DRB mapping is now annotated with direction for both data and control PDUs
- Simplified DRB and SDAP setup
-
add_drb()in PDCP API now delegates SDAP config processing cleanly -
new_nr_sdap_entity()is used consistently to register a fresh SDAP context for the UE and PDU session.- Also, re-use and reconfigure existing SDAP entity if already exists.
- logging has been added to trace mapped QFIs from RRC and resulting table entries
- Improved QFI-to-DRB management
- Refactored
nr_sdap_qfi2drb_map_update()to register QFIs based on parsed config - Ensures control PDUs are correctly routed even after reconfiguration
- Extended
nr_sdap_ue_qfi2drb_config: perform UL QoS flow to DRB mapping configuration for a SDAP entity has already been established according to TS 37.324, 5.3 QoS flow to DRB Mapping, 5.3.1 Configuration Procedures. Handle both UL QoS Flows mapping rules to add and to remove. QFIs will now be properly unmapped if specified viamappedQoS_FlowsToRelease, this might prevent stale QFI mappings from being used incorrectly. -
nr_sdap_qfi2drb()andsdap_map_ctrl_pdu()now strictly fallback todefault_drbonly if a QFI mapping is missing. Missing default DRB now triggersLOG_E()(previously silent or misrouted to DRB 0).
5 Other cleanup
- Remove dependencies from legacy
rb_id_t