1. 12 Feb, 2024 11 commits
    • Robert Schmidt's avatar
      c33a308d
    • Robert Schmidt's avatar
      Periodically check for stats freeing to prevent assert · 0a1651e4
      Robert Schmidt authored
      Not periodically checking stats freeing can lead to asserts if these
      lists are full. Check it once a frame to ensure that lists remain
      non-empty.
      0a1651e4
    • Robert Schmidt's avatar
      Update some timing stats · f3bba45b
      Robert Schmidt authored
      f3bba45b
    • Robert Schmidt's avatar
      Remove misleading PUSCH decoding · 362bc481
      Robert Schmidt authored
      PUSCH decoding is started multiple times in nr_ulsch_procedures() for
      each ULSCH segment, and stopped once inside
      phy_procedures_gNB_uespec_RX(). Not only is it not clear if that works
      with the API, it also might measure more than just PUSCH decoding.
      
      Remove the PUSCH decoding, it is misleading. Check L1 RX processing
      instead.
      362bc481
    • Robert Schmidt's avatar
      Add 100 MHz 2x2 phytest-timing test · 41802483
      Robert Schmidt authored
      41802483
    • Robert Schmidt's avatar
      CI: phytest-timing: detect deviation from normalized values above/below · 00356767
      Robert Schmidt authored
      The CI would only detect a deviation from the normalized value based on
      a configurable threshold, typically 1.25 (so we would tolerate a 25%
      increase). However, it often happens that a timing gets shorter (e.g.,
      forgot to put the timing measurements). This commit introduces a
      "Deviation Threshold" (smaller than 1) to not only check that we exceed
      1.0 + "Deviation Threshold" (as before), but also that are not below 1.0
      - "Deviation Threshold".
      
      In other words, assuming a maximum divergence of 25%, instead of just
      checking if val > 1.25, we now also check if val < 0.75 (and flag
      error).
      00356767
    • Robert Schmidt's avatar
      Add Slot Indication to monitoring · 6ba87167
      Robert Schmidt authored
      6ba87167
    • Robert Schmidt's avatar
      Add slot indication timing · e9d6081a
      Robert Schmidt authored
      e9d6081a
    • Raymond Knopp's avatar
      Introduce separate thread to handle gNB TX processing · d52b8179
      Raymond Knopp authored
      This commit introduces a separate thread (l1_tx_thread) that processes
      gNB DL/TX slots. It receives a message from the ru_thread when a new
      slot started, and starts processing.
      
      The DL part of the scheduler is run in the l1_tx_thread.  Therefore,
      only call UL indication (for scheduler) in UL slots.  The UL indication
      previously triggered the DL scheduler -- hence, it had to be called in
      every slot. Now, since the DL scheduler is moved into the DL thread, we
      don't have to call the scheduler in every slot anymore.
      
      The reorder thread is removed, as reordering with this scheme is not
      necessary anymore.
      
      The main advantage of this version is that the TX can be scheduled
      earlier (sl_ahead). Further, there can no longer be race conditions in
      the TX path, since the scheduler/L2, TX L1 processing and the RU tx
      function are all execute in the same thread (L1_tX_thread).
      
      Also, the scheduler prepares PRACH/PUSCH/PUCCH FAPI PDUs. As of this
      commit, the scheduler runs in the TX processing chain, whereas these
      PDUs are destined for RX processing.  Thus, too avoid data races,
      instead of triggering the RX processing at the same time as TX
      processing in the RU thread, this commit changes the code to trigger RX
      processing after the scheduler has been run in TX processing to avoid
      data races.
      
      Finally, we synchronize RU and L1 threads. This is important for
      rfsimulator, since unlike most radios, rfsimulator can run slower or
      faster, depending on I/O and CPU (it does not have a stable "tick").
      Co-authored-by: default avatarkiran <saikiran@iitj.ac.in>
      d52b8179
    • Robert Schmidt's avatar
      Remove unused UL_INFO_mutex · fb69d9c6
      Robert Schmidt authored
      The UL_INFO_mutex is used in only one place, and therefore useless.
      Also, the scheduler uses a lock internally to prevent concurrent access.
      Hence, the UL_INFO_mutex is not needed.
      
      Remove kill_gNB_proc(), as it is now dead code.
      fb69d9c6
    • Robert Schmidt's avatar
      Introduce slot indication tick to run (DL) scheduler · 88852dc9
      Robert Schmidt authored
      The next commit introduces a separate gNB TX processing thread. To
      properly separate DL scheduler (for scheduling decisions) from UL
      indication handling (for UL packets), this commit introduces a slot
      indication "tick" to run the DL scheduler which will be put into the gNB
      TX processing chain instead of the UL indication.
      88852dc9
  2. 06 Feb, 2024 5 commits
  3. 05 Feb, 2024 6 commits
  4. 03 Feb, 2024 18 commits
    • Robert Schmidt's avatar
      Send RRC UECapabilityEnquiry after reconfig, trigger UE update if necessary · 4a7d7975
      Robert Schmidt authored
      We used to trigger the UECapabilityEnquiry right after
      SecurityModeComplete, and before the RRCReconfiguration (which we call
      "default" reconfiguration). However, 38.401 tells us that we should send
      the RRCReconfiguration right after the SecurityModeComplete. In fact,
      even though we get the UE capabilities, we cannot use them during this
      reconfiguration, as we would first need to update the DU with a UE
      Context Modification Request, which we cannot, as we just sent the UE
      Context Setup Request, and the DU relies on first getting the
      RRCReconfiguration.
      
      Since we rely on a subsequent reconfiguration anyway, we can safely
      trigger the UECapabilityEnquiry after RRCReconfigurationComplete.
      (38.331 also says we can send UECapabilityEnquiry at any point.)
      
      To cater for the possibility that there might not be any reconfiguration
      coming afterwards, we check if a DRB has been set up. If not, we assume
      a reconfiguration will come, and do not trigger one only for the UE
      capabilities (this is what we do before this commit). If we already have
      DRBs set up, they might have been set up during the "default" RRC
      Reconfiguration, and another reconfiguration might not follow soon; in
      this case, we trigger the reconfiguration by sending the UE capabilities
      to the DU right away.
      4a7d7975
    • Robert Schmidt's avatar
      Delay PDU session resource setup request if necessary · 0f100a6e
      Robert Schmidt authored
      The next commit moves the UE Capability Enquiry after the first
      reconfiguration. This has the effect that for some UEs (e.g., iPhone),
      the Setup Requests come too close to each other, triggering RRC
      Reconfigurations while previous transactions are ongoing.
      
      I think the "true" solution would be to implement some tracking of
      transactions across RRC, F1AP, E1AP, but this might require many
      changes. For the moment, limit to delaying PDU session resource setups
      to prevent above problem. Delaying is done using ITTI timers (to be able
      to serve other UEs), waiting 10ms each time, up to 20 times (to not
      deadlock the transaction -- after all, if the UE is unhappy, it will
      drop the connection).
      0f100a6e
    • Robert Schmidt's avatar
      RRC transaction IDs: clean up · d6dd87ae
      Robert Schmidt authored
      - Put consistently transaction IDs
      - Remove transaction IDs when transaction finished, or in places that do
        not trigger an RRC transaction
      d6dd87ae
    • Robert Schmidt's avatar
      d2cd7c86
    • Robert Schmidt's avatar
      8302a060
    • Robert Schmidt's avatar
      RRC transactions: mark "no action" · 62200cde
      Robert Schmidt authored
      62200cde
    • Robert Schmidt's avatar
      c643abd8
    • Robert Schmidt's avatar
      Implement PDU session estab through NGAP Initial UE Context Setup · 6642b467
      Robert Schmidt authored
      This commit allows the gNB to handle PDU sessions that the core requests
      to setup during the NGAP Initial UE Context Setup. Previously, we only
      managed them as part of PDU Session Resource Setup Request.
      
      The RRC will, depending on whether a PDU session is in the NGAP Initial
      UE Context Setup, either directly trigger the Security Command, or first
      do a bearer setup at the CU-UP. Some asserts have been lifted, as now
      the PDU sessions might be present before the RRC Connection is fully
      established.
      
      Implement the correct forwarding of the bearers in an F1 UE Context
      Setup Request message.
      
      This solves bug #672.
      6642b467
    • Robert Schmidt's avatar
      c818e9b5
    • Robert Schmidt's avatar
      59b69e24
    • Robert Schmidt's avatar
      Simplify RRC DRB handling code · f81ec9c2
      Robert Schmidt authored
      Prior to this commit, the handling of DRBs is complex: first the RRC
      "guessed" a DRB ID when setting up DRBs via E1AP (in
      rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ()), and later chose one for
      real in fill_DRB_Configlist() (called in
      rrc_gNB_generate_dedicatedRRCReconfiguration()).
      
      To simplify, remove fill_DRB_Configlist(), and instead allocate the DRB
      using generateDRB() before sending the message via E1AP, in
      rrc_gNB_generate_dedicatedRRCReconfiguration(). The rest of the logic is
      the same.
      
      For PDU sessions, always mark PDU sessions as "done" to match pdu
      session state logic.
      f81ec9c2
    • Robert Schmidt's avatar
    • Robert Schmidt's avatar
      Provide means to look-up if UE has a CU-UP · 2800203e
      Robert Schmidt authored
      It might happen that a UE has no CU-UP (e.g., never requested a PDU
      session). When triggering a release, we previously and implicitly
      associated a CU-UP in that case. That is not good, and confusing.
      
      This commit adds a function to look up if the UE has an associated
      CU-UP. We only send a release if it is the case.
      
      The function get_existing_cuup_for_ue() now instead verifies that a
      CU-UP exist, and does not implicitly create an association (which might
      be unwanted, see above).
      2800203e
    • Robert Schmidt's avatar
      4c7080ec
    • Robert Schmidt's avatar
      E1 bearer ctxt setup handler: correct AssertFatal() · ce4ec296
      Robert Schmidt authored
      The number of tunnels corresponds to number of DRBs, so correctly
      compare tunnels and DRBs.
      ce4ec296
    • Robert Schmidt's avatar
      Remove unused variables · 2494a7bc
      Robert Schmidt authored
      2494a7bc
    • Robert Schmidt's avatar
      Remove unused variables in RRC · 5258acbf
      Robert Schmidt authored
      5258acbf
    • Robert Schmidt's avatar
      Remove superfluous function, rename variable · d5257ca8
      Robert Schmidt authored
      The function rrc_gNB_process_RRCReconfigurationComplete() does almost
      nothing, we can delete it.
      
      The variable name ue_reconfiguration_after_reestablishment_counter is
      misleading, as it counts all reconfigurations; rename to make it clear.
      d5257ca8