1. 16 Dec, 2024 40 commits
    • Robert Schmidt's avatar
      Merge remote-tracking branch 'origin/telnet-o1' into integration_2024_w50 (!3125) · 0d4c7364
      Robert Schmidt authored
      Add support for O1 in O-DU via telnet
      
      This change set adds a simple telnet interface to nr-softmodem. Together
      with oai/o1-adapter>, this implements a part of the O1 interface, for
      the DU only. Currently supported uses cases:
      
      - some stats are send to an SMO (such as bandwidth, PLMN, frequency, ...)
      - re-configuration of bandwidth, frequency
      - stop/start of the softmodem, while keeping the CU and L2 running
      - the o1-adapter implements two alarms, load overload and base station
        offline, using this interface.
      
      It is possible to use the telnet interface by itself (i.e., "o1" without
      the o1-adapter). To do this, compile with telnet support (./build_oai
      --build-lib telnetsrv) and start the nr-softmodem with O1 module
      (./nr-softmodem --telnetsrv --telnetsrv.shrmod o1). You can then do the
      following:
      
      - see some statistics as exposed to o1-adapter, in JSON: echo o1 stats | nc 127.0.0.1 9090 && echo
      - stop the L1: echo o1 stop_modem | nc 127.0.0.1 9090 && echo
      - reconfigure bandwidth: e.g., echo o1 bwconfig 20 | nc 127.0.0.1 9090 && echo (also supported: 40, 60, 100)
      - start the L1: echo o1 start_modem | nc 127.0.0.1 9090 && echo
      
      Note that the reconfiguration works with split-8 radios. Notably, it
      does not work yet out-of-the-box with 7.2 radios, because they have to
      be manually reconfigured on bandwith/frequency switch. The planned
      M-plane should allow such use case, though.
      
      To help with the above, this branch also includes fixes (for more
      information, refer to the corresponding commits):
      
      - fixes for stopping the L1, notably stop threads in right order, stop
        thread pool of RU
      - collect some general MAC metrics, fix some bugs in MAC
      - fix problems in F1AP gNB-DU configuration update message, update test
      - fix some problems in RRC
      0d4c7364
    • sagar arora's avatar
      Add telnet (O1) support modules in gNB image · 59e6a33d
      sagar arora authored
      59e6a33d
    • Robert Schmidt's avatar
      Do not free inside gnb_du_configuration_update_f1ap() · bcba876f
      Robert Schmidt authored
      The consumer of this function just passes a pointer to something to be
      sent. This function should not free this memory, it's simply not it's
      task. This is the same bug as above in
      "CU_handle_gNB_DU_CONFIGURATION_UPDATE(): don't free the message of RRC"
      bcba876f
    • Robert Schmidt's avatar
      70a746a4
    • Ronak Kanthaliya's avatar
      c71c9de9
    • Robert Schmidt's avatar
      Add basic O1 telnet module · aba506e5
      Robert Schmidt authored
      This adds a basic telnet module to support the O1 interface at the DU,
      to be used together with the oai/o1-adapter>. Concretely, this first
      version supports to
      
      - read/modify cell parameters
      - stop/start the L1
      aba506e5
    • Robert Schmidt's avatar
      Implement start_L1L2() · 68ae3ea1
      Robert Schmidt authored
      Implements the re-start of the L1 after it has been stopped through
      stop_L1(). It takes into account some changes, such as bandwidth, or
      frequency, when restarting the L1. To this end, it also triggers a
      gNB-DU configuration update message on each restart to inform the CU
      about any changes in the DU. FDD has not been tested.
      68ae3ea1
    • Robert Schmidt's avatar
      Refactor code to stop L1 · 8e32f566
      Robert Schmidt authored
      Refactor L1 stopping code into a function. The function is basically the
      same as what we were doing at the end of main() of nr-softmodem.c.
      
      This will be reused to support the "soft-restart" functionality in the
      next commits.
      8e32f566
    • Robert Schmidt's avatar
      Expose F1 primitives for next commits · 511b5f8e
      Robert Schmidt authored
      Need to proper forward declaration, as we otherwise need to make
      telnet_o1 module dependent on F1.  Make functions publicly accessible,
      as the F1 functions are used in an upcoming commit to start the L1.
      511b5f8e
    • Robert Schmidt's avatar
      Upon RRC exit: stop ongoing timer · 0c24f1ff
      Robert Schmidt authored
      0c24f1ff
    • Robert Schmidt's avatar
      Keep track of number of RUs in L1 · 5f01cf6f
      Robert Schmidt authored
      Need to keep track of number of RUs, as the RU initialization increments
      the number of RUs. Therefore, subsequent initializations would fail if
      we don't decrement first. There is no better place (or I did not find
      it) to decrement the number of RUs than in nr_phy_free_RU(). For this
      reason, we also have to manually set the number of RUs in nr_prachsim to
      1, otherwise the assert will trigger.
      5f01cf6f
    • Robert Schmidt's avatar
      CU_handle_gNB_DU_CONFIGURATION_UPDATE(): don't free the message of RRC · 6b852a6f
      Robert Schmidt authored
      The message is already freed at reception at RRC.
      6b852a6f
    • Robert Schmidt's avatar
    • Robert Schmidt's avatar
      3e63f1da
    • Robert Schmidt's avatar
    • Robert Schmidt's avatar
      3e8636ce
    • Robert Schmidt's avatar
      Properly implement eq/cp() functions of gNB-DU config update, fix test · adbbbaea
      Robert Schmidt authored
      Implement those functions following more closely 38.473, i.e., check all
      mandatory fields. Add mandatory fields in the test.
      adbbbaea
    • Robert Schmidt's avatar
      Use PLMNID_TO_MCC_MNC() to decode PLMN ID · 509cc8cc
      Robert Schmidt authored
      509cc8cc
    • Robert Schmidt's avatar
      Fix eq_f1ap_cell_info(): correct TAC comparison · 3de8a746
      Robert Schmidt authored
      Check that both a->tac/b->tac are present, or both not present. Then,
      check they are equal if present.
      3de8a746
    • Robert Schmidt's avatar
      eq_f1ap_sys_info(): correct check · 6b7055bb
      Robert Schmidt authored
      a and b can only be equal if both NULL or both set (and all fields the
      same). Check for this.
      6b7055bb
    • Robert Schmidt's avatar
      F1: refactor out served_cell_info/du system info · ed876a53
      Robert Schmidt authored
      Split out these functions, to be reused in a follow-up commit to
      correctly have gNB-DU configuration update message working.
      
      Change the return type copy_f1ap_served_cell_info(), to return the copy,
      which IMO is more intuitive then passing target and source in
      parentheses.
      ed876a53
    • Robert Schmidt's avatar
      nr_rrc_config_ul_tda(): ensure not double initialization · c852d933
      Robert Schmidt authored
      For the "restart" feature, earlier versions where creating multiple UL
      TDA. This is not a problem (anymore), but to avoid that we call this
      multiple times, add this assert.
      c852d933
    • Robert Schmidt's avatar
      rrc_gNB_du.c: avoid potential double-free · 3c94b9a1
      Robert Schmidt authored
      Set pointer to NULL when freeing to avoid potential double frees.
      3c94b9a1
    • Robert Schmidt's avatar
    • Robert Schmidt's avatar
      RLF: avoid encoder problem · 462d1a6a
      Robert Schmidt authored
      462d1a6a
    • Robert Schmidt's avatar
      UL ref sequences: prevent double-initialization · 5600316d
      Robert Schmidt authored
      The existing code prevents double initialization if e.g., both gNB&UE
      call these functions (like in a simulator). However, in the case of a
      double-initialization such as stopping and re-starting the L1, the
      memory will be freed, but not freed again. Basically, this works:
      
          generate()
          generate() # not initialized again
      
      but this leads to problems:
      
          generate()
          free()
          generate() # not initialized again, but should be!
      
      Reimplement the check based on the data to be initialized, such that an
      intermediate free() will be handled properly.
      5600316d
    • Robert Schmidt's avatar
      Stop L1_rx_thread/L1_tx_thread first · 70b46110
      Robert Schmidt authored
      These are the "main" worker threads (apart the ru_thread). If the
      thread-pool stops, they might get stuck. E.g., in PUSCH channel
      estimation, it uses a local response queue, and if the thread pool is
      terminated, it seems that the L1_rx_thread can get stuck in there.
      
      To limit these problems, attempt to stop these threads first; stop the
      queue from which they read and make them terminate; then, stop the
      thread pool.
      
      Also, fix the termination of respPuschSymb queue.
      70b46110
    • Robert Schmidt's avatar
      3361db1a
    • Robert Schmidt's avatar
      config module: check that memory is enough, allow more restarts · a7d0e609
      Robert Schmidt authored
      A later commit implements the "restart" of the L1. The L1 reads
      configuration options. First, allow to re-read configurations by
      increasing the amount of memory the config module might allocate. Then,
      avoid an out-of-bound write by checking that we still have memory
      available (and assert if not possible).
      a7d0e609
    • Robert Schmidt's avatar
      fixup: there is no init_gNB_afterRU() · 6330bfe0
      Robert Schmidt authored
      6330bfe0
    • Robert Schmidt's avatar
      f804a355
    • Robert Schmidt's avatar
      NR MAC: save total/used PRBs aggregate · c80821e5
      Robert Schmidt authored
      c80821e5
    • Robert Schmidt's avatar
      Msg4 RNTI not found: abort RA · 5785bc18
      Robert Schmidt authored
      5785bc18
    • Robert Schmidt's avatar
      Merge remote-tracking branch 'origin/ldpc_decoding_module_interface_rework'... · a2613d56
      Robert Schmidt authored
      Merge remote-tracking branch 'origin/ldpc_decoding_module_interface_rework' into integration_2024_w50 (2952)
      
      New LDPC coding library interface for decoding and encoding complete slots in one call to the library
      
      Previous attempts to integrate LDPC decoding relying on offloading show
      the limitation of the original code segment coding interface for the
      library implementing LDPC coding. In order to perform the offload and
      therefore the decoding in an optimal fashion, it is relevant to provide
      the implementation with the broader amount of data possible per call,
      which is a slot.  A previous MR related to T2 offload managed to offer
      an interface for decoding transport blocks by modifying only
      nr_ulsch_decoding.c. But this may not be sufficient for performing an
      efficient decoding in any situation. Slots could be shared between
      multiple transport blocks in case multiple UEs are connected to the RAN,
      which makes the transport block size shrink and therefore degrades the
      efficiency of the offloading.
      
      This MR offers a broader interface with a gNB decoding entry point in
      phy_procedures_nr_gNB.c. The file nr_ulsch_decoding.c now lets the
      decoding library implement deinterleaving, rate-unmatching and decoding
      for the slot. In gNB encoding and UE decoding and encoding as well,
      tasks are partitioned in a similar fashion.
      
      As it allows to feed the implementation with the broadest amount of data
      possible, it allows to fit any coding solution in a library. This will
      avoid further modification to OAI source code and addition of options to
      select an implementation when integrating new decoding solutions. An
      implementation of this interface will therefore be offered for every
      existing decoding solution in OAI and solutions added in the future will
      be provided as independent module code without any modification to the
      core of OAI code.  The way to choose the decoding solution and to
      configure it was also unified using configmodule. The library can be
      chosen through the option --loader.ldpc.shlibversion. The slot coding
      solutions shipped with this MR can be configured through configmodule
      (e.g., T2 address and isolated cores).
      
      This MR includes three coding implementations:
      
      - A wrapper around segment decoding libraries for test purpose: libldpc.so
      - A one shot slot coding and encoding with the T2 board: libldpc_t2.so
      - A decoder on FPGA using the XDMA driver: libldpc_xdma.so
      
      Improvements brought by this MR:
      
      - Easy integration of a wider variety of LDPC coding solution at gNB and UE
      - Easy selection of the LDPC coding solution (option --ldpc-offload-enable is kept for now but it can be ultimately removed)
      - T2:
        * More efficient when many UEs are connected
        * Decoding and encoding in nr-uesoftmodem
      a2613d56
    • Robert Schmidt's avatar
      Merge remote-tracking branch 'origin/NGAP-FAILMESSAGE' into integration_2024_w50 (!3163) · deba36a5
      Robert Schmidt authored
      NGAP-Initial Context Setup Failure
      
      NGAP Failure message - Initial Context Setup Failure.  When an Initial
      Context Setup Request is received with the UE context as null, it
      triggers Initial Context Setup failure
      deba36a5
    • Robert Schmidt's avatar
      Merge remote-tracking branch 'origin/build-rocky9.5' into integration_2024_w50 (!3162) · e5622f44
      Robert Schmidt authored
      Add Rocky 9.5 to list of distributions
      e5622f44
    • Robert Schmidt's avatar
      Merge remote-tracking branch 'origin/sib19-ue-utilization' into integration_2024_w50 (!3019) · 0b78a18d
      Robert Schmidt authored
      SIB19 utilization on UE
      
      Following SIB19 initialization and scheduling on gNB (!2899 - merged)
      and Receive SIB19 on nrUE (!2920 - merged), this merge request aims to
      introduce the actual use of the SIB19 provided parameters by gNB in UE.
      Changes needed for utilization include: initialization of position
      coordinates parameters for UE (which are needed to calculate propagation
      delay between UE and SAT), propagation delay calculations and timing
      advance adjusts. Moreover, this change removes the now unused arguments
      for ntn_koffset, ntn_ta_common and ntn_ta_commondrift
      0b78a18d
    • Robert Schmidt's avatar
      Merge remote-tracking branch 'origin/fhi-72-hotfixes' into integration_2024_w50 (!3160) · a8a79469
      Robert Schmidt authored
      FHI-72: initialize mask, find correct libxran
      
      See commits for more information
      a8a79469
    • Robert Schmidt's avatar
      Merge remote-tracking branch 'origin/gtpv1u-data-no-itti' into integration_2024_w50 (!3158) · 85440e2d
      Robert Schmidt authored
      GTP: use direct call instead of ITTI
      
      Using ITTI calls for user plane implies (1) a memory allocation, (2)
      mutexes, and (3) queueing messages for each user plane packet, which is
      heavy. Use a direct API call instead to reduce overhead.
      85440e2d
    • Romain Beurdouche's avatar
      Simplify segment decoder and encoder interfaces · 7bf6f3f2
      Romain Beurdouche authored
      More complex implementations will be achieved using the new reworked interface
      
      - t_nrLDPC_dec_params: remove F, Qm, rv and perCB
      - encoder_implemparams_t: remove Qm, Tbslbrm, G, rv and perCB
      7bf6f3f2