Skip to content

fix(NR_MAC): fix BWP mismatches during F1/N2 handover with dedicated BWP#276

Open
safwan2mo wants to merge 1 commit into
duranta-project:developfrom
safwan2mo:fix/n2ho-dedicated-bwp
Open

fix(NR_MAC): fix BWP mismatches during F1/N2 handover with dedicated BWP#276
safwan2mo wants to merge 1 commit into
duranta-project:developfrom
safwan2mo:fix/n2ho-dedicated-bwp

Conversation

@safwan2mo

@safwan2mo safwan2mo commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #96

N2-based handover fails when one or both gNBs are configured with a dedicated BWP (first_active_bwp = 1). Three distinct issues are addressed:

gNB (target):

  • UE->local_bwp_id was not initialized in the SA path of create_new_UE(), so configure_UE_BWP() always resolved to BWP0 and dereferenced a NULL initialDownlinkBWP (absent when first_active_bwp != 0).
  • The RA BWP0 fallback also overwrote local_bwp_id, causing the post-CFRA scheduling call to resolve the wrong BWP.
  • bwpd/ubwpd dereferences are additionally guarded against NULL.

UE:

  • After switching to BWP0 for PRACH (TS 38.321 §5.15 — active UL BWP has no rach_ConfigCommon), the UE was not restoring the configured BWP on CFRA success. The UE stayed on BWP0 while the gNB resumed scheduling on the configured BWP, causing mutual deafness and repeated re-establishment.

Note for reviewers:

  • These fixes have only been validated for F1 and N2-based handover (inter-gNB, AMF as anchor).
  • Additionally, the CFRA BWP restore and the local_bwp_id save/restore around the RA fallback should be reviewed for full spec compliance. The current changes are confirmed working for the dedicated BWP scenario in RFSIM.

gNB side:
- Set UE->local_bwp_id in create_new_UE() SA path from radio_config, fixing
  a NULL dereference in configure_UE_BWP() when first_active_bwp != 0 and
  initialDownlinkBWP is absent from the serving cell dedicated config
- Guard bwpd/ubwpd dereferences in configure_UE_BWP() against NULL for
  configurations where initialDownlinkBWP/initialUplinkBWP are not present
- Save and restore UE->local_bwp_id across the RA BWP0 fallback call in
  configure_UE_BWP() so the post-CFRA scheduling call resolves the correct
  configured BWP rather than the temporary RA BWP

UE side:
- Save active BWP IDs before the PRACH BWP switch in init_RA() and restore
  them after CFRA success in nr_ra_succeeded(), so the UE resumes PDCCH
  monitoring and SR transmission on the configured BWP instead of staying
  on the BWP0 used for PRACH
@rorsc rorsc requested a review from francescomani July 7, 2026 08:35
@rorsc rorsc added the nrUE Run only 5G UE tests (physims included, LDPC tests excluded). label Jul 7, 2026
@safwan2mo safwan2mo changed the title fix(NR_MAC): fix BWP mismatches during N2 handover with dedicated BWP fix(NR_MAC): fix BWP mismatches during F1/N2 handover with dedicated BWP Jul 7, 2026
@rorsc rorsc added 5G-NR Perform 5G Tests retrigger-ci Re-run CI and removed nrUE Run only 5G UE tests (physims included, LDPC tests excluded). labels Jul 8, 2026
@github-actions github-actions Bot removed the retrigger-ci Re-run CI label Jul 8, 2026
@durantabot

Copy link
Copy Markdown
Collaborator

@francescomani

Copy link
Copy Markdown
Collaborator

The current changes are confirmed working for the dedicated BWP scenario in RFSIM

What about COTS UE? Did you test it?

@safwan2mo

safwan2mo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

The current changes are confirmed working for the dedicated BWP scenario in RFSIM

What about COTS UE? Did you test it?

No, trying to find a way to test this with COTS UE as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5G-NR Perform 5G Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handover with dedicated BWP configured [Migrated Issue #1040]

4 participants