Compare commits

...

229 Commits

Author SHA1 Message Date
Arash Sahbafard
909f925541 Iterate Over All configured PLMNs 2025-07-03 16:37:11 +02:00
Jaroslava Fiedlerova
a3b9db2022 Merge branch 'integration_2025_w26' into 'develop'
Integration: `2025.w26`

See merge request oai/openairinterface5g!3493

* !3435 Cleanup PDU Session Handling in RRC/NGAP
* !3371 Add NAS Authentication Reject enc/dec library and unit test
* !3490 nr pdcp security: add a 'decipher' API function
* !3477 CI: Upgrade Aerial version to 25-1
* !3491 Fix Msg3 with MAC CE for C-RNTI and RRCReestablishmentComplete
2025-06-26 15:19:26 +00:00
Jaroslava Fiedlerova
99eb6c726c Merge remote-tracking branch 'origin/Msg3_C-RNTI_RRCReestablishmentComplete' into integration_2025_w26 (!3491)
Fix Msg3 with MAC CE for C-RNTI and RRCReestablishmentComplete

- Only trigger RRCReconfiguration if UE is not performing RRCReestablishment
- The RRCReconfiguration will be triggered by the RRCReestablishmentComplete

Since this MR fixes a regression, additional info can be found in the following
closed issues and merged MR:
- #687 (closed)
- #747 (closed)
- !2600 (merged)
2025-06-25 22:33:21 +02:00
Jaroslava Fiedlerova
c22e7d22c4 Merge remote-tracking branch 'origin/aerial-25_1' into integration_2025_w26 (!3477)
CI: Upgrade Aerial version to 25-1

- Update the Nvidia L1 (cuBB) from version 24-3 to 25-1
- Decrease the number of cores dedicated to the OAI gNB; testing showed
  it does not need that many
2025-06-25 12:59:54 +02:00
Jaroslava Fiedlerova
8db35e468d Merge remote-tracking branch 'origin/cleanup-pdu-session' into integration_2025_w26 (!3435)
Cleanup PDU Session Handling in RRC/NGAP

Currently, NGAP and RRC share the same structures and responsibilities when
handling PDU Session information: this creates tight coupling, redundancy, and
makes the code harder to maintain.

- NGAP should be responsible only for: Protocol-specific encoding/decoding
(3GPP TS 38.413)
- RRC should own: PDU Session handling and storage in the UE context

This MR is the first step in a broader refactoring of the PDU Session handling
code across NGAP and RRC layers, with the goal of splitting responsibilities
cleanly between both modules.

- Unified gtpu_tunnel_t for tunnel endpoint config (formerly f1u_tunnel_t)
- Refactored and relocated PDU Session struct definitions for better separation
  between NGAP and RRC
  - Moved pdusession_t for PDU Session handling out of NGAP, now defined and
    managed by RRC only
  - Defined 3GPP TS 38.413 message-specific structs in NGAP module
  - NGAP now decodes NGAP PDU Session Resource Setup/Modify IEs and transfers
    decoded data to RRC via ITTI
  - Add helper functions to copy from NGAP message to pdusession_t
- Introduced new encoders/decoders/helpers in NGAP for handling PDU Session
  Resource Setup/Modify procedures (e.g. decode_pdusession_transfer)
  - Migrated to NGAP and removed duplicated logic for QoS information decoding
    (fill_qos)
- Improved logging of GTP tunnel info
- Merged redundant functions (f1u_dl_gtp_update and f1u_ul_gtp_update)
- Removed unused code and obsolete types
- do free_func in seq_arr_erase_it on the provided range and updated unit test
- Other fixes and simplifications (e.g. simplified and clarified naming of
  tunnel/session parameters and structs)

This cleanup improves code readability, has a high code churn (the deletions are
~159.7% of the insertions) and prepares for better modularity before the
refactoring of PDU Session handling in RRC/NGAP.
2025-06-23 15:55:57 +02:00
Jaroslava Fiedlerova
472480f6fe Merge remote-tracking branch 'origin/pdcp-decipher-api' into integration_2025_w26 (!3490)
nr pdcp security: add a 'decipher' API function

May be needed for new algorithms where ciphering and deciphering are different
operations.
2025-06-23 15:37:54 +02:00
Jaroslava Fiedlerova
673024f587 Merge remote-tracking branch 'origin/nr-ue-nas-auth-reject' into integration_2025_w26 (!3371)
Add NAS Authentication Reject enc/dec library and unit test

This MR introduces the library for encoding/decoding of NAS Authentication
Reject (8.2.5.1 of 3GPP TS 24.501) and relevant unit test.

The message is sent by the AMF to the UE to indicate that the authentication
procedure has failed. A NAS handler was also introduced.
2025-06-23 15:36:23 +02:00
luis_pereira87
260135a35b Fix Msg3 with MAC CE for C-RNTI and RRCReestablishmentComplete
Only trigger RRCReconfiguration if UE is not performing RRCReestablishment
The RRCReconfiguration will be triggered by the RRCReestablishmentComplete
2025-06-23 11:00:51 +01:00
Cedric Roux
a0974f7c73 nr pdcp security: add a 'decipher' API function 2025-06-23 10:02:54 +02:00
Robert Schmidt
69d1d5fb5f Merge branch 'integration_2025_w25' into 'develop'
Integration: `2025.w25`

Closes #970 and #969

See merge request oai/openairinterface5g!3485

* !3083 Speed up ubuntu22 image build
* !3428 NR UE fallback to RRCSetup from RRCReestablishment
* !3479 Suspend RBs at UE
* !3446 DL NAS Transport: Fix Message Type retrieval on too short message
* !3445 Finalize FAPI dump functions, add Digital Beamforming Table and Precoding Matrix Table to CONFIG.request
* !3447 NAS Registration Reject: Add bounds and lengths checks
* !3481 RNTI information printed in UE stats
* !3484 gNB RRC: handle optional measResultQuantity fields independently
* !3480 USRP lib: fix incorrect config check for time_source fallback
* !3483 UE segfault in DLInformationTransfer
* !3367 Enabling usage of ulsyncvalidityDuration timer in SIB19
* !3482 CI: Add "may_fail" step to execute flaky steps
2025-06-19 11:31:22 +00:00
Robert Schmidt
1750d4052f Merge remote-tracking branch 'origin/ci-may-fail' into integration_2025_w25 (!3482)
CI: Add "may_fail" step to execute flaky steps

Add a generic may_fail CI XML step option that indicates the CI step may
fail, but the CI would still be marked as succeeded (instead of skipping
all steps and mark as failed). The cause of this failure depends on the
specific step, e.g., Iperf failing because of low throughput. This
allows to clean up some code and e.g. remove the command_fail option of
Custom_Command, which is then superfluous (and less generic). An
inconvenience is that those may_fail steps will be marked as "failed" in
the HTML. Later cleanup can correct this.

The may_fail is used for executing FHI7.2 testing to push 700 Mbps in DL
(close to the maximum).

Fix some bugs and add some clean up, see commit messages.
2025-06-19 08:26:33 +02:00
Robert Schmidt
f5a07f17f1 Merge remote-tracking branch 'origin/NR_NTN_ulsyncduration' into integration_2025_w25 (!3367)
Enabling usage of ulsyncvalidityDuration timer in SIB19

ntn-UlSyncValidityDuration in SIB19 from Spec 38.331 v17.12 A validity
duration configured by the network for assistance information which
indicates the maximum time duration (from epochTime) during which the UE
can apply assistance information without having acquired new assistance
information. The unit of ntn-UlSyncValidityDuration is second. Value s5
corresponds to 5 s, value s10 indicate 10 s and so on.

    ntn-UlSyncValidityDuration-r17 ENUMERATED{ s5, s10, s15, s20, s25, s30, s35,s40, s45, s50, s55, s60, s120, s180, s240, s900}

Implementation of epochtime is under discussion.

It can be configured in configuration file according to the above
enumeration. For GEO - 240s, MEO - 20s, LEO-5s can be used.
2025-06-19 08:25:28 +02:00
Robert Schmidt
54af637997 Merge remote-tracking branch 'origin/issue_969' into integration_2025_w25 (!3483)
UE segfault in DLInformationTransfer

Closes #969
2025-06-19 08:22:54 +02:00
Guido Casati
88f294bed1 Handle NAS Authentication Reject in stack
Handle authentication not accepted by the network. The handler assumes the message
is not integrity protected, processes the received NAS message and logs whether a
EAP-failure is enclosed. The UE enters state: 5GMM-DEREGISTERED.

Not done in this commit: the UE shall performs actions as per 5.4.1.3.5 of
3GPP TS 24.501, including (1) Abort any ongoing 5GMM procedure
(2) Stop all active timers: T3510, T3516, T3517, T3519, T3520, T3521
(3) Delete stored SUCI. (4) handle EAP-failure message.
2025-06-18 16:29:00 +02:00
Guido Casati
299ce4a9bd Add enc/dec lib for NAS Authentication Reject and unit test 2025-06-18 15:27:35 +02:00
Guido Casati
5445b12c32 Add enc/dec function for EAP Message
Also, add EAP message (optional) enc-dec to Service Reject lib
2025-06-18 15:26:44 +02:00
Reem Bahsoun
833edb3b25 Hard code the name of nvIPC file when called in the cls_containerize.py script
- This is to avoid the Docker image builder from being confused in case we have multiple nvIPC files in `/opt/nvidia-ipc`
- This occurs when we have an MR to upgrade the cuBB image
2025-06-18 14:56:28 +02:00
Jaroslava Fiedlerova
a679a4fb7a Merge remote-tracking branch 'origin/fix-usrp-lib-time-source' into integration_2025_w25 (!3480)
USRP lib: fix incorrect config check for time_source fallback

Corrected a logic bug in usrp_lib.cpp where the code mistakenly checked
openair0_cfg[0].clock_source instead of time_source when a time_source
was already specified in usrp_args.

Also improved the warning log to clarify that the config value is being
ignored in favor of the explicit user-provided usrp_args.

Co-authored-by: Alexandre Serio alexandre.j.serio@altice.pt
2025-06-18 12:43:02 +02:00
Jaroslava Fiedlerova
8d340fca6e Merge remote-tracking branch 'origin/issue-970-meas-quantity' into integration_2025_w25 (!3484)
gNB RRC: handle optional measResultQuantity fields independently

Closes: #970
2025-06-18 12:41:14 +02:00
Jaroslava Fiedlerova
6cb9db1a9b Merge remote-tracking branch 'origin/RNTI_UE_stats' into integration_2025_w25 (!3481)
RNTI information printed in UE stats
2025-06-18 12:40:42 +02:00
Jaroslava Fiedlerova
b03619ea51 Merge remote-tracking branch 'origin/reg-reject-len-check' into integration_2025_w25 (!3447)
NAS Registration Reject: Add bounds and lengths checks

This change adds lengths checks to the received registration reject
message and also performs a bounds check for the received cause.
Since the cause is not checked, any string in the memory can be
dereferenced, possibly leading to DoS.

Signed-off-by: Eduard Vlad eduard.vlad@rwth-aachen.de
2025-06-18 11:33:20 +02:00
Jaroslava Fiedlerova
5580dd21cf Merge remote-tracking branch 'origin/nfapi_dump_functions' into integration_2025_w25 (!3445)
Finalize FAPI dump functions, add Digital Beamforming Table and Precoding Matrix
Table to CONFIG.request

This MR finalizes the addition of dump utility functions for the PARAM.response,
CONFIG.request, CONFIG.response, TX_DATA.request and UCI.indication messages.

These functions are intended to be used to aid in debugging FAPI messages between
the VNF and the PNF by printing out every parameter in a more readable form,
instead of a simple hexdump. These are also used by the nFAPI Hex Parser utility,
to be able to debug an Hex dump provided from elsewhere.

Furthermore, this MR also adds the necessary logic to send/receive the Digital
Beamforming Table and Precoding Matrix Table, this in the CONFIG.request message.
This is achieved by the addition of 2 Vendor Extension TLVs (0xA002 and 0xA003),
in order to be able to reuse existing logic to pack/unpack the data. Note: The
present implementation predicts the existence of multiple instances of the
Precoding Matrix Table via the parameter num_pm_idx, whic is not present in the
SCF specification. Note: The created TLVs are only used to ease the pack/unpack
procedure, by allowing to reuse already existing logic for other TlVs, the tag
and length are not sent.

The necessary additions to the utility functions are done to account for these
table. The CONFIG.request unitary test is changed to fill these tables with
randomized data to test transport and copy.
2025-06-18 11:30:32 +02:00
Guido Casati
122ff99b49 Use f1u_gtp_update in rrc_gNB_process_e1_bearer_context_setup_resp 2025-06-18 10:52:15 +02:00
Guido Casati
7d0640ebcb Improve PDU Session GTP tunnels logging 2025-06-18 10:52:15 +02:00
Guido Casati
b5a717cc99 Add encoder for PDU Session Resource Setup Response Transfer IE in NGAP (Initial Context/PDU Session) Setup Response 2025-06-18 10:52:15 +02:00
Guido Casati
248cf7f155 Use gtpu_tunnel_t in pdusession_setup_t 2025-06-18 10:52:15 +02:00
Guido Casati
e1fc1c38db Use cp_pdusession in trigger_bearer_setup 2025-06-18 10:52:15 +02:00
Guido Casati
389b40b121 Use calloc_or_fail to initiate UE->initial_pdus 2025-06-18 10:52:15 +02:00
Guido Casati
0c408875a3 Refactor NGAP decodePDUSessionResourceSetup/Modify to improve RRC/NGAP separation
Motivation of the commit:

Previously, the RRC module on the NGAP interface directly handled ASN.1 decoding
of NGAP PDU Session Resource items, that was directly stored in pdusession_t, i.e.
in the UE context. Decode logic between Setup and Modify was also duplicated.,
e.g. fill_qos/fill_qos2. The idea behind this change is to achieve this flow:
(1) NGAP handler: decoding (2) ITTI to RRC: transfer decoded message (3) RRC
handler: process decoded message, e.g. store in UE context, etc..

The goal of this commit is to:

* improve the NGAP decoding library by adding decoding functions
* let RRC handle the already decoded data
* enhance error handling, with decode failures now consistently detected and rejected early
* have a cleaner, more maintainable code with fewer duplications and a clearer separation of modules

Changes:
* Moved all ASN.1 decode logic for PDU Session Resource items into the NGAP library
* Introduced decode functions for NGAP IEs whenever necessary, e.g. decode_TNLInformation
decode_pdusession_transfer
* Removed duplicate fill_qos functions and centralized QoS handling in NGAP
* Added function to copy from NGAP PDU Session Resource item to RRC pdusession_t: this actually
  replaces decodePDUSessionResourceSetup in RRC, copying from the decoded NGAP struct to
  the UE context pdusession_t
2025-06-18 10:52:15 +02:00
Guido Casati
48a4c2b0ab Move pdu_session_type_t to platform constants
* It is used by both NGAP and RRC
2025-06-18 10:52:15 +02:00
Guido Casati
5ff24cce71 Refactor pdusession_t Definitions
Motivation:
The previous code had overlapping and partially inconsiste definitions of
`pdusession_t` and related structures across NGAP and RRC. This struct type
was used for either the data stored in the UE context and the NGAP message
IEs holding the PDU session to setup/modify information.

This patch aims to separte the `pdusession_t` in RRC, where it logically belongs,
since RRC owns the state of the PDU sessions. NGAP should only
deal with protocol messages, i.e. enc/dec and transfer structures to RRC.

This clarifies module ownership. This also makes the code easier to maintain.

Changes:
* Moved `pdusession_t` definition from NGAP (`ngap_messages_types.h`) to RRC
  (`nr_rrc_defs.h`)
* Added a simpler `pdusession_resource_item_t` structure to NGAP for use in
  protocol messages
* Adjusted NGAP structures accordingly (Initial Context Setup, PDU Session
  Setup Request, and PDU Session Modify Request).
* do decodePDUSessionResourceSetup to decode the NGAP IEs holding PDU session
  information and store what necessary in the UE context PDU Session IE: NOTE
  this changes were necessary since previously this function was acting on
  the common NGAP/RRC pdu_session_t struct
2025-06-18 10:52:15 +02:00
Guido Casati
a36de80e6f Simplify pdu session structs members naming to pdusession
Rename the struct members:
`pdusession_param` to `pdusession` in NGAP Initial Context Setup Request
`pdusession_setup_params` in `ngap_pdusession_setup_req_t`
`pdusession_modify_params` and `ngap_pdusession_modify_req_t`
2025-06-18 10:52:15 +02:00
Guido Casati
4ec498c996 Refactor tunnel endpoint struct members in pdu_session_t
Motivation:
Clarify the role of GTP tunnel endpoint IDs in PDU session handling. Previously,
the struct members (gNB_teid_N3, UPF_teid_N3, etc.) were confusingly named and
duplicated with separate transport-layer address fields.
This refactoring replaces these with explicit n3_incoming and n3_outgoing members using
gtpu_tunnel_t. This aligns with GTP conventions: "incoming TEID" refers to the
TEID received from the remote peer (UPF on N3), while "outgoing TEID" is the
TEID sent by the local entity (NG-RAN on N3) to the remote peer.

Benefits:
* Improves readability and clarity of the code
* Reduces redundant struct members, i.e. remove UPF_teid_N3, UPF_addr_N3
* Aligns naming with 3GPP conventions for transport layer tunnels

Changes:
* Replace gtp_addr_N3, gNB_teid_N3, gtp_teid, upf_addr with n3_incoming and n3_outgoing
* Update all related code to use the new struct members
* Aligns naming with 3GPP conventions for transport layer tunnels
2025-06-18 10:52:15 +02:00
Guido Casati
b86ae96c66 Merge f1u_dl_gtp_update and f1u_ul_gtp_update in f1u_gtp_update
* The 2 functions do the same thing, the only difference is the
  direction (DL/UL)
2025-06-18 10:52:15 +02:00
Guido Casati
32e5f972e9 Refactor f1u_tunnel_t into gtpu_tunnel_t
This struct is used in different layers, e.g. RRC, NGAP: therefore it
has been moved to platform_types.h.

Also, the struct holds the tunnel endpoint configuration for any GTP-U
tunnel, therefore the f1u prefix is not accurate and was updated
to a more generic gtpu.
2025-06-18 10:52:15 +02:00
Guido Casati
93936ffd9b Fix comment in transport_layer_addr_t 2025-06-18 10:52:15 +02:00
Guido Casati
78feea10bb Add function to deep copy pdusession_t struct 2025-06-18 10:51:59 +02:00
Guido Casati
00b18f2990 Cleanup unused and/or long time commented out code in RRC/NGAP
* Remove drb_is_active: function is unused and the logic will be later
  added to another function to add DRBs if necessary
* Remove unused NGAP structs and empty TODO functions
* Remove unused pdusession_setup_req_t struct definition
2025-06-17 23:53:07 +02:00
Guido Casati
786fada6e6 Change pdusession_id_t type to int and remove redundant definition for an ID type 2025-06-17 23:53:07 +02:00
Guido Casati
a8f8244b09 Fix mutation of input iterators in seq_arr_erase_it
The seq_arr_erase_it function was modifying start_it during the free_func loop,
which led to incorrectly apply the free_func on the whole array.

This commit makes sure the elements "freed" are only those in the range and not the whole seq_arr.

* Fixes the logic by introducing a temporary iterator for the free loop,
  preserving start_it and end_it for correct offset calculations.

* Adds a regression test in test_seq_arr to verify that only the selected
  subrange is erased and that free_func is called exactly on that range.
2025-06-17 23:50:43 +02:00
Jaroslava Fiedlerova
d35270bfd0 Merge remote-tracking branch 'origin/dl-nas-transport-len-check' into integration_2025_w25 (!3446)
DL NAS Transport: Fix Message Type retrieval on too short message

The change addresses the SM message type retrieval for DL NAS Transport
messages. The assumption of an offset 17 = 7 (MM Sec) + 3 (MM Plain) + 1
(IEI) + 2 (Len) + 4 (SM) is correct.

However, if the DL NAS Transport is received in a plain header, the
lengths would not add up anymore. (This is not complying with the
standard, so not allowed, but possible). The check for the length is
necessary to not process arbitrary memory contents beyond the
pdu_buffer.
2025-06-17 23:39:02 +02:00
Jaroslava Fiedlerova
547b2eaf52 Merge remote-tracking branch 'origin/UE_RB_suspend' into integration_2025_w25 (!3479)
Suspend RBs at UE

In case of suspended radio bearer (by RRC), the MAC needs to discarded received
PDUs and avoid to transmit using LCID related to that RB
2025-06-17 23:37:25 +02:00
Robert Schmidt
7fb44bdb86 CI FHI7.2/VVDN: add test step to test high throughput
This test may fail, so mark it as such.
2025-06-17 19:21:21 +02:00
Robert Schmidt
02608313fb CI: remove useless Iperf test description
"multi-ue profile" was a specific iperf option to do iperf across
multiple UEs. However, this is not necessary anymore, the Iperf
handling multiple UEs "implicitly" (based on the number of UEs).
2025-06-17 19:21:21 +02:00
Robert Schmidt
79448178cb Remove "command_fail" option from Custom_Command/Custom_Script
As of the parent commit, there is a generic "may_fail" option through
which we could still ignore an error. Thus, command_fail is superfluous,
and avoids some extra code.

Further, in all these cases, we should better be informed about any
error, so let's not use may_fail for these tests.
2025-06-17 19:21:21 +02:00
Robert Schmidt
97d0b6534a Implement generic CI step "may_fail" option
There might be various occasions where a CI step should be attempted to
be executed, despite a chance of failing.  For instance, we might want
to try executing an instable Iperf test, and still mark the CI as
passing if it fails.

This commit introduces a generic "may_fail" option that will mark any CI
test as succeeded, despite having failed.

Ideally, we would print a warning in the HTML code, but this is not
possible because each step emits its own HTML code, instead of the main
loop handling this. We can improve this in the future.
2025-06-17 19:21:21 +02:00
Reem Bahsoun
a18a4888ec Change number of cores used for OAI gNB from 8 to 2
- After testing we found that we do not need 8 cores
2025-06-17 14:57:27 +02:00
Reem Bahsoun
6677277b6d Update cuBB version to 25-1 2025-06-17 14:56:40 +02:00
Raghavendra Dinavahi
7877e38890 UE changes: Handle T430 expiry in RRC, MAC
SPEC 38.331 section 5.2.2.6
Inform MAC that UL SYNC got lost because of T430 expiry
- Send message NR_MAC_RRC_CONFIG_RESET with cause UL_SYNC_LOST_T430_EXPIRY to MAC
Reacquire SIB19 after T430 expiry

This is not checked in this commit
- RACH needs to be performed through probably PDCCH order to reobtain UL-SYNC
- system usecase involving Recovery from T430 expiry not tested yet as that requires changes on gNB side.
2025-06-17 13:50:00 +02:00
Raghavendra Dinavahi
6fc02164c5 UE changes: Handling of ulsyncvalidityduration IE in sib19
Spec 38.331 section 5.2.2.4.21 indicates this
1> start or restart T430 for serving cell with the timer value set to ntn-UlSyncValidityDuration for the serving cell
from the subframe indicated by epochTime for the serving cell;
NOTE: UE should attempt to re-acquire SIB19 before the end of the duration indicated by ntn-UlSyncValidityDuration and epochTime

Epochtime IE
When explicitly provided through SIB, or through dedicated signaling, the EpochTime is the starting time of a DL
sub-frame, indicated by a SFN and a sub-frame number signaled together with the assistance information.
For serving cell, the field sfn indicates the current SFN or the next upcoming SFN after the frame where the message indicating the epochTime is received.
This field is mandatory present when ntn-Config is provided in dedicated configuration.

gNB implementation related to epochtime will be done in a separate merge request.
2025-06-17 13:49:55 +02:00
Robert Schmidt
aca48aa9f8 gNB RRC: handle optional measResultQuantity fields independently
Closes: #970
2025-06-17 11:30:11 +02:00
Rúben Soares Silva
ba4608d46b Remove unnecessary checks on P7 free utility functions 2025-06-17 10:09:31 +01:00
Rúben Soares Silva
625fd54ae2 Remove unnecessary checks on P5 free utility functions 2025-06-17 10:09:31 +01:00
Rúben Soares Silva
923cfc9cd2 Finish dump procedure for UCI.indication message
Remove unnecessary checks on free_uci_indication
2025-06-17 10:09:31 +01:00
Rúben Soares Silva
c9835a13e7 Finish dump procedure for TX_DATA.request message 2025-06-17 10:09:31 +01:00
Rúben Soares Silva
d3205ea09a Finish dump procedure for CONFIG.response message
Remove unnecessary checks on free_config_response
2025-06-17 10:09:31 +01:00
Rúben Soares Silva
018d456a2a Add pack/unpack for CONFIG.request Precoding Matrix table
Adds the packing and unpacking functions needed for the PM Table in CONFIG.request
This table tag is specified in SCF222.10.06(0x104B), previous versions didn't have a tag for this table, and this version of the spec introduces the parameter `num_pm_idx`, previously not present.
A struct nfapi_nr_pm_tlv_ve_t is added to represent this TLV in order to be able to use the pack_nr_tlv function.
The necessary additions to the utility functions are done to account for this table.
The unitary test is changed to fill this table with randomized data to test transport and copy.
2025-06-17 10:09:31 +01:00
Rúben Soares Silva
8519c748d1 Add pack/unpack for CONFIG.request Beamforming Table
Adds the packing and unpacking functions needed for the DBT Table in CONFIG.request
This table tag is specified in SCF222.5.0 (0x1043) and this tag is used to transport the table, previous versions did not include a tag for the table.
A struct nfapi_nr_dbt_tlv_ve_t is added to represent this TLV in order to be able to use the pack_nr_tlv function.
The necessary additions to the utility functions are done to account for this table.
The unitary test is changed to fill this table with randomized data to test transport and copy.
2025-06-17 10:09:29 +01:00
Rúben Soares Silva
5016fc75c6 Finish dump procedure for CONFIG.request message
Remove unnecessary checks on free_config_request

Added logic to fill random data for PNF addresses and port TLVs to test dumping function
2025-06-17 10:08:16 +01:00
Rúben Soares Silva
5a30abc29e Finish dump procedure for PARAM.response message
Remove unnecessary checks on free_param_response
2025-06-17 10:08:16 +01:00
Jaroslava Fiedlerova
6878550557 Merge remote-tracking branch 'origin/NR_RRC_UE_fallback_to_Setup_from_Reestablishment' into integration_2025_w25 (!3428)
NR UE fallback to RRCSetup from RRCReestablishment

Implementation of the procedure to handle reception of RRCSetup as response
to RRCReestablishment request
2025-06-17 10:33:15 +02:00
Jaroslava Fiedlerova
9146879207 Merge remote-tracking branch 'origin/fast-u22-build' into integration_2025_w25 (!3083)
Speed up ubuntu22 image build

Speed up softmodems build by means of:
- Avoiding the copying the repo (using bind instead)
- Creating cache directories for:
  - ccache cache
  - CPM cache
  - Same technique applied to FlexRIC build
- Make ubuntu ran-base image docker build cache friendly
2025-06-17 10:31:43 +02:00
francescomani
d8c7123a8a preventing segfault in DLInformationTransfer at RRC UE 2025-06-17 10:07:37 +02:00
francescomani
499cdc62d9 do not transmit data for a logical channel corresponding to a radio bearer that is suspended 2025-06-17 09:50:41 +02:00
Robert Schmidt
bb9fa2c6a0 CI: Remove double Custom_Command Step
Step 004000 appears double in the XML description. Remove one to avoid
that it is executed twice (because the Python code goes through the list
of test descriptions and executes all that match the current ID =>
double if appears twice).
2025-06-17 08:12:20 +02:00
Robert Schmidt
65f85d55db Correct b2xx_fx3_utils path on nepes 2025-06-17 08:09:40 +02:00
Robert Schmidt
2902967740 Remove useless sleep in CI footer creation 2025-06-16 19:01:20 +02:00
francescomani
2b4b3fcd00 discard rx PDU if RB is suspended 2025-06-16 16:39:41 +02:00
francescomani
3331a43b95 add option to suspend/resume RBs at MAC upon signaling from RRC 2025-06-16 16:36:19 +02:00
Guido Casati
a41be56b2a USRP lib: fix incorrect config check for time_source fallback
Corrected a logic bug in usrp_lib.cpp where the code mistakenly checked
openair0_cfg[0].clock_source instead of time_source when a time_source
was already specified in usrp_args.

Also improved the warning log to clarify that the config value is being
ignored in favor of the explicit user-provided usrp_args.

Co-authored-by: Alexandre Serio <alexandre.j.serio@altice.pt>
2025-06-16 11:25:30 +02:00
francescomani
38bac5376b fix in multi-UE RFsim action description 2025-06-16 10:13:20 +02:00
francescomani
cce685323a adding RNTI information to stats printed at UE 2025-06-15 17:38:45 +02:00
francescomani
f2e06a8b12 store RB information in LCID structure at UE 2025-06-13 16:46:21 +02:00
francescomani
cad681e626 renaming structure for LCID to RB mapping 2025-06-13 16:46:21 +02:00
Robert Schmidt
8c0641c676 Merge branch 'integration_2025_w24' into 'develop'
Integration: `2025.w24`

Closes #965

See merge request oai/openairinterface5g!3476

* !3354 Preparation Work for N2 Handover
* !3383 Add configurable values of NR RLC and NR PDCP to the configuration file
* !3468 Resolve "SSB frequency at gnb.sa.band78.fr1.24PRB.usrpb210.conf is invalid"
* !3466 YAML related updates
* !3460 SRS configuration
* !3474 Fix AMF selection fallback by PLMN ID when no UE identity is present or matching
* !3473 Fix various bugs and inconsistencies in config read, SCTP, ITTI, GTP
* !3169 NR RU improvements for analog beamforming
* !3456 CI: update config for AW2S pipeline
* !3369 Add Security Mode Reject lib/unit test and adopt in stack
* !3457 Fix NR reestablishment
* !3412 [E2 agent] E2AP README update and OAI-FlexRIC CI pipeline improvements
2025-06-13 14:31:54 +00:00
luis_pereira87
736ea530f7 Only reestablish RLC while processing reconfiguration complete after a RRCReestablishment and not for every RRCReconfiguration 2025-06-13 12:05:34 +01:00
Robert Schmidt
5b9d770960 Merge remote-tracking branch 'origin/e2-fixes-updates' into integration_2025_w24 (!3412)
[E2 agent] E2AP README update and OAI-FlexRIC CI pipeline improvements

- E2AP README - add OSC nearRT-RIC section; update with proper FlexRIC
  links, and explanations on prerequisites, as well as for xApps
- OAI-FlexRIC CI - use separate containers for xApps
- add reference files for CU-UP/CU-CP
- add logging for KPM NSSAI condition
2025-06-13 10:40:29 +02:00
Robert Schmidt
9513d481d5 Merge remote-tracking branch 'origin/fix_nr_reestablishment' into integration_2025_w24 (!3457)
Fix NR reestablishment by implementing the "DRB-suspend" at the MAC.
This means that the during reestablishment, gNB MAC discards received
DRB packets, and does not schedule DRB. Fix a couple of additional
issues in reestablishment.  # Please enter a commit message to explain
why this merge is necessary,

For additional information, see
https://gitlab.eurecom.fr/oai/openairinterface5g/-/merge_requests/2668#note_119369
2025-06-13 10:25:57 +02:00
Robert Schmidt
dfadcab458 Store spCellConfig during reestablishment for reconfiguration
The spCellConfig is to be dropped during reestablishment and to be
applied after reconfiguration. Implement this using the
RRCReconfigurationComplete acknowledgment from the CU to the DU,
applying the spCellConfig if present (which signals a prior
reestablishment). Remove a prior flag that is not needed anymore, and
do not "guess" when is the reconfiguration, because it is now handled in
the case of the ack.

The spCellConfig is not relevant as long as we use a common search space
for DCIs (and the activation of dedicated search space happens after
applying spCellConfig). For PUCCH, there is the PDSCH transmission of
RRCReconfiguration which gets ack'ed in the default PUCCH.
RRCReconfigurationComplete is sent in PUSCH (again through common
search space). In theory, there cannot be another PUCCH before the
application of spCellConfig, as all bearers are still suspended, and
there should not be another SRB1 transmission in the meantime, as only
one RRC transaction can be active at a time.

Co-authored-by: francescomani <email@francescomani.it>
2025-06-12 15:47:03 +02:00
Robert Schmidt
81dbaf0aad Add comment on reestablishment in MAC-RRC DL handler 2025-06-12 15:39:36 +02:00
Robert Schmidt
15370e7192 Implement RB suspend at gNB MAC
Add a flag for each RB that tracks suspension state. Mark all RBs
(except SRB1) as suspended on reestablishment, and de-suspend on
reconfiguration. Only check RLC status for non-suspended RBs. For UL
data traffic, check that DRB/SRB2 exist (SRB1 should be there as soon as
the UE context exists).
2025-06-12 15:39:00 +02:00
Robert Schmidt
f3802d77cc Merge remote-tracking branch 'origin/nr-ue-nas-sec-mode-reject' into integration_2025_w24 (!3369)
Add Security Mode Reject lib/unit test and adopt in stack

This MR is adding the library for the NAS Security Mode Reject, and
relevant unit test.

The UE shall send a SECURITY MODE REJECT containing a 5GMM cause that
typically indicates one of the following cause values: (23) UE security
capabilities mismatch. (24) security mode rejected, unspecified

- The message shall be protected if a security context is available.
- The message is adopted in the handling of Security Mode Command failure.

See 3GPP TS 24.501 5.4.2.5 "NAS security mode command not accepted by
the UE".

This MR includes changes from !3262:

> This patch series addresses a security issue where the UE improperly
> accepts a Security Mode Command (SMC) without an authentication header
> (Security Header 0). This behavior violates TS 24.501 and enables an
> attacker to bypass authentication, set integrity protection to NULL
> (NIA0), and reconfigure the UE without proper verification.
>
> We identified the following issues:
>
> 1. The UE currently accepts unauthenticated SMC messages, even
>    allowing NIA0 and EIA0 to be set outside emergency mode.
> 2. When applying NIA0, the MAC field remains uninitialized,
>    consistently containing the sequence 0xFF3F0000, making it feasible
>    to bypass authentication and enforce insecure configurations.
> 3. The UE does not properly signal security mode failures to the Core
>    Network.
>
> This patch series tries to address the above-mentioned issues:
>
> 1. Reject unauthenticated SMC messages, enforcing the requirement that
>    they must be integrity-protected.
> 2. Validate MAC before applying security settings, ensuring that only
>    authenticated messages are accepted.
> 3. Tear down the security context if an integrity check fails.
> 4. Introduce the Security Mode Reject message to inform the Core
>    Network of failed SMC procedures, as required by TS 24.501.
2025-06-12 14:44:17 +02:00
Robert Schmidt
690be9c1ff Merge remote-tracking branch 'origin/ci-asue-test' into integration_2025_w24 (!3456)
CI: update config for AW2S pipeline

Update location of lteue and ws.js after AmariUE SW update.
2025-06-12 14:43:55 +02:00
Jaroslava Fiedlerova
27ece7e7f5 CI: update AmariUE configuration file, add RF configuration 2025-06-12 11:46:47 +02:00
Eduard Vlad
5e45ecb123 Security Mode Command: Perform Algorithm Rejection in NAS Handler
This change performs the algorithm rejection in the corresponding NAS
handler for 5G, since the protocol definitions differ between LTE and
5G, regarding NIA0/EIA0 user plane traffic.

Therefore, for 5G NIA0 is rejected, since it is not allowed under normal
circumstances, while LTE user plane traffic can indeed have EIA0
selected.

Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
2025-06-12 09:49:34 +02:00
Eduard Vlad
a2a8e3ba6d Security Mode Command: Handle incorrect authentication
It is not allowed to accept an unauthenticated SMC message,
as this effectively bypasses all security measures and
enables a malicioius attacker to compromise the confidentiality
and integrity of exchanged messages.

Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
Co-authored-by: Guido Casati <hello@guidocasati.com>
2025-06-12 09:49:33 +02:00
Eduard Vlad
6c8a3796ae nas security: Implement reusable procedures for Security Mode Command handling
Retrieving the mac is necessary during the handling of the SMC, since the
context is generated from the specified keys therein. Therefore, it is
necessary to check the MAC right after generation and ensure the authenticity
of the message. If it is not given, the message must be rejected.

Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
Co-authored-by: Guido Casati <hello@guidocasati.com>
2025-06-12 09:49:33 +02:00
Eduard Vlad
896698dab5 SMC: reject NULL integrity for non emergency cases
Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
2025-06-12 09:49:33 +02:00
Eduard Vlad
6399d93be8 Add callback for generation of NAS Security Mode Reject message
This is necessary to indicate to the Core network, that
the security mode command procedure has failed.

Check for the security context presence when generating the Security Mode
reject message: according to 3GPP TS 24.501 5.4.2.5 "NAS security mode command
not accepted by the UE" The UE shall send a SECURITY MODE REJECT containing
a 5GMM cause that typically indicates one of the following cause values:
(23) UE security capabilities mismatch
(24) security mode rejected, unspecified
The message shall be protected if a security context is available

Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
Co-authored-by: Guido Casati <hello@guidocasati.com>
2025-06-12 09:49:33 +02:00
Eduard Vlad
98c458fa2c FGS NAS lib: enable encoding of Security Mode Reject
Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>

Co-authored-by: Guido Casati <hello@guidocasati.com>
2025-06-12 09:49:33 +02:00
Guido Casati
4262203e2d Add NAS Security Mode Reject enc/dec lib and unit test
This 5GMM message is required for an invalid security mode command,
e.g. when the MAC integrity fails, or the wrong Security Header is set.

* Add encode/decode functions for common IEs in fgmm_lib: this library
  provides encoding/decoding helpers for IEs shared across multiple
  NAS messages. The goal is to avoid the legacy approach of creating
  separate files per IE
* add NAS Cause enc/dec lib
* Adopted byte_array_t to handle the buffer

Co-authored-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
2025-06-12 09:49:32 +02:00
Robert Schmidt
dec4e3f217 Merge remote-tracking branch 'origin/RU_beam_management' into integration_2025_w24 (!3169)
NR RU improvements for analog beamforming
2025-06-11 18:37:15 +02:00
Robert Schmidt
a4b4fbe96b Merge remote-tracking branch 'origin/fixes-itti-gtp-config' into integration_2025_w24 (!3473)
Fix various bugs and inconsistencies in config read, SCTP, ITTI, GTP

Fix bugs across various layers, mostly layer 3, including memory leaks.
See the commits for more details.
2025-06-11 18:36:39 +02:00
francescomani
73a2ba3894 assertion to avoid using analog beamforming in split scenario 2025-06-11 10:22:23 +02:00
francescomani
ded3187734 omitting beam weigths in case of DAS 2025-06-11 10:19:23 +02:00
Robert Schmidt
068983915e Merge remote-tracking branch 'origin/bugfix-ngap-amf-selection' into integration_2025_w24 (!3474)
Fix AMF selection fallback by PLMN ID when no UE identity is present or matching

If a mask is present (i.e., not zero), AMF selection by PLMN ID may
still fail, causing the AMF selection process to skip the fallback
option, i.e. selection by PLMN ID, when no UE identity is available or
when no match is found.

This MR adds also warnings in case there's a match for the AMF is not
found.
2025-06-11 07:55:11 +02:00
Robert Schmidt
e36f3ee995 Merge remote-tracking branch 'origin/SRS-meas' into integration_2025_w24 (!3460)
SRS configuration

- Fix segmentation fault, a memory leak, and LOGs for SRS usage
  NFAPI_NR_SRS_BEAMMANAGEMENT
- Refactor SRS configuration;
- Add SRS ResourceSet to get the SNR measurements at MAC layer

In this MR we have 2 SRS ResourceSet, for the same SRS Resource. This
way, in addition to obtaining the UL-RI, we also obtain the SNR in the
MAC and fill the PRB Black list.

This branch has been tested with COTS UE and with RFSim. The measured
values seem correct.
2025-06-11 07:54:17 +02:00
Robert Schmidt
f0ca66adcd Remove unused MAC types and includes
Using the USIM interface in the MAC is non-sensical (violates layer
separation). Add header include in nr-softmodem.c, which previously came
through nr_mac_gNB.h -> usim_interface.h.
2025-06-10 18:00:49 +02:00
Robert Schmidt
986b212fe9 GTP: fix memory leak when socket binding fails
Avoid leaking memory upon failed socket binding by calling
freeaddrinfo() before exiting in error cases.

Fixes leak:

    Direct leak of 64 byte(s) in 1 object(s) allocated from:
        #0 0x0000004ac038 in malloc (/home/richie/oai/cmake_targets/ran_build/build/nr-softmodem+0x4ac038) (BuildId: 875d6e5bc54d7c89bdcf151452f12703cb6fd110)
        #1 0x7f0fdd92e2a6 in getaddrinfo (/lib64/libc.so.6+0x1202a6) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
        #2 0x00000043d7ad in getaddrinfo (/home/richie/oai/cmake_targets/ran_build/build/nr-softmodem+0x43d7ad) (BuildId: 875d6e5bc54d7c89bdcf151452f12703cb6fd110)
        #3 0x000000700c73 in udpServerSocket(openAddr_s) /home/richie/oai/openair3/ocp-gtpu/gtp_itf.cpp:486:17
        #4 0x000000700c73 in gtpv1Init /home/richie/oai/openair3/ocp-gtpu/gtp_itf.cpp:546:10
        #5 0x000000c692b8 in cuup_init_n3 /home/richie/oai/openair2/E1AP/e1ap.c:744:61
        #6 0x000000549ea1 in create_gNB_tasks /home/richie/oai/executables/nr-softmodem.c:320:7
        #7 0x000000549ea1 in main /home/richie/oai/executables/nr-softmodem.c:619:15
        #8 0x7f0fdd8115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
        #9 0x7f0fdd8116a7 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x36a7) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
        #10 0x000000408524 in _start (/home/richie/oai/cmake_targets/ran_build/build/nr-softmodem+0x408524) (BuildId: 875d6e5bc54d7c89bdcf151452f12703cb6fd110)
2025-06-10 18:00:49 +02:00
Robert Schmidt
0f78aade97 Remove useless printf in config reading
This printf just shows which config sections are being read, but this
has no useful information for a user. It was introduced in 7731f5bd2d
but was not present prior to this commit, either.
2025-06-10 18:00:49 +02:00
Robert Schmidt
405d122937 GTP: check that packets are not larger than max UDP size 2025-06-10 18:00:49 +02:00
Robert Schmidt
1a690a5cff Merge remote-tracking branch 'origin/965-ssb-frequency-at-gnb-sa-band78-fr1-24prb-usrpb210-conf-is-invalid' into integration_2025_w24 (!3468)
Resolve "SSB frequency at gnb.sa.band78.fr1.24PRB.usrpb210.conf is invalid"

Closes #965
2025-06-10 15:03:14 +02:00
Robert Schmidt
db663d124b Merge remote-tracking branch 'origin/yaml-config-fixes' into integration_2025_w24 (!3466)
YAML related updates

- Add common function config_common_getdefault
- Handle exceptions from the yaml-cpp library, transform them into
  understandable errors written to stderr
- Add some unit tests.
2025-06-10 15:02:42 +02:00
Robert Schmidt
9a34b31470 Merge remote-tracking branch 'origin/nr-rlc-pdcp-config-file' into integration_2025_w24 (!3383)
Add configurable values of NR RLC and NR PDCP to the configuration file

This is for the gNB (the UE gets the values from the gNB).

The physical simulators were also adapted (we put the previously
hardcoded values that were everywhere in the code into the simulators
themselves). I don't think we need to have those values configurable for
the simulators, but I can study the possibility to add this if someone
tells me it's important (if not important I prefer not to do it, I am
not sure if it is trivial to do or not).
2025-06-10 15:02:05 +02:00
Robert Schmidt
852fd7fd6c Merge remote-tracking branch 'origin/n2-ho-preparation-work' into integration_2025_w24 (!3354)
Preparation Work for N2 Handover

This MR introduces preliminary improvements to support !3334.

Refactored utility NGAP functions

- Moved allocAddrCopy to NGAP utilities

Decoding Functions for NGAP IEs:

- Added common decoding functions (decode_ngap_guami,
  decode_ngap_UEAggregateMaximumBitRate, decode_ngap_nssai, etc.)
- Adopted these functions across the NGAP stack

Improvements to RRC and Handover Handling:

- Enhanced get_neighbour_cell_information and get_neighbour_config to
  differentiate input parameters (cell by NR Cell ID vs. gNB by PCI)
- Used byte_array_t in nr_initiate_handover
- Introduced RRCReconfigurationParams_t to structure RRCReconfiguration
  IEs
- Added a function to build NR_RRCReconfiguration_IEs_t
- Adopted this approach in do_RRCReconfiguration and refactored the
  function
- Refactored the handling of Dedicated NAS message list
- Add masterKeyUpdate handling in RRCReconfiguration generation

PDCP Re-Establishment Improvements:

- Enabled PDCP re-establishment for SRB1/SRB2 based on a bitmap in
  createSRBlist (3GPP TS 38.331 RadioBearerConfig)

NH & KgNB Key Management:

- Added NH derivation function as per 3GPP TS 33.501 A.10
- Moved KgNB derivation function to key_nas_deriver utilities
2025-06-10 14:59:58 +02:00
Raymond Knopp
1153721b19 changes for multi-RU DAS scenario, handling of antenna ports in 7.2 (memory allocations for PRACH and neAxc in fh_config) 2025-06-10 12:11:51 +02:00
Raymond Knopp
a1a4f24d0f hotfix for F. Mani's update to nr_feptx_prec handling of multiple beams 2025-06-10 12:11:51 +02:00
francescomani
e15631b23c adapting nr_feptx_prec function to analog beam management 2025-06-10 12:11:51 +02:00
francescomani
3743719b88 fix wrong assertion in nr_fill_prach_ru 2025-06-10 12:11:51 +02:00
francescomani
f555bf2957 analog beamforming based distributed antenna system 2025-06-10 12:11:49 +02:00
francescomani
964c737b7d simplify get_nr_prach_duration function 2025-06-10 12:10:59 +02:00
francescomani
9f97191243 fix beam allocation for multiple TD prach occasions in a slot 2025-06-10 12:10:59 +02:00
francescomani
be8771189e moving beam weigths to MACRLC config file section and requiring only a single beam index per beam in analog beamforming 2025-06-10 12:10:59 +02:00
francescomani
bf6ddb70c4 extension of analog beamforming doc to lower layers 2025-06-10 12:10:59 +02:00
francescomani
93b08c5f20 bugfix in L1 analog beam allocation
the allocation in L1 is done symbol-wise but the L2 is scheduling beams slot-based
this means we need to check for beam availability in the whole slot
2025-06-10 12:10:59 +02:00
francescomani
038247f074 RU analog beam management (not for 7.2) 2025-06-10 12:10:59 +02:00
Rúben Soares Silva
f5072833b6 Add pack/unpack functionality for 2 new vendor extension TLVs.
Add the ability to pack/unpack 2 new TLVs for analog beamforming
total_num_beams_vendor_ext and analog_beam_list
Add the unpack related changes for the first 2 vendor extension TLVs introduced related to beamforming.

For the moment the packing is guarded by an Assert to ensure it is not used.

Add the necessary utility function changes to support these VE TLVs

Add the necessary changes to the corresponding unitary test for pack/unpack,
commented for the moment, since the packing is disabled with an Assert.
2025-06-10 12:10:59 +02:00
francescomani
675e1129b4 using the analog beamforming oai extension fapi fields instead of digital beamforming structure for analog beamforming 2025-06-10 12:10:55 +02:00
Teodora
83df3c5e79 Add OSC nearRT-RIC J release contribution and xDevSM framework 2025-06-10 10:51:32 +02:00
Guido Casati
03b6e32fdb Rename nr_neighbour_gnb_configuration_t to nr_neighbour_cell_t for clarity 2025-06-10 10:47:11 +02:00
Guido Casati
f5f61162ff Add mismatch warning in AMF selection utility functions 2025-06-10 10:05:44 +02:00
Guido Casati
90230078b4 Select AMF by PLMN ID when no other ue_identity.presenceMask is present and/or matching
The mask could be present, .e.g not zero, but the selection of the AMF could
fail. This would lead to a skipping the selection of the AMF by PLMN ID,
which is the last option when no UE identity is present and/or matching.
2025-06-10 10:05:44 +02:00
Guido Casati
a06457bab6 Fix direct leak in rrc_gNB_send_NGAP_NAS_FIRST_REQ
Free memory allocated in NGAP after use in RRC.

 Direct leak of 29 byte(s) in 1 object(s) allocated from:
    > #0 0x7f11200b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    > #1 0x558b7fcd0137 in malloc_or_fail /n2-handover-preparation/common/utils/utils.h:86
    > #2 0x558b7fcd0137 in create_byte_array /n2-handover-preparation/common/utils/ds/byte_array.c:32
    > #3 0x558b7fdb7a5c in rrc_gNB_send_NGAP_NAS_FIRST_REQ /n2-handover-preparation/openair2/RRC/NR/rrc_gNB_NGAP.c:183
    > #4 0x558b7fd2ab30 in rrc_gNB_process_RRCSetupComplete /n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:439
    > #5 0x558b7fd2ab30 in handle_rrcSetupComplete /n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:1715
    > #6 0x558b7fd63e23 in rrc_gNB_decode_dcch /n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:1851
    > #7 0x558b7fd8b4c3 in rrc_gnb_task /n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2718
    > #8 0x7f111ea94ac2 in start_thread nptl/pthread_create.c:442
2025-06-09 20:43:44 +02:00
Guido Casati
114f833a77 Fix memory leak in createSRBlist
ASN_SEQUENCE_ADD is calling realloc which is allocating memory for the
'array' which was not freed.

> Direct leak of 32 byte(s) in 1 object(s) allocated from:
>     #0 0x7ce97deb4c38 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:164
>     #1 0x5813fba02574 in asn_set_add /openairinterface5g/n2-handover-preparation/cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/asn_SET_OF.c:27
>     #2 0x5813faf6c672 in createSRBlist /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:331
>     #3 0x5813faf9aa78 in rrc_gNB_generate_RRCSetup /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:421
>     #4 0x5813fafba2ee in rrc_handle_RRCSetupRequest /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:1243
>     #5 0x5813fafba2ee in rrc_gNB_process_initial_ul_rrc_message /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2019
>     #6 0x5813fafcdc3a in rrc_gnb_task /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2761
>     #7 0x7ce97c894ac2 in start_thread nptl/pthread_create.c:442

> Direct leak of 32 byte(s) in 1 object(s) allocated from:
>     #0 0x7ce97deb4c38 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:164
>     #1 0x5813fba02574 in asn_set_add /openairinterface5g/n2-handover-preparation/cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/asn_SET_OF.c:27
>     #2 0x5813faf6c672 in createSRBlist /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:331
>     #3 0x5813faf7d89d in get_RRCReconfiguration_params /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:660
>     #4 0x5813faf914b3 in rrc_gNB_generate_dedicatedRRCReconfiguration /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:716
>     #5 0x5813faf96856 in rrc_CU_process_ue_context_setup_response /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2190
>     #6 0x5813fafcd3ed in rrc_gnb_task /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2796
>     #7 0x7ce97c894ac2 in start_thread nptl/pthread_create.c:442
2025-06-09 20:43:44 +02:00
Guido Casati
12d9e1f116 Fix memory leak in fill_neighbour_cell_configuration
dynamically allocated memory is pushed to the seq_arr that
is doing a memcpy, so it can be either or better allocated
in the stack instead

> Direct leak of 16 byte(s) in 1 object(s) allocated from:
>    #0 0x7efd8f6b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
>    #1 0x577888f3457e in fill_neighbour_cell_configuration /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:1914
>    #2 0x577888f3457e in RCconfig_NRRRC /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:2108
>    #3 0x57788869a0d2 in create_gNB_tasks /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:253
>    #4 0x57788869a0d2 in main /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:619
>    #5 0x7efd8e029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
2025-06-09 20:43:44 +02:00
Guido Casati
abcc00945e Fix memory leak in fill_neighbour_cell_configuration
the dynamically allocated memory is pushed to the seq_arr that
is doing a memcpy, so it can be either or better allocated in the
stack instead

> Direct leak of 48 byte(s) in 1 object(s) allocated from:
>    #0 0x7d4c934b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
>    #1 0x577622a40137 in fill_neighbour_cell_configuration /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:1933
>    #2 0x577622a40137 in RCconfig_NRRRC /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:2109
>    #3 0x5776221a30f2 in create_gNB_tasks /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:253
>    #4 0x5776221a30f2 in main /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:619
>    #5 0x7d4c91e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
2025-06-09 20:43:44 +02:00
Guido Casati
70239c086c Fix memory leak in fill_measurement_configuration
seq_arr_push_back is doing a memcpy so locally allocated memory can be freed after.
Allocate in stack.

> Direct leak of 64 byte(s) in 2 object(s) allocated from:
>    #0 0x7ec4bb8b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
>    #1 0x55895aae1b1f in fill_measurement_configuration /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:2015
>    #2 0x55895aae1b1f in RCconfig_NRRRC /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:2112
>    #3 0x55895a246112 in create_gNB_tasks /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:253
>    #4 0x55895a246112 in main /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:619
>    #5 0x7ec4ba229d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
2025-06-09 20:43:44 +02:00
Guido Casati
dca7e6c95d Rework handover ack callback
Inside of passing the RRCReconfiguration buffer, call RRCReconfiguration
message generation inside the F1 callback. This will simplify the code in the
rrc_CU_process_ue_context_setup_response() function once the N2 handover case
is introduced. In rrc_CU_process_ue_context_setup_response(), with presence
of the HO context, the HO ACK callback is called only once and depending
on the type of HO it will do either RRCReconfiguration for F1 and
HandoverCommand for N2.
2025-06-09 20:43:42 +02:00
Guido Casati
7fba453329 Pass byte_array_t to handover acknowledge function
The byte_array reference contains the pointer to the
encoded RRC buffer to be used in the handover acknowledge
callback (e.g. in F1 to trigger RRCReconfiguration)
2025-06-09 20:43:42 +02:00
Guido Casati
60535aae99 Use get_RRCReconfiguration_params in rrc_gNB_generate_dedicatedRRCReconfiguration 2025-06-09 20:43:42 +02:00
Guido Casati
d18830f359 Enable PDCP re-establishment for SRB1/SRB2 based on bitmap in createSRBlist
This is necessary because the function was re-establishing PDCP only for SRB2
however according to specs 3GPP TS 38.331 RadioBearerConfig, PDCP shall be
re-established for SRB1 and/or SRB2 whenever the security key used for the
radio bearer changes, with some exceptions for SRB1 (i.e. when resuming
an RRC connection, or at the first reconfiguration after RRC connection
reestablishment in NR, do not re-establish PDCP for SRB1).

* the input param "reestablish" is converted into a bitmap to indicate
  whether PDCP should be re-established for the SRB1 and/or SRB2.
* For convenience the bitmap is 0-based, with index 1 corresponding to SRB1,
  index 2 to SRB2.

This commit is keeping the legacy re-establishment, that is re-establishment
of PCDP for SRB2 only.
2025-06-09 20:43:41 +02:00
Guido Casati
a937eaec23 Rework RRCReconfiguration handling in RRC/ASN1
according to TS 38.331, RRCReconfiguration messages can be carried
in a container by different RRC messages, e.g. HandoverPreparationInformation,
HandoverCommand, RRCResume etc.. therefore before the introduction of new
RRCReconfiguration messages, e.g. for handover, a new design seems to be necessary
in order to improve modularity and maintainability of the code.

The goal of this commit is to make the generation of RRCReconfiguration
messages more modular by (1) preparing the RRCReconfiguration parameters
data in RRC (2) pass it to ASN1 for IEs allocation (3) encode to buffer

The following changes are introduced:
(1) introduce struct nr_rrc_reconfig_param_t to store the RRC parameters relevant
    to encode the RRCReconfiguration IEs
(2) add RRC function get_RRCReconfiguration_params to fetch nr_rrc_reconfig_param_t
    data from the UE context and
(3) pass it to the ASN1 encoder, e.g. do_RRCReconfiguration
(4) add a function build_RRCReconfiguration_IEs to allocate memory and build the
    ASN1 NR_RRCReconfiguration_IEs_t and
(5) adopt it in do_RRCReconfiguration
(4) add free_RRCReconfiguration_params for memory management of nr_rrc_reconfig_param_t data
(6) add test for rrc_reconfiguration

get_RRCReconfiguration_params:

This function prepares RRCReconfigurationParams for RRC encoding.

Motivation of this change: depending on the RRCReconfiguration
message to be encoded, the ownership of ASN1 memory allocation
should belong to the ASN1 layer, therefore this function is
preparing the nr_rrc_reconfig_param_t data to pass to the
ASN1 encoder to build the ASN1 message and encode to buffer

The function is preparing the params for the IEs that are
either mandatory or shared among different RRC messages.
Specific fields that depend on the message to be encoded are then
added afterwards in the caller. The input param to indicate
re-establishment has been split between SRBs and DRBs, since
depending on the scenario the PDCP re-establishment can vary.
This will be addressed in a later commit.

This function is also handling xid.

build_RRCReconfiguration_IE:

The long term goal is to transfer ownership of memory allocation in ASN1 encoding to
build_RRCReconfiguration_IE, then by calling ASN_STRUCT_FREE_CONTENTS_ONLY
on dl_dcch_msg, all IEs allocated in the context are freed after encoding to buffer.
In the long term, createDRBlist, createSRBlist can also be brought into the context
of build_RRCReconfiguration_IEs and free the ASN1 structure after encoding.
This improves maintability and helps preventing memory leaks.

Currently, what is not allocated in the context, is nulled and freed outside.

free_RRCReconfiguration_params:

this function frees memory allocated to build the nr_rrc_reconfig_param_t data,
including the NR_DRB_ToAddModList_t and NR_SRB_ToAddModList_t. The function
freeDRBlist has been removed since no longer necessary.

dedicated_NAS_msg_list:

dedicated_NAS_msg_list handling has also been refactored, by:

(1) fetch the NAS PDUs from the UE context in get_RRCReconfiguration_params,
which translates to (2) passing an array of dedicatedNAS-MessageList + size
to the ASN1 encoding function where (3) the ASN1 encoding logic for the
dedicated_NAS_msg_list IE has been moved

Note, 3GPP TS 38.331:
dedicatedNAS-MessageList: SEQUENCE (SIZE(1..maxDRB)) OF DedicatedNAS-Message
2025-06-09 20:43:04 +02:00
Guido Casati
d413cf9696 Refactor handover functions: get_neighbour_cell_information and get_neighbour_config
* differentiate the 2 functions based on the input: either NR Cell ID or PCI
* enhanced variables naming to distinguish the parameters
* add logging for debugging purposes
2025-06-09 20:12:12 +02:00
batuhan duyuler
75c7220345 Refactored code to populate DRBs to be setup list in nr_initiate_handover
Co-authored-by: Guido Casati <guido.casati@firecell.io>
2025-06-09 20:12:12 +02:00
Guido Casati
63b4a784a8 Use byte_array_t in nr_initiate_handover 2025-06-09 20:12:12 +02:00
Guido Casati
eb4cd38577 Refactor handling of NGAP UE Context in ngap_gNB_handle_nas_first_req
this commit is refactoring the function ngap_gNB_handle_nas_first_req
to (1) fill first a local instance of ngap_gNB_ue_context_t and then
(2) pass it to ngap_store_ue_context which will allocate memory
for the instance to store in ngap
2025-06-09 20:12:12 +02:00
Guido Casati
9d951b109f Return in nr_ue_get_sdu when mac->lc_ordered_list.count is 0
This count is used to size the dynamic array lcids_bj_pos. In case
count is zero, this would lead to runtime error. With this change,
the function will indicate to the caller that no SDUs are present and
will print an error.
2025-06-09 20:12:12 +02:00
Guido Casati
de0730a4e8 Use module_id in rrc_gNB_get_next_transaction_identifier call 2025-06-09 20:11:55 +02:00
Guido Casati
6de5b1d3de Store PCI received in reconfigurationWithSync
According to 3GPP TS 38.331 5.3.5.5.2 (Reconfiguration with sync), the UE
shall consider the target SpCell to be one with a physical cell identity
indicated by the physCellId
2025-06-09 20:10:01 +02:00
Guido Casati
70eb09dc09 Add NH derivation function (A.10 3GPP TS 33.501) 2025-06-09 20:10:01 +02:00
Guido Casati
bd1f266ab5 Add utility to log hex buffer with size len (LOG_D) and remove unused legacy hex_dump
* logging buffer is pretty useful for debugging purposes, e.g. derived key values
2025-06-09 20:10:01 +02:00
Guido Casati
d06790fcf2 Move derive_kgnb to key_nas_deriver lib 2025-06-09 20:10:01 +02:00
Guido Casati
1d2fb5af9d Fix FC value definition for NH (A.10 3GPP TS 33.501) 2025-06-09 20:10:01 +02:00
francescomani
e3e516e652 Reception of RRC Setup as response to re-establishment request
It also introduces state for resume request (even if not yet implemented)
2025-06-09 15:17:15 +02:00
francescomani
8a544b9fbb simpler RU beam management by storing RU beam index at L1 instead of FAPI beam index 2025-06-09 12:00:17 +02:00
Teodora
26b3b16aa5 Move the OSC nearRT-RIC tutorial in OAI E2 agent from FlexRIC 2025-06-07 14:41:17 +02:00
Robert Schmidt
842ab32c91 ITTI: remove useless log_scheduler() function
The primary motivation here is to remove a VLA, as in the parent
commits.  Closer inspection revealed that (1) it is only used by the LTE
UE, and (2) it only logs some data which we likely don't need. So I
simply removed this function.
2025-06-06 18:23:28 +02:00
francescomani
e6aeb47ea8 correct order for releasing spCellConfig 2025-06-06 11:40:47 +02:00
francescomani
3020200288 in case of DCIX0 38.214 tells us to assume it is always type1 allocation 2025-06-06 11:40:47 +02:00
Robert Schmidt
b7f00aa240 SCTP: Provide more info on getaddrinfo() fail
Upon failure, the error message was saying that something failed (i.e.,
the reason), but not parameters of the getaddrinfo(). Simplify root
cause analysis by providing the parameters for the attempted
getaddrinfo() call.
2025-06-06 07:53:58 +02:00
Jaroslava Fiedlerova
c5f5ab2820 CI: set NR RLC and NR PDCP parameters in the conf file
Default values used.
2025-06-05 14:58:37 +02:00
Bartosz Podrygajlo
5cb1113674 Handle YAML Exceptions 2025-06-05 12:55:41 +02:00
Bartosz Podrygajlo
c1c4c65a93 Unify setting default parameters in config libraries
Add common function config_common_getdefault
2025-06-05 12:54:05 +02:00
Guido Casati
eb2facfa76 Add macro to iterate over seq_arr_t 2025-06-05 11:37:56 +02:00
Guido Casati
5e2d7638d1 Move allocAddrCopy to NGAP utilities
This function is needed also in upcoming NGAP
libraries (i.e. N2 Handover) and therefore is moved
to the NGAP utilities file. The function converts
transport_layer_addr_t data struct to BIT_STRING_t
by copying the content of its members. The naming
is also updated to tnl_to_bitstring.
2025-06-05 11:35:51 +02:00
Guido Casati
615f5ef663 Add decoding functions for common NGAP IEs and use in stack
* Functions added:
  decode_ngap_guami
  decode_ngap_UEAggregateMaximumBitRate
  decode_ngap_nssai
  decode_ngap_security_capabilities
  decode_ngap_mobility_restriction
* Adopt these functions in the common NGAP library
2025-06-05 11:35:45 +02:00
Guido Casati
4b2cd156bb Adopt existing ngap_ambr_t in NGAP PDU Session Setup Request 2025-06-05 11:30:59 +02:00
Teodora
5b837f9250 Remove unnecessary shared volume for SMs
Follow-up for 497b4d3451.
2025-06-05 11:23:58 +02:00
rmagueta
7080810e49 Refactor SRS configuration 2025-06-05 10:19:55 +01:00
rmagueta
d851e7799c Fix segmentation fault and LOGs for SRS usage NFAPI_NR_SRS_BEAMMANAGEMENT 2025-06-05 10:19:55 +01:00
Cedric Roux
127ba6f0d9 add checks for allowed sections 2025-06-05 10:14:58 +02:00
Cedric Roux
c1372a52c8 bugfix: don't print '.' if no prefix
It's confusing to read "Section ".rlc" not allowed" when it should be
"Section "rlc" not allowed".
2025-06-05 10:13:09 +02:00
francescomani
bd05075ac6 code cosmetic improvement 2025-06-05 09:42:49 +02:00
Cedric Roux
915f9d55d8 fix asn1 test compilation
encode_xx() are needed
2025-06-05 09:18:49 +02:00
Cedric Roux
b9dffde03e adapt existing code to use NR RLC and NR PDCP values from configuration
- remove hardcoded values
- adapt gNB RRC code
- adapt gNB MAC code
- adapt physical simulators, where we put the hardcoded values
  that were everywhere else before; if there is a need for those
  simulators to get configurable values, more work is needed
  (but it's doubtful that it is needed)
2025-06-05 09:18:48 +02:00
Cedric Roux
178a5a66d4 add functions to retrieve configuration values for NR RLC and NR PDCP
They will be used in a later commit.
2025-06-05 08:58:07 +02:00
Cedric Roux
e214ffc0f3 add configuration for NR RLC to the MAC gNB structure
A later commit will use it.
2025-06-05 08:58:07 +02:00
Cedric Roux
82a3911971 add configuration for NR RLC and NR PDCP to the RRC gNB structure
A later commit will use them.
2025-06-05 08:58:07 +02:00
Cedric Roux
3f2eddd6ba simplify NR PDCP ASN.1 decoding and add encoding for configuration values 2025-06-05 08:58:07 +02:00
Cedric Roux
9845891ec4 simplify NR RLC ASN.1 decoding and add encoding for configuration values 2025-06-05 08:58:07 +02:00
Cedric Roux
7852518bd3 add NR PDCP parameter definitions
To be used in a later commit to retrieve NR PDCP configuration
parameters.

To use, add the following to the configuration file (outside of other
configurations). Adapt the values to your setup. The names ("len18bits",
"ms100", etc.) come from 3GPP TS 38.331.

pdcp = {
  drb = {
    sn_size = "len18bits"
    t_reordering  = "ms100"
    discard_timer = "infinity"
  }
}

Default values are applied if the configuration is absent.
The default values are the ones given above.
2025-06-05 08:58:07 +02:00
Cedric Roux
f70d2f1312 add NR RLC parameter definitions
To be used in a later commit to retrieve NR RLC configuration
parameters.

To use, add the following to the configuration file (outside of other
configurations). Adapt the values to your setup. The names ("ms45",
"size12", etc.) come from 3GPP TS 38.331.

rlc = {
  srb = {
    t_poll_retransmit = "ms45"
    t_reassembly = "ms25"
    t_status_prohibit = "ms0"
    poll_pdu = "infinity"
    poll_byte = "infinity"
    max_retx_threshold = "t8"
    sn_field_length = "size12"
  }
  drb_am = {
    t_poll_retransmit = "ms45"
    t_reassembly = "ms15"
    t_status_prohibit = "ms15"
    poll_pdu = "p64"
    poll_byte = "kB500"
    max_retx_threshold = "t32"
    sn_field_length = "size18"
  }
  drb_um = {
    t_reassembly = "ms15"
    sn_field_length = "size12"
  }
}

Default values are applied if the configuration is absent.
The default values are the ones given above.
2025-06-05 08:58:07 +02:00
Cedric Roux
c7ce407a4b add configuration values and structure for NR PDCP 2025-06-05 08:58:07 +02:00
Cedric Roux
1d0b8c1dc6 add configuration values and structure for NR RLC 2025-06-05 08:58:07 +02:00
Cedric Roux
93d9abd9b8 increase max number of check values
This will be needed for NR RLC and NR PDCP parameters.
2025-06-05 08:58:07 +02:00
Robert Schmidt
627e60f5bd Merge branch 'integration_2025_w23' into 'develop'
Integration: `2025.w23`

Closes #962, #956, and #801

See merge request oai/openairinterface5g!3464

* !3302 Enhance UE identity management in Initial UE Message and other NGAP improvements
* !3400 T bugfix: check input data a bit better
* !3459 Improvements in NR band tables according to Rel.17
* !3465 Fix checking that amf_ip_address section is not set.
* !3463 Move RRC radio parameters file to DU
* CI: Use host network mode in NSA-B200 pipeline
* !3389 Relax NR_UE_CAPABILITY_SLOT_RX_TO_TX asserts
* !3417 Imscope updates
* !3443 Fix data race in NR UE MSG3 scheduling
* !3467 remove dead globals
2025-06-04 20:14:00 +00:00
Utku Ucak
401ebe17b2 fix config file 2025-06-04 13:31:46 +00:00
Jaroslava Fiedlerova
a0578a5205 Merge remote-tracking branch 'origin/remove-dead-variables' into integration_2025_w23 (!3467)
remove dead globals
2025-06-03 19:00:18 +02:00
Jaroslava Fiedlerova
3bf3b78cb6 Merge remote-tracking branch 'origin/fix-msg3-datarace' into integration_2025_w23 (!3443)
Fix data race in NR UE MSG3 scheduling

Fixed a data race between DL processing of RAR and UL scheduler, which might
result in dropping MSG3.

It was possible that the UL scheduler for the UL slot which RAR indicates as
MSG3 slot was already run by the time the RAR was decoded.

Therefore when DCI for RAR is decoded, assume worst case and halt UL scheduler
for next slot until RAR is decoded solving the data race. This also in turn
halts all later scheduling due to sequential nature of the UL scheduler calls.

Closes #962
2025-06-03 18:59:16 +02:00
Jaroslava Fiedlerova
8fbee94045 Merge remote-tracking branch 'origin/imscope-csv-export' into integration_2025_w23 (!3417)
imscope updates

- Add CSV export button to imscope
- Add extra cache for IQ data in imscope record thread so that UE time domain
  data can be kept until PDSCH is decoded.
- Add metadata to UE time domain samples scope
- Add UE pdsch pre-compensation IQ and PDSCH channel estimates
2025-06-03 18:04:29 +02:00
Jaroslava Fiedlerova
4104a1fbcf Merge remote-tracking branch 'origin/relax-ue-k1k2-assert' into integration_2025_w23 (!3389)
Relax NR_UE_CAPABILITY_SLOT_RX_TO_TX asserts

Relax the UEs requirements on k1/k2 value.
2025-06-03 18:03:35 +02:00
Jaroslava Fiedlerova
404e0b3ba8 Merge remote-tracking branch 'origin/nr-rrc-config-at-mac' into integration_2025_w23 (!3463)
Move RRC radio parameters file to DU

A number of radio-related RRC parameters, e.g., CellGroupConfig, "originate" at
the DU and are sent to the CU for forwarding to the UE only. Similarly, there
are additional parameters, e.g., RLC-BearerConfig (part of CellGroupConfig),
that originate at the DU.

Hence, the DU decides about these parameters, depending on the MAC state and
capabilities. To clarify this, move the existing

openair2/RRC/NR/nr_rrc_config.{c,h} => openair2/LAYER2/NR_MAC_gNB/nr_radio_config.{c,h}

So that developers know that while those are RRC parameters, they originate at
the DU.

In other words, the CU/RRC is not supposed to use any of these functions in
the RRC. Correspondingly, includes of this file have been cleaned up (and when
they are not necessary at the MAC as well)
2025-06-03 18:00:49 +02:00
Teodora
a84a5328f2 Make xApp duration flexible
Improvement introduced in 0410c02372.
2025-06-03 17:07:31 +02:00
Teodora
498d2f8b37 Improve OAI-FlexRIC CI pipeline
Instead of running xApps from oai-flexric container,
create dedicated xApp containers.

In addition, modify the flexric.conf: DB_PATH doesn't exist;
DB_DIR is the correct name.
2025-06-03 17:07:03 +02:00
Teodora
735bc2fa05 Delete unnecessary test cases for OAI-FlexRIC CI pipeline
Needless sleep time test case, and duplicated test case for
the xApp with custom SMs.
2025-06-03 17:07:03 +02:00
Teodora
bd97d11654 Update FlexRIC submodule commit ID 2025-06-03 17:07:03 +02:00
Teodora
227f9e92f6 Properly fill RC RAN Function Name
Follow-up for 143c0238e9.
2025-06-03 17:07:03 +02:00
Teodora
dfa1bd4efe Add the NSSAI logging condition in KPM
It is a periodic output, based on the reporting period.
2025-06-03 17:07:03 +02:00
Teodora
2644594c32 Update the E2AP README
- prerequisites - use the links to FlexRIC tutorial
  - build FlexRIC - use the build tutorial from FlexRIC tutorial
  - explain in more details the supported service model functionalities
  - explanation if no RIC INDICATION is being sent
  - use multi-UE rfsim tutorial from doc/, not oai-workshops repository
2025-06-03 17:06:44 +02:00
Laurent THOMAS
72c29248a3 remove dead globals 2025-06-03 17:03:17 +02:00
Bartosz Podrygajlo
85f3e62caf Fix data race in NR UE MSG3 scheduling
Fixed a data race between DL processing of RAR and UL scheduler, which
might result in dropping MSG3.

It was possible that the UL scheduler for the UL slot which RAR
indicates as MSG3 slot was already run by the time the RAR was decoded.

Therefore when DCI for RAR is decoded, assume worst case and halt the
earliest corresponding UL scheduler call until RAR is decoded solving
the data race. This also in turn halts all later scheduling due to
sequential nature of the UL scheduler calls.
2025-06-03 14:41:06 +02:00
Jaroslava Fiedlerova
c52e2681c2 CI: Use host network mode in NSA-B200 pipeline
Following a power cycle of the CI machines in the NSA-B200 setup, the gNB
machine encountered a networking issue. Although packets were observed leaving
and returning to the host of gNB, they failed to reach the container.

Debugging steps taken:
- upgraded the gNB machine
- reinstalled Docker
- reviewed and verified IP rules and routing settings

Setting the container to use host network mode resolved the issue.
2025-06-03 13:25:01 +02:00
Bartosz Podrygajlo
456fe094bc Add UE PDSCH ChanEst and pre-compensation IQ to imscope 2025-06-03 13:15:33 +02:00
Bartosz Podrygajlo
114ac4d1bb Add metadata to UE time domain samples scope
Also fix the unintentional one symbol time delay.
2025-06-03 11:47:50 +02:00
Bartosz Podrygajlo
b58870d47c Add CSV iq export to Imscope
Add CSV export button to imscope.
2025-06-03 11:47:42 +02:00
Bartosz Podrygajlo
4ebe910363 Add extra cache for imscope record thread
This should allow to capture UE time domain data after PDSCH decoding failure.
2025-06-03 11:46:23 +02:00
Jaroslava Fiedlerova
12d3ef48eb Merge remote-tracking branch 'origin/fix-config-not-set' into integration_2025_w23 (!3465)
Fix checking that amf_ip_address section is not set.

The constructed setting path with prefix was invalid.

Closes #956
2025-06-03 10:51:46 +02:00
Jaroslava Fiedlerova
7efbdef2dc Merge remote-tracking branch 'origin/NR_bands_fix' into integration_2025_w23 (!3459)
Improvements in NR band tables according to Rel.17

Following a request in the mailing list
2025-06-03 10:50:07 +02:00
Bartosz Podrygajlo
fc3e9f0efe UE TX time budget
Measure the UEs TX time budget and warn if its violated.
2025-06-03 08:57:40 +02:00
Bartosz Podrygajlo
e676d0d2cc Relax NR_UE_CAPABILITY_SLOT_RX_TO_TX asserts
Relax the UEs requirements on k1/k2 value.
2025-06-03 08:56:31 +02:00
Bartosz Podrygajlo
debad23a7e Fix checking that amf_ip_address section is not set.
The constructed setting path with prefix was invalid.
2025-06-02 17:36:48 +02:00
Jaroslava Fiedlerova
2b4bbf7930 Merge remote-tracking branch 'origin/bugfix-t-event-checks' into integration_2025_w23 (!3400)
T bugfix: check input data a bit better

Some small fixes in T tracers.
2025-06-02 16:44:36 +02:00
Jaroslava Fiedlerova
dda3b7e88d Merge remote-tracking branch 'origin/issue-801' into integration_2025_w23 (!3302)
Enhance UE identity management in Initial UE Message and other NGAP improvements

This MR improves the Initial UE Message procedures by supporting simultaneous
presence of both 5G-S-TMSI and GUAMI. Previously, only one identity could be
used, leading to potential AMF selection failures. Now the presenceMask allows
both identities. The AMF selection is prioritizing GUAMI first, then falling
back to 5G-S-TMSI, and finally using PLMN or highest capacity.

Also, fix handling of selected PLMN identity in NGAP.

Refactoring:
- Select the AMF based on (1) absence of UE Identity (2) Presence of GUAMI
  (3) Presence of 5G-S-TMSI
- Also refactored the AMF selection logic for better readability and reliability.
- Refactor and cleanup rrc_gNB_send_NGAP_NAS_FIRST_REQ
- Replace ngap_pdu_t with byte_array_t
- Add guami_t to ngran_types.h: refactor NGAP and RRC code to use one common
  GUAMI type instead of two identical ones

Also:
- Bugfix in ngap_gNB_handle_ng_setup_response: use correct count for PLMNSupportList

Closes issue #801
2025-06-02 16:20:24 +02:00
Teodora
2b3e1772d6 Add e2_agent section in CU/DU split configuration 2025-06-02 15:22:35 +02:00
Teodora
3f930551ff Fix CU to not contain the pointer for MAC/RLC stats
Segmentation fault occured since the commit ID 9e5c5497ab,
where we try to copy the pointer which was not even been allocated. Before, we were
copying the address of a NULL pointer and therefore no segmentation fault.

This commit fixes the segmentation fault by checking if the memory was allocated, i.e. should not be
in the case of CU (as it doesn't contain MAC/RLC layers).
2025-06-02 15:22:35 +02:00
Teodora
f5a75caa4c Do not check E2AP/KPM versions if E2 agent disabled 2025-06-02 15:22:35 +02:00
Teodora
4f7b44e862 Remove the cmake option XAPP_MULTILANGUAGE from all Dockerfiles
The FlexRIC main CMakeLists.txt sets XAPP_MULTILANGUAGE to OFF by default.
Related commit ID: 637f718c32
2025-06-02 15:22:02 +02:00
Robert Schmidt
4d755c9a1a Move nr_rrc_config.c to DU and rename nr_radio_config.c
A number of radio-related RRC parameters, e.g., CellGroupConfig,
"originate" at the DU and are sent to the CU for forwarding to the UE
only. Similarly, there are additional parameters, e.g., RLC-BearerConfig
(part of CellGroupConfig), that originate at the DU.

Hence, the DU decides about these parameters, depending on the MAC state
and capabilities. To clarify this, move the existing

  openair2/RRC/NR/nr_rrc_config.{c,h} => openair2/LAYER2/NR_MAC_gNB/nr_radio_config.{c,h}

So that developers know that while those are RRC parameters, they
originate at the DU.

In other words, the CU/RRC is not supposed to use any of these functions
in the RRC. Correspondingly, includes of this file have been cleaned up
(and when they are not necessary at the MAC as well).
2025-06-02 14:13:51 +02:00
Robert Schmidt
c334ad7f7c Remove unused, add necessary headers 2025-06-02 11:43:40 +02:00
Robert Schmidt
8bf48f326a Move NR_MAX_SUPPORTED_DL_LAYERS to where it is used 2025-06-02 11:43:40 +02:00
Robert Schmidt
ac01fcc1b4 Move RLC-BearerConfig file to nr_rrc_config.c
One of the next commits moves nr_rrc_config.c "down to" the MAC/DU. The
BearerConfig functions are only used at the DU, so move them here in the
corresponding file.
2025-06-02 11:43:40 +02:00
Cedric Roux
7a77ee2f43 T: validate input data a bit more
When data is generated by "normal" T tracers, it should be fine.
But it might come from unknown sources and then content might be
"strange". So let's validate input data a bit more.
2025-06-02 11:19:23 +02:00
Cedric Roux
2fa337d853 T bugfix: include size of 'length' to allocated memory
The way allocation is done (granularity of 64KiB) makes a crash more
difficult to achieve, but if a trace is exactly 64KiB, we miss 4 bytes
in the realloc and then anything may happen.
2025-06-02 11:19:23 +02:00
francescomani
805d22aa3b fixing band 50 (according to newer release), band 94 and adding new bands present in Rel.17 2025-05-29 16:23:31 +02:00
Bartosz Podrygajlo
8be33ed66f Make ubuntu22 base image docker cache friendly
Use wget instead of ADD to allow efficient caching of tini install.
2025-05-29 15:10:23 +02:00
Bartosz Podrygajlo
171f1fc015 Add ccache and CPM cache in ubuntu22 image builds 2025-05-29 13:48:01 +02:00
Guido Casati
4ad2a78706 Fix GUAMI decoding in NG Setup Response handler
GUAMI fields (Set ID, Pointer and Region ID) were decoded as Octet String,
however they are encoded as BIT STRING. Therefore, the GUAMI value was wrongly decoded.

In the AMF logs the AMF IDs are 1,1,1, however in gNB logs we had 1,64,4

Quick local test confirmed that:

---- TESTING AMF IDs = 1 ----
Region ID (OCTET STRING): 1
Region ID (BIT STRING):   1
Set ID (OCTET STRING): 64
Set ID (BIT STRING):   1
Pointer (OCTET STRING): 4
Pointer (BIT STRING):   1

The difference arises because:
- OCTET STRING treats the buffer as raw bytes, with all bits used.
- BIT STRING includes a `bits_unused` field, which tells how many padding bits
  are present in the least significant end. This is especially important in
  3GPP ASN.1 definitions like AMF Set ID (10 bits), AMF Region ID (8 bits),
  AMF Pointer (6 bits),  where the full byte(s) may contain unused bits that
  must be masked out.
2025-05-28 13:01:28 +02:00
Guido Casati
cc57bcc3a0 Log served GUAMIs, PLMNs and slices in NG Setup handler 2025-05-28 13:01:28 +02:00
Guido Casati
539d17203f Fix handling of selected PLMN in NGAP
selectedPLMN-Identity IE in RRCSetupComplete is an Index (long) of the PLMN selected
by the UE from the plmn-IdentityInfoList (SIB1) (see 3GPP TS 38.331)

while

Selected PLMN Identity in NGAP INITIAL UE MESSAGE Indicates the selected PLMN
id for the non-3GPP access (PLMN Identity ID carrying MNC, MCC and MNC size,
9.2.5.1 3GPP TS 38.413)

The legacy code was setting Selected PLMN Identity in the latter to an ID
value as the former, however in NGAP the IE to be encoded is PLMN Identity 9.3.3.5

therefore:

* set plmn type plmn_id_t in ngap_nas_first_req_t
* check whether received selectedPLMN-Identity is within bounds
* select PLMN from gNB_RrcConfigurationReq by selectedPLMN-Identity ID
  note: this commit is assuming that the plmn-IdentityInfoList in SIB1
  is matching the PLMN list in gNB_RrcConfigurationReq
* in NGAP: store the PLMN in the NGAP UE context, no need to fetch the PLMN
  in the NGAP instance since the UE context already tells what PLMN
  was selected

Closes #801
2025-05-28 13:01:28 +02:00
Guido Casati
8a0baed430 Handle both 5G-S-TMSI and GUAMI in the NGAP Initial UE Message procedures
* use bitmask to select presence of either 5G-S-TMSI or GUAMI
* select the AMF based on
  (1) absence of UE Identity (2) Presence of GUAMI (3) Presence of 5G-S-TMSI

Related to #801
2025-05-28 13:01:28 +02:00
Guido Casati
afe73820d6 Refactor and cleanup rrc_gNB_send_NGAP_NAS_FIRST_REQ
* add function to process AMF Identifier
* add function to select AMF
* set const parameters in utility nnsf functions
* adopt utilities for memory allocation
* improve readability and maintainability
* improve logging
2025-05-28 13:01:28 +02:00
Guido Casati
8fb8713023 Replace ngap_pdu_t with byte_array_t
ngap_pdu_t has the same definition as byte_array_t, so it is
replaced by the latter. This simplify the stack and reduces
duplicated code.

Also, add function create_byte_array to copy from an
existing buffer to a new byte_array_t and replaced
allocCopy with create_byte_array, and adopted
OCTET_STRING_fromBuf whenever possible.
2025-05-28 12:59:50 +02:00
Jaroslava Fiedlerova
139c0d548c CI: change path to lteue and configs after SW update 2025-05-27 19:00:22 +02:00
Raghavendra Dinavahi
bc1844b482 Added in the Conf file for testing in CI, description updated 2025-05-23 17:26:47 +02:00
Raghavendra Dinavahi
61d5dd0094 GNB-Changes: Enabling ulsyncvalidityDuration timer in SIB19
ntn-UlSyncValidityDuration in SIB19 from Spec 38.331 v17.12
A validity duration configured by the network for assistance information which indicates the maximum time duration
(from epochTime) during which the UE can apply assistance information without having acquired new assistance information.
The unit of ntn-UlSyncValidityDuration is second. Value s5 corresponds to 5 s, value s10 indicate 10 s and so on.
ntn-UlSyncValidityDuration-r17 ENUMERATED{ s5, s10, s15, s20, s25, s30, s35,s40, s45, s50, s55, s60, s120, s180, s240, s900}
Implementation of epochtime is under discussion.

It can be configured in configuration file according to the above enumeration. For GEO - 240s, MEO - 20s, LEO-5s can be used.
2025-05-23 17:26:47 +02:00
Eduard Vlad
a7e2374e1d NAS Registration Reject: Add bounds and lengths checks
This change adds lengths checks to the received registration reject
message and also performs a bounds check for the received cause.
Since the cause is not checked, any string in the memory can be
dereferenced, possibly leading to DoS.

Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
2025-05-22 15:31:28 +02:00
Eduard Vlad
5dd9ead820 DL NAS Transport: Fix Message Type retrieval on too short message
The change addresses the SM message type retrieval for DL NAS Transport
messages. The assumption of an offset 17 = 7 (MM Sec) + 3 (MM Plain) + 1
(IEI) + 2 (Len) + 4 (SM) is correct.

However, if the DL NAS Transport is received in a plain header, the
lengths would not add up anymore. (This is not complying with the
standard, so not allowed, but possible). The check for the length is
necessary to not process arbitrary memory contents beyond the
`pdu_buffer`.

Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
2025-05-22 15:10:40 +02:00
Guido Casati
4c179270c2 Add guami_t to ngran_types.h
* refactor NGAP and RRC code to use one common GUAMI type
  instead of two identical ones
2025-05-08 10:04:36 +02:00
Guido Casati
002fa0050f Bugfix in ngap_gNB_handle_ng_setup_response: use correct count for PLMNSupportList 2025-05-01 11:19:59 +02:00
221 changed files with 6101 additions and 3331 deletions

View File

@@ -300,14 +300,15 @@ add_definitions(-DHAVE_NETINET_IN_H)
set(E2_AGENT "OFF" CACHE STRING "O-RAN-compliant E2 Agent")
set_property(CACHE E2_AGENT PROPERTY STRINGS "ON" "OFF")
set(E2AP_VERSION "E2AP_V2" CACHE STRING "E2AP version")
set_property(CACHE E2AP_VERSION PROPERTY STRINGS "E2AP_V1" "E2AP_V2" "E2AP_V3")
message(STATUS "Selected E2AP_VERSION: ${E2AP_VERSION}")
set(KPM_VERSION "KPM_V2_03" CACHE STRING "The KPM SM version to use")
set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2_03" "KPM_V3_00")
message(STATUS "Selected KPM Version: ${KPM_VERSION}")
if (E2_AGENT)
set(E2AP_VERSION "E2AP_V2" CACHE STRING "E2AP version")
set_property(CACHE E2AP_VERSION PROPERTY STRINGS "E2AP_V1" "E2AP_V2" "E2AP_V3")
message(STATUS "Selected E2AP version: ${E2AP_VERSION}")
set(KPM_VERSION "KPM_V2_03" CACHE STRING "The KPM SM version to use")
set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2_03" "KPM_V3_00")
message(STATUS "Selected KPM version: ${KPM_VERSION}")
endif()
add_boolean_option(ENABLE_IMSCOPE OFF "Enable phy scope based on imgui" OFF)
add_boolean_option(ENABLE_IMSCOPE_RECORD OFF "Enable recording IQ data for imscope" OFF)
@@ -1147,7 +1148,6 @@ set(L2_NR_SRC
${NR_RRC_DIR}/rrc_gNB.c
${NR_RRC_DIR}/mac_rrc_dl_direct.c
${NR_RRC_DIR}/mac_rrc_dl_f1ap.c
${NR_RRC_DIR}/nr_rrc_config.c
${NR_RRC_DIR}/rrc_gNB_nsa.c
${NR_RRC_DIR}/rrc_gNB_UE_context.c
${NR_RRC_DIR}/rrc_gNB_NGAP.c
@@ -1230,6 +1230,7 @@ set (MAC_NR_SRC
${NR_GNB_MAC_DIR}/mac_rrc_dl_handler.c
${NR_GNB_MAC_DIR}/mac_rrc_ul_direct.c
${NR_GNB_MAC_DIR}/mac_rrc_ul_f1ap.c
${NR_GNB_MAC_DIR}/nr_radio_config.c
)

View File

@@ -8,13 +8,13 @@
#define DL_ARFCN 631296
#define TDD 1
log_options: "all.level=warn,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_options: "all.level=debug,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver_20/1chan.cfg",
include "rf_driver/config.cfg",
/* If true, allow the simulation of several UEs at the same time and
allow dynamic UE creation from remote API */
@@ -22,7 +22,6 @@ allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
ldpc_max_its:8,
cells: [{
rf_port: 0,
bandwidth: 20,

View File

@@ -0,0 +1,47 @@
/* Parameters for SDR device version 2023-06-10
* Copyright (C) 2015-2023 Amarisoft
*/
#if !defined(N_CELL)
#define N_CELL 1
#endif
#if N_ANTENNA_DL <= 2
#define N_CHAN N_CELL
#else
#define N_CHAN 2*N_CELL
#endif
rf_driver: {
name: "sdr",
/* list of devices. 'dev0' is always the master. */
#if N_CHAN == 1
args: "dev0=/dev/sdr0",
#elif N_CHAN == 2
args: "dev0=/dev/sdr0,dev1=/dev/sdr1",
#elif N_CHAN == 3
args: "dev0=/dev/sdr0,dev1=/dev/sdr1,dev2=/dev/sdr2",
#elif N_CHAN == 4
args: "dev0=/dev/sdr0,dev1=/dev/sdr1,dev2=/dev/sdr2,dev3=/dev/sdr3",
#elif N_CHAN == 6
args: "dev0=/dev/sdr0,dev1=/dev/sdr1,dev2=/dev/sdr2,dev3=/dev/sdr3,dev4=/dev/sdr4,dev5=/dev/sdr5",
#else
args: "",
#endif
/* synchronisation source: internal, gps, external (default = internal) */
// sync: "gps",
//rx_antenna:"rx", // force to use the RX connector in TDD as RX antenna
/* PCIe jitter. decrease it to reduce latency */
fifo_tx_time: 50,
//rx_latency: 30,
},
#if 0
tx_pad_duration:300,
#endif
tx_gain: 75.0, /* TX gain (in dB) */
rx_gain: 55.0, /* RX gain (in dB) */

View File

@@ -147,125 +147,127 @@ ltebox-nepes:
amarisoft_ue:
Host: amariue
InitScript: /root/lteue-linux-2023-10-27/ue/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-multi-00102-20.cfg &
TermScript: /root/2023-10-27/libs/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-multi-00102-20.cfg &
TermScript: /root/lteue-linux-2025-03-15/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
NetworkScript: ip netns exec ue1 ip a show dev pdn0
amarisoft_ue_2x2:
Host: amariue
InitScript: /root/lteue-linux-2023-10-27/ue/lteue /root/oaicicd/ran_sa_aw2s_asue_2x2/aw2s-multi-00102-2x2-v2.cfg &
TermScript: /root/2023-10-27/libs/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_aw2s_asue_2x2/aw2s-multi-00102-2x2-v2.cfg &
TermScript: /root/lteue-linux-2025-03-15/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
NetworkScript: ip netns exec ue1 ip a show dev pdn0
amarisoft_ue_fhi72:
Host: amariue
InitScript: /root/lteue-linux-2023-10-27/ue/lteue /root/oaicicd/ran_sa_fhi72_asue_2x2_benetel550/fhi72-multi-20897-2x2.cfg &
TermScript: /root/2023-10-27/libs/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_fhi72_asue_2x2_benetel550/fhi72-multi-20897-2x2.cfg &
TermScript: /root/lteue-linux-2025-03-15/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
amarisoft_ue_1:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":1}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":1}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":1}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":1}'
NetworkScript: ip netns exec ue1 ip a show dev pdn0
CmdPrefix: ip netns exec ue1
MTU: 1500
amarisoft_ue_2:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":2}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":2}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":2}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":2}'
NetworkScript: ip netns exec ue2 ip a show dev pdn0
CmdPrefix: ip netns exec ue2
MTU: 1500
amarisoft_ue_3:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":3}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":3}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":3}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":3}'
NetworkScript: ip netns exec ue3 ip a show dev pdn0
CmdPrefix: ip netns exec ue3
MTU: 1500
amarisoft_ue_4:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":4}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":4}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":4}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":4}'
NetworkScript: ip netns exec ue4 ip a show dev pdn0
CmdPrefix: ip netns exec ue4
MTU: 1500
amarisoft_ue_5:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":5}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":5}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":5}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":5}'
NetworkScript: ip netns exec ue5 ip a show dev pdn0
CmdPrefix: ip netns exec ue5
MTU: 1500
amarisoft_ue_6:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":6}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":6}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":6}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":6}'
NetworkScript: ip netns exec ue6 ip a show dev pdn0
CmdPrefix: ip netns exec ue6
MTU: 1500
amarisoft_ue_7:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":7}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":7}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":7}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":7}'
NetworkScript: ip netns exec ue7 ip a show dev pdn0
CmdPrefix: ip netns exec ue7
MTU: 1500
amarisoft_ue_8:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":8}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":8}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":8}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":8}'
NetworkScript: ip netns exec ue8 ip a show dev pdn0
CmdPrefix: ip netns exec ue8
MTU: 1500
amarisoft_ue_9:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":9}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":9}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":9}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":9}'
NetworkScript: ip netns exec ue9 ip a show dev pdn0
CmdPrefix: ip netns exec ue9
MTU: 1500
amarisoft_ue_10:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":10}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":10}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":10}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":10}'
NetworkScript: ip netns exec ue10 ip a show dev pdn0
CmdPrefix: ip netns exec ue10
MTU: 1500
amarisoft_ue_11:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":11}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":11}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":11}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":11}'
NetworkScript: ip netns exec ue11 ip a show dev pdn0
CmdPrefix: ip netns exec ue11
MTU: 1500
amarisoft_ue_12:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":12}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":12}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":12}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":12}'
NetworkScript: ip netns exec ue12 ip a show dev pdn0
CmdPrefix: ip netns exec ue12
MTU: 1500
amarisoft_ue_13:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":13}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":13}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":13}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":13}'
NetworkScript: ip netns exec ue13 ip a show dev pdn0
CmdPrefix: ip netns exec ue13
MTU: 1500
amarisoft_ue_14:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":14}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":14}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":14}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":14}'
NetworkScript: ip netns exec ue14 ip a show dev pdn0
CmdPrefix: ip netns exec ue14
MTU: 1500
amarisoft_ue_15:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":15}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":15}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":15}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":15}'
NetworkScript: ip netns exec ue15 ip a show dev pdn0
CmdPrefix: ip netns exec ue15
MTU: 1500
amarisoft_ue_16:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":16}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":16}'
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":16}'
DetachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":16}'
NetworkScript: ip netns exec ue16 ip a show dev pdn0
CmdPrefix: ip netns exec ue16
MTU: 1500

View File

@@ -498,10 +498,10 @@ class Containerize():
elif image != 'ran-build':
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
if image == 'oai-gnb-aerial':
cmd.run('cp -f /opt/nvidia-ipc/nvipc_src.*.tar.gz .')
cmd.run('cp -f /opt/nvidia-ipc/nvipc.src.2025.05.20.tar.gz .')
ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {name}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} {option} . > cmake_targets/log/{name}.log 2>&1', timeout=1200)
if image == 'oai-gnb-aerial':
cmd.run('rm -f nvipc_src.*.tar.gz')
cmd.run('rm -f nvipc.src.2025.05.20.tar.gz')
if image == 'ran-build' and ret.returncode == 0:
cmd.run(f"docker run --name test-log -d {name}:{imageTag} /bin/true")
cmd.run(f"docker cp test-log:/oai-ran/cmake_targets/log/ cmake_targets/log/{name}/")

View File

@@ -224,7 +224,6 @@ class HTMLManagement():
self.htmlFile.write(' </table>\n')
self.htmlFile.write(' </div>\n')
self.htmlFile.close()
time.sleep(1)
if passStatus:
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__//' test_results.html"
subprocess.run(cmd, shell=True)

View File

@@ -213,7 +213,7 @@ def Iperf_analyzeV2UDP(server_filename, iperf_bitrate_threshold, iperf_packetlos
pal_msg += f' (too high! >{iperf_packetloss_threshold}%)'
return (result, f'{req_msg}\n{bir_msg}\n{brl_msg}\n{jit_msg}\n{pal_msg}')
def Custom_Command(HTML, node, command, command_fail):
def Custom_Command(HTML, node, command):
logging.info(f"Executing custom command on {node}")
cmd = cls_cmd.getConnection(node)
ret = cmd.run(command)
@@ -221,26 +221,20 @@ def Custom_Command(HTML, node, command, command_fail):
logging.debug(f"Custom_Command: {command} on node: {node} - {'OK, command succeeded' if ret.returncode == 0 else f'Error, return code: {ret.returncode}'}")
status = 'OK'
message = []
if ret.returncode != 0 and not command_fail:
message = [ret.stdout]
logging.warning(f'Custom_Command output: {message}')
status = 'Warning'
if ret.returncode != 0 and command_fail:
if ret.returncode != 0:
message = [ret.stdout]
logging.error(f'Custom_Command failed: output: {message}')
status = 'KO'
HTML.CreateHtmlTestRowQueue(command, status, message)
return status == 'OK' or status == 'Warning'
def Custom_Script(HTML, node, script, command_fail):
def Custom_Script(HTML, node, script):
logging.info(f"Executing custom script on {node}")
ret = cls_cmd.runScript(node, script, 90)
logging.debug(f"Custom_Script: {script} on node: {node} - return code {ret.returncode}, output:\n{ret.stdout}")
status = 'OK'
message = [ret.stdout]
if ret.returncode != 0 and not command_fail:
status = 'Warning'
if ret.returncode != 0 and command_fail:
if ret.returncode != 0:
status = 'KO'
HTML.CreateHtmlTestRowQueue(script, status, message)
return status == 'OK' or status == 'Warning'

View File

@@ -58,6 +58,14 @@ gNBs =
}
);
pdcp = {
drb = {
sn_size = "len18bits"
t_reordering = "ms100"
discard_timer = "infinity"
}
}
security = {
# preferred ciphering algorithms
# the first one of the list that an UE supports in chosen

View File

@@ -163,6 +163,31 @@ gNBs =
}
);
rlc = {
srb = {
t_poll_retransmit = "ms45"
t_reassembly = "ms25"
t_status_prohibit = "ms0"
poll_pdu = "infinity"
poll_byte = "infinity"
max_retx_threshold = "t8"
sn_field_length = "size12"
}
drb_am = {
t_poll_retransmit = "ms45"
t_reassembly = "ms15"
t_status_prohibit = "ms15"
poll_pdu = "p64"
poll_byte = "kB500"
max_retx_threshold = "t32"
sn_field_length = "size18"
}
drb_um = {
t_reassembly = "ms15"
sn_field_length = "size12"
}
}
MACRLCs = (
{
num_cc = 1;

View File

@@ -169,10 +169,10 @@ gNBs =
NETWORK_INTERFACES :
{
GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.68.194";
GNB_IPV4_ADDRESS_FOR_S1U = "192.168.68.194";
GNB_IPV4_ADDRESS_FOR_S1_MME = "172.21.16.109";
GNB_IPV4_ADDRESS_FOR_S1U = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
GNB_IPV4_ADDRESS_FOR_X2C = "192.168.68.194";
GNB_IPV4_ADDRESS_FOR_X2C = "172.21.16.109";
GNB_PORT_FOR_X2C = 36422; # Spec 36422
};

View File

@@ -149,6 +149,8 @@ gNBs =
#ext2
#ntn_Config_r17
# This can be of values {s5, s10, s15, s20, s25, s30, s35, s40, s45, s50, s55, s60, s120, s180, s240, s900}
ntn-UlSyncValidityDuration-r17 = 240;
cellSpecificKoffset_r17 = 478;
ta-Common-r17 = 58629666; # 238.74 ms
positionX-r17 = 0;

View File

@@ -21,7 +21,6 @@ gNBs =
sib1_tda = 15;
min_rxtxtime = 6;
beam_weights = [0]; // single SSB -> one analog beam
servingCellConfigCommon = (
{
@@ -179,6 +178,7 @@ MACRLCs = ({
set_analog_beamforming = 1;
beam_duration = 1;
beams_per_period = 1;
beam_weights = [0]; // single SSB -> one analog beam
});
L1s = (

View File

@@ -376,14 +376,12 @@ def ExecuteActionWithParam(action):
# Change all execution targets to localhost
node = 'localhost'
command = test.findtext('command')
command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
success = cls_oaicitest.Custom_Command(HTML, node, command, command_fail)
success = cls_oaicitest.Custom_Command(HTML, node, command)
elif action == 'Custom_Script':
node = test.findtext('node')
script = test.findtext('script')
command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
success = cls_oaicitest.Custom_Script(HTML, node, script, command_fail)
success = cls_oaicitest.Custom_Script(HTML, node, script)
elif action == 'Pull_Cluster_Image':
tag_prefix = test.findtext('tag_prefix') or ""
@@ -626,6 +624,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
HTML.testCase_id=CiTestObj.testCase_id
CiTestObj.desc = test.findtext('desc')
always_exec = test.findtext('always_exec') in ['True', 'true', 'Yes', 'yes']
may_fail = test.findtext('may_fail') in ['True', 'true', 'Yes', 'yes']
HTML.desc=CiTestObj.desc
action = test.findtext('class')
if (CheckClassValidity(xml_class_list, action, id) == False):
@@ -639,7 +638,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
break
try:
test_succeeded = ExecuteActionWithParam(action)
if not test_succeeded:
if not test_succeeded and may_fail:
logging.warning(f"test ID {test_case_id} action {action} may or may not fail, proceeding despite error")
elif not test_succeeded:
logging.error(f"test ID {test_case_id} action {action} failed ({test_succeeded}), skipping next tests")
task_set_succeeded = False
except Exception as e:

View File

@@ -95,7 +95,6 @@ class RANManagement():
self.cmd_prefix = '' # prefix before {lte,nr}-softmodem
self.node = ''
self.command = ''
self.command_fail = False
#-----------------------------------------------------------

View File

@@ -27,6 +27,8 @@
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
000001
000011
000012
000002
000003
000004
@@ -38,7 +40,21 @@
<desc>This should succeed</desc>
<node>localhost</node>
<command>true</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="000011">
<class>Custom_Command</class>
<desc>This may fail</desc>
<may_fail>true</may_fail>
<node>localhost</node>
<command>false</command>
</testCase>
<testCase id="000012">
<class>Custom_Command</class>
<desc>This is still executed</desc>
<node>localhost</node>
<command>true</command>
</testCase>
<testCase id="000002">
@@ -46,7 +62,6 @@
<desc>This should fail</desc>
<node>localhost</node>
<command>false</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="000003">
@@ -54,7 +69,6 @@
<desc>This should be skipped</desc>
<node>localhost</node>
<command>true</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="000004">
@@ -63,6 +77,5 @@
<always_exec>true</always_exec>
<node>localhost</node>
<command>true</command>
<command_fail>yes</command_fail>
</testCase>
</testCaseList>

View File

@@ -134,7 +134,6 @@
<desc>Simulate a DL radio channel with noise (3 dB)</desc>
<node>cacofonix</node>
<command>echo channelmod modify 0 noise_power_dB 3 | nc --send-only 192.168.71.181 8091</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="030021">
@@ -166,7 +165,6 @@
<desc>Trigger Reestablishment</desc>
<node>cacofonix</node>
<command>echo ci force_reestab | nc 192.168.71.171 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="020022">
@@ -185,7 +183,6 @@
<desc>Verify Reestablishment</desc>
<node>cacofonix</node>
<command>echo ci get_reestab_count | nc 192.168.71.150 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="040021">
@@ -193,7 +190,6 @@
<desc>Simulate a disruption of DL radio channel (ploss 55)</desc>
<node>cacofonix</node>
<command>echo channelmod modify 0 ploss 55 | nc 192.168.71.181 8091</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="040022">
@@ -201,7 +197,6 @@
<desc>Get UE sync state (UE ID 0)</desc>
<node>cacofonix</node>
<command>echo ciUE sync_state 0 | nc 192.168.71.181 8091 | grep -E UE_NOT_SYNC</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="040023">
@@ -209,7 +204,6 @@
<desc>Restoration of the original DL channel conditions (ploss 20)</desc>
<node>cacofonix</node>
<command>echo channelmod modify 0 ploss 20 | nc 192.168.71.181 8091</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="040024">
@@ -217,7 +211,6 @@
<desc>Get UE sync state (UE ID 0)</desc>
<node>cacofonix</node>
<command>echo ciUE sync_state 0 | nc 192.168.71.181 8091 | grep -E UE_CONNECTED</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="040025">
@@ -225,7 +218,6 @@
<desc>Trigger Handover</desc>
<node>cacofonix</node>
<command>echo ci trigger_f1_ho | nc 192.168.71.150 9090</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="040026">
@@ -233,7 +225,6 @@
<desc>UE (1) connected to DU-PCI 0?</desc>
<node>cacofonix</node>
<command>echo ci fetch_du_by_ue_id 1 | nc 192.168.71.150 9090 | grep "3584"</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="040027">
@@ -241,7 +232,6 @@
<desc>UE (1) connected to DU-PCI 1?</desc>
<node>cacofonix</node>
<command>echo ci fetch_du_by_ue_id 1 | nc 192.168.71.150 9090 | grep "3585"</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="100021">

View File

@@ -32,7 +32,6 @@
000001
000002
000003
002001
010000
000004
333333
@@ -40,7 +39,6 @@
010002
010003
020005
010013
002006
444444
100002
@@ -50,12 +48,6 @@
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="002001">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>10</idle_sleep_time_in_sec>
</testCase>
<testCase id="111110">
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
@@ -173,43 +165,39 @@
</testCase>
<testCase id="010000">
<class>Custom_Command</class>
<class>Deploy_Object</class>
<desc>RC monitoring</desc>
<node>localhost</node>
<command_fail>yes</command_fail>
<command>docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_rc_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/rc-moni-010000.log</command>
<yaml_path>ci-scripts/yaml_files/5g_rfsimulator_flexric</yaml_path>
<services>xapp-rc-moni</services>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="010001">
<class>Custom_Command</class>
<class>Deploy_Object</class>
<desc>KPM monitoring</desc>
<node>localhost</node>
<command_fail>yes</command_fail>
<command>docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_kpm_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/kpm-moni-010001.log</command>
<yaml_path>ci-scripts/yaml_files/5g_rfsimulator_flexric</yaml_path>
<services>xapp-kpm-moni</services>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="010002">
<class>Custom_Command</class>
<class>Deploy_Object</class>
<desc>KPM monitoring and RC control</desc>
<node>localhost</node>
<command_fail>yes</command_fail>
<command>docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/kpm_rc/xapp_kpm_rc" > ../cmake_targets/log/5g_rfsimulator_flexric/kpm_rc-010002.log</command>
<yaml_path>ci-scripts/yaml_files/5g_rfsimulator_flexric</yaml_path>
<services>xapp-kpm-rc</services>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="010003">
<class>Custom_Command</class>
<class>Deploy_Object</class>
<desc>Custom SMs monitoring</desc>
<node>localhost</node>
<command_fail>yes</command_fail>
<command>docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/sms-moni-010003.log</command>
</testCase>
<testCase id="010013">
<class>Custom_Command</class>
<desc>Custom SMs monitoring</desc>
<node>localhost</node>
<command_fail>yes</command_fail>
<command>docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/sms-moni-010013.log</command>
<yaml_path>ci-scripts/yaml_files/5g_rfsimulator_flexric</yaml_path>
<services>xapp-gtp-mac-rlc-pdcp-moni</services>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
</testCaseList>

View File

@@ -242,7 +242,7 @@
<testCase id="444445">
<class>Detach_UE</class>
<desc>Detach OAI UE 2 to 10</desc>
<desc>Detach OAI UE 3 to 10</desc>
<id>rfsim5g_ue3 rfsim5g_ue4 rfsim5g_ue5 rfsim5g_ue6 rfsim5g_ue7 rfsim5g_ue8 rfsim5g_ue9 rfsim5g_ue10</id>
<nodes>cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix</nodes>
</testCase>

View File

@@ -151,7 +151,6 @@
<desc>Force Msg3 C-RNTI RA</desc>
<node>cacofonix</node>
<command>echo ciUE force_crnti_ra | nc 192.168.71.150 8091</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="040002">
@@ -159,7 +158,6 @@
<desc>Force RRC_IDLE (UE ID 0)</desc>
<node>cacofonix</node>
<command>echo ciUE force_RRC_IDLE | nc 192.168.71.150 8091</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="100001">

View File

@@ -79,7 +79,6 @@
<desc>Check that UE synched</desc>
<node>cacofonix</node>
<command>docker logs rfsim5g-oai-nr-ue-2 | grep -m 1 "PSBCH RX:OK"</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="100001">

View File

@@ -108,14 +108,6 @@
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="004000">
<class>Custom_Command</class>
<always_exec>true</always_exec>
<desc>Clean-Up any residual volume</desc>
<node>cacofonix</node>
<command>docker volume rm 5g_rfsimulator_tdd_dora_rrc.config</command>
</testCase>
<testCase id="222222">
<class>Clean_Test_Server_Images</class>
<always_exec>true</always_exec>

View File

@@ -70,9 +70,9 @@
<testCase id = "100000">
<class>Custom_Command</class>
<desc>Reset USRP</desc>
<desc>Reset USRP on nepes</desc>
<node>nepes</node>
<command>sudo -S /usr/lib/uhd/utils/b2xx_fx3_utils --reset-device</command>
<command>sudo -S /usr/local/lib/uhd/utils/b2xx_fx3_utils --reset-device</command>
</testCase>
<testCase id="200000">

View File

@@ -182,7 +182,7 @@
<testCase id="100010">
<class>Iperf</class>
<desc>iperf (DL/3Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (DL/3Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 45M -t 30 -R</iperf_args>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
@@ -193,7 +193,7 @@
<testCase id="100030">
<class>Iperf</class>
<desc>iperf (DL/TCP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (DL/TCP)(30 sec)</desc>
<iperf_args>-t 30 -R</iperf_args>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<iperf_tcp_rate_target>2</iperf_tcp_rate_target>
@@ -202,7 +202,7 @@
<testCase id="100020">
<class>Iperf</class>
<desc>iperf (UL/1Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (UL/1Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 15M -t 30</iperf_args>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
@@ -213,7 +213,7 @@
<testCase id="100040">
<class>Iperf</class>
<desc>iperf (UL/TCP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (UL/TCP)(30 sec)</desc>
<iperf_args>-t 30</iperf_args>
<svr_id>oc-cn5g</svr_id>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>

View File

@@ -179,7 +179,7 @@
<testCase id="000010">
<class>Iperf</class>
<desc>iperf (DL/4Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (DL/4Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 60M -t 30 -R</iperf_args>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
@@ -190,7 +190,7 @@
<testCase id="000030">
<class>Iperf</class>
<desc>iperf (DL/TCP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (DL/TCP)(30 sec)</desc>
<iperf_args>-t 30 -R</iperf_args>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<iperf_tcp_rate_target>3.9</iperf_tcp_rate_target>
@@ -199,7 +199,7 @@
<testCase id="000020">
<class>Iperf</class>
<desc>iperf (UL/1.5Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (UL/1.5Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 22.5M -t 30</iperf_args>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
@@ -210,7 +210,7 @@
<testCase id="000040">
<class>Iperf</class>
<desc>iperf (UL/TCP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (UL/TCP)(30 sec)</desc>
<iperf_args>-t 30</iperf_args>
<svr_id>oc-cn5g</svr_id>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>

View File

@@ -200,14 +200,12 @@
<desc>Trigger Reestablishment</desc>
<node>ofqot</node>
<command>echo ci force_reestab | nc -N 127.0.0.1 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="060002">
<class>Custom_Command</class>
<desc>Verify Reestablishment</desc>
<node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="030201">

View File

@@ -188,14 +188,12 @@
<desc>Trigger Reestablishment (on DU)</desc>
<node>ofqot</node>
<command>echo ci force_reestab | nc -N 127.0.0.1 9091 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="360002">
<class>Custom_Command</class>
<desc>Verify Reestablishment (on CU)</desc>
<node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="100002">

View File

@@ -233,14 +233,12 @@
<desc>Trigger Reestablishment (on DU)</desc>
<node>ofqot</node>
<command>echo ci force_reestab | nc -N 127.0.0.1 9091 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="160002">
<class>Custom_Command</class>
<desc>Verify Reestablishment (on CU)</desc>
<node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="130201">

View File

@@ -49,7 +49,6 @@
<desc>Setup sriov and network interfaces Metanoia</desc>
<node>cacofonix</node>
<script>yaml_files/sa_fhi_7.2_metanoia_2x2_gnb/setup_sriov_metanoia.sh</script>
<command_fail>yes</command_fail>
</testCase>
<testCase id="110000">
@@ -92,7 +91,7 @@
<testCase id="100010">
<class>Iperf</class>
<desc>iperf (DL/570Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (DL/570Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 570M -t 30 -R</iperf_args>
<id>up2-fhi72</id>
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
@@ -103,7 +102,7 @@
<testCase id="100030">
<class>Iperf</class>
<desc>iperf (DL/TCP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (DL/TCP)(30 sec)</desc>
<iperf_args>-t 30 -R</iperf_args>
<id>up2-fhi72</id>
<iperf_tcp_rate_target>80</iperf_tcp_rate_target>
@@ -112,7 +111,7 @@
<testCase id="100020">
<class>Iperf</class>
<desc>iperf (UL/100Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (UL/100Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 100M -t 30</iperf_args>
<id>up2-fhi72</id>
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
@@ -123,7 +122,7 @@
<testCase id="100040">
<class>Iperf</class>
<desc>iperf (UL/TCP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (UL/TCP)(30 sec)</desc>
<iperf_args>-t 30</iperf_args>
<id>up2-fhi72</id>
<iperf_tcp_rate_target>80</iperf_tcp_rate_target>
@@ -166,7 +165,6 @@
<desc>Set CPU to idle state, set kernel parameters to default values</desc>
<node>cacofonix</node>
<script>yaml_files/sa_fhi_7.2_metanoia_2x2_gnb/setup_cleanup.sh</script>
<command_fail>yes</command_fail>
</testCase>
</testCaseList>

View File

@@ -36,6 +36,7 @@
100020
100030
100040
100011
103000
100002
130000
@@ -49,7 +50,6 @@
<desc>Setup sriov and network interfaces VVDN</desc>
<node>cacofonix</node>
<script>yaml_files/sa_fhi_7.2_vvdn_gnb/setup_sriov_vvdn.sh</script>
<command_fail>yes</command_fail>
</testCase>
<testCase id="110000">
@@ -90,7 +90,7 @@
<testCase id="100010">
<class>Iperf</class>
<desc>iperf (DL/600Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (DL/600Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 600M -t 30 -R</iperf_args>
<id>up2-fhi72</id>
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
@@ -99,9 +99,20 @@
<svr_id>oc-cn5g-20897</svr_id>
</testCase>
<testCase id="100011">
<class>Iperf</class>
<desc>Optional iperf (DL/700Mbps/UDP)(30 sec)</desc>
<may_fail>true</may_fail>
<iperf_args>-u -b 700M -t 30 -R</iperf_args>
<id>up2-fhi72</id>
<iperf_packetloss_threshold>10</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold>
<svr_id>oc-cn5g-20897</svr_id>
</testCase>
<testCase id="100030">
<class>Iperf</class>
<desc>iperf (DL/TCP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (DL/TCP)(30 sec)</desc>
<iperf_args>-t 30 -R</iperf_args>
<id>up2-fhi72</id>
<iperf_tcp_rate_target>40</iperf_tcp_rate_target>
@@ -110,7 +121,7 @@
<testCase id="100020">
<class>Iperf</class>
<desc>iperf (UL/80Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (UL/80Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 80M -t 30</iperf_args>
<id>up2-fhi72</id>
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
@@ -121,7 +132,7 @@
<testCase id="100040">
<class>Iperf</class>
<desc>iperf (UL/TCP)(30 sec)(multi-ue profile)</desc>
<desc>iperf (UL/TCP)(30 sec)</desc>
<iperf_args>-t 30</iperf_args>
<id>up2-fhi72</id>
<iperf_tcp_rate_target>10</iperf_tcp_rate_target>
@@ -164,7 +175,6 @@
<desc>Set CPU to idle state, set kernel parameters to default values</desc>
<node>cacofonix</node>
<script>yaml_files/sa_fhi_7.2_vvdn_gnb/setup_cleanup.sh</script>
<command_fail>yes</command_fail>
</testCase>

View File

@@ -194,14 +194,12 @@
<desc>Trigger Reestablishment</desc>
<node>ofqot</node>
<command>echo ci force_reestab | nc -N 127.0.0.1 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="260002">
<class>Custom_Command</class>
<desc>Verify Reestablishment</desc>
<node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="230201">

View File

@@ -1,5 +1,5 @@
[NEAR-RIC]
NEAR_RIC_IP = 192.168.70.150
[XAPP]
DB_PATH = /flexric/db/
DB_NAME = xapp_rnis_db
DB_DIR = /tmp/

View File

@@ -7,12 +7,79 @@ services:
ipv4_address: 192.168.70.150
volumes:
- ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf
- sharedXappLibs:/usr/local/lib/flexric/
healthcheck:
test: /bin/bash -c "pgrep nearRT-RIC"
interval: 10s
timeout: 5s
xapp-rc-moni:
image: ${REGISTRY:-oaisoftwarealliance}/oai-flexric:${FLEXRIC_TAG:-develop}
command: "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_rc_moni"
container_name: xapp-rc-moni
depends_on:
- oai-flexric
- oai-gnb
networks:
public_net:
ipv4_address: 192.168.70.154
volumes:
- ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf
healthcheck:
test: /bin/bash -c "pgrep xapp_rc_moni"
interval: 10s
timeout: 5s
xapp-kpm-moni:
image: ${REGISTRY:-oaisoftwarealliance}/oai-flexric:${FLEXRIC_TAG:-develop}
command: "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_kpm_moni"
container_name: xapp-kpm-moni
depends_on:
- oai-flexric
- oai-gnb
networks:
public_net:
ipv4_address: 192.168.70.155
volumes:
- ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf
healthcheck:
test: /bin/bash -c "pgrep xapp_kpm_moni"
interval: 10s
timeout: 5s
xapp-kpm-rc:
image: ${REGISTRY:-oaisoftwarealliance}/oai-flexric:${FLEXRIC_TAG:-develop}
command: "stdbuf -o0 /usr/local/flexric/xApp/c/kpm_rc/xapp_kpm_rc"
container_name: xapp-kpm-rc
depends_on:
- oai-flexric
- oai-gnb
networks:
public_net:
ipv4_address: 192.168.70.156
volumes:
- ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf
healthcheck:
test: /bin/bash -c "pgrep xapp_kpm_rc"
interval: 10s
timeout: 5s
xapp-gtp-mac-rlc-pdcp-moni:
image: ${REGISTRY:-oaisoftwarealliance}/oai-flexric:${FLEXRIC_TAG:-develop}
command: "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni"
container_name: xapp-gtp-mac-rlc-pdcp-moni
depends_on:
- oai-flexric
- oai-gnb
networks:
public_net:
ipv4_address: 192.168.70.157
volumes:
- ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf
healthcheck:
test: /bin/bash -c "pgrep -f xapp_gtp_mac_rlc_pdcp_moni"
interval: 10s
timeout: 5s
oai-gnb:
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
privileged: true
@@ -27,7 +94,6 @@ services:
ipv4_address: 192.168.70.151
volumes:
- ../../conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf:/opt/oai-gnb/etc/gnb.conf
- sharedXappLibs:/usr/local/lib/flexric/
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
@@ -72,9 +138,6 @@ services:
timeout: 5s
retries: 5
volumes:
sharedXappLibs:
networks:
public_net:
name: oai-cn5g-public-net

View File

@@ -9,6 +9,7 @@ services:
- IPC_LOCK
ulimits:
core: -1 # for core dumps
network_mode: "host"
environment:
USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: --nsa -E -q --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function
@@ -16,9 +17,6 @@ services:
- /dev/bus/usb/:/dev/bus/usb/
volumes:
- ../../conf_files/gnb.nsa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
networks:
public_net:
ipv4_address: 192.168.68.194
#entrypoint: /bin/bash -c "sleep infinity"
healthcheck:
# pgrep does NOT work
@@ -26,12 +24,3 @@ services:
interval: 10s
timeout: 5s
retries: 5
networks:
public_net:
name: nsa-b200-gnb-net
ipam:
config:
- subnet: 192.168.68.192/26
driver_opts:
com.docker.network.bridge.name: "nsa-gnb-net"

View File

@@ -23,7 +23,7 @@ services:
- ../../../cmake_targets/share:/opt/cuBB/share
userns_mode: host
ipc: "shareable"
image: cubb-build:24-3
image: cubb-build:25-1
environment:
- cuBB_SDK=/opt/nvidia/cuBB
command: bash -c "sudo rm -rf /tmp/phy.log && sudo chmod +x /opt/nvidia/cuBB/aerial_l1_entrypoint.sh && /opt/nvidia/cuBB/aerial_l1_entrypoint.sh"
@@ -33,7 +33,7 @@ services:
timeout: 5s
retries: 5
oai-gnb-aerial:
cpuset: "13-20"
cpuset: "13-14"
image: ${REGISTRY:-oaisoftwarealliance}/oai-gnb-aerial:${TAG:-develop}
depends_on:
nv-cubb:

View File

@@ -35,6 +35,24 @@ typedef struct nssai_s {
uint32_t sd;
} nssai_t;
// Globally Unique AMF Identifier
typedef struct nr_guami_s {
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_len;
uint8_t amf_region_id;
uint16_t amf_set_id;
uint8_t amf_pointer;
} nr_guami_t;
typedef enum {
PDUSessionType_ipv4 = 0,
PDUSessionType_ipv6 = 1,
PDUSessionType_ipv4v6 = 2,
PDUSessionType_ethernet = 3,
PDUSessionType_unstructured = 4
} pdu_session_type_t;
typedef enum { NON_DYNAMIC, DYNAMIC } fiveQI_t;
#endif

View File

@@ -308,3 +308,63 @@ void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, ch
break;
}
}
/**
* @brief Assigns the default value to a configuration parameter if available.
*
* This function checks the type of the parameter and assigns its default value
* if it is defined. It handles various parameter types, including strings, integers,
* arrays, doubles, IPv4 addresses, and lists. If the parameter is marked with
* PARAMFLAG_DONOTREAD, it is ignored.
*
* @param[in] cfg Pointer to the configuration module interface.
* @param[in] cfgoption Pointer to the parameter definition structure.
* @param[in] prefix Optional prefix for the parameter name (can be NULL).
* @return 1 if the default value was set, 0 if ignored, or -1 on error/unsupported type.
*/
int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoption, char *prefix)
{
if( (cfgoption->paramflags & PARAMFLAG_DONOTREAD) != 0) {
return 0;
}
switch(cfgoption->type) {
case TYPE_STRING:
return config_setdefault_string(cfg, cfgoption, prefix);
case TYPE_STRINGLIST:
return config_setdefault_stringlist(cfg, cfgoption, prefix);
case TYPE_UINT8:
case TYPE_INT8:
case TYPE_UINT16:
case TYPE_INT16:
case TYPE_UINT32:
case TYPE_INT32:
case TYPE_MASK:
return config_setdefault_int(cfg, cfgoption, prefix);
case TYPE_UINT64:
case TYPE_INT64:
return config_setdefault_int64(cfg, cfgoption, prefix);
case TYPE_UINTARRAY:
case TYPE_INTARRAY:
return config_setdefault_intlist(cfg, cfgoption, prefix);
case TYPE_DOUBLE:
return config_setdefault_double(cfg, cfgoption, prefix);
case TYPE_IPV4ADDR:
return config_setdefault_ipv4addr(cfg, cfgoption, prefix);
case TYPE_LIST:
// No default value for list type
fprintf(stderr,"[CONFIG] %s.%s TYPE_LIST has no default value\n", prefix, cfgoption->optname);
return -1;
default:
fprintf(stderr,"[CONFIG] %s.%s type %i not supported\n", prefix, cfgoption->optname, cfgoption->type);
return -1;
} /* switch on param type */
}

View File

@@ -50,6 +50,7 @@ int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptio
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree);
void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *fullname, int val);
int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoption, char *prefix);
#ifdef __cplusplus
}

View File

@@ -53,7 +53,7 @@
#define PARAMFLAG_PARAMSETDEF (1 << 17) // parameter has been set to default value in get functions
/* checkedparam_t is possibly used in paramdef_t for specific parameter value validation */
#define CONFIG_MAX_NUMCHECKVAL 20
#define CONFIG_MAX_NUMCHECKVAL 64
typedef struct paramdef paramdef_t;
typedef struct configmodule_interface configmodule_interface_t;
typedef union checkedparam {
@@ -169,7 +169,6 @@ typedef struct paramlist_def {
/* Macros to get parameters with the config module API */
#define GET_PARAMS(param_def, param_desc, prefix) \
printf("Reading '%s' section from the config file\n", #param_def); \
paramdef_t param_def[] = param_desc; \
config_get(config_get_if(), param_def, sizeofArray(param_def), prefix);

View File

@@ -356,7 +356,7 @@ int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
snprintf( *cfgoptions[i].strptr , cfgoptions[i].numelt, "%s", str);
printf_params(cfg, "[LIBCONFIG] %s: \"%s\"\n", cfgpath, *cfgoptions[i].strptr);
} else {
defval = config_setdefault_string(cfg, &cfgoptions[i], prefix);
defval = config_common_getdefault(cfg, &cfgoptions[i], prefix);
}
break;
@@ -367,7 +367,7 @@ int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
if ( setting != NULL) {
read_strlist(cfg, &cfgoptions[i], setting, cfgpath);
} else {
defval = config_setdefault_stringlist(cfg, &(cfgoptions[i]), prefix);
defval = config_common_getdefault(cfg, &(cfgoptions[i]), prefix);
}
break;
@@ -383,7 +383,7 @@ int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
config_check_valptr(cfg, &(cfgoptions[i]), sizeof(*cfgoptions[i].iptr), 1);
config_assign_int(cfg, &(cfgoptions[i]), cfgpath, u);
} else {
defval = config_setdefault_int(cfg, &(cfgoptions[i]), prefix);
defval = config_common_getdefault(cfg, &(cfgoptions[i]), prefix);
}
break;
@@ -401,7 +401,7 @@ int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
printf_params(cfg, "[LIBCONFIG] %s: %ld\n", cfgpath, *cfgoptions[i].i64ptr);
}
} else {
defval = config_setdefault_int64(cfg, &(cfgoptions[i]), prefix);
defval = config_common_getdefault(cfg, &(cfgoptions[i]), prefix);
}
break;
@@ -413,7 +413,7 @@ int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
if ( setting != NULL) {
read_intarray(cfg, &cfgoptions[i], setting, cfgpath);
} else {
defval = config_setdefault_intlist(cfg, &(cfgoptions[i]), prefix);
defval = config_common_getdefault(cfg, &(cfgoptions[i]), prefix);
}
break;
@@ -424,14 +424,14 @@ int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
*cfgoptions[i].dblptr = dbl;
printf_params(cfg, "[LIBCONFIG] %s: %lf\n", cfgpath, *(cfgoptions[i].dblptr));
} else {
defval = config_setdefault_double(cfg, &(cfgoptions[i]), prefix);
defval = config_common_getdefault(cfg, &(cfgoptions[i]), prefix);
}
break;
case TYPE_IPV4ADDR:
if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
defval = config_setdefault_ipv4addr(cfg, &(cfgoptions[i]), prefix);
defval = config_common_getdefault(cfg, &(cfgoptions[i]), prefix);
} else {
int rst = config_assign_ipv4addr(cfg, cfgoptions, str);

View File

@@ -25,8 +25,7 @@ extern "C" {
#include "common/config/config_userapi.h"
void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree);
void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int elt_sz, int nb_elt);
#include "../config_userapi.h"
#include "../config_common.h"
int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoption, char *prefix);
}
#include <cstring>
#include <string>
@@ -44,71 +43,6 @@ class YamlConfig {
}
};
void SetDefault(configmodule_interface_t *cfg, paramdef_t *param)
{
switch (param->type) {
case TYPE_INT:
*param->iptr = param->defintval;
break;
case TYPE_UINT:
*param->uptr = param->defuintval;
break;
case TYPE_STRING:
if (param->defstrval != nullptr) {
if (param->numelt == 0) {
config_check_valptr(cfg, param, 1, strlen(param->defstrval) + 1);
}
sprintf(*param->strptr, "%s", param->defstrval);
}
break;
case TYPE_INT8:
*param->i8ptr = param->defintval;
break;
case TYPE_UINT8:
*param->u8ptr = param->defuintval;
break;
case TYPE_INT16:
*param->i16ptr = param->defintval;
break;
case TYPE_UINT16:
*param->u16ptr = param->defuintval;
break;
case TYPE_INT64:
*param->i64ptr = param->defint64val;
break;
case TYPE_UINT64:
*param->u64ptr = param->defint64val;
break;
case TYPE_DOUBLE:
*param->dblptr = param->defdblval;
break;
case TYPE_MASK:
*param->uptr = param->defuintval;
break;
case TYPE_STRINGLIST:
if (param->defstrlistval != nullptr) {
param->strlistptr = param->defstrlistval;
}
break;
case TYPE_INTARRAY:
if (param->defintarrayval) {
param->iptr = param->defintarrayval;
}
break;
case TYPE_UINTARRAY:
if (param->defintarrayval) {
param->uptr = (uint32_t *)param->defintarrayval;
}
break;
case TYPE_IPV4ADDR:
config_setdefault_ipv4addr(cfg, param, param->defstrval);
break;
default:
AssertFatal(false, "Unhandled type %d", param->type);
}
param->paramflags |= PARAMFLAG_PARAMSETDEF;
}
void SetNonDefault(configmodule_interface_t *cfg, const YAML::Node &node, paramdef_t *param)
{
auto optname = std::string(param->optname);
@@ -207,14 +141,12 @@ void SetNonDefault(configmodule_interface_t *cfg, const YAML::Node &node, paramd
param->paramflags |= PARAMFLAG_PARAMSET;
}
void GetParams(configmodule_interface_t *cfg, const YAML::Node &node, paramdef_t *params, int num_params)
void GetParam(configmodule_interface_t *cfg, const YAML::Node &node, paramdef_t *param)
{
for (auto i = 0; i < num_params; i++) {
if (node && node[std::string(params[i].optname)]) {
SetNonDefault(cfg, node, &params[i]);
} else {
SetDefault(cfg, &params[i]);
}
if (node && node[std::string(param->optname)]) {
SetNonDefault(cfg, node, param);
} else {
config_common_getdefault(cfg, param, nullptr);
}
}
@@ -229,7 +161,15 @@ extern "C" int config_yaml_init(configmodule_interface_t *cfg)
pthread_mutex_init(&cfg->memBlocks_mutex, NULL);
memset(cfg->oneBlock, 0, sizeof(cfg->oneBlock));
config_yaml::config = new config_yaml::YamlConfig(std::string(cfgP[0]));
try {
config_yaml::config = new config_yaml::YamlConfig(std::string(cfgP[0]));
} catch (const YAML::BadFile &e) {
fprintf(stderr, "[CONFIG] Error loading YAML file '%s': %s\n", cfgP[0], e.what());
return -1;
} catch (const YAML::Exception &e) {
fprintf(stderr, "[CONFIG] Error parsing YAML file '%s': %s\n", cfgP[0], e.what());
return -1;
}
return 0;
}
@@ -249,14 +189,14 @@ YAML::Node find_node(const std::string &prefix, YAML::Node node)
if (key.at(0) == '[' && key.back() == ']') {
// The key is an index to a sequence
if (!current.IsSequence()) {
throw std::invalid_argument("Incorrect yaml file structure");
throw std::invalid_argument("Expected a sequence at " + key);
}
int index = std::stoi(key.substr(1, key.size() - 2));
current = current[index];
continue;
}
if (!current.IsMap()) {
throw std::invalid_argument("Incorrect yaml file structure");
throw std::invalid_argument("Expected a map at " + key);
}
if (!current[key]) {
return config_yaml::invalid_node;
@@ -272,8 +212,14 @@ extern "C" int config_yaml_get(configmodule_interface_t *cfg, paramdef_t *cfgopt
if (prefix != nullptr) {
p = std::string(prefix);
}
auto node = find_node(p, YAML::Clone(config_yaml::config->config));
if (node == config_yaml::invalid_node) {
YAML::Node node;
try {
node = find_node(p, YAML::Clone(config_yaml::config->config));
if (node == config_yaml::invalid_node) {
return -1;
}
} catch (const std::invalid_argument &e) {
fprintf(stderr, "[CONFIG] Error finding node '%s': %s\n", p.c_str(), e.what());
return -1;
}
for (auto i = 0; i < numoptions; i++) {
@@ -282,7 +228,14 @@ extern "C" int config_yaml_get(configmodule_interface_t *cfg, paramdef_t *cfgopt
config_check_valptr(cfg, &cfgoptions[i], sizeof(void *), 1);
}
}
config_yaml::GetParams(cfg, node, cfgoptions, numoptions);
for (int i = 0; i < numoptions; i++) {
try {
config_yaml::GetParam(cfg, node, &cfgoptions[i]);
} catch (const YAML::Exception &e) {
fprintf(stderr, "[CONFIG] Config error: prefix: %s, setting: %s, error: %s\n", p.c_str(), cfgoptions[i].optname, e.what());
return -1;
}
}
return numoptions;
}
@@ -323,7 +276,14 @@ extern "C" int config_yaml_getlist(configmodule_interface_t *cfg,
}
}
config_yaml::GetParams(cfg, node[i], ParamList->paramarray[i], numparams);
for (int j = 0; j < numparams; j++) {
try {
config_yaml::GetParam(cfg, node[i], &ParamList->paramarray[i][j]);
} catch (const YAML::Exception &e) {
fprintf(stderr, "[CONFIG] Config error: prefix: %s, setting: %s, error: %s\n", path, ParamList->paramarray[i][j].optname, e.what());
return -1;
}
}
}
}

View File

@@ -11,3 +11,5 @@ configure_file(test_list_of_mappings.yml test_list_of_mappings.yml COPYONLY)
configure_file(test_int_array.yaml test_int_array.yaml COPYONLY)
configure_file(test_read_mapping_as_list.yaml test_read_mapping_as_list.yaml COPYONLY)
configure_file(test_ipv4.yaml test_ipv4.yaml COPYONLY)
configure_file(test_read_str_as_int.yaml test_read_str_as_int.yaml COPYONLY)
configure_file(malformed.yaml malformed.yaml COPYONLY)

View File

@@ -0,0 +1,13 @@
test:
-
bad_file:
- "testvalue1"
- "testvalue2"
- "testvalue3"
- "testvalue4"
- "testvalue5"
- "testvalue6"
- "testvalue7"
- "testvalue8"
- "testvalue9"
- "testvalue10" - yaml error

View File

@@ -0,0 +1,2 @@
test:
var: "test_var"

View File

@@ -78,8 +78,9 @@ TEST(yaml_config, yaml_get_existing_values) {
uint16_t value;
p.type = TYPE_UINT16;
p.u16ptr = &value;
p.paramflags = PARAMFLAG_MANDATORY;
char prefix[] = "test";
config_yaml_get(cfg, &p, 1, prefix);
EXPECT_EQ(config_yaml_get(cfg, &p, 1, prefix), 1);
EXPECT_EQ(value, i);
}
@@ -94,7 +95,7 @@ TEST(yaml_config, yaml_get_non_existing_values) {
cfg->cfgP[0] = strdup("test1.yaml");
EXPECT_EQ(config_yaml_init(cfg), 0);
// Testing paremters present in the test node
// Testing parameters not present in the test node
paramdef_t p = {0};
for (auto i = 4; i <= 5; i++) {
sprintf(p.optname, "%s%d", "value", i);
@@ -421,6 +422,43 @@ TEST(yaml_config, test_read_ipv4) {
free(p.defstrval);
}
TEST(yaml_config, yaml_read_str_as_int) {
configmodule_interface_t *cfg = static_cast<configmodule_interface_t*>(calloc(1, sizeof(*cfg)));
cfg->cfgP[0] = strdup("test_read_str_as_int.yaml");
EXPECT_EQ(config_yaml_init(cfg), 0);
// Testing paremters present in the test node
paramdef_t p = {0};
uint16_t value;
p.type = TYPE_UINT16;
p.u16ptr = &value;
p.paramflags = PARAMFLAG_MANDATORY;
char prefix[] = "test";
sprintf(p.optname, "%s", "var");
EXPECT_EQ(config_yaml_get(cfg, &p, 1, prefix), -1);
config_yaml_end(cfg);
free(cfg->cfgP[0]);
end_configmodule(cfg);
}
TEST(yaml_config, yaml_open_non_existing_file) {
configmodule_interface_t *cfg = static_cast<configmodule_interface_t*>(calloc(1, sizeof(*cfg)));
cfg->cfgP[0] = strdup("non_existing_file.yaml");
EXPECT_EQ(config_yaml_init(cfg), -1);
free(cfg->cfgP[0]);
end_configmodule(cfg);
}
TEST(yaml_config, malformed_file) {
configmodule_interface_t *cfg = static_cast<configmodule_interface_t*>(calloc(1, sizeof(*cfg)));
cfg->cfgP[0] = strdup("malformed.yaml");
EXPECT_EQ(config_yaml_init(cfg), -1);
free(cfg->cfgP[0]);
end_configmodule(cfg);
}
int main(int argc, char** argv)
{
logInit();

View File

@@ -207,26 +207,38 @@ typedef struct nsa_msg_t {
uint8_t msg_buffer[MAX_MESSAGE_SIZE];
} nsa_msg_t;
typedef enum nr_lcid_rb_type { NR_LCID_NONE = 0, NR_LCID_SRB = 1, NR_LCID_DRB = 2 } nr_lcid_rb_type;
typedef struct nr_lcid_rb_t {
nr_lcid_rb_type type;
union {
int srb_id;
int drb_id;
} choice;
} nr_lcid_rb_t;
typedef struct transport_layer_addr_s {
/**
* Transport Layer Address as a bitstring:
* - 32 bits for IPv4 (RFC 791),
* - 128 bits for IPv6 (RFC 2460),
* - 160 bits for both IPv4 and IPv6, with IPv4 in the first 32 bits.
* The S1AP/NGAP layer forwards this address (bitstring<1..160>)
* to S1-U/NG-U without interpreting it.
*/
/** Transport Layer Address in bytes:
* - 4 bytes for IPv4 (RFC 791), 16 bytes for IPv6 (RFC 2460),
* - 20 bytes for both IPv4 and IPv6, with IPv4 in the first 4 bytes. */
uint8_t length;
/// Buffer: address in network byte order
uint8_t buffer[20];
} transport_layer_addr_t;
/** @brief GTP tunnel configuration */
typedef struct {
// Tunnel endpoint identifier
uint32_t teid;
// Transport layer address
transport_layer_addr_t addr;
} gtpu_tunnel_t;
//-----------------------------------------------------------------------------
// GTPV1U TYPES
//-----------------------------------------------------------------------------
typedef uint32_t teid_t; // tunnel endpoint identifier
typedef uint8_t ebi_t; // eps bearer id
typedef uint8_t pdusessionid_t;
//-----------------------------------------------------------------------------
//

View File

@@ -24,9 +24,11 @@ event get_event(int socket, OBUF *event_buffer, void *database)
again:
if (fullread(socket, &length, 4) == -1) goto read_error;
#ifdef T_SEND_TIME
if (length < sizeof(struct timespec)) goto error;
if (fullread(socket, &t, sizeof(struct timespec)) == -1) goto read_error;
length -= sizeof(struct timespec);
#endif
if (length < sizeof(int)) goto error;
if (fullread(socket, &type, sizeof(int)) == -1) goto read_error;
length -= sizeof(int);
if (event_buffer->omaxsize < length) {
@@ -48,6 +50,9 @@ again:
return new_event(type, length, event_buffer->obuf, database);
#endif
error:
printf("error: bad data in get_event()\n");
read_error:
return (event){.type = -1};
}
@@ -64,6 +69,9 @@ event new_event(int type, int length, char *buffer, void *database)
int i;
int offset;
/* arbitrary limit to 1GiB (to simplify size checks) */
if (length < 0 || length > 1024 * 1024 * 1024) goto fatal;
#ifdef T_SEND_TIME
e.sending_time = sending_time;
#endif
@@ -87,26 +95,33 @@ event new_event(int type, int length, char *buffer, void *database)
for (i = 0; i < f.count; i++) {
//e.e[i].offset = offset;
if (!strcmp(f.type[i], "int")) {
if (offset + 4 > length) goto fatal;
e.e[i].type = EVENT_INT;
e.e[i].i = *(int *)(&buffer[offset]);
offset += 4;
} else if (!strcmp(f.type[i], "ulong")) {
if (offset + sizeof(unsigned long) > length) goto fatal;
e.e[i].type = EVENT_ULONG;
e.e[i].ul = *(unsigned long *)(&buffer[offset]);
offset += sizeof(unsigned long);
} else if (!strcmp(f.type[i], "float")) {
if (offset + sizeof(float) > length) goto fatal;
e.e[i].type = EVENT_FLOAT;
e.e[i].f = *(float *)(&buffer[offset]);
offset += sizeof(float);
} else if (!strcmp(f.type[i], "string")) {
if (offset + 1 > length) goto fatal;
e.e[i].type = EVENT_STRING;
e.e[i].s = &buffer[offset];
while (buffer[offset]) offset++;
while (offset < length && buffer[offset]) offset++;
if (offset == length) goto fatal;
offset++;
} else if (!strcmp(f.type[i], "buffer")) {
if (offset + sizeof(int) > length) goto fatal;
int len;
e.e[i].type = EVENT_BUFFER;
len = *(int *)(&buffer[offset]);
if (len <= 0 || offset + len + sizeof(int) > length) goto fatal;
e.e[i].bsize = len;
e.e[i].b = &buffer[offset+sizeof(int)];
offset += len+sizeof(int);
@@ -119,4 +134,8 @@ event new_event(int type, int length, char *buffer, void *database)
if (e.ecount==0) { printf("FORMAT not set in event %d\n", type); abort(); }
return e;
fatal:
printf("fatal: bad buffer in new_event\n");
abort();
}

View File

@@ -46,8 +46,8 @@ int main(int n, char **v)
/* read event from file */
if (fread(&length, 4, 1, in) != 1) break;
if (ebuf.omaxsize < length) {
ebuf.omaxsize = (length + 65535) & ~65535;
if (ebuf.omaxsize < length + 4) {
ebuf.omaxsize = (length + 4 + 65535) & ~65535;
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
}

View File

@@ -157,8 +157,8 @@ int main(int n, char **v)
/* read event from file */
if (fread(&length, 4, 1, in) != 1) break;
if (ebuf.omaxsize < length) {
ebuf.omaxsize = (length + 65535) & ~65535;
if (ebuf.omaxsize < length + 4) {
ebuf.omaxsize = (length + 4 + 65535) & ~65535;
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
}

View File

@@ -114,8 +114,8 @@ int read_tracee(int s, OBUF *ebuf, int *_type, int32_t *_length)
int vpos = 0;
if (fullread(s, &length, 4) == -1) return -1;
if (ebuf->omaxsize < length) {
ebuf->omaxsize = (length + 65535) & ~65535;
if (ebuf->omaxsize < length + 4) {
ebuf->omaxsize = (length + 4 + 65535) & ~65535;
ebuf->obuf = realloc(ebuf->obuf, ebuf->omaxsize);
if (ebuf->obuf == NULL) { printf("out of memory\n"); exit(1); }
}
@@ -123,10 +123,12 @@ int read_tracee(int s, OBUF *ebuf, int *_type, int32_t *_length)
memcpy(v+vpos, &length, 4);
vpos += 4;
#ifdef T_SEND_TIME
if (length < sizeof(struct timespec)) return -1;
if (fullread(s,v+vpos,sizeof(struct timespec))==-1) return -1;
vpos += sizeof(struct timespec);
length -= sizeof(struct timespec);
#endif
if (length < sizeof(int)) return -1;
if (fullread(s, &type, sizeof(int)) == -1) return -1;
memcpy(v+vpos, &type, sizeof(int));
vpos += sizeof(int);

View File

@@ -133,8 +133,8 @@ int main(int n, char **v)
int vpos = 0;
if (fullread(socket, &length, 4) == -1) goto read_error;
if (ebuf.omaxsize < length) {
ebuf.omaxsize = (length + 65535) & ~65535;
if (ebuf.omaxsize < length + 4) {
ebuf.omaxsize = (length + 4 + 65535) & ~65535;
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
}
@@ -142,10 +142,12 @@ int main(int n, char **v)
memcpy(v+vpos, &length, 4);
vpos += 4;
#ifdef T_SEND_TIME
if (length < sizeof(struct timespec)) goto read_error;
if (fullread(socket,v+vpos,sizeof(struct timespec))==-1) goto read_error;
vpos += sizeof(struct timespec);
length -= sizeof(struct timespec);
#endif
if (length < sizeof(int)) goto read_error;
if (fullread(socket, &type, sizeof(int)) == -1) goto read_error;
memcpy(v+vpos, &type, sizeof(int));
vpos += sizeof(int);

View File

@@ -146,8 +146,8 @@ int main(int n, char **v)
/* read event from file */
if (fread(&length, 4, 1, in) != 1) break;
if (ebuf.omaxsize < length) {
ebuf.omaxsize = (length + 65535) & ~65535;
if (ebuf.omaxsize < length + 4) {
ebuf.omaxsize = (length + 4 + 65535) & ~65535;
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
}

View File

@@ -23,15 +23,21 @@
#include <assert.h>
#include <string.h>
#include "common/utils/utils.h" // for malloc_or_fail
byte_array_t create_byte_array(const size_t len, const uint8_t* buffer)
{
byte_array_t result = {.len = len};
if (len) {
result.buf = malloc_or_fail(len);
memcpy(result.buf, buffer, len);
}
return result;
}
byte_array_t copy_byte_array(byte_array_t src)
{
byte_array_t dst = {0};
dst.buf = malloc(src.len);
assert(dst.buf != NULL && "Memory exhausted");
memcpy(dst.buf, src.buf, src.len);
dst.len = src.len;
return dst;
return create_byte_array(src.len, src.buf);
}
void free_byte_array(byte_array_t ba)

View File

@@ -28,6 +28,13 @@
#include <stdint.h>
#include <stdlib.h>
#define FREE_AND_ZERO_BYTE_ARRAY(BA) \
do { \
free_byte_array(BA); \
BA.buf = NULL; \
BA.len = 0; \
} while (0)
typedef struct {
size_t len;
uint8_t* buf;
@@ -43,5 +50,6 @@ bool eq_byte_array(const byte_array_t* m0, const byte_array_t* m1);
byte_array_t cp_str_to_ba(const char* str);
char* cp_ba_to_str(const byte_array_t ba);
byte_array_t create_byte_array(const size_t len, const uint8_t* buffer);
#endif

View File

@@ -123,11 +123,10 @@ void seq_arr_erase_it(seq_arr_t* arr, void* start_it, void* end_it, void (*free_
return;
if (free_func != NULL) {
void* start_it = seq_arr_front(arr);
void* end_it = seq_arr_end(arr);
while (start_it != end_it) {
free_func(start_it);
start_it = seq_arr_next(arr, start_it);
void* it = start_it;
while (it != end_it) {
free_func(it);
it = seq_arr_next(arr, it);
}
}

View File

@@ -34,6 +34,9 @@ SOFTWARE.
#include <stdlib.h>
#include <stdint.h>
#define FOR_EACH_SEQ_ARR(type, var, arr) \
for (type var = seq_arr_front(arr); var != seq_arr_end(arr); var = seq_arr_next(arr, var))
typedef struct seq_arr_s {
uint8_t* data;
size_t size;

View File

@@ -36,6 +36,13 @@ static int compar(const void* m0, const void* m1)
return 1;
}
static int free_func_call_count = 0;
static void dummy_free_func(void* it)
{
++free_func_call_count;
}
int main()
{
seq_arr_t arr = {0};
@@ -83,6 +90,19 @@ int main()
void* it = bsearch(&key, base, nmemb, size, compar);
assert(seq_arr_dist(&arr, seq_arr_front(&arr), it) == 4);
// Regression test: erase a partial range only
// Erase 92, 93, 94 (i.e., indices 1 to 3)
int* start = seq_arr_at(&arr, 1);
int* end = seq_arr_at(&arr, 4);
seq_arr_erase_it(&arr, start, end, dummy_free_func);
// Now values should be: [91, 95, 96, 97, 98, 99]
assert(free_func_call_count == 3);
assert(seq_arr_size(&arr) == 6);
assert(*(int*)seq_arr_at(&arr, 0) == 91);
assert(*(int*)seq_arr_at(&arr, 1) == 95);
assert(*(int*)seq_arr_at(&arr, 5) == 99);
// Free data structure
seq_arr_free(&arr, NULL);

View File

@@ -207,7 +207,7 @@ int get_smallest_supported_bandwidth_index(int scs, frequency_range_t frequency_
return -1; // not found
}
// Table 5.2-1 NR operating bands in FR1 & FR2 (3GPP TS 38.101)
// Table 5.2-1 NR operating bands in FR1 & FR2 (3GPP TS 38.101) (Rel.17)
// Table 5.4.2.3-1 Applicable NR-ARFCN per operating band in FR1 & FR2 (3GPP TS 38.101)
// Notes:
// - N_OFFs for bands from 80 to 89 and band 95 is referred to UL
@@ -236,6 +236,7 @@ const nr_bandentry_t nr_bandtable[] = {{1, 1920000, 1980000, 2110000, 2170000, 2
{40, 2300000, 2400000, 2300000, 2400000, 20, 460000, 100},
{41, 2496000, 2690000, 2496000, 2690000, 3, 499200, 15},
{41, 2496000, 2690000, 2496000, 2690000, 6, 499200, 30},
{46, 5150000, 5925000, 5150000, 5925000, 1, 743334, 15},
{47, 5855000, 5925000, 5855000, 5925000, 1, 790334, 15},
{48, 3550000, 3700000, 3550000, 3700000, 1, 636667, 15},
{48, 3550000, 3700000, 3550000, 3700000, 2, 636668, 30},
@@ -273,6 +274,11 @@ const nr_bandentry_t nr_bandtable[] = {{1, 1920000, 1980000, 2110000, 2170000, 2
{94, 880000, 915000, 1432000, 1517000, 20, 286400, 100},
{95, 2010000, 2025000, 000, 000, 20, 402000, 100},
{96, 5925000, 7125000, 5925000, 7125000, 1, 795000, 15},
{100, 874400, 880000, 919400, 925000, 20, 174880, 100},
{101, 1900000, 1910000, 1900000, 1910000, 20, 380000, 100},
{102, 5925000, 6425000, 5925000, 6425000, 1, 795000, 15},
{104, 6425000, 7125000, 6425000, 7125000, 1, 828334, 15},
{104, 6425000, 7125000, 6425000, 7125000, 2, 828334, 30},
{254, 1610000, 1626500, 2483500, 2500000, 20, 496700, 100},
{254, 1610000, 1626500, 2483500, 2500000, 2, 496700, 10},
{255, 1626500, 1660500, 1525000, 1559000, 20, 305000, 100},
@@ -288,7 +294,7 @@ const nr_bandentry_t nr_bandtable[] = {{1, 1920000, 1980000, 2110000, 2170000, 2
{261, 27500040, 28350000, 27500040, 28350000, 1, 2070833, 60},
{261, 27500040, 28350000, 27500040, 28350000, 2, 2070833, 120}};
// synchronization raster per band tables (Rel.15)
// synchronization raster per band tables (Rel.17)
// (38.101-1 Table 5.4.3.3-1 and 38.101-2 Table 5.4.3.3-1)
// band nb, sub-carrier spacing index, Range of gscn (First, Step size, Last)
// clang-format off
@@ -321,8 +327,9 @@ const sync_raster_t sync_raster[] = {
{40, 1, 5762, 1, 5989},
{41, 0, 6246, 3, 6717},
{41, 1, 6252, 3, 6714},
{46, 1, 8993, 1, 9530},
{48, 1, 7884, 1, 7982},
{50, 0, 3584, 1, 3787},
{50, 1, 3590, 1, 3781},
{51, 0, 3572, 1, 3574},
{53, 0, 6215, 1, 6232},
{53, 1, 6221, 1, 6226},
@@ -343,7 +350,13 @@ const sync_raster_t sync_raster[] = {
{91, 0, 3572, 1, 3574},
{92, 0, 3584, 1, 3787},
{93, 0, 3572, 1, 3574},
{94, 0, 3584, 1, 3587},
{94, 0, 3584, 1, 3787},
{96, 1, 9531, 1, 10363},
{100, 0, 2303, 1, 2307},
{101, 0, 4754, 1, 4768},
{101, 1, 4760, 1, 4764},
{102, 1, 9531, 1, 9877},
{104, 1, 9882, 7, 10358},
{254, 0, 6215, 1, 6244},
{254, 1, 6218, 1, 6241},
{255, 0, 3818, 1, 3892},

View File

@@ -475,41 +475,5 @@ typedef struct timer_elm_s {
return 0;
}
void log_scheduler(const char* label)
{
int policy = sched_getscheduler(0);
struct sched_param param;
if (sched_getparam(0, &param) == -1)
{
LOG_E(HW, "sched_getparam: %s\n", strerror(errno));
abort();
}
cpu_set_t cpu_set;
if (sched_getaffinity(0, sizeof(cpu_set), &cpu_set) == -1)
{
LOG_E(HW, "sched_getaffinity: %s\n", strerror(errno));
abort();
}
int num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
if (num_cpus < 1)
{
LOG_E(HW, "sysconf(_SC_NPROCESSORS_ONLN): %s\n", strerror(errno));
abort();
}
char buffer[num_cpus];
for (int i = 0; i < num_cpus; i++)
{
buffer[i] = CPU_ISSET(i, &cpu_set) ? 'Y' : '-';
}
LOG_A(HW, "Scheduler policy=%d priority=%d affinity=[%d]%.*s label=%s\n",
policy,
param.sched_priority,
num_cpus,
num_cpus,
buffer,
label);
}
} // extern "C"

View File

@@ -566,7 +566,6 @@ int timer_remove(long timer_id);
int signal_handle(int *end);
int signal_mask(void);
void log_scheduler(const char *label);
#ifdef __cplusplus
}
#endif

View File

@@ -34,7 +34,7 @@
#include "openair2/RRC/NR/nr_rrc_defs.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "openair2/RRC/NR/nr_rrc_config.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c"
#include "common/utils/nr/nr_common.h"

View File

@@ -7,34 +7,6 @@
#include <errno.h>
#include "utils.h"
const char *hexdump(const void *data, size_t data_len, char *out, size_t out_len)
{
char *p = out;
char *endp = out + out_len;
const uint8_t *q = data;
snprintf(p, endp - p, "[%zu]", data_len);
p += strlen(p);
for (size_t i = 0; i < data_len; ++i)
{
if (p >= endp)
{
static const char ellipses[] = "...";
char *s = endp - sizeof(ellipses);
if (s >= p)
{
strcpy(s, ellipses);
}
break;
}
snprintf(p, endp - p, " %02X", *q++);
p += strlen(p);
}
return out;
}
/****************************************************************************
** **
** Name: hex_char_to_hex_value() **

View File

@@ -109,8 +109,6 @@ static inline void *malloc_or_fail(size_t size)
#define PAGE_MASK 0xfffff000
#define virt_to_phys(x) (x)
const char *hexdump(const void *data, size_t data_len, char *out, size_t out_len);
// Converts an hexadecimal ASCII coded digit into its value. **
int hex_char_to_hex_value (char c);
// Converts an hexadecimal ASCII coded string into its value.**

View File

@@ -1677,6 +1677,7 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h \
@@ -1687,6 +1688,7 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/openair2_proc.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/RLC/rlc.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_UE/mac_tables.c \
@@ -1847,7 +1849,6 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_defs.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/cucp_cuup_if.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/cucp_cuup_direct.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_config.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/mac_rrc_dl_direct.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_radio_bearers.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_NGAP.h \
@@ -1858,7 +1859,6 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_UE_context.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/cucp_cuup_e1ap.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_config.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_radio_bearers.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_NGAP.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/mac_rrc_dl_f1ap.c \

View File

@@ -231,6 +231,9 @@ Or by providing this the the command line parameters:
The main parameters to cope with the large NTN propagation delay are cellSpecificKoffset, ta-Common, ta-CommonDrift and the ephemeris data (satellite position and velocity vectors).
The parameter `ntn-UlSyncValidityDuration-r17` indicates the maximum time duration from epochtime during which the UE can apply assistance information without having acquired new assistance information. i.e this enables UE to re-read SIB19 before timer with value ulSyncValidityDuration expires. The unit of the field is in seconds. Example values for GEO: 240s, MEO: 20s, LEO: 5s.
As epochtime is not implemented yet, UE starts the timer from the TTI where SIB19 is received with ntn-UlSyncValidityDuration-r17 IE.
The parameter `cellSpecificKoffset_r17` is the scheduling offset used for the timing relationships that are modified for NTN (see TS 38.213).
The unit of the field Koffset is number of slots for a given subcarrier spacing of 15 kHz.

View File

@@ -10,6 +10,8 @@ There are three main beamforming techinques: analog, digital and hybrid. The nam
The presence of a limited number of predefined beams at RU poses constraints to the scheduler at gNB. As a matter of fact, the scheduler can serve only a limited number of beams, depending on the RU characteristics (possibly only 1), in a given time scale, that also depends on the RU characteristics (e.g. 1 slot or 1 symbol). This limitation doesn't exist for digital beamforming.
Analog beamforming implementation also allows to enable distributed antenna systems (DAS), where each beam corrisponds to one antenna (or a set of antennas) of the system. In this scenario, the scheduler constaint is alleviated because normally the number of concurrent beams allowed equals the total number of beams.
# Configuration file fields for analog beamforming
A set of parameters in configuration files controls the implementation of analog beamforming and instructs the scheduler on how to behave in such scenarios. Since most notably this technique in 5G is employed in FR2, the configuration file example currently available is a RFsim one for band 261. [Config file example](../ci-scripts/conf_files/gnb.sa.band261.u3.32prb.rfsim.conf)
@@ -18,8 +20,9 @@ In the `MACRLC` section of configuration files, there are three new parameters:
- `set_analog_beamforming` can be set to 1 or 0 to activate or desactivate analog beamforming (default value is 0)
- `beam_duration` is the number of slots (currently minimum duration of a beam) the scheduler is tied to a beam (default value is 1)
- `beams_per_period` is the number of concurrent beams the RU can handle in the beam duration (default value is 1)
- `beam_weights` is a vector field containing the set of beam indices to be provided by the OAI L1 to the RU is also required. In current implementation, the number of beam indices should be equal to the number of SSBs transmitted
In the `gNBs` section of the configuration file, under the phyisical parameters, a vector field containing the set of beam indices to be provided by the OAI L1 to the RU is also required. This field is called `beam_weights`. In current implementation, the number of beam indices should be equal to the number of SSBs transmitted.
DAS is enabled by setting to 1 the parameter `enable_das` in the L1 section of the configuration file. In case of DAS enabled, the field `beam_weights` in `MACRLC` section can be omitted.
# Implementation in OAI scheduler
@@ -28,3 +31,28 @@ This matrix contains the beams already allocated in a given slot, to flag the sc
To this goal, we extended the virtual resource block (VRB) map by one dimension to also contain information per allocated beam. As said, the scheduler can independently schedule users in a number of beams up to `beams_per_period` concurrently.
It is important to note that in current implementation, there are several periodical channels, e.g. PRACH or PUCCH for CSI et cetera, that have the precendence in being assigned a beam, that is because the scheduling is automatic, set in RRC configuration, and not up to the scheduler. For these instances, we assume the beam is available (if not there are assertions to stop the process). For data channels, the currently implemented PF scheduler is used. The only modification is that a UE can be served only if there is a free beam available or the one of the beams already in use correspond to that UE beam.
# FAPI implementation
To be noted that in our implementation analog beamforming is only supported in non-split/monolithic mode because we don't support yet SCF P19 interface that would be needed to manage these procedure in a split scenario with SCF FAPI.
In `config_request` structure, a vendor extension (`nfapi_nr_analog_beamforming_ve_t`) configures the lower layers at initialization with the following information:
- `analog_bf_vendor_ext` which can assume values 1 or 0 for enabling or disabling analog beamforming
- `num_beams_period_vendor_ext` which corresponds to the configuration parameter `beams_per_period`
- `total_num_beams_vendor_ext` which corresponds to the number of beams configured in `beam_weights`
- `analog_beam_list` which contains the RU beamforming indices configured in `beam_weights`
Additionally, L2 provides in each channel FAPI message information about the beam index. Small Cell Forum (SCF) FAPI provides in its PHY API specifications for the channels only a field for digital beamforming as part of the `precoding_and_beamforming` stucture. Therefore without a better option, we are currently using that one to store the internal analog beamforming index. This is the index used internally by the code to progressively identify the beam with a value from 0 to `total_num_beams_vendor_ext`.
# L1 implementation
To handle multiple concurrent beams, the buffers containing Tx and Rx data in frequency domain (`txdataF` and `rxdataF`) have been extended by one dimension to contain multiple concurrent beams to be transmitted/received.
The function `beam_index_allocation`, called by every L1 channel, is responsible to match the FAPI analog beam index to the RU beam index and to store the latter `beam_id` structure, which allocates the beams per symbol, despite L2 only supporting beam change at slot level. At the same time, the function returns the concurrent beam index, to be used to store data in frequency domain buffers. While doing so, the function also checks if there is room for current beam in the list of concurrent beams, which should always be the case, if L2 properly allocated the channels.
In case of DAS, since each beam corresponds to a specific antenna port, the `beam_index_allocation` function is simplified in the sense that the beam index corresponds to the antenna port index of the frequency domain buffers.
# RU implementation
The implementation is still work in progress.
The first dimension of the Tx and Rx buffers that used to contain the number of Tx/Rx antennas, it is now extended to contain the number of parallel streams which is the number of antennas multiplied by the number of concurrent beams.

View File

@@ -40,6 +40,7 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
#gcc needed for build_oai
build-essential \
ccache \
psmisc \
git \
#use gcc-12 to avoid problems of default gcc-11 in FlexRIC
@@ -52,15 +53,15 @@ RUN apt-get update && \
flex \
m4 \
# python3-pip for conf template generation
python3-pip && \
python3-pip \
wget && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12 && \
pip3 install --ignore-installed pyyaml
# Add "Tini - A tiny but valid init for containers", https://github.com/krallin/tini
# it will be copied into target containers, to print exit numbers and handle signals properly
ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini
RUN chmod +x /tini
RUN wget https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} -O /tini && chmod +x /tini
# In some network environments, GIT proxy is required
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"

View File

@@ -61,7 +61,7 @@ RUN /bin/sh oaienv && \
--gNB \
--build-lib 'telnetsrv enbscope uescope nrscope' \
-t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib \
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION" &&\
--build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION" &&\
# Mainly to see if the sanitize option was perfectly executed
ldd ran_build/build/nr-softmodem && \
ldd ran_build/build/liboran_fhlib_5g.so && \
@@ -72,7 +72,6 @@ RUN mkdir -p openair2/E2AP/flexric/build && \
cd openair2/E2AP/flexric/build && \
scl enable gcc-toolset-13 "\
cmake -GNinja -DCMAKE_BUILD_TYPE=Release \
-DXAPP_MULTILANGUAGE=OFF \
-DKPM_VERSION=$KPM_VERSION \
-DE2AP_VERSION=$E2AP_VERSION .. &&\
ninja && \

View File

@@ -71,7 +71,7 @@ RUN /bin/sh oaienv && \
--gNB \
--build-lib "telnetsrv enbscope uescope nrscope" \
-t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib \
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
--build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
$BUILD_OPTION && \
# Mainly to see if the sanitize option was perfectly executed
ldd ran_build/build/nr-softmodem && \
@@ -82,7 +82,6 @@ RUN /bin/sh oaienv && \
RUN mkdir -p openair2/E2AP/flexric/build && \
cd openair2/E2AP/flexric/build && \
cmake -GNinja -DCMAKE_BUILD_TYPE=Release \
-DXAPP_MULTILANGUAGE=OFF \
-DKPM_VERSION=$KPM_VERSION \
-DE2AP_VERSION=$E2AP_VERSION \
-DCMAKE_C_COMPILER=gcc-12 \

View File

@@ -41,8 +41,7 @@ RUN /bin/sh oaienv && \
scl enable gcc-toolset-13 "\
CXXFLAGS='-Werror -fstack-protector-strong' CFLAGS='-Werror -fstack-protector-strong' ./build_oai -c --ninja \
--eNB --gNB --RU --UE --nrUE \
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt \
-DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
--build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
--build-lib 'telnetsrv enbscope uescope nrscope' \
--build-tool-opt -k10 \
-w USRP -t Ethernet \
@@ -57,7 +56,6 @@ RUN mkdir -p openair2/E2AP/flexric/build && \
cd openair2/E2AP/flexric/build && \
scl enable gcc-toolset-13 "\
cmake -GNinja -DCMAKE_BUILD_TYPE=Release \
-DXAPP_MULTILANGUAGE=OFF \
-DKPM_VERSION=$KPM_VERSION \
-DE2AP_VERSION=$E2AP_VERSION .. &&\
ninja && \

View File

@@ -36,14 +36,19 @@ WORKDIR /oai-ran
COPY . .
# build all targets so final targets can be created afterwards
RUN /bin/sh oaienv && \
RUN \
# Mount CCache cache direrctory
--mount=type=cache,target=/root/.cache/ccache/ \
# Mount CPM package cache
--mount=type=cache,target=/root/.cache/cpm/ \
/bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai -c --ninja \
--eNB --gNB --RU --UE --nrUE \
--build-lib "telnetsrv enbscope uescope nrscope" \
-w USRP -t Ethernet \
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
--build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
--noavx512 \
--build-tool-opt -k10 \
--cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror" $BUILD_OPTION && \
@@ -54,10 +59,12 @@ RUN /bin/sh oaienv && \
ldd ran_build/build/*.so
## Build FlexRIC for SM Models
RUN mkdir -p openair2/E2AP/flexric/build && \
RUN \
# Mount CCache cache direrctory
--mount=type=cache,target=/root/.cache/ccache/ \
mkdir -p openair2/E2AP/flexric/build && \
cd openair2/E2AP/flexric/build && \
cmake -GNinja -DCMAKE_BUILD_TYPE=Release \
-DXAPP_MULTILANGUAGE=OFF \
-DKPM_VERSION=$KPM_VERSION \
-DE2AP_VERSION=$E2AP_VERSION \
-DCMAKE_C_COMPILER=gcc-12 \

View File

@@ -45,7 +45,7 @@ WORKDIR /oai-ran
COPY . .
RUN /bin/sh oaienv && \
tar -xvzf nvipc_src.*.tar.gz && \
tar -xvzf nvipc* && \
cd nvipc_src.* && \
rm -rf build && mkdir build && cd build && \
cmake .. -DNVIPC_DPDK_ENABLE=OFF -DNVIPC_DOCA_ENABLE=OFF -DNVIPC_CUDA_ENABLE=OFF -DENABLE_SLT_RSP=ON && \

View File

@@ -45,7 +45,7 @@ WORKDIR /oai-ran
COPY . .
RUN /bin/sh oaienv && \
tar -xvzf nvipc_src.*.tar.gz && \
tar -xvzf nvipc* && \
cd nvipc_src.* && \
rm -rf build && mkdir build && cd build && \
cmake .. -DNVIPC_DPDK_ENABLE=OFF -DNVIPC_DOCA_ENABLE=OFF -DNVIPC_CUDA_ENABLE=OFF -DENABLE_SLT_RSP=ON && \

View File

@@ -1740,8 +1740,6 @@ void *UE_thread(void *arg) {
oai_exit=1;
}
log_scheduler(__func__);
while (!oai_exit) {
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
int instance_cnt_synch = UE->proc.instance_cnt_synch;

View File

@@ -360,32 +360,29 @@ void term_gNB_Tpool(int inst) {
}
/// eNB kept in function name for nffapi calls, TO FIX
void init_eNB_afterRU(void) {
int inst,ru_id,i,aa;
PHY_VARS_gNB *gNB;
for (inst=0; inst<RC.nb_nr_L1_inst; inst++) {
gNB = RC.gNB[inst];
void init_eNB_afterRU(void)
{
for (int inst = 0; inst < RC.nb_nr_L1_inst; inst++) {
PHY_VARS_gNB *gNB = RC.gNB[inst];
phy_init_nr_gNB(gNB);
// map antennas and PRACH signals to gNB RX
if (0) AssertFatal(gNB->num_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id);
LOG_D(NR_PHY, "Mapping RX ports from %d RUs to gNB %d\n", gNB->num_RU, gNB->Mod_id);
for (ru_id=0,aa=0; ru_id<gNB->num_RU; ru_id++) {
int aa = 0;
for (int ru_id = 0; ru_id < gNB->num_RU; ru_id++) {
AssertFatal(gNB->RU_list[ru_id]->common.rxdataF != NULL, "RU %d : common.rxdataF is NULL\n", gNB->RU_list[ru_id]->idx);
AssertFatal(gNB->RU_list[ru_id]->prach_rxsigF != NULL, "RU %d : prach_rxsigF is NULL\n", gNB->RU_list[ru_id]->idx);
for (i=0; i<gNB->RU_list[ru_id]->nb_rx; aa++,i++) {
LOG_I(PHY,"Attaching RU %d antenna %d to gNB antenna %d\n",gNB->RU_list[ru_id]->idx,i,aa);
for (int i = 0; i < gNB->RU_list[ru_id]->nb_rx; aa++, i++) {
LOG_I(PHY,"Attaching RU %d antenna %d to gNB antenna %d\n", gNB->RU_list[ru_id]->idx, i, aa);
gNB->prach_vars.rxsigF[aa] = gNB->RU_list[ru_id]->prach_rxsigF[0][i];
// TODO hardcoded beam to 0, still need to understand how to handle this properly
gNB->common_vars.rxdataF[0][aa] = (c16_t *)gNB->RU_list[ru_id]->common.rxdataF[i];
for (int b = 0; b < gNB->RU_list[ru_id]->num_beams_period; b++) {
int idx = i + b * gNB->RU_list[ru_id]->nb_rx;
gNB->common_vars.rxdataF[b][aa] = (c16_t *)gNB->RU_list[ru_id]->common.rxdataF[idx];
}
}
}
/* TODO: review this code, there is something wrong.
* In monolithic mode, we come here with nb_antennas_rx == 0
* (not tested in other modes).
@@ -393,7 +390,6 @@ void init_eNB_afterRU(void) {
//init_precoding_weights(RC.gNB[inst]);
init_gNB_Tpool(inst);
}
}
/**

View File

@@ -240,20 +240,20 @@ int connect_rau(RU_t *ru) {
void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
int offset = ru->nr_frame_parms->get_samples_slot_timestamp(slot,ru->nr_frame_parms,0);
void *buffs[ru->nb_tx];
for (int aid=0;aid<ru->nb_tx;aid++) buffs[aid] = (void*)&ru->common.txdata[aid][offset];
void *buffs[ru->nb_tx];
for (int aid = 0; aid < ru->nb_tx; aid++)
buffs[aid] = (void*)&ru->common.txdata[aid][offset];
struct timespec txmeas;
clock_gettime(CLOCK_MONOTONIC, &txmeas);
LOG_D(NR_PHY,"IF5 TX %d.%d, TS %llu, buffs[0] %p, buffs[1] %p ener0 %f dB, tx start %d\n",frame,slot,(unsigned long long)timestamp,buffs[0],buffs[1],
10*log10((double)signal_energy(buffs[0],ru->nr_frame_parms->get_samples_per_slot(slot,ru->nr_frame_parms))),(int)txmeas.tv_nsec);
ru->ifdevice.trx_write_func2(&ru->ifdevice,
timestamp,
timestamp,
buffs,
0,
ru->nr_frame_parms->get_samples_per_slot(slot,ru->nr_frame_parms),
0,
ru->nb_tx);
0,
ru->nr_frame_parms->get_samples_per_slot(slot,ru->nr_frame_parms),
0,
ru->nb_tx);
}
// southbound IF4p5 fronthaul
@@ -591,33 +591,28 @@ static void rx_rf(RU_t *ru, int *frame, int *slot)
RU_proc_t *proc = &ru->proc;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
openair0_config_t *cfg = &ru->openair0_cfg;
void *rxp[ru->nb_rx];
unsigned int rxs;
int i;
uint32_t samples_per_slot = fp->get_samples_per_slot(*slot,fp);
uint32_t samples_per_slot_prev ;
openair0_timestamp ts,old_ts;
AssertFatal(*slot<fp->slots_per_frame && *slot>=0, "slot %d is illegal (%d)\n",*slot,fp->slots_per_frame);
uint32_t samples_per_slot = fp->get_samples_per_slot(*slot, fp);
AssertFatal(*slot < fp->slots_per_frame && *slot >= 0, "slot %d is illegal (%d)\n", *slot, fp->slots_per_frame);
start_meas(&ru->rx_fhaul);
for (i=0; i<ru->nb_rx; i++)
rxp[i] = (void *)&ru->common.rxdata[i][fp->get_samples_slot_timestamp(*slot,fp,0)];
int nb = ru->nb_rx * ru->num_beams_period;
void *rxp[nb];
for (int i = 0; i < nb; i++)
rxp[i] = (void *)&ru->common.rxdata[i][fp->get_samples_slot_timestamp(*slot, fp, 0)];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
old_ts = proc->timestamp_rx;
LOG_D(PHY,"Reading %d samples for slot %d (%p)\n",samples_per_slot,*slot,rxp[0]);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1);
openair0_timestamp old_ts = proc->timestamp_rx;
LOG_D(PHY,"Reading %d samples for slot %d (%p)\n", samples_per_slot, *slot, rxp[0]);
openair0_timestamp ts;
unsigned int rxs;
if(emulate_rf) {
wait_on_condition(&proc->mutex_emulateRF,&proc->cond_emulateRF,&proc->instance_cnt_emulateRF,"emulatedRF_thread");
release_thread(&proc->mutex_emulateRF,&proc->instance_cnt_emulateRF,"emulatedRF_thread");
rxs = samples_per_slot;
ts = old_ts + rxs;
} else {
rxs = ru->rfdevice.trx_read_func(&ru->rfdevice,
&ts,
rxp,
samples_per_slot,
ru->nb_rx);
rxs = ru->rfdevice.trx_read_func(&ru->rfdevice, &ts, rxp, samples_per_slot, nb);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
@@ -629,7 +624,7 @@ static void rx_rf(RU_t *ru, int *frame, int *slot)
LOG_E(PHY, "rx_rf: Asked for %d samples, got %d from USRP\n", samples_per_slot, rxs);
if (proc->first_rx != 1) {
samples_per_slot_prev = fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp);
uint32_t samples_per_slot_prev = fp->get_samples_per_slot((*slot - 1) % fp->slots_per_frame, fp);
if (proc->timestamp_rx - old_ts != samples_per_slot_prev) {
LOG_D(PHY,
@@ -752,8 +747,6 @@ void tx_rf(RU_t *ru, int frame,int slot, uint64_t timestamp)
RU_proc_t *proc = &ru->proc;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
nfapi_nr_config_request_scf_t *cfg = &ru->config;
void *txp[ru->nb_tx];
int i;
T(T_ENB_PHY_OUTPUT_SIGNAL,
T_INT(0),
T_INT(0),
@@ -820,7 +813,9 @@ void tx_rf(RU_t *ru, int frame,int slot, uint64_t timestamp)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot);
for (i = 0; i < ru->nb_tx; i++)
int nt = ru->nb_tx * ru->num_beams_period;
void *txp[nt];
for (int i = 0; i < nt; i++)
txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot, fp, 0)] - sf_extension * sizeof(int32_t);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp + ru->ts_offset) & 0xffffffff);
@@ -830,12 +825,12 @@ void tx_rf(RU_t *ru, int frame,int slot, uint64_t timestamp)
timestamp + ru->ts_offset - sf_extension,
txp,
siglen + sf_extension,
ru->nb_tx, flags);
nt,
flags);
LOG_D(PHY,
"[TXPATH] RU %d aa %d tx_rf, writing to TS %llu, %d.%d, unwrapped_frame %d, slot %d, flags %d, siglen+sf_extension %d, "
"[TXPATH] RU %d tx_rf, writing to TS %llu, %d.%d, unwrapped_frame %d, slot %d, flags %d, siglen+sf_extension %d, "
"returned %d, E %f\n",
ru->idx,
i,
(long long unsigned int)(timestamp + ru->ts_offset - sf_extension),
frame,
slot,
@@ -851,7 +846,6 @@ void tx_rf(RU_t *ru, int frame,int slot, uint64_t timestamp)
static void fill_rf_config(RU_t *ru, char *rf_config_file)
{
int i;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
nfapi_nr_config_request_scf_t *config = &ru->config; //tmp index
openair0_config_t *cfg = &ru->openair0_cfg;
@@ -877,13 +871,14 @@ static void fill_rf_config(RU_t *ru, char *rf_config_file)
AssertFatal(ru->nb_rx > 0 && ru->nb_rx <= 8, "openair0 does not support more than 8 antennas\n");
cfg->Mod_id = 0;
cfg->num_rb_dl=N_RB;
cfg->tx_num_channels=ru->nb_tx;
cfg->rx_num_channels=ru->nb_rx;
cfg->num_rb_dl = N_RB;
cfg->tx_num_channels = ru->nb_tx * ru->num_beams_period;
cfg->rx_num_channels = ru->nb_rx * ru->num_beams_period;
cfg->num_distributed_ru = ru->num_beams_period;
LOG_I(PHY,"Setting RF config for N_RB %d, NB_RX %d, NB_TX %d\n",cfg->num_rb_dl,cfg->rx_num_channels,cfg->tx_num_channels);
LOG_I(PHY,"tune_offset %.0f Hz, sample_rate %.0f Hz\n",cfg->tune_offset,cfg->sample_rate);
for (i=0; i<ru->nb_tx; i++) {
for (int i = 0; i < ru->nb_tx * ru->num_beams_period; i++) {
if (ru->if_frequency == 0) {
cfg->tx_freq[i] = (double)fp->dl_CarrierFreq;
} else if (ru->if_freq_offset) {
@@ -898,7 +893,7 @@ static void fill_rf_config(RU_t *ru, char *rf_config_file)
i, cfg->tx_gain[i],cfg->tx_freq[i]);
}
for (i=0; i<ru->nb_rx; i++) {
for (int i = 0; i < ru->nb_rx * ru->num_beams_period; i++) {
if (ru->if_frequency == 0) {
cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
} else if (ru->if_freq_offset) {
@@ -944,8 +939,8 @@ static void fill_split7_2_config(split7_config_t *split7, const nfapi_nr_config_
Each rf chain is is addressed by the card number and the chain on the card. The
rf_map specifies for each antenna port, on which rf chain the mapping should start. Multiple
antennas are mapped to successive RF chains on the same card. */
int setup_RU_buffers(RU_t *ru) {
int i,j;
int setup_RU_buffers(RU_t *ru)
{
int card,ant;
//uint16_t N_TA_offset = 0;
NR_DL_FRAME_PARMS *fp;
@@ -967,27 +962,27 @@ int setup_RU_buffers(RU_t *ru) {
if (ru->openair0_cfg.mmapped_dma == 1) {
// replace RX signal buffers with mmaped HW versions
for (i=0; i<ru->nb_rx; i++) {
card = i/4;
ant = i%4;
for (int i = 0; i < ru->nb_rx * ru->num_beams_period; i++) {
card = i / 4;
ant = i % 4;
LOG_D(PHY, "Mapping RU id %u, rx_ant %d, on card %d, chain %d\n", ru->idx, i, ru->rf_map.card + card, ru->rf_map.chain + ant);
free(ru->common.rxdata[i]);
ru->common.rxdata[i] = ru->openair0_cfg.rxbase[ru->rf_map.chain + ant];
for (j = 0; j < 16; j++) {
ru->common.rxdata[i][j] = 16-j;
for (int j = 0; j < 16; j++) {
ru->common.rxdata[i][j] = 16 - j;
}
}
for (i=0; i<ru->nb_tx; i++) {
card = i/4;
ant = i%4;
for (int i = 0; i < ru->nb_tx * ru->num_beams_period; i++) {
card = i / 4;
ant = i % 4;
LOG_D(PHY, "Mapping RU id %u, tx_ant %d, on card %d, chain %d\n", ru->idx, i, ru->rf_map.card + card, ru->rf_map.chain + ant);
free(ru->common.txdata[i]);
ru->common.txdata[i] = ru->openair0_cfg.txbase[ru->rf_map.chain + ant];
for (j = 0; j < 16; j++) {
ru->common.txdata[i][j] = 16-j;
for (int j = 0; j < 16; j++) {
ru->common.txdata[i][j] = 16 - j;
}
}
} else { // not memory-mapped DMA
@@ -1054,7 +1049,7 @@ void ru_tx_func(void *param)
ru->fh_north_out(ru);
} else {
if(frame_tx == print_frame) {
for (int i=0; i<ru->nb_tx; i++) {
for (int i = 0; i < ru->nb_tx * ru->num_beams_period; i++) {
if(slot_tx == 0) {
sprintf(filename,"gNBdataF_frame%d_sl%d.m", print_frame, slot_tx);
LOG_M(filename,"txdataF_frame",&ru->gNB_list[0]->common_vars.txdataF[i][0],fp->samples_per_frame_wCP, 1, 1);
@@ -1324,10 +1319,12 @@ void *ru_thread(void *param)
for (int prach_oc = 0; prach_oc < p->num_prach_ocas; prach_oc++) {
int prachStartSymbol = p->prachStartSymbol + prach_oc * N_dur;
int beam_id = ru->prach_list[prach_id].beam ? ru->prach_list[prach_id].beam[prach_oc] : 0;
//comment FK: the standard 38.211 section 5.3.2 has one extra term +14*N_RA_slot. This is because there prachStartSymbol is given wrt to start of the 15kHz slot or 60kHz slot. Here we work slot based, so this function is anyway only called in slots where there is PRACH. Its up to the MAC to schedule another PRACH PDU in the case there are there N_RA_slot \in {0,1}.
rx_nr_prach_ru(ru,
p->fmt, // could also use format
p->numRA,
beam_id,
prachStartSymbol,
p->slot,
prach_oc,

View File

@@ -23,6 +23,7 @@
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include "common/config/config_userapi.h"
#include "common/utils/load_module_shlib.h"
#include "RRC/LTE/rrc_vars.h"
#ifdef SMBV
#include "PHY/TOOLS/smbv.h"

View File

@@ -43,6 +43,7 @@
#include "position_interface.h"
#include "nr_phy_common.h"
#include "common/utils/time_manager/time_manager.h"
#include "log.h"
/*
* NR SLOT PROCESSING SEQUENCE
@@ -545,6 +546,28 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx
}
}
if (!IS_SOFTMODEM_RFSIM) {
uint64_t deadline_us = rxtxD->absolute_deadline_us;
struct timespec current_time;
if (clock_gettime(CLOCK_REALTIME, &current_time)) {
LOG_E(PHY, "clock_gettime failed\n");
}
uint64_t current_time_us = current_time.tv_sec * 1e6 + current_time.tv_nsec / 1e3;
if (current_time_us > deadline_us) {
static unsigned int deadline_warning_rate_limit = 0;
if (deadline_warning_rate_limit % 1000 == 0) {
LOG_W(PHY,
"Deadline missed for tx slot %d.%d (current time %lu us, deadline %lu us, missed by %lu)\n",
proc->frame_tx,
proc->nr_slot_tx,
current_time_us,
deadline_us,
current_time_us - deadline_us);
}
deadline_warning_rate_limit++;
}
}
openair0_timestamp writeTimestamp = proc->timestamp_tx;
int writeBlockSize = rxtxD->writeBlockSize;
// if writeBlockSize gets longer that slot size, fill with dummy
@@ -728,7 +751,8 @@ static int UE_dl_preprocessing(PHY_VARS_NR_UE *UE,
}
sampleShift = pbch_pdcch_processing(UE, proc, phy_data);
if (phy_data->dlsch[0].active && phy_data->dlsch[0].rnti_type == TYPE_C_RNTI_) {
if (phy_data->dlsch[0].active
&& (phy_data->dlsch[0].rnti_type == TYPE_C_RNTI_ || phy_data->dlsch[0].rnti_type == TYPE_RA_RNTI_)) {
// indicate to tx thread to wait for DLSCH decoding
if (phy_data->dlsch[0].dlsch_config.k1_feedback) { // if feedback is 0 there is no HARQ associated with this DLSCH
const int ack_nack_slot = (proc->nr_slot_rx + phy_data->dlsch[0].dlsch_config.k1_feedback) % fp->slots_per_frame;
@@ -1138,8 +1162,13 @@ void *UE_thread(void *arg)
const int readBlockSize = get_readBlockSize(slot_nr, fp) - iq_shift_to_apply;
openair0_timestamp rx_timestamp;
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice, &rx_timestamp, rxp, readBlockSize, fp->nb_antennas_rx);
UEscopeCopy(UE, ueTimeDomainSamples, rxp[0], sizeof(c16_t), 1, readBlockSize, 0);
metadata meta = {.slot = curMsg.proc.nr_slot_rx, .frame = curMsg.proc.frame_rx};
UEscopeCopyWithMetadata(UE, ueTimeDomainSamples, rxp[0] - firstSymSamp * sizeof(c16_t), sizeof(c16_t), 1, readBlockSize, 0, &meta);
AssertFatal(readBlockSize == tmp, "");
struct timespec current_time;
if (clock_gettime(CLOCK_REALTIME, &current_time)) {
LOG_E(PHY, "clock_gettime failed\n");
}
if(slot_nr == (nb_slot_frame - 1)) {
// read in first symbol of next frame and adjust for timing drift
@@ -1162,6 +1191,11 @@ void *UE_thread(void *arg)
const openair0_timestamp writeTimestamp = rx_timestamp + fp->get_samples_slot_timestamp(slot_nr, fp, duration_rx_to_tx)
- firstSymSamp - UE->N_TA_offset - timing_advance;
// Calculate TX deadline, approximately 1 symbol before the first sample should be written
const uint64_t samples_diff = writeTimestamp - rx_timestamp - fp->ofdm_symbol_size;
const float deadline_us = samples_diff / UE->rfdevice.openair0_cfg->sample_rate * 1e6;
const uint64_t absolute_deadline_us = current_time.tv_sec * 1e6 + current_time.tv_nsec / 1e3 + deadline_us;
// but use current UE->timing_advance value to compute writeBlockSize
int writeBlockSize = fp->get_samples_per_slot((slot_nr + duration_rx_to_tx) % nb_slot_frame, fp) - iq_shift_to_apply;
int new_timing_advance = UE->timing_advance;
@@ -1204,6 +1238,7 @@ void *UE_thread(void *arg)
curMsgTx->writeBlockSize = writeBlockSize;
curMsgTx->proc.timestamp_tx = writeTimestamp;
curMsgTx->UE = UE;
curMsgTx->absolute_deadline_us = absolute_deadline_us;
int slot = curMsgTx->proc.nr_slot_tx;
int slot_and_frame = slot + curMsgTx->proc.frame_tx * UE->frame_parms.slots_per_frame;

View File

@@ -368,9 +368,6 @@ void start_oai_nrue_threads()
int NB_UE_INST = 1;
configmodule_interface_t *uniqCfg = NULL;
// A global var to reduce the changes size
ldpc_interface_t ldpc_interface = {0}, ldpc_interface_offload = {0};
nrLDPC_coding_interface_t nrLDPC_coding_interface = {0};
int main(int argc, char **argv)

View File

@@ -35,6 +35,9 @@
#include "debug.h"
#define INDENTED_PRINTF(format, ...) printf("%*s" format, depth * 2, "", ##__VA_ARGS__)
#define INDENTED_GENERIC_PRINT(string, format, ...) INDENTED_PRINTF(string " = " format "\n", ##__VA_ARGS__)
#define INDENTED_TLV_PRINT(tlv_name, tlv) INDENTED_GENERIC_PRINT("(0x%04x) " tlv_name, "0x%02x", tlv.tl.tag, tlv.value)
#define INDENTED_TLV_FORMAT_PRINT(tlv_name, format, tlv) INDENTED_GENERIC_PRINT("(0x%04x) " tlv_name, format, tlv.tl.tag, tlv.value)
#define EQ_TLV(_tlv_a, _tlv_b) \
do { \

View File

@@ -724,6 +724,53 @@ uint8_t unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *
&pNfapiMsg->vendor_extension));
}
static uint8_t pack_dbt_table_tlv_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_dbt_tlv_ve_t *dbt_ve = (nfapi_nr_dbt_tlv_ve_t *)tlv;
nfapi_nr_dbt_pdu_t *dbt_config = &dbt_ve->value;
if (!( push16(dbt_config->num_dig_beams, ppWritePackedMsg, end) && push16(dbt_config->num_txrus, ppWritePackedMsg, end) )) {
return 0;
}
for (int i = 0; i< dbt_config->num_dig_beams; i++) {
const nfapi_nr_dig_beam_t *dig_beam = &dbt_config->dig_beam_list[i];
if (!(push16(dig_beam->beam_idx, ppWritePackedMsg, end))) {
return 0;
}
for (int k = 0; k< dbt_config->num_txrus; k++) {
const nfapi_nr_txru_t *tx_ru = &dig_beam->txru_list[k];
if (!(push16(tx_ru->dig_beam_weight_Re, ppWritePackedMsg, end) && push16(tx_ru->dig_beam_weight_Im, ppWritePackedMsg, end))) {
return 0;
}
}
}
return 1;
}
static uint8_t pack_pm_table_tlv_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_pm_tlv_ve_t *pm_ve = (nfapi_nr_pm_tlv_ve_t *)tlv;
nfapi_nr_pm_list_t *pmi_list = &pm_ve->value;
if (!( push16(pmi_list->num_pm_idx, ppWritePackedMsg, end) )) {
return 0;
}
for (int i = 0; i< pmi_list->num_pm_idx; i++) {
const nfapi_nr_pm_pdu_t *pm_pdu = &pmi_list->pmi_pdu[i];
if (!(push16(pm_pdu->pm_idx, ppWritePackedMsg, end) && push16(pm_pdu->numLayers, ppWritePackedMsg, end)
&& push16(pm_pdu->num_ant_ports, ppWritePackedMsg, end))) {
return 0;
}
for (int k = 0; k < pm_pdu->numLayers; k++) {
for (int j = 0; j < pm_pdu->num_ant_ports; j++) {
const nfapi_nr_pm_weights_t *pm_weight = &pm_pdu->weights[k][j];
if (!(push16(pm_weight->precoder_weight_Re, ppWritePackedMsg, end) && push16(pm_weight->precoder_weight_Im, ppWritePackedMsg, end))) {
return 0;
}
}
}
}
return 1;
}
uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config)
{
uint8_t *pNumTLVFields = (uint8_t *)*ppWritePackedMsg;
@@ -1044,11 +1091,19 @@ uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
// END Measurement Config
// START Digital Beam Table (DBT) PDU
// Struct in nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h nfapi_nr_dbt_pdu_t, currently unused
if (pNfapiMsg->dbt_config.num_dig_beams != 0) {
nfapi_nr_dbt_tlv_ve_t dbt_tlv = {.tl.tag = NFAPI_NR_CONFIG_BEAMFORMING_TABLE_TAG, .value = pNfapiMsg->dbt_config};
pack_nr_tlv(NFAPI_NR_CONFIG_BEAMFORMING_TABLE_TAG, &dbt_tlv, ppWritePackedMsg, end, &pack_dbt_table_tlv_value);
numTLVs++;
}
// END Digital Beam Table (DBT) PDU
// START Precoding Matrix (PM) PDU
// Struct in nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h nfapi_nr_pm_pdu_t, currently unused, tag to use for AERIAL
if (pNfapiMsg->pmi_list.num_pm_idx != 0) {
nfapi_nr_pm_tlv_ve_t pm_tlv = {.tl.tag = NFAPI_NR_CONFIG_PRECODING_TABLE_V6_TAG, .value = pNfapiMsg->pmi_list};
pack_nr_tlv(NFAPI_NR_CONFIG_PRECODING_TABLE_V6_TAG, &pm_tlv, ppWritePackedMsg, end, &pack_pm_table_tlv_value);
numTLVs++;
}
// is 0xA011 END Precoding Matrix (PM) PDU
#ifndef ENABLE_AERIAL
// START nFAPI TLVs included in CONFIG.request for IDLE and CONFIGURED states
@@ -1124,11 +1179,94 @@ uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
// only increase if it was set
numTLVs += pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext.tl.tag == NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG;
AssertFatal(pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext.tl.tag == 0,
"Total num beams Vendor extension shouldn't be set!");
// The call to pack the TLV would be the same as any other TLV, it is only packed if the tag is set,
// so, it's safe to add the call to pack_nr_tlv even if it is not always set
retval &= pack_nr_tlv(NFAPI_NR_FAPI_TOTAL_NUM_BEAMS_VENDOR_EXTENSION_TAG,
&(pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value);
// only increase if it was set
numTLVs +=
pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext.tl.tag == NFAPI_NR_FAPI_TOTAL_NUM_BEAMS_VENDOR_EXTENSION_TAG;
for (int beam = 0; beam < pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext.value; beam++) {
AssertFatal(pNfapiMsg->analog_beamforming_ve.analog_beam_list[beam].tl.tag == 0,
"Analog beams list Vendor extension shouldn't be set!");
// The call to pack the TLV would be the same as any other TLV, it is only packed if the tag is set,
// so, it's safe to add the call to pack_nr_tlv even if it is not always set
retval &= pack_nr_tlv(NFAPI_NR_FAPI_ANALOG_BEAM_VENDOR_EXTENSION_TAG,
&(pNfapiMsg->analog_beamforming_ve.analog_beam_list[beam]),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value);
// only increase if it was set
numTLVs += pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext.tl.tag == NFAPI_NR_FAPI_TOTAL_NUM_BEAMS_VENDOR_EXTENSION_TAG;
}
pNfapiMsg->num_tlv = numTLVs;
retval &= push8(pNfapiMsg->num_tlv, &pNumTLVFields, end);
return retval;
}
static uint8_t unpack_dbt_table_tlv_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_nr_dbt_pdu_t *dbt_config = (nfapi_nr_dbt_pdu_t *)tlv;
if (!(pull16(ppReadPackedMsg, &dbt_config->num_dig_beams, end) && pull16(ppReadPackedMsg, &dbt_config->num_txrus, end))) {
return 0;
}
if (dbt_config->num_dig_beams > 0) {
dbt_config->dig_beam_list = calloc(dbt_config->num_dig_beams, sizeof(*dbt_config->dig_beam_list));
}
for (int i = 0; i < dbt_config->num_dig_beams; i++) {
nfapi_nr_dig_beam_t *dig_beam = &dbt_config->dig_beam_list[i];
if (!(pull16(ppReadPackedMsg, &dig_beam->beam_idx, end))) {
return 0;
}
if (dbt_config->num_txrus > 0) {
dig_beam->txru_list = calloc(dbt_config->num_txrus, sizeof(*dig_beam->txru_list));
}
for (int k = 0; k < dbt_config->num_txrus; k++) {
nfapi_nr_txru_t *tx_ru = &dig_beam->txru_list[k];
if (!(pull16(ppReadPackedMsg, &tx_ru->dig_beam_weight_Re, end) && pull16(ppReadPackedMsg, &tx_ru->dig_beam_weight_Im, end))) {
return 0;
}
}
}
return 1;
}
static uint8_t unpack_pm_table_tlv_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_nr_pm_list_t *pm_list = (nfapi_nr_pm_list_t *)tlv;
if (!(pull16(ppReadPackedMsg, &pm_list->num_pm_idx, end))) {
return 0;
}
if (pm_list->num_pm_idx > 0) {
pm_list->pmi_pdu = calloc(pm_list->num_pm_idx, sizeof(*pm_list->pmi_pdu));
}
for (int i = 0; i < pm_list->num_pm_idx; i++) {
nfapi_nr_pm_pdu_t *pm_pdu = &pm_list->pmi_pdu[i];
if (!(pull16(ppReadPackedMsg, &pm_pdu->pm_idx, end) && pull16(ppReadPackedMsg, &pm_pdu->numLayers, end)
&& pull16(ppReadPackedMsg, &pm_pdu->num_ant_ports, end))) {
return 0;
}
AssertFatal(pm_pdu->numLayers <= 4 && pm_pdu->num_ant_ports <= 4, "Precoding matrix size limited to 4X4 for the time being\n");
for (int k = 0; k < pm_pdu->numLayers; k++) {
for (int j = 0; j < pm_pdu->num_ant_ports; j++) {
nfapi_nr_pm_weights_t *pm_weight = &pm_pdu->weights[k][j];
if (!(pulls16(ppReadPackedMsg, &pm_weight->precoder_weight_Re, end)
&& pulls16(ppReadPackedMsg, &pm_weight->precoder_weight_Im, end))) {
return 0;
}
}
}
}
return 1;
}
uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t *config)
{
// Helper vars for indexed TLVs
@@ -1138,6 +1276,7 @@ uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
int config_beam_idx = 0;
int tdd_periodicity_idx = 0;
int symbol_per_slot_idx = 0;
int beam_ve_idx = 0;
nfapi_nr_config_request_scf_t *pNfapiMsg = (nfapi_nr_config_request_scf_t *)msg;
// unpack TLVs
@@ -1188,7 +1327,13 @@ uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
&unpack_uint8_tlv_value},
{NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), &unpack_uint8_tlv_value},
{NFAPI_NR_CONFIG_SLOT_CONFIG_TAG, NULL, &unpack_uint8_tlv_value},
{NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG, &(pNfapiMsg->analog_beamforming_ve.num_beams_period_vendor_ext), &unpack_uint8_tlv_value},
{NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG, &(pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext), &unpack_uint8_tlv_value},
{NFAPI_NR_FAPI_TOTAL_NUM_BEAMS_VENDOR_EXTENSION_TAG, &(pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext), &unpack_uint8_tlv_value},
{NFAPI_NR_FAPI_ANALOG_BEAM_VENDOR_EXTENSION_TAG, NULL, &unpack_uint8_tlv_value},
{NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG, &(pNfapiMsg->measurement_config.rssi_measurement), &unpack_uint8_tlv_value},
{NFAPI_NR_CONFIG_BEAMFORMING_TABLE_TAG, NULL, &unpack_dbt_table_tlv_value},
{NFAPI_NR_CONFIG_PRECODING_TABLE_V6_TAG, NULL, &unpack_pm_table_tlv_value},
{NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4), &unpack_ipv4_address_value},
{NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6), &unpack_ipv6_address_value},
{NFAPI_NR_NFAPI_P7_VNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_port), &unpack_uint16_tlv_value},
@@ -1221,6 +1366,29 @@ uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
}
int result = 0;
switch (generic_tl.tag) {
case NFAPI_NR_FAPI_TOTAL_NUM_BEAMS_VENDOR_EXTENSION_TAG:
pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext.tl.tag = generic_tl.tag;
pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext.tl.length = generic_tl.length;
result = (*unpack_fns[idx].unpack_func)(&pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext, ppReadPackedMsg, end);
pNfapiMsg->analog_beamforming_ve.analog_beam_list = (nfapi_uint8_tlv_t *)malloc(
pNfapiMsg->analog_beamforming_ve.total_num_beams_vendor_ext.value * sizeof(nfapi_uint8_tlv_t));
beam_ve_idx = 0;
break;
case NFAPI_NR_FAPI_ANALOG_BEAM_VENDOR_EXTENSION_TAG:
unpack_fns[idx].tlv = &pNfapiMsg->analog_beamforming_ve.analog_beam_list[beam_ve_idx];
pNfapiMsg->analog_beamforming_ve.analog_beam_list[beam_ve_idx].tl.tag = generic_tl.tag;
pNfapiMsg->analog_beamforming_ve.analog_beam_list[beam_ve_idx].tl.length = generic_tl.length;
result = (*unpack_fns[idx].unpack_func)(&pNfapiMsg->analog_beamforming_ve.analog_beam_list[beam_ve_idx], ppReadPackedMsg, end);
beam_ve_idx ++;
break;
case NFAPI_NR_CONFIG_BEAMFORMING_TABLE_TAG:
unpack_fns[idx].tlv = &generic_tl;
result = (*unpack_fns[idx].unpack_func)(&pNfapiMsg->dbt_config, ppReadPackedMsg, end);
break;
case NFAPI_NR_CONFIG_PRECODING_TABLE_V6_TAG:
unpack_fns[idx].tlv = &generic_tl;
result = (*unpack_fns[idx].unpack_func)(&pNfapiMsg->pmi_list, ppReadPackedMsg, end);
break;
case NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG:
pNfapiMsg->prach_config.num_prach_fd_occasions.tl.tag = generic_tl.tag;
pNfapiMsg->prach_config.num_prach_fd_occasions.tl.length = generic_tl.length;

View File

@@ -259,6 +259,40 @@ bool eq_config_request(const nfapi_nr_config_request_scf_t *unpacked_req, const
EQ_TLV(unpacked_req->measurement_config.rssi_measurement, req->measurement_config.rssi_measurement);
EQ(unpacked_req->dbt_config.num_dig_beams, req->dbt_config.num_dig_beams);
EQ(unpacked_req->dbt_config.num_txrus, req->dbt_config.num_txrus);
for (int i = 0; i < req->dbt_config.num_dig_beams; i++) {
const nfapi_nr_dig_beam_t *unpacked_dig_beam = &unpacked_req->dbt_config.dig_beam_list[i];
const nfapi_nr_dig_beam_t *req_dig_beam = &req->dbt_config.dig_beam_list[i];
EQ(unpacked_dig_beam->beam_idx, req_dig_beam->beam_idx);
for (int k = 0; k < req->dbt_config.num_txrus; ++k) {
const nfapi_nr_txru_t *unpacked_tx_ru = &unpacked_dig_beam->txru_list[k];
const nfapi_nr_txru_t *req_tx_ru = &req_dig_beam->txru_list[k];
EQ(unpacked_tx_ru->dig_beam_weight_Re, req_tx_ru->dig_beam_weight_Re);
EQ(unpacked_tx_ru->dig_beam_weight_Im, req_tx_ru->dig_beam_weight_Im);
}
}
EQ(unpacked_req->pmi_list.num_pm_idx, req->pmi_list.num_pm_idx);
for (int i = 0; i < req->pmi_list.num_pm_idx; i++) {
const nfapi_nr_pm_pdu_t *req_pmi_pdu = &req->pmi_list.pmi_pdu[i];
const nfapi_nr_pm_pdu_t *unpacked_pmi_pdu = &unpacked_req->pmi_list.pmi_pdu[i];
EQ(unpacked_pmi_pdu->pm_idx, req_pmi_pdu->pm_idx);
EQ(unpacked_pmi_pdu->numLayers, req_pmi_pdu->numLayers);
EQ(unpacked_pmi_pdu->num_ant_ports, req_pmi_pdu->num_ant_ports);
for (int j = 0; j < req_pmi_pdu->num_ant_ports; ++j) {
for (int k = 0; k < req_pmi_pdu->num_ant_ports; ++k) {
const nfapi_nr_pm_weights_t* req_pm_weight = &req_pmi_pdu->weights[j][k];
const nfapi_nr_pm_weights_t* unpacked_pm_weight = &unpacked_pmi_pdu->weights[j][k];
EQ(unpacked_pm_weight->precoder_weight_Re, req_pm_weight->precoder_weight_Re);
EQ(unpacked_pm_weight->precoder_weight_Im, req_pm_weight->precoder_weight_Im);
}
}
}
EQ(unpacked_req->nfapi_config.p7_vnf_address_ipv4.tl.tag, req->nfapi_config.p7_vnf_address_ipv4.tl.tag);
for (int i = 0; i < NFAPI_IPV4_ADDRESS_LENGTH; ++i) {
EQ(unpacked_req->nfapi_config.p7_vnf_address_ipv4.address[i], req->nfapi_config.p7_vnf_address_ipv4.address[i]);
@@ -276,6 +310,17 @@ bool eq_config_request(const nfapi_nr_config_request_scf_t *unpacked_req, const
EQ_TLV(unpacked_req->nfapi_config.timing_info_mode, req->nfapi_config.timing_info_mode);
EQ_TLV(unpacked_req->nfapi_config.timing_info_period, req->nfapi_config.timing_info_period);
EQ_TLV(unpacked_req->analog_beamforming_ve.num_beams_period_vendor_ext, req->analog_beamforming_ve.num_beams_period_vendor_ext);
EQ_TLV(unpacked_req->analog_beamforming_ve.analog_bf_vendor_ext, req->analog_beamforming_ve.analog_bf_vendor_ext);
EQ_TLV(unpacked_req->analog_beamforming_ve.total_num_beams_vendor_ext, req->analog_beamforming_ve.total_num_beams_vendor_ext);
for (int i = 0; i < unpacked_req->analog_beamforming_ve.total_num_beams_vendor_ext.value; ++i) {
EQ_TLV(unpacked_req->analog_beamforming_ve.analog_beam_list[i], req->analog_beamforming_ve.analog_beam_list[i]);
}
return true;
}
@@ -380,27 +425,20 @@ bool eq_error_indication(const nfapi_nr_error_indication_scf_t *unpacked_req, co
void free_param_request(nfapi_nr_param_request_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
}
void free_param_response(nfapi_nr_param_response_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
free(msg->cell_param.config_tlvs_to_report_list);
if (msg->cell_param.config_tlvs_to_report_list) {
free(msg->cell_param.config_tlvs_to_report_list);
}
}
void free_config_request(nfapi_nr_config_request_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
if (msg->prach_config.num_prach_fd_occasions_list) {
for (int i = 0; i < msg->prach_config.num_prach_fd_occasions.value; i++) {
@@ -419,67 +457,55 @@ void free_config_request(nfapi_nr_config_request_scf_t *msg)
free(msg->tdd_table.max_tdd_periodicity_list);
}
if (msg->pmi_list.pmi_pdu) {
free(msg->pmi_list.pmi_pdu);
for (int i = 0; i < msg->dbt_config.num_dig_beams; i++) {
free(msg->dbt_config.dig_beam_list[i].txru_list);
}
free(msg->dbt_config.dig_beam_list);
free(msg->pmi_list.pmi_pdu);
if (msg->analog_beamforming_ve.analog_beam_list) {
free(msg->analog_beamforming_ve.analog_beam_list);
}
}
void free_config_response(nfapi_nr_config_response_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
if (msg->invalid_tlvs_list) {
free(msg->invalid_tlvs_list);
}
free(msg->invalid_tlvs_list);
if (msg->invalid_tlvs_configured_in_idle_list) {
free(msg->invalid_tlvs_configured_in_idle_list);
}
free(msg->invalid_tlvs_configured_in_idle_list);
if (msg->invalid_tlvs_configured_in_running_list) {
free(msg->invalid_tlvs_configured_in_running_list);
}
free(msg->invalid_tlvs_configured_in_running_list);
if (msg->missing_tlvs_list) {
free(msg->missing_tlvs_list);
}
free(msg->missing_tlvs_list);
}
void free_start_request(nfapi_nr_start_request_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
}
void free_start_response(nfapi_nr_start_response_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
}
void free_stop_request(nfapi_nr_stop_request_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
}
void free_stop_indication(nfapi_nr_stop_indication_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
}
void free_error_indication(nfapi_nr_error_indication_scf_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
}
void copy_param_request(const nfapi_nr_param_request_scf_t *src, nfapi_nr_param_request_scf_t *dst)
@@ -795,6 +821,42 @@ void copy_config_request(const nfapi_nr_config_request_scf_t *src, nfapi_nr_conf
COPY_TLV(dst->measurement_config.rssi_measurement, src->measurement_config.rssi_measurement);
dst->dbt_config.num_dig_beams = src->dbt_config.num_dig_beams;
dst->dbt_config.num_txrus = src->dbt_config.num_txrus;
dst->dbt_config.dig_beam_list = calloc(dst->dbt_config.num_dig_beams, sizeof(*dst->dbt_config.dig_beam_list));
for (int i = 0; i < dst->dbt_config.num_dig_beams; i++) {
nfapi_nr_dig_beam_t *dst_dig_beam = &dst->dbt_config.dig_beam_list[i];
const nfapi_nr_dig_beam_t *src_dig_beam = &src->dbt_config.dig_beam_list[i];
dst_dig_beam->beam_idx = src_dig_beam->beam_idx;
dst_dig_beam->txru_list = calloc(dst->dbt_config.num_txrus , sizeof(*dst_dig_beam->txru_list ));
for (int k = 0; k < dst->dbt_config.num_txrus; ++k) {
nfapi_nr_txru_t *dst_tx_ru = &dst_dig_beam->txru_list[k];
const nfapi_nr_txru_t *src_tx_ru = &src_dig_beam->txru_list[k];
dst_tx_ru->dig_beam_weight_Re = src_tx_ru->dig_beam_weight_Re;
dst_tx_ru->dig_beam_weight_Im = src_tx_ru->dig_beam_weight_Im;
}
}
dst->pmi_list.num_pm_idx = src->pmi_list.num_pm_idx;
if (dst->pmi_list.num_pm_idx > 0) {
dst->pmi_list.pmi_pdu = calloc(dst->pmi_list.num_pm_idx , sizeof(*dst->pmi_list.pmi_pdu));
for (int i = 0; i < dst->pmi_list.num_pm_idx; i++) {
nfapi_nr_pm_pdu_t * dst_pmi_pdu = &dst->pmi_list.pmi_pdu[i];
const nfapi_nr_pm_pdu_t * src_pmi_pdu = &src->pmi_list.pmi_pdu[i];
dst_pmi_pdu->pm_idx = src_pmi_pdu->pm_idx;
dst_pmi_pdu->numLayers = src_pmi_pdu->numLayers;
dst_pmi_pdu->num_ant_ports = src_pmi_pdu->num_ant_ports;
for (int j = 0; j < dst_pmi_pdu->numLayers; ++j) {
for (int k = 0; k < dst_pmi_pdu->num_ant_ports; ++k) {
nfapi_nr_pm_weights_t* dst_pm_weight = &dst_pmi_pdu->weights[j][k];
const nfapi_nr_pm_weights_t* src_pm_weight = &src_pmi_pdu->weights[j][k];
dst_pm_weight->precoder_weight_Re = src_pm_weight->precoder_weight_Re;
dst_pm_weight->precoder_weight_Im = src_pm_weight->precoder_weight_Im;
}
}
}
}
COPY_TL(dst->nfapi_config.p7_vnf_address_ipv4.tl, src->nfapi_config.p7_vnf_address_ipv4.tl);
memcpy(dst->nfapi_config.p7_vnf_address_ipv4.address,
src->nfapi_config.p7_vnf_address_ipv4.address,
@@ -832,6 +894,21 @@ void copy_config_request(const nfapi_nr_config_request_scf_t *src, nfapi_nr_conf
COPY_TLV(dst->nfapi_config.ul_dci_timing_offset, src->nfapi_config.ul_dci_timing_offset);
COPY_TLV(dst->nfapi_config.tx_data_timing_offset, src->nfapi_config.tx_data_timing_offset);
COPY_TLV(dst->analog_beamforming_ve.num_beams_period_vendor_ext, src->analog_beamforming_ve.num_beams_period_vendor_ext);
COPY_TLV(dst->analog_beamforming_ve.analog_bf_vendor_ext, src->analog_beamforming_ve.analog_bf_vendor_ext);
COPY_TLV(dst->analog_beamforming_ve.total_num_beams_vendor_ext, src->analog_beamforming_ve.total_num_beams_vendor_ext);
if (dst->analog_beamforming_ve.total_num_beams_vendor_ext.value > 0) {
dst->analog_beamforming_ve.analog_beam_list = (nfapi_uint8_tlv_t *)malloc(
dst->analog_beamforming_ve.total_num_beams_vendor_ext.value * sizeof(nfapi_uint8_tlv_t));
for (int i = 0; i < src->analog_beamforming_ve.total_num_beams_vendor_ext.value; ++i) {
COPY_TLV(dst->analog_beamforming_ve.analog_beam_list[i], src->analog_beamforming_ve.analog_beam_list[i]);
}
}
}
void copy_config_response(const nfapi_nr_config_response_scf_t *src, nfapi_nr_config_response_scf_t *dst)
@@ -956,22 +1033,382 @@ void dump_param_request(const nfapi_nr_param_request_scf_t *msg)
void dump_param_response(const nfapi_nr_param_response_scf_t *msg)
{
int depth = 0;
dump_p5_message_header(&msg->header,depth);
dump_p5_message_header(&msg->header, depth);
depth++;
INDENTED_PRINTF("Error Code = 0x%02x\n", msg->error_code);
INDENTED_PRINTF("Number of TLVs = 0x%02x\n", msg->num_tlv);
/* dump all TLVs from each table */
/* Cell Param */
const nfapi_nr_cell_param_t *cell_param = &msg->cell_param;
depth++;
INDENTED_TLV_PRINT("Release Capability", cell_param->release_capability);
INDENTED_TLV_PRINT("PHY State", cell_param->phy_state);
INDENTED_TLV_PRINT("Skip Blank Dl Config", cell_param->skip_blank_dl_config);
INDENTED_TLV_PRINT("Skip Blank UL Config", cell_param->skip_blank_ul_config);
INDENTED_TLV_PRINT("NumConfigTLVsToReport", cell_param->num_config_tlvs_to_report);
depth++;
for (int i = 0; i < cell_param->num_config_tlvs_to_report.value; i++) {
const nfapi_uint8_tlv_t *reportedTLV = &cell_param->config_tlvs_to_report_list[i];
INDENTED_PRINTF("(0x%04x) Reported CONFIG TLV #%d = 0x%02x\n", reportedTLV->tl.tag, i + 1, reportedTLV->value);
}
depth--;
/* Carrier Param */
const nfapi_nr_carrier_param_t *carrier_param = &msg->carrier_param;
INDENTED_TLV_PRINT("Cyclic Prefix", carrier_param->cyclic_prefix);
INDENTED_TLV_PRINT("Supported SCS DL", carrier_param->supported_subcarrier_spacings_dl);
INDENTED_TLV_PRINT("Supported BW DL", carrier_param->supported_bandwidth_dl);
INDENTED_TLV_PRINT("Supported SCS UL", carrier_param->supported_subcarrier_spacings_ul);
INDENTED_TLV_PRINT("Supported BW UL", carrier_param->supported_bandwidth_ul);
/* PDCCH Param */
const nfapi_nr_pdcch_param_t *pdcch_param = &msg->pdcch_param;
INDENTED_TLV_PRINT("CCE Mapping Type", pdcch_param->cce_mapping_type);
INDENTED_TLV_PRINT("CSet Outside First 3 OFDM Symbols of Slot", pdcch_param->coreset_outside_first_3_of_ofdm_syms_of_slot);
INDENTED_TLV_PRINT("Precoder Granularity Coreset", pdcch_param->coreset_precoder_granularity_coreset);
INDENTED_TLV_PRINT("PDCCH Mu MIMO", pdcch_param->pdcch_mu_mimo);
INDENTED_TLV_PRINT("PDCCH Precoder Cycling", pdcch_param->pdcch_precoder_cycling);
INDENTED_TLV_PRINT("Max PDCCH per Slot", pdcch_param->max_pdcch_per_slot);
/* PUCHH Params */
const nfapi_nr_pucch_param_t *pucch_param = &msg->pucch_param;
INDENTED_TLV_PRINT("PUCCH Formats", pucch_param->pucch_formats);
INDENTED_TLV_PRINT("Max PUCCH per Slot", pucch_param->max_pucchs_per_slot);
/* PDSCH Params */
const nfapi_nr_pdsch_param_t *pdsch_param = &msg->pdsch_param;
INDENTED_TLV_PRINT("PDSCH Mapping Type", pdsch_param->pdsch_mapping_type);
INDENTED_TLV_PRINT("PDSCH Allocation Types", pdsch_param->pdsch_allocation_types);
INDENTED_TLV_PRINT("PDSCH VRB to PRB Mapping", pdsch_param->pdsch_vrb_to_prb_mapping);
INDENTED_TLV_PRINT("PDSCH CBG", pdsch_param->pdsch_cbg);
INDENTED_TLV_PRINT("PDSCH DMRS Config Types", pdsch_param->pdsch_dmrs_config_types);
INDENTED_TLV_PRINT("PDSCH DMRS Max Length", pdsch_param->pdsch_dmrs_max_length);
INDENTED_TLV_PRINT("PDSCH DMRS Additional Position", pdsch_param->pdsch_dmrs_additional_pos);
INDENTED_TLV_PRINT("Max PDSCH TBs per Slot", pdsch_param->max_pdsch_tbs_per_slot);
INDENTED_TLV_PRINT("Max number MIMO Layers PDSCH", pdsch_param->max_number_mimo_layers_pdsch);
INDENTED_TLV_PRINT("Supported Max Modulation Order DL", pdsch_param->supported_max_modulation_order_dl);
INDENTED_TLV_PRINT("Max Mu MIMO Users DL", pdsch_param->max_mu_mimo_users_dl);
INDENTED_TLV_PRINT("PDSCH Data in DMRS Symbols", pdsch_param->pdsch_data_in_dmrs_symbols);
INDENTED_TLV_PRINT("Preemption Support", pdsch_param->premption_support);
INDENTED_TLV_PRINT("PDSCH Non Slot Support", pdsch_param->pdsch_non_slot_support);
/* PUSCH Params */
const nfapi_nr_pusch_param_t *pusch_param = &msg->pusch_param;
INDENTED_TLV_PRINT("UCI Mux ULSCH in PUSCH", pusch_param->uci_mux_ulsch_in_pusch);
INDENTED_TLV_PRINT("UCI Only PUSCH", pusch_param->uci_only_pusch);
INDENTED_TLV_PRINT("PUSCH Frequency Hopping", pusch_param->pusch_frequency_hopping);
INDENTED_TLV_PRINT("PUSCH DMRS Config Types", pusch_param->pusch_dmrs_config_types);
INDENTED_TLV_PRINT("PUSCH DMRS Max Len", pusch_param->pusch_dmrs_max_len);
INDENTED_TLV_PRINT("PUSCH DMRS Additional Pos", pusch_param->pusch_dmrs_additional_pos);
INDENTED_TLV_PRINT("PUSCH CBG", pusch_param->pusch_cbg);
INDENTED_TLV_PRINT("PUSCH Mapping Type", pusch_param->pusch_mapping_type);
INDENTED_TLV_PRINT("PUSCH Allocation Types", pusch_param->pusch_allocation_types);
INDENTED_TLV_PRINT("PUSCH VRB to PRB Mapping", pusch_param->pusch_vrb_to_prb_mapping);
INDENTED_TLV_PRINT("PUSCH Max PTRS Ports", pusch_param->pusch_max_ptrs_ports);
INDENTED_TLV_PRINT("Max PUSCH TBs per Slot", pusch_param->max_pduschs_tbs_per_slot);
INDENTED_TLV_PRINT("Max Number MIMO Layers non CB PUSCH", pusch_param->max_number_mimo_layers_non_cb_pusch);
INDENTED_TLV_PRINT("Supported Modulation Order UL", pusch_param->supported_modulation_order_ul);
INDENTED_TLV_PRINT("Max MU MIMO Users UL", pusch_param->max_mu_mimo_users_ul);
INDENTED_TLV_PRINT("DTFS OFDM Support", pusch_param->dfts_ofdm_support);
INDENTED_TLV_PRINT("PUSCH Aggregation Factor", pusch_param->pusch_aggregation_factor);
/* PRACH Params */
const nfapi_nr_prach_param_t *prach_param = &msg->prach_param;
INDENTED_TLV_PRINT("PRACH Long Formats", prach_param->prach_long_formats);
INDENTED_TLV_PRINT("PRACH Short Formats", prach_param->prach_short_formats);
INDENTED_TLV_PRINT("PRACH Restricted Sets", prach_param->prach_restricted_sets);
INDENTED_TLV_PRINT("Max PRACH Occasions in a Slot", prach_param->max_prach_fd_occasions_in_a_slot);
/* Measurement Params */
const nfapi_nr_measurement_param_t *measurement_param = &msg->measurement_param;
INDENTED_TLV_PRINT("RSSI Measurement Support", measurement_param->rssi_measurement_support);
/* nFAPI Config */
const nfapi_nr_nfapi_t *nfapi_config = &msg->nfapi_config;
if (nfapi_config->p7_vnf_address_ipv4.tl.tag) {
char ip_str[INET_ADDRSTRLEN];
INDENTED_GENERIC_PRINT("(0x%04x) P7 VNF Address IPv4",
"%s",
nfapi_config->p7_vnf_address_ipv4.tl.tag,
inet_ntop(AF_INET, nfapi_config->p7_vnf_address_ipv4.address, ip_str, sizeof(ip_str)));
}
if (nfapi_config->p7_vnf_address_ipv6.tl.tag) {
char addr6[INET6_ADDRSTRLEN];
INDENTED_GENERIC_PRINT("(0x%04x) P7 VNF Address IPv6",
"%s",
nfapi_config->p7_vnf_address_ipv6.tl.tag,
inet_ntop(AF_INET6, nfapi_config->p7_vnf_address_ipv6.address, addr6, sizeof(addr6)));
}
INDENTED_TLV_FORMAT_PRINT("P7 VNF Port", "%d", nfapi_config->p7_vnf_port);
if (nfapi_config->p7_pnf_address_ipv4.tl.tag) {
char ip_str[INET_ADDRSTRLEN];
INDENTED_GENERIC_PRINT("(0x%04x) P7 PNF Address IPv4",
"%s",
nfapi_config->p7_pnf_address_ipv4.tl.tag,
inet_ntop(AF_INET, nfapi_config->p7_pnf_address_ipv4.address, ip_str, sizeof(ip_str)));
}
if (nfapi_config->p7_pnf_address_ipv6.tl.tag) {
char addr6[INET6_ADDRSTRLEN];
INDENTED_GENERIC_PRINT("(0x%04x) P7 PNF Address IPv6",
"%s",
nfapi_config->p7_pnf_address_ipv6.tl.tag,
inet_ntop(AF_INET6, nfapi_config->p7_pnf_address_ipv6.address, addr6, sizeof(addr6)));
}
INDENTED_TLV_FORMAT_PRINT("P7 PNF Port", "%d", nfapi_config->p7_pnf_port);
INDENTED_TLV_FORMAT_PRINT("Timing Window", "%d", nfapi_config->timing_window);
INDENTED_TLV_FORMAT_PRINT("Timing Info Mode", "%d", nfapi_config->timing_info_mode);
INDENTED_TLV_FORMAT_PRINT("Timing Info Period", "%d", nfapi_config->timing_info_period);
INDENTED_TLV_FORMAT_PRINT("DL_TTI Timing Offset", "%d", nfapi_config->dl_tti_timing_offset);
INDENTED_TLV_FORMAT_PRINT("UL_TTI Timing Offset", "%d", nfapi_config->ul_tti_timing_offset);
INDENTED_TLV_FORMAT_PRINT("UL_DCI Timing Offset", "%d", nfapi_config->ul_dci_timing_offset);
INDENTED_TLV_FORMAT_PRINT("TX_DATA Timing Offset", "%d", nfapi_config->tx_data_timing_offset);
depth--;
}
void dump_config_request(const nfapi_nr_config_request_scf_t *msg)
{
int depth = 0;
dump_p5_message_header(&msg->header,depth);
dump_p5_message_header(&msg->header, depth);
depth++;
INDENTED_PRINTF("Number of TLVs = 0x%02x\n", msg->num_tlv);
/* dump all TLVs from each table */
/* Carrier Config */
const nfapi_nr_carrier_config_t *carrier_config = &msg->carrier_config;
INDENTED_TLV_PRINT("DL Bandwidth", carrier_config->dl_bandwidth);
INDENTED_TLV_PRINT("DL Frequency", carrier_config->dl_frequency);
INDENTED_PRINTF("(0x%04x) DL K0 = ", NFAPI_NR_CONFIG_DL_K0_TAG);
for (int i = 0; i < 5; i++) {
printf("%d ", carrier_config->dl_k0[i].value);
}
printf("\n");
INDENTED_PRINTF("(0x%04x) DL Grid Size = ", NFAPI_NR_CONFIG_DL_GRID_SIZE_TAG);
for (int i = 0; i < 5; i++) {
printf("%d ", carrier_config->dl_grid_size[i].value);
}
printf("\n");
INDENTED_TLV_PRINT("Num TX Antennas", carrier_config->num_tx_ant);
INDENTED_TLV_PRINT("UL Bandwidth", carrier_config->uplink_bandwidth);
INDENTED_TLV_PRINT("UL Frequency", carrier_config->uplink_frequency);
INDENTED_PRINTF("(0x%04x) UL K0 = ", NFAPI_NR_CONFIG_UL_K0_TAG);
for (int i = 0; i < 5; i++) {
printf("%d ", carrier_config->ul_k0[i].value);
}
printf("\n");
INDENTED_PRINTF("(0x%04x) UL Grid Size = ", NFAPI_NR_CONFIG_UL_GRID_SIZE_TAG);
for (int i = 0; i < 5; i++) {
printf("%d ", carrier_config->ul_grid_size[i].value);
}
printf("\n");
INDENTED_TLV_PRINT("Num RX Antennas", carrier_config->num_rx_ant);
INDENTED_TLV_PRINT("Frequency Shift 7p5KHz", carrier_config->frequency_shift_7p5khz);
/* Cell Config */
const nfapi_nr_cell_config_t *cell_config = &msg->cell_config;
INDENTED_TLV_PRINT("Physical Cell ID", cell_config->phy_cell_id);
INDENTED_TLV_PRINT("Frame Duplex Type", cell_config->frame_duplex_type);
/* SSB Config */
const nfapi_nr_ssb_config_t *ssb_config = &msg->ssb_config;
INDENTED_TLV_PRINT("SSB Block Power", ssb_config->ss_pbch_power);
INDENTED_TLV_PRINT("BCH Payload", ssb_config->bch_payload);
INDENTED_TLV_PRINT("SCS Common", ssb_config->scs_common);
/* PRACH Config */
const nfapi_nr_prach_config_t *prach_config = &msg->prach_config;
INDENTED_TLV_PRINT("PRACH Sequence Length", prach_config->prach_sequence_length);
INDENTED_TLV_PRINT("PRACH Subcarrier Spacing", prach_config->prach_sub_c_spacing);
INDENTED_TLV_PRINT("Restricted Set Config", prach_config->restricted_set_config);
INDENTED_TLV_PRINT("Num PRACH FD Occasions", prach_config->num_prach_fd_occasions);
INDENTED_TLV_PRINT("PRACH Config Index", prach_config->prach_ConfigurationIndex);
depth++;
for (int i = 0; i < prach_config->num_prach_fd_occasions.value; i++) {
const nfapi_nr_num_prach_fd_occasions_t *prach_fd_occasion = &(prach_config->num_prach_fd_occasions_list[i]);
INDENTED_TLV_PRINT("PRACH Root Sequence Index", prach_fd_occasion->prach_root_sequence_index);
INDENTED_TLV_PRINT("Num Root Sequences", prach_fd_occasion->num_root_sequences);
INDENTED_TLV_PRINT("K1", prach_fd_occasion->k1);
INDENTED_TLV_PRINT("PRACH Zero CorrelationZone Config", prach_fd_occasion->prach_zero_corr_conf);
INDENTED_TLV_PRINT("Num Unused Root Sequences", prach_fd_occasion->num_unused_root_sequences);
depth++;
for (int k = 0; k < prach_fd_occasion->num_unused_root_sequences.value; k++) {
INDENTED_TLV_PRINT("Unused Root Sequence", prach_fd_occasion->unused_root_sequences_list[k]);
}
depth--;
}
depth--;
INDENTED_TLV_PRINT("SSB Per RACH", prach_config->ssb_per_rach);
INDENTED_TLV_PRINT("PRACH Multiple Carriers in a Band", prach_config->prach_multiple_carriers_in_a_band);
/* SSB Table */
const nfapi_nr_ssb_table_t *ssb_table = &msg->ssb_table;
INDENTED_TLV_PRINT("SSB Offset PointA", ssb_table->ssb_offset_point_a);
INDENTED_TLV_PRINT("Beta PSS", ssb_table->beta_pss);
INDENTED_TLV_PRINT("SSB Period", ssb_table->ssb_period);
INDENTED_TLV_PRINT("SSB Subcarrier Offset", ssb_table->ssb_subcarrier_offset);
INDENTED_TLV_PRINT("MIB", ssb_table->MIB);
INDENTED_PRINTF("SSB Mask:\n");
depth++;
for (int i = 0; i < 2; i++) {
INDENTED_TLV_PRINT("SSB Mask", ssb_table->ssb_mask_list[i].ssb_mask);
}
depth--;
INDENTED_PRINTF("Beam ID:\n");
depth++;
for (int i = 0; i < 64; i++) {
INDENTED_TLV_PRINT("Beam ID", ssb_table->ssb_beam_id_list[i].beam_id);
}
depth--;
INDENTED_TLV_PRINT("ssPBCH Multiple Carriers in a Band", ssb_table->ss_pbch_multiple_carriers_in_a_band);
INDENTED_TLV_PRINT("Multiple Cells ssPBCH in a Carrier", ssb_table->multiple_cells_ss_pbch_in_a_carrier);
/* TDD Table */
const nfapi_nr_tdd_table_t *tdd_table = &msg->tdd_table;
if (cell_config->frame_duplex_type.value == 1 /* TDD */) {
INDENTED_TLV_PRINT("TDD Period", tdd_table->tdd_period);
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
// Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04
uint8_t cyclicprefix = 1;
// 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2
uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12;
INDENTED_PRINTF("Slot Config:\n");
depth++;
for (int i = 0; i < slotsperframe[ssb_config->scs_common.value]; i++) {
for (int k = 0; k < number_of_symbols_per_slot; k++) {
const uint8_t slot_type = tdd_table->max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config.value;
const char *slot_dir = slot_type == 0 ? "DL" : slot_type == 1 ? "UL" : "S";
INDENTED_GENERIC_PRINT("(0x%04x) Slot Config",
"%d (%s)",
tdd_table->max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config.tl.tag,
slot_type,
slot_dir);
}
}
depth--;
}
/* Measurement Config */
const nfapi_nr_measurement_config_t *measurement_config = &msg->measurement_config;
INDENTED_TLV_PRINT("RSSI Measurement", measurement_config->rssi_measurement);
/* Beamforming Table */
const nfapi_nr_dbt_pdu_t *dbt_config = &msg->dbt_config;
INDENTED_PRINTF("Digital Beam Table\n");
depth++;
INDENTED_GENERIC_PRINT("Num Digital Beams", "%d", dbt_config->num_dig_beams);
INDENTED_GENERIC_PRINT("Num TX RUs", "%d", dbt_config->num_txrus);
depth++;
for (int i = 0; i < dbt_config->num_dig_beams; i++) {
const nfapi_nr_dig_beam_t *dig_beam = &dbt_config->dig_beam_list[i];
INDENTED_GENERIC_PRINT("Beam IDX", "%d", dig_beam->beam_idx);
depth++;
for (int k = 0; k < dbt_config->num_txrus; k++) {
const nfapi_nr_txru_t *tx_ru = &dig_beam->txru_list[k];
INDENTED_GENERIC_PRINT("Dig Beam Weight Real", "0x%02x", tx_ru->dig_beam_weight_Re);
INDENTED_GENERIC_PRINT("Dig Beam Weight Imaginary", "0x%02x", tx_ru->dig_beam_weight_Im);
}
depth--;
}
depth--;
depth--;
/* Precoding Table */
const nfapi_nr_pm_list_t *pmi_list = &msg->pmi_list;
INDENTED_PRINTF("Precoding Matrix Table\n");
depth++;
INDENTED_GENERIC_PRINT("Num Precoding Tables", "%d", pmi_list->num_pm_idx);
depth++;
for (int i = 0; i < pmi_list->num_pm_idx; i++) {
const nfapi_nr_pm_pdu_t *pm_pdu = &pmi_list->pmi_pdu[i];
INDENTED_GENERIC_PRINT("Precoding Matrix IDX", "0x%02x", pm_pdu->pm_idx);
INDENTED_GENERIC_PRINT("Number of Layers", "%d", pm_pdu->numLayers);
INDENTED_GENERIC_PRINT("Number of Antenna Ports", "%d", pm_pdu->num_ant_ports);
depth++;
for (int k = 0; k < pm_pdu->numLayers; k++) {
for (int l = 0; l < pm_pdu->num_ant_ports; l++) {
const nfapi_nr_pm_weights_t *pm_weights = &pm_pdu->weights[k][l];
INDENTED_GENERIC_PRINT("Dig Beam Weight Real", "0x%02x", pm_weights->precoder_weight_Re);
INDENTED_GENERIC_PRINT("Dig Beam Weight Imaginary", "0x%02x", pm_weights->precoder_weight_Im);
}
}
depth--;
}
depth--;
depth--;
/* nFAPI Config */
const nfapi_nr_nfapi_t *nfapi_config = &msg->nfapi_config;
if (nfapi_config->p7_vnf_address_ipv4.tl.tag) {
char ip_str[INET_ADDRSTRLEN];
INDENTED_GENERIC_PRINT("(0x%04x) P7 VNF Address IPv4",
"%s",
nfapi_config->p7_vnf_address_ipv4.tl.tag,
inet_ntop(AF_INET, nfapi_config->p7_vnf_address_ipv4.address, ip_str, sizeof(ip_str)));
}
if (nfapi_config->p7_vnf_address_ipv6.tl.tag) {
char addr6[INET6_ADDRSTRLEN];
INDENTED_GENERIC_PRINT("(0x%04x) P7 VNF Address IPv6",
"%s",
nfapi_config->p7_vnf_address_ipv6.tl.tag,
inet_ntop(AF_INET6, nfapi_config->p7_vnf_address_ipv6.address, addr6, sizeof(addr6)));
}
INDENTED_TLV_FORMAT_PRINT("P7 VNF Port", "%d", nfapi_config->p7_vnf_port);
if (nfapi_config->p7_pnf_address_ipv4.tl.tag) {
char ip_str[INET_ADDRSTRLEN];
INDENTED_GENERIC_PRINT("(0x%04x) P7 PNF Address IPv4",
"%s",
nfapi_config->p7_pnf_address_ipv4.tl.tag,
inet_ntop(AF_INET, nfapi_config->p7_pnf_address_ipv4.address, ip_str, sizeof(ip_str)));
}
if (nfapi_config->p7_pnf_address_ipv6.tl.tag) {
char addr6[INET6_ADDRSTRLEN];
INDENTED_GENERIC_PRINT("(0x%04x) P7 PNF Address IPv6",
"%s",
nfapi_config->p7_pnf_address_ipv6.tl.tag,
inet_ntop(AF_INET6, nfapi_config->p7_pnf_address_ipv6.address, addr6, sizeof(addr6)));
}
INDENTED_TLV_FORMAT_PRINT("P7 PNF Port", "%d", nfapi_config->p7_pnf_port);
INDENTED_TLV_FORMAT_PRINT("Timing Window", "%d", nfapi_config->timing_window);
INDENTED_TLV_FORMAT_PRINT("Timing Info Mode", "%d", nfapi_config->timing_info_mode);
INDENTED_TLV_FORMAT_PRINT("Timing Info Period", "%d", nfapi_config->timing_info_period);
INDENTED_TLV_FORMAT_PRINT("DL_TTI Timing Offset", "%d", nfapi_config->dl_tti_timing_offset);
INDENTED_TLV_FORMAT_PRINT("UL_TTI Timing Offset", "%d", nfapi_config->ul_tti_timing_offset);
INDENTED_TLV_FORMAT_PRINT("UL_DCI Timing Offset", "%d", nfapi_config->ul_dci_timing_offset);
INDENTED_TLV_FORMAT_PRINT("TX_DATA Timing Offset", "%d", nfapi_config->tx_data_timing_offset);
/* Beamforming VE */
const nfapi_nr_analog_beamforming_ve_t *analog_beamforming_ve = &msg->analog_beamforming_ve;
INDENTED_TLV_FORMAT_PRINT("Num Beams per Period", "%d", analog_beamforming_ve->num_beams_period_vendor_ext);
INDENTED_TLV_PRINT("Analog Beamforming VE", analog_beamforming_ve->analog_bf_vendor_ext);
/* Vendor Extension */
if (msg->vendor_extension) {
const nfapi_tl_t *vendor_extension = (nfapi_tl_t *)&msg->vendor_extension;
switch (vendor_extension->tag) {
case VENDOR_EXT_TLV_1_TAG: {
vendor_ext_tlv_1 *ve = (vendor_ext_tlv_1 *)vendor_extension;
INDENTED_PRINTF("(0x%04x) Vendor extension = %d 0x%02x\n", ve->tl.tag, ve->tl.length, ve->dummy);
} break;
case VENDOR_EXT_TLV_2_TAG: {
vendor_ext_tlv_2 *ve = (vendor_ext_tlv_2 *)vendor_extension;
INDENTED_PRINTF("(0x%04x) Vendor extension = %d 0x%02x\n", ve->tl.tag, ve->tl.length, ve->dummy);
} break;
default:
break;
}
}
depth--;
}
static void dump_generic_tlv(const nfapi_nr_generic_tlv_scf_t* tlv, int depth)
{
INDENTED_PRINTF("TLV tag 0x%02x , Length 0x%02x , Value ", tlv->tl.tag, tlv->tl.length);
switch (tlv->tl.length) {
case UINT_8:
printf("0x%x\n", tlv->value.u8);
break;
case UINT_16:
printf("0x%02x\n", tlv->value.u16);
break;
case UINT_32:
printf("0x%04x\n", tlv->value.u32);
break;
case ARRAY_UINT_16:
for (int i = 0; i< 5 ; i++) {
printf("0x%04x ", tlv->value.array_u16[i]);
}
printf("\n");
break;
default:
printf("unknown length %d\n", tlv->tl.length);
DevAssert(1 == 0);
break;
}
}
void dump_config_response(const nfapi_nr_config_response_scf_t *msg)
@@ -986,6 +1423,25 @@ void dump_config_response(const nfapi_nr_config_response_scf_t *msg)
msg->num_invalid_tlvs_configured_in_running);
INDENTED_PRINTF("Number of Missing TLVs = 0x%02x\n", msg->num_missing_tlvs);
/* dump all TLVs from each table */
INDENTED_PRINTF("Invalid or Unsupported TLVs (%d) :\n",msg->num_invalid_tlvs);
for (int i = 0; i < msg->num_invalid_tlvs; ++i) {
dump_generic_tlv(&msg->invalid_tlvs_list[i], depth+1);
}
INDENTED_PRINTF("TLVs that can only be configured in IDLE (%d):\n", msg->num_invalid_tlvs_configured_in_idle);
for (int i = 0; i < msg->num_invalid_tlvs; ++i) {
dump_generic_tlv(&msg->invalid_tlvs_list[i], depth+1);
}
INDENTED_PRINTF("TLVs that can only be configured in RUNNING (%d):\n",msg->num_invalid_tlvs_configured_in_running);
for (int i = 0; i < msg->num_invalid_tlvs; ++i) {
dump_generic_tlv(&msg->invalid_tlvs_list[i], depth+1);
}
INDENTED_PRINTF("Missing TLVs (%d):\n",msg->num_missing_tlvs);
for (int i = 0; i < msg->num_invalid_tlvs; ++i) {
dump_generic_tlv(&msg->invalid_tlvs_list[i], depth+1);
}
depth--;
}

View File

@@ -859,9 +859,7 @@ bool eq_rach_indication(const nfapi_nr_rach_indication_t *a, const nfapi_nr_rach
void free_dl_tti_request(nfapi_nr_dl_tti_request_t *msg)
{
if (msg->vendor_extension) {
free(msg->vendor_extension);
}
free(msg->vendor_extension);
}
void free_ul_tti_request(nfapi_nr_ul_tti_request_t *msg)
@@ -907,9 +905,7 @@ void free_rx_data_indication(nfapi_nr_rx_data_indication_t *msg)
if (msg->number_of_pdus > 0) {
for (int pdu_idx = 0; pdu_idx < msg->number_of_pdus; ++pdu_idx) {
nfapi_nr_rx_data_pdu_t *rx_pdu = &msg->pdu_list[pdu_idx];
if (rx_pdu->pdu) {
free(rx_pdu->pdu);
}
free(rx_pdu->pdu);
}
free(msg->pdu_list);
}
@@ -917,99 +913,75 @@ void free_rx_data_indication(nfapi_nr_rx_data_indication_t *msg)
void free_crc_indication(nfapi_nr_crc_indication_t *msg)
{
if (msg->crc_list) {
for (int crc_idx = 0; crc_idx < msg->number_crcs; ++crc_idx) {
nfapi_nr_crc_t *crc = &msg->crc_list[crc_idx];
if (crc->cb_crc_status) {
free(crc->cb_crc_status);
}
}
free(msg->crc_list);
for (int crc_idx = 0; crc_idx < msg->number_crcs; ++crc_idx) {
nfapi_nr_crc_t *crc = &msg->crc_list[crc_idx];
free(crc->cb_crc_status);
}
free(msg->crc_list);
}
void free_uci_indication(nfapi_nr_uci_indication_t *msg)
{
if (msg->uci_list) {
for (int pdu_idx = 0; pdu_idx < msg->num_ucis; ++pdu_idx) {
nfapi_nr_uci_t *uci_pdu = &msg->uci_list[pdu_idx];
switch (uci_pdu->pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE: {
nfapi_nr_uci_pusch_pdu_t *pdu = &uci_pdu->pusch_pdu;
// Bit 0 not used in PUSCH PDU
// HARQ
if ((pdu->pduBitmap >> 1) & 0x01) {
if (pdu->harq.harq_payload) {
free(pdu->harq.harq_payload);
}
}
// CSI Part 1
if ((pdu->pduBitmap >> 2) & 0x01) {
if (pdu->csi_part1.csi_part1_payload) {
free(pdu->csi_part1.csi_part1_payload);
}
}
// CSI Part 2
if ((pdu->pduBitmap >> 3) & 0x01) {
if (pdu->csi_part2.csi_part2_payload) {
free(pdu->csi_part2.csi_part2_payload);
}
}
break;
for (int pdu_idx = 0; pdu_idx < msg->num_ucis; ++pdu_idx) {
nfapi_nr_uci_t *uci_pdu = &msg->uci_list[pdu_idx];
switch (uci_pdu->pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE: {
nfapi_nr_uci_pusch_pdu_t *pdu = &uci_pdu->pusch_pdu;
// Bit 0 not used in PUSCH PDU
// HARQ
if ((pdu->pduBitmap >> 1) & 0x01) {
free(pdu->harq.harq_payload);
}
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
// Nothing to free
break;
// CSI Part 1
if ((pdu->pduBitmap >> 2) & 0x01) {
free(pdu->csi_part1.csi_part1_payload);
}
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu = &uci_pdu->pucch_pdu_format_2_3_4;
// SR
if (pdu->pduBitmap & 0x01) {
if (pdu->sr.sr_payload) {
free(pdu->sr.sr_payload);
}
}
// HARQ
if ((pdu->pduBitmap >> 1) & 0x01) {
if (pdu->harq.harq_payload) {
free(pdu->harq.harq_payload);
}
}
// CSI Part 1
if ((pdu->pduBitmap >> 2) & 0x01) {
if (pdu->csi_part1.csi_part1_payload) {
free(pdu->csi_part1.csi_part1_payload);
}
}
// CSI Part 2
if ((pdu->pduBitmap >> 3) & 0x01) {
if (pdu->csi_part2.csi_part2_payload) {
free(pdu->csi_part2.csi_part2_payload);
}
}
break;
// CSI Part 2
if ((pdu->pduBitmap >> 3) & 0x01) {
free(pdu->csi_part2.csi_part2_payload);
}
default:
AssertFatal(1 == 0, "Unknown UCI.indication PDU Type %d\n", uci_pdu->pdu_type);
break;
break;
}
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
// Nothing to free
break;
}
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu = &uci_pdu->pucch_pdu_format_2_3_4;
// SR
if (pdu->pduBitmap & 0x01) {
free(pdu->sr.sr_payload);
}
// HARQ
if ((pdu->pduBitmap >> 1) & 0x01) {
free(pdu->harq.harq_payload);
}
// CSI Part 1
if ((pdu->pduBitmap >> 2) & 0x01) {
free(pdu->csi_part1.csi_part1_payload);
}
// CSI Part 2
if ((pdu->pduBitmap >> 3) & 0x01) {
free(pdu->csi_part2.csi_part2_payload);
}
break;
}
default:
AssertFatal(1 == 0, "Unknown UCI.indication PDU Type %d\n", uci_pdu->pdu_type);
break;
}
free(msg->uci_list);
}
free(msg->uci_list);
}
void free_srs_indication(nfapi_nr_srs_indication_t *msg)
{
if (msg->pdu_list) {
free(msg->pdu_list);
}
free(msg->pdu_list);
}
void free_rach_indication(nfapi_nr_rach_indication_t *msg)
{
if (msg->pdu_list) {
free(msg->pdu_list);
}
free(msg->pdu_list);
}
static void copy_dl_tti_beamforming(const nfapi_nr_tx_precoding_and_beamforming_t *src,
@@ -2586,6 +2558,27 @@ void dump_ul_dci_request(const nfapi_nr_ul_dci_request_t *msg)
}
}
static void dump_tx_data_request_tlv(const nfapi_nr_tx_data_request_tlv_t *tlv, int depth)
{
INDENTED_PRINTF("Tag = %d\n", tlv->tag);
INDENTED_PRINTF("Length = %d\n", tlv->length);
INDENTED_PRINTF("Value = ");
switch (tlv->tag) {
case 0:
for (int i = 0; i < tlv->length; i++) {
printf("0x%02x ", ((uint8_t*)tlv->value.direct)[i]);
}
break;
case 1:
printf("%p", tlv->value.ptr);
break;
default:
printf( " Unknown tag value %d",tlv->tag);
break;
}
printf("\n");
}
void dump_tx_data_request(const nfapi_nr_tx_data_request_t *msg)
{
int depth = 0;
@@ -2594,15 +2587,18 @@ void dump_tx_data_request(const nfapi_nr_tx_data_request_t *msg)
INDENTED_PRINTF("SFN = %d\n", msg->SFN);
INDENTED_PRINTF("Slot = %d\n", msg->Slot);
INDENTED_PRINTF("Number of PDUs = %d\n", msg->Number_of_PDUs);
depth++;
for (int i = 0; i < msg->Number_of_PDUs; i++) {
depth++;
INDENTED_PRINTF("PDU #%d\n", i);
const nfapi_nr_pdu_t *pdu = &msg->pdu_list[i];
INDENTED_PRINTF("PDU Length = 0x%02x\n", pdu->PDU_length);
INDENTED_PRINTF("PDU Index = 0x%02x\n", pdu->PDU_index);
INDENTED_PRINTF("numTLV = 0x%02x\n", pdu->num_TLV);
for (int tlv_idx = 0; tlv_idx < pdu->num_TLV; tlv_idx++) {
const nfapi_nr_tx_data_request_tlv_t *tlv = &pdu->TLVs[tlv_idx];
/* call to dump_tx_data_request_tlv */
depth--;
dump_tx_data_request_tlv(tlv, depth + 1);
}
}
}
@@ -2664,6 +2660,134 @@ void dump_crc_indication(const nfapi_nr_crc_indication_t *msg)
}
}
static void dump_harq_2_3_4(const nfapi_nr_harq_pdu_2_3_4_t *harq, int depth)
{
INDENTED_PRINTF("HARQ CRC = %01x\n", harq->harq_crc);
INDENTED_PRINTF("HARQ Bit Length = %d\n", harq->harq_bit_len);
INDENTED_PRINTF("HARQ Payload = ");
for (int i = 0; i < harq->harq_bit_len / 8 + 1; i++) {
printf("%x ", harq->harq_payload[i]);
}
printf("\n");
}
static void dump_csi_part_1(const nfapi_nr_csi_part1_pdu_t *csi, int depth)
{
INDENTED_PRINTF("CSI Part 1 CRC = %01x\n", csi->csi_part1_crc);
INDENTED_PRINTF("CSI Part 1 Bit Length = %d\n", csi->csi_part1_bit_len);
INDENTED_PRINTF("CSI Part 1 Payload = ");
for (int i = 0; i < csi->csi_part1_bit_len / 8 + 1; i++) {
printf("%x ", csi->csi_part1_payload[i]);
}
printf("\n");
}
static void dump_csi_part_2(const nfapi_nr_csi_part2_pdu_t *csi, int depth)
{
INDENTED_PRINTF("CSI Part 1 CRC = %01x\n", csi->csi_part2_crc);
INDENTED_PRINTF("CSI Part 1 Bit Length = %d\n", csi->csi_part2_bit_len);
INDENTED_PRINTF("CSI Part 1 Payload = ");
for (int i = 0; i < csi->csi_part2_bit_len / 8 + 1; i++) {
printf("%x ", csi->csi_part2_payload[i]);
}
printf("\n");
}
static void dump_uci_PUSCH_PDU(const nfapi_nr_uci_pusch_pdu_t *pdu, int depth)
{
INDENTED_PRINTF("PDU Bitmap = 0x%01x\n", pdu->pduBitmap);
INDENTED_PRINTF("Handle = 0x%04x\n", pdu->handle);
INDENTED_PRINTF("RNTI = 0x%02x\n", pdu->rnti);
INDENTED_PRINTF("UL_CQI = 0x%02x\n", pdu->ul_cqi);
INDENTED_PRINTF("Timing Advance = 0x%02x\n", pdu->timing_advance);
INDENTED_PRINTF("RSSI = 0x%02x\n", pdu->rssi);
// HARQ payload, CSI Part 1 and 2 are conditionally allocated
if ((pdu->pduBitmap >> 1) & 0x01) {
INDENTED_PRINTF("HARQ Information\n");
dump_harq_2_3_4(&pdu->harq, depth + 1);
}
if ((pdu->pduBitmap >> 2) & 0x01) {
INDENTED_PRINTF("CSI Part 1\n");
dump_csi_part_1(&pdu->csi_part1, depth + 1);
}
if ((pdu->pduBitmap >> 3) & 0x01) {
INDENTED_PRINTF("CSI Part 1\n");
dump_csi_part_2(&pdu->csi_part2, depth + 1);
}
}
static void dump_sr_0_1(const nfapi_nr_sr_pdu_0_1_t *sr, int depth)
{
INDENTED_PRINTF("SR Indication = 0x%02x\n", sr->sr_indication);
INDENTED_PRINTF("SR Confidence Level = 0x%02x\n", sr->sr_confidence_level);
}
static void dump_harq_0_1(const nfapi_nr_harq_pdu_0_1_t *harq, int depth)
{
INDENTED_PRINTF("Num HARQ = 0x%02x\n", harq->num_harq);
INDENTED_PRINTF("HARQ Confidence Level = 0x%02x\n", harq->harq_confidence_level);
depth++;
for (int i = 0; i < harq->num_harq; i++) {
INDENTED_PRINTF("HARQ Value[%d] : 0x%02x \n", i, harq->harq_list[i].harq_value);
}
}
static void dump_uci_PUCCH_0_1(const nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu, int depth)
{
INDENTED_PRINTF("PDU Bitmap = 0x%01x\n", pdu->pduBitmap);
INDENTED_PRINTF("Handle = 0x%04x\n", pdu->handle);
INDENTED_PRINTF("RNTI = 0x%02x\n", pdu->rnti);
INDENTED_PRINTF("PUCCH Format = 0x%02x\n", pdu->pucch_format);
INDENTED_PRINTF("UL_CQI = 0x%02x\n", pdu->ul_cqi);
INDENTED_PRINTF("Timing Advance = 0x%02x\n", pdu->timing_advance);
INDENTED_PRINTF("RSSI = 0x%02x\n", pdu->rssi);
if ((pdu->pduBitmap) & 0x01) {
INDENTED_PRINTF("SR Information\n");
dump_sr_0_1(&pdu->sr, depth + 1);
}
if ((pdu->pduBitmap >> 1) & 0x01) {
INDENTED_PRINTF("HARQ Information\n");
dump_harq_0_1(&pdu->harq, depth + 1);
}
}
static void dump_sr_2_3_4(const nfapi_nr_sr_pdu_2_3_4_t *sr, int depth)
{
INDENTED_PRINTF("SR Bit Length = %d\n", sr->sr_bit_len);
INDENTED_PRINTF("SR Payload ");
for (int i = 0; i < sr->sr_bit_len / 8 + 1; i++) {
printf("%x ", sr->sr_payload[i]);
}
printf("\n");
}
static void dump_uci_PUCCH_2_3_4(const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu, int depth)
{
INDENTED_PRINTF("PDU Bitmap = 0x%01x\n", pdu->pduBitmap);
INDENTED_PRINTF("Handle = 0x%04x\n", pdu->handle);
INDENTED_PRINTF("RNTI = 0x%02x\n", pdu->rnti);
INDENTED_PRINTF("PUCCH Format = 0x%02x\n", pdu->pucch_format);
INDENTED_PRINTF("UL_CQI = 0x%02x\n", pdu->ul_cqi);
INDENTED_PRINTF("Timing Advance = 0x%02x\n", pdu->timing_advance);
INDENTED_PRINTF("RSSI = 0x%02x\n", pdu->rssi);
// SR
if (pdu->pduBitmap & 0x01) {
dump_sr_2_3_4(&pdu->sr, depth + 1);
}
// HARQ
if ((pdu->pduBitmap >> 1) & 0x01) {
dump_harq_2_3_4(&pdu->harq, depth + 1);
}
// CSI Part 1
if ((pdu->pduBitmap >> 2) & 0x01) {
dump_csi_part_1(&pdu->csi_part1, depth + 1);
}
// CSI Part 2
if ((pdu->pduBitmap >> 3) & 0x01) {
dump_csi_part_2(&pdu->csi_part2, depth + 1);
}
}
void dump_uci_indication(const nfapi_nr_uci_indication_t *msg)
{
int depth = 0;
@@ -2680,6 +2804,20 @@ void dump_uci_indication(const nfapi_nr_uci_indication_t *msg)
INDENTED_PRINTF("PDUType = 0x%02x\n", uci->pdu_type);
INDENTED_PRINTF("PDUSize = 0x%02x\n", uci->pdu_size);
/* call to dump_uci_indication_<PDU_Type>_pdu */
switch (uci->pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
dump_uci_PUSCH_PDU(&uci->pusch_pdu, depth + 1);
break;
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE:
dump_uci_PUCCH_0_1(&uci->pucch_pdu_format_0_1, depth + 1);
break;
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE:
dump_uci_PUCCH_2_3_4(&uci->pucch_pdu_format_2_3_4, depth + 1);
break;
default:
INDENTED_PRINTF("Unknown PDU type 0x%02x\n", uci->pdu_type);
break;
}
depth--;
}
}

View File

@@ -31,6 +31,9 @@
#define NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG 0x0120
#define NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG 0xA000
#define NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG 0xA001
#define NFAPI_NR_FAPI_TOTAL_NUM_BEAMS_VENDOR_EXTENSION_TAG 0xA002
#define NFAPI_NR_FAPI_ANALOG_BEAM_VENDOR_EXTENSION_TAG 0xA003
typedef struct {
uint16_t phy_id;

View File

@@ -24,7 +24,7 @@
#define NFAPI_MAX_NUM_GROUPS 8
#define NFAPI_MAX_NUM_CB 8
#define NFAPI_MAX_NUM_PRGS 1
#define NFAPI_MAX_NUM_BG_IF 1
#define NFAPI_MAX_NUM_BG_IF 6
#define NFAPI_MAX_NUM_PERIODS 8
// Extension to the generic structures for single tlv values
@@ -328,6 +328,8 @@ typedef struct
#define NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG 0x1028
#define NFAPI_NR_CONFIG_TDD_TABLE 0x1035
#define NFAPI_NR_CONFIG_BEAMFORMING_TABLE_TAG 0x1043 // This tag was added in version 5 of the SCF222 standard ( Table 3-50 of SCF222.10.05 )
#define NFAPI_NR_CONFIG_PRECODING_TABLE_V6_TAG 0x104B // This tag was added in version 6 of the SCF222 standard ( Table 3-52 of SCF222.10.06 )
//table 3-21
typedef struct
@@ -473,6 +475,11 @@ typedef struct {
nfapi_nr_dig_beam_t *dig_beam_list;
} nfapi_nr_dbt_pdu_t;
typedef struct {
nfapi_tl_t tl;
nfapi_nr_dbt_pdu_t value;
} nfapi_nr_dbt_tlv_ve_t;
// Table 362 Precoding matrix (PM) PDU (v.222.10.04)
typedef struct {
int16_t precoder_weight_Re;
@@ -491,11 +498,18 @@ typedef struct {
typedef struct {
uint16_t num_pm_idx;
nfapi_nr_pm_pdu_t *pmi_pdu;
} nfapi_nr_pm_list_t;
} nfapi_nr_pm_list_t; // This corresponds to Table 3-69 of SCF222.10.06, which introduces the num_pm_idx parameter
typedef struct {
nfapi_tl_t tl;
nfapi_nr_pm_list_t value;
} nfapi_nr_pm_tlv_ve_t;
typedef struct {
nfapi_uint8_tlv_t num_beams_period_vendor_ext;
nfapi_uint8_tlv_t analog_bf_vendor_ext;
nfapi_uint8_tlv_t total_num_beams_vendor_ext;
nfapi_uint8_tlv_t *analog_beam_list;
} nfapi_nr_analog_beamforming_ve_t;
// ERROR enums
@@ -1829,7 +1843,7 @@ typedef struct {
uint8_t num_symbols; // Number of symbols for SRS. Value: 1 -> 4. If a PHY does not report for individual symbols then this parameter should be set to 1.
uint8_t wide_band_snr; // SNR value in dB measured within configured SRS bandwidth on each symbol. Value: 0 -> 255 representing -64 dB to 63 dB with a step size 0.5 dB. 0xff will be set if this field is invalid.
uint8_t num_reported_symbols; // Number of symbols reported in this message. This allows PHY to report individual symbols or aggregated symbols where this field will be set to 1. Value: 1 -> 4.
nfapi_nr_srs_reported_symbol_t* reported_symbol_list;
nfapi_nr_srs_reported_symbol_t reported_symbol_list[4];
} nfapi_nr_srs_beamforming_report_t;
// SRS indication

View File

@@ -4455,8 +4455,7 @@ int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen,
&& pull8(&pReadPackedMessage, &nr_srs_beamforming_report->num_reported_symbols, end))) {
return -1;
}
nr_srs_beamforming_report->reported_symbol_list =
calloc(nr_srs_beamforming_report->num_reported_symbols, sizeof(*nr_srs_beamforming_report->reported_symbol_list));
for (int reported_symbol = 0; reported_symbol < nr_srs_beamforming_report->num_reported_symbols; ++reported_symbol) {
if (!unpack_nr_srs_reported_symbol(&nr_srs_beamforming_report->reported_symbol_list[reported_symbol],
&pReadPackedMessage,

View File

@@ -206,6 +206,47 @@ static void fill_config_request_tlv_tdd_rand(nfapi_nr_config_request_scf_t *nfap
FILL_TLV(nfapi_resp->measurement_config.rssi_measurement, NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG, rand8());
nfapi_resp->num_tlv++;
uint16_t nb_beams = rand16_range(1, 15);
uint16_t nb_tx = rand16_range(1, 15);
nfapi_resp->dbt_config.num_dig_beams = nb_beams;
if (nfapi_resp->dbt_config.num_dig_beams > 0) {
nfapi_resp->dbt_config.num_txrus = nb_tx;
nfapi_resp->dbt_config.dig_beam_list = calloc(nb_beams , sizeof(*nfapi_resp->dbt_config.dig_beam_list));
for (int i = 0; i < nb_beams; i++) {
nfapi_nr_dig_beam_t *beam = &nfapi_resp->dbt_config.dig_beam_list[i];
beam->beam_idx = i;
beam->txru_list = calloc(nb_tx , sizeof(*beam->txru_list));
for (int j = 0; j < nb_tx; j++) {
nfapi_nr_txru_t *txru = &beam->txru_list[j];
txru->dig_beam_weight_Re = rand16_range(1, 0xffff);
txru->dig_beam_weight_Im = rand16_range(1, 0xffff);
}
}
nfapi_resp->num_tlv++;
}
nfapi_nr_pm_list_t *pm_list = &nfapi_resp->pmi_list;
const uint16_t num_layers = rand16_range(1, 4);
const uint16_t num_ant_ports = rand16_range(1, 4);
pm_list->num_pm_idx = rand16_range(1, 4);
if (nfapi_resp->pmi_list.num_pm_idx > 0) {
pm_list->pmi_pdu = calloc(pm_list->num_pm_idx, sizeof(*pm_list->pmi_pdu));
for (int i = 0; i < pm_list->num_pm_idx; i++) {
nfapi_nr_pm_pdu_t *pmi_pdu = &pm_list->pmi_pdu[i];
pmi_pdu->pm_idx = i+1;
pmi_pdu->numLayers = num_layers;
pmi_pdu->num_ant_ports = num_ant_ports;
for (int j = 0; j < num_layers; j++) {
for (int k = 0; k < num_ant_ports; k++) {
nfapi_nr_pm_weights_t* pm_weight = &pmi_pdu->weights[j][k];
pm_weight->precoder_weight_Re = (int16_t)rand16_range(1, 0xffff);
pm_weight->precoder_weight_Im = (int16_t)rand16_range(1, 0xffff);
}
}
}
nfapi_resp->num_tlv++;
}
nfapi_resp->nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
for (int i = 0; i < NFAPI_IPV4_ADDRESS_LENGTH; ++i) {
nfapi_resp->nfapi_config.p7_vnf_address_ipv4.address[i] = rand8();
@@ -221,6 +262,21 @@ static void fill_config_request_tlv_tdd_rand(nfapi_nr_config_request_scf_t *nfap
FILL_TLV(nfapi_resp->nfapi_config.p7_vnf_port, NFAPI_NR_NFAPI_P7_VNF_PORT_TAG, rand16());
nfapi_resp->num_tlv++;
nfapi_resp->nfapi_config.p7_pnf_address_ipv4.tl.tag = NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG;
for (int i = 0; i < NFAPI_IPV4_ADDRESS_LENGTH; ++i) {
nfapi_resp->nfapi_config.p7_pnf_address_ipv4.address[i] = rand8();
}
nfapi_resp->num_tlv++;
nfapi_resp->nfapi_config.p7_pnf_address_ipv6.tl.tag = NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG;
for (int i = 0; i < NFAPI_IPV6_ADDRESS_LENGTH; ++i) {
nfapi_resp->nfapi_config.p7_pnf_address_ipv6.address[i] = rand8();
}
nfapi_resp->num_tlv++;
FILL_TLV(nfapi_resp->nfapi_config.p7_pnf_port, NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, rand16());
nfapi_resp->num_tlv++;
FILL_TLV(nfapi_resp->nfapi_config.timing_window, NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, rand8());
nfapi_resp->num_tlv++;
@@ -229,6 +285,33 @@ static void fill_config_request_tlv_tdd_rand(nfapi_nr_config_request_scf_t *nfap
FILL_TLV(nfapi_resp->nfapi_config.timing_info_period, NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, rand8());
nfapi_resp->num_tlv++;
/*
// TODO: Uncomment this block when ready to enable the pack of the following VE TLVs in nr_fapi_p5.c
// NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG
// NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG
// NFAPI_NR_FAPI_TOTAL_NUM_BEAMS_VENDOR_EXTENSION_TAG
// NFAPI_NR_FAPI_ANALOG_BEAM_VENDOR_EXTENSION_TAG
FILL_TLV(nfapi_resp->analog_beamforming_ve.num_beams_period_vendor_ext,
NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG,
rand8());
nfapi_resp->num_tlv++;
FILL_TLV(nfapi_resp->analog_beamforming_ve.analog_bf_vendor_ext, NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG, rand8());
nfapi_resp->num_tlv++;
FILL_TLV(nfapi_resp->analog_beamforming_ve.total_num_beams_vendor_ext,
NFAPI_NR_FAPI_TOTAL_NUM_BEAMS_VENDOR_EXTENSION_TAG,
rand8());
nfapi_resp->num_tlv++;
if (nfapi_resp->analog_beamforming_ve.total_num_beams_vendor_ext.value > 0) {
nfapi_resp->analog_beamforming_ve.analog_beam_list =
(nfapi_uint8_tlv_t *)malloc(nfapi_resp->analog_beamforming_ve.total_num_beams_vendor_ext.value * sizeof(nfapi_uint8_tlv_t));
for (int i = 0; i < nfapi_resp->analog_beamforming_ve.total_num_beams_vendor_ext.value; ++i) {
FILL_TLV(nfapi_resp->analog_beamforming_ve.analog_beam_list[i], NFAPI_NR_FAPI_ANALOG_BEAM_VENDOR_EXTENSION_TAG, rand8());
nfapi_resp->num_tlv++;
}
}*/
}
static void test_pack_unpack(nfapi_nr_config_request_scf_t *req)

View File

@@ -31,15 +31,10 @@ typedef struct ldpc_interface_s {
LDPC_encoderfunc_t *LDPCencoder;
} ldpc_interface_t;
// Global var to limit the rework of the dirty legacy code
extern ldpc_interface_t ldpc_interface, ldpc_interface_offload, ldpc_interface_segment;
/* functions to load the LDPC shared lib, implemented in openair1/PHY/CODING/nrLDPC_load.c */
int load_LDPClib(char *version, ldpc_interface_t *);
int free_LDPClib(ldpc_interface_t *ldpc_interface);
LDPC_initfunc_t LDPCinit;
LDPC_shutdownfunc_t LDPCshutdown;
LDPC_decoderfunc_t LDPCdecoder;
LDPC_encoderfunc_t LDPCencoder;

View File

@@ -172,8 +172,7 @@ void phy_init_nr_gNB(PHY_VARS_gNB *gNB)
for (int i = 0; i < common_vars->num_beams_period; i++)
common_vars->rxdataF[i] = (c16_t **)malloc16(Prx * sizeof(c16_t*));
common_vars->num_beams = cfg->dbt_config.num_dig_beams;
if (common_vars->num_beams > 0) {
if (cfg->analog_beamforming_ve.analog_bf_vendor_ext.value) {
common_vars->beam_id = (int **)malloc16(common_vars->num_beams_period * sizeof(int*));
for (int i = 0; i < common_vars->num_beams_period; i++)
common_vars->beam_id[i] = (int*)malloc16_clear(fp->symbols_per_slot * fp->slots_per_frame * sizeof(int));

View File

@@ -29,7 +29,7 @@
void init_prach_ru_list(RU_t *ru);
int nr_phy_init_RU(RU_t *ru)
void nr_phy_init_RU(RU_t *ru)
{
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
@@ -47,36 +47,40 @@ int nr_phy_init_RU(RU_t *ru)
AssertFatal(ru->nb_log_antennas > 0 && ru->nb_log_antennas < 13, "ru->nb_log_antennas %d ! \n",ru->nb_log_antennas);
ru->common.beam_id = malloc16_clear(MAX_NUM_BEAM_PERIODS * sizeof(int*));
for(int i = 0; i < MAX_NUM_BEAM_PERIODS; i++)
nfapi_nr_analog_beamforming_ve_t *analog_config = &cfg->analog_beamforming_ve;
ru->num_beams_period = analog_config->analog_bf_vendor_ext.value ? analog_config->num_beams_period_vendor_ext.value : 1;
int nb_tx_streams = ru->nb_tx * ru->num_beams_period;
int nb_rx_streams = ru->nb_rx * ru->num_beams_period;
LOG_I(NR_PHY, "nb_tx_streams %d, nb_rx_streams %d, num_Beams_period %d\n", nb_tx_streams, nb_rx_streams, ru->num_beams_period);
ru->common.beam_id = malloc16_clear(ru->num_beams_period * sizeof(int*));
for(int i = 0; i < ru->num_beams_period; i++)
ru->common.beam_id[i] = malloc16_clear(fp->symbols_per_slot * fp->slots_per_frame * sizeof(int));
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals
// Time-domain signals
ru->common.txdata = (int32_t**)malloc16(ru->nb_tx*sizeof(int32_t*));
ru->common.rxdata = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
ru->common.txdata = (int32_t**)malloc16(nb_tx_streams * sizeof(int32_t*));
ru->common.rxdata = (int32_t**)malloc16(nb_rx_streams * sizeof(int32_t*));
for (int i = 0; i < ru->nb_tx; i++) {
for (int i = 0; i < nb_tx_streams; i++) {
// Allocate 10 subframes of I/Q TX signal data (time) if not
ru->common.txdata[i] = (int32_t*)malloc16_clear((ru->sf_extension + fp->samples_per_frame)*sizeof(int32_t));
ru->common.txdata[i] = (int32_t*)malloc16_clear((ru->sf_extension + fp->samples_per_frame) * sizeof(int32_t));
LOG_D(PHY,
"[INIT] common.txdata[%d] = %p (%lu bytes,sf_extension %d)\n",
i,
ru->common.txdata[i],
(ru->sf_extension + fp->samples_per_frame) * sizeof(int32_t),
ru->sf_extension);
ru->common.txdata[i] = &ru->common.txdata[i][ru->sf_extension];
ru->common.txdata[i] = &ru->common.txdata[i][ru->sf_extension];
LOG_D(PHY, "[INIT] common.txdata[%d] = %p \n", i, ru->common.txdata[i]);
}
for (int i = 0; i < ru->nb_rx; i++) {
ru->common.rxdata[i] = (int32_t*)malloc16_clear( fp->samples_per_frame*sizeof(int32_t) );
for (int i = 0; i < nb_rx_streams; i++) {
ru->common.rxdata[i] = (int32_t*)malloc16_clear(fp->samples_per_frame * sizeof(int32_t));
}
} // IF5 or local RF
else {
ru->common.txdata = (int32_t**)NULL;
ru->common.rxdata = (int32_t**)NULL;
ru->common.txdata = (int32_t**)NULL;
ru->common.rxdata = (int32_t**)NULL;
}
if (ru->function != NGFI_RRU_IF5) { // we need to do RX/TX RU processing
LOG_D(PHY, "nb_tx %d\n", ru->nb_tx);
@@ -85,7 +89,6 @@ int nr_phy_init_RU(RU_t *ru)
ru->common.rxdata_7_5kHz[i] = (int32_t*)malloc16_clear( 2*fp->samples_per_subframe*2*sizeof(int32_t) );
LOG_D(PHY, "rxdata_7_5kHz[%d] %p for RU %d\n", i, ru->common.rxdata_7_5kHz[i], ru->idx);
}
// allocate precoding input buffers (TX)
ru->common.txdataF = (int32_t **)malloc16(ru->nb_tx*sizeof(int32_t*));
@@ -94,15 +97,15 @@ int nr_phy_init_RU(RU_t *ru)
ru->common.txdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP * sizeof(int32_t));
// allocate IFFT input buffers (TX)
ru->common.txdataF_BF = (int32_t **)malloc16(ru->nb_tx*sizeof(int32_t*));
LOG_D(PHY, "[INIT] common.txdata_BF= %p (%lu bytes)\n", ru->common.txdataF_BF, ru->nb_tx * sizeof(int32_t *));
for (int i = 0; i < ru->nb_tx; i++) {
ru->common.txdataF_BF[i] = (int32_t*)malloc16_clear(fp->samples_per_subframe_wCP*sizeof(int32_t) );
ru->common.txdataF_BF = (int32_t **)malloc16(nb_tx_streams * sizeof(int32_t*));
LOG_D(PHY, "[INIT] common.txdata_BF= %p (%lu bytes)\n", ru->common.txdataF_BF, nb_tx_streams * sizeof(int32_t *));
for (int i = 0; i < nb_tx_streams; i++) {
ru->common.txdataF_BF[i] = (int32_t*)malloc16_clear(fp->samples_per_subframe_wCP * sizeof(int32_t));
LOG_D(PHY, "txdataF_BF[%d] %p for RU %d\n", i, ru->common.txdataF_BF[i], ru->idx);
}
// allocate FFT output buffers (RX)
ru->common.rxdataF = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
for (int i = 0; i < ru->nb_rx; i++) {
ru->common.rxdataF = (int32_t**)malloc16(nb_rx_streams * sizeof(int32_t*));
for (int i = 0; i < nb_rx_streams; i++) {
// allocate 4 slots of I/Q signal data (frequency)
int size = RU_RX_SLOT_DEPTH * fp->symbols_per_slot * fp->ofdm_symbol_size;
ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(**ru->common.rxdataF) * size);
@@ -113,40 +116,38 @@ int nr_phy_init_RU(RU_t *ru)
// AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
// "nb_antennas_rx too large");
for (int j = 0; j < NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX; j++) {
ru->prach_rxsigF[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
ru->prach_rxsigF[j] = (int16_t**)malloc(nb_rx_streams * sizeof(int16_t*));
for (int i = 0; i < ru->nb_rx; i++) {
for (int i = 0; i < nb_rx_streams; i++) {
// largest size for PRACH FFT is 4x98304 (16*24576)
ru->prach_rxsigF[j][i] = (int16_t*)malloc16_clear( 4*98304*2*sizeof(int16_t) );
LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[j][i]);
ru->prach_rxsigF[j][i] = (int16_t*)malloc16_clear(4 * 98304 * 2 * sizeof(int16_t));
LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n", i, ru->prach_rxsigF[j][i]);
}
}
AssertFatal(ru->num_gNB <= NUMBER_OF_gNB_MAX,"gNB instances %d > %d\n",
ru->num_gNB,NUMBER_OF_gNB_MAX);
AssertFatal(ru->num_gNB <= NUMBER_OF_gNB_MAX, "gNB instances %d > %d\n", ru->num_gNB,NUMBER_OF_gNB_MAX);
LOG_D(PHY, "[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB);
} // !=IF5
init_prach_ru_list(ru);
return(0);
}
void nr_phy_free_RU(RU_t *ru)
{
LOG_D(PHY, "Freeing RU signal buffers (if_south %s) nb_tx %d\n", ru_if_types[ru->if_south], ru->nb_tx);
int nb_tx_streams = ru->nb_tx * ru->num_beams_period;
int nb_rx_streams = ru->nb_rx * ru->num_beams_period;
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals
// Hack: undo what is done at allocation
for (int i = 0; i < ru->nb_tx; i++) {
for (int i = 0; i < nb_tx_streams; i++) {
int32_t *p = &ru->common.txdata[i][-ru->sf_extension];
free_and_zero(p);
}
free_and_zero(ru->common.txdata);
for (int i = 0; i < ru->nb_rx; i++)
for (int i = 0; i < nb_rx_streams; i++)
free_and_zero(ru->common.rxdata[i]);
free_and_zero(ru->common.rxdata);
} // else: IF5 or local RF -> nothing to free()
@@ -162,21 +163,21 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->common.txdataF);
// free IFFT input buffers (TX)
for (int i = 0; i < ru->nb_tx; i++)
for (int i = 0; i < nb_tx_streams; i++)
free_and_zero(ru->common.txdataF_BF[i]);
free_and_zero(ru->common.txdataF_BF);
// free FFT output buffers (RX)
for (int i = 0; i < ru->nb_rx; i++)
for (int i = 0; i < nb_rx_streams; i++)
free_and_zero(ru->common.rxdataF[i]);
free_and_zero(ru->common.rxdataF);
for (int j = 0; j < NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX; j++) {
for (int i = 0; i < ru->nb_rx; i++)
for (int i = 0; i < nb_rx_streams; i++)
free_and_zero(ru->prach_rxsigF[j][i]);
free_and_zero(ru->prach_rxsigF[j]);
}
for(int i = 0; i < MAX_NUM_BEAM_PERIODS; ++i)
for(int i = 0; i < ru->num_beams_period; ++i)
free_and_zero(ru->common.beam_id[i]);
free_and_zero(ru->common.beam_id);
}

View File

@@ -85,6 +85,11 @@ static const int nr_ssb_table[][3] = {
{93, 15, nr_ssb_type_A},
{94, 15, nr_ssb_type_A},
{96, 30, nr_ssb_type_C},
{100, 15, nr_ssb_type_A},
{101, 15, nr_ssb_type_A},
{101, 30, nr_ssb_type_C},
{102, 30, nr_ssb_type_C},
{104, 30, nr_ssb_type_C},
{254, 15, nr_ssb_type_A},
{254, 30, nr_ssb_type_C},
{255, 15, nr_ssb_type_A},

View File

@@ -81,7 +81,9 @@ static void nr_generate_dci(PHY_VARS_gNB *gNB,
int dci_idx = 0;
// multi-beam number (for concurrent beams)
int bitmap = SL_to_bitmap(cset_start_symb, pdcch_pdu_rel15->DurationSymbols);
int beam_nb = beam_index_allocation(dci_pdu->precodingAndBeamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx,
int beam_nb = beam_index_allocation(gNB->enable_analog_das,
dci_pdu->precodingAndBeamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx,
&gNB->gNB_config.analog_beamforming_ve,
&gNB->common_vars,
slot,
frame_parms->symbols_per_slot,

View File

@@ -680,7 +680,9 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
nfapi_nr_tx_precoding_and_beamforming_t *pb = &rel15->precodingAndBeamforming;
// beam number in multi-beam scenario (concurrent beams)
int bitmap = SL_to_bitmap(rel15->StartSymbolIndex, rel15->NrOfSymbols);
int beam_nb = beam_index_allocation(pb->prgs_list[0].dig_bf_interface_list[0].beam_idx,
int beam_nb = beam_index_allocation(gNB->enable_analog_das,
pb->prgs_list[0].dig_bf_interface_list[0].beam_idx,
&gNB->gNB_config.analog_beamforming_ve,
&gNB->common_vars,
slot,
frame_parms->symbols_per_slot,

View File

@@ -42,7 +42,6 @@ void init_prach_list(PHY_VARS_gNB *gNB)
for (int i = 0; i < NUMBER_OF_NR_PRACH_MAX; i++){
gNB->prach_vars.list[i].frame = -1;
gNB->prach_vars.list[i].slot = -1;
gNB->prach_vars.list[i].beam_nb = -1;
gNB->prach_vars.list[i].num_slots = -1;
}
}
@@ -51,8 +50,8 @@ void free_nr_prach_entry(PHY_VARS_gNB *gNB, int prach_id)
{
gNB->prach_vars.list[prach_id].frame = -1;
gNB->prach_vars.list[prach_id].slot = -1;
gNB->prach_vars.list[prach_id].beam_nb = -1;
gNB->prach_vars.list[prach_id].num_slots = -1;
free_and_zero(gNB->prach_vars.list[prach_id].beam_nb);
}
int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame, int slot, find_type_t type) {
@@ -70,7 +69,7 @@ int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame, int slot, find_type_t type) {
return -1;
}
void nr_fill_prach(PHY_VARS_gNB *gNB, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu)
int nr_fill_prach(PHY_VARS_gNB *gNB, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu)
{
int prach_id = find_nr_prach(gNB, SFN, Slot, SEARCH_EXIST_OR_FREE);
AssertFatal(((prach_id >= 0) && (prach_id < NUMBER_OF_NR_PRACH_MAX)), "illegal or no prach_id found!!! prach_id %d\n", prach_id);
@@ -79,16 +78,25 @@ void nr_fill_prach(PHY_VARS_gNB *gNB, int SFN, int Slot, nfapi_nr_prach_pdu_t *p
prach->slot = Slot;
const int format = prach_pdu->prach_format;
prach->num_slots = (format < 4) ? get_long_prach_dur(format, gNB->frame_parms.numerology_index) : 1;
prach->beam_nb = 0;
if (gNB->common_vars.beam_id) {
int fapi_beam_idx = prach_pdu->beamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx;
// TODO no idea how to compute final prach symbol here so for now we go til the end of the slot
int temp_nb_symbols = NR_NUMBER_OF_SYMBOLS_PER_SLOT - prach_pdu->prach_start_symbol;
int bitmap = SL_to_bitmap(prach_pdu->prach_start_symbol, temp_nb_symbols);
prach->beam_nb = beam_index_allocation(fapi_beam_idx, &gNB->common_vars, Slot, NR_NUMBER_OF_SYMBOLS_PER_SLOT, bitmap);
int n_symb = get_nr_prach_duration(prach_pdu->prach_format);
prach->beam_nb = calloc(prach_pdu->beamforming.dig_bf_interface, sizeof(*prach->beam_nb));
for (int i = 0; i < prach_pdu->beamforming.dig_bf_interface; i++) {
int fapi_beam_idx = prach_pdu->beamforming.prgs_list[0].dig_bf_interface_list[i].beam_idx;
int start_symb = prach_pdu->prach_start_symbol + i * n_symb;
int bitmap = SL_to_bitmap(start_symb, n_symb);
prach->beam_nb[i] = beam_index_allocation(gNB->enable_analog_das,
fapi_beam_idx,
&gNB->gNB_config.analog_beamforming_ve,
&gNB->common_vars,
Slot,
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
bitmap);
}
}
LOG_D(NR_PHY,"Copying prach pdu %d bytes to index %d\n", (int)sizeof(*prach_pdu), prach_id);
memcpy(&prach->pdu, prach_pdu, sizeof(*prach_pdu));
return prach_id;
}
void init_prach_ru_list(RU_t *ru)
@@ -121,10 +129,10 @@ int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type)
return -1;
}
void nr_fill_prach_ru(RU_t *ru, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu)
void nr_fill_prach_ru(RU_t *ru, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu, int *beam_id)
{
int prach_id = find_nr_prach_ru(ru, SFN, Slot, SEARCH_EXIST_OR_FREE);
AssertFatal(((prach_id >= 0) && (prach_id < NUMBER_OF_NR_PRACH_MAX)) || (prach_id < 0),
AssertFatal((prach_id >= 0) && (prach_id < NUMBER_OF_NR_PRACH_MAX),
"illegal or no prach_id found!!! prach_id %d\n",
prach_id);
@@ -135,6 +143,7 @@ void nr_fill_prach_ru(RU_t *ru, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_p
ru->prach_list[prach_id].num_slots = (fmt < 4) ? get_long_prach_dur(fmt, ru->nr_frame_parms->numerology_index) : 1;
ru->prach_list[prach_id].fmt = fmt;
ru->prach_list[prach_id].numRA = prach_pdu->num_ra;
ru->prach_list[prach_id].beam = beam_id;
ru->prach_list[prach_id].prachStartSymbol = prach_pdu->prach_start_symbol;
ru->prach_list[prach_id].num_prach_ocas = prach_pdu->num_prach_ocas;
pthread_mutex_unlock(&ru->prach_list_mutex);
@@ -151,6 +160,7 @@ void free_nr_ru_prach_entry(RU_t *ru, int prach_id)
void rx_nr_prach_ru(RU_t *ru,
int prachFormat,
int numRA,
int beam,
int prachStartSymbol,
int prachStartSlot,
int prachOccasion,
@@ -159,7 +169,6 @@ void rx_nr_prach_ru(RU_t *ru,
{
AssertFatal(ru != NULL,"ru is null\n");
int16_t **rxsigF = NULL;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
int slot2 = slot;
int16_t *prach[ru->nb_rx];
@@ -191,15 +200,16 @@ void rx_nr_prach_ru(RU_t *ru,
prachStartSymbol,
prachOccasion);
rxsigF = ru->prach_rxsigF[prachOccasion];
int16_t **rxsigF = ru->prach_rxsigF[prachOccasion];
AssertFatal(ru->if_south == LOCAL_RF || ru->if_south == REMOTE_IF5,
"we shouldn't call this if if_south != LOCAL_RF or REMOTE_IF5\n");
for (int aa=0; aa<ru->nb_rx; aa++){
for (int aa = 0; aa < ru->nb_rx; aa++) {
if (prach_sequence_length == 0)
slot2 = prachStartSlot;
prach[aa] = (int16_t*)&ru->common.rxdata[aa][fp->get_samples_slot_timestamp(slot2, fp, 0) + sample_offset_slot - ru->N_TA_offset];
int idx = aa + beam * ru->nb_rx;
prach[aa] = (int16_t*)&ru->common.rxdata[idx][fp->get_samples_slot_timestamp(slot2, fp, 0) + sample_offset_slot - ru->N_TA_offset];
}
int reps;

View File

@@ -257,14 +257,11 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
int slot,
nfapi_nr_pusch_pdu_t *ulsch_pdu);
void nr_fill_prach(PHY_VARS_gNB *gNB,
int SFN,
int Slot,
nfapi_nr_prach_pdu_t *prach_pdu);
int nr_fill_prach(PHY_VARS_gNB *gNB, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu);
void rx_nr_prach(PHY_VARS_gNB *gNB,
nfapi_nr_prach_pdu_t *prach_pdu,
int prachOccasion,
int prachOccasion,
int frame,
int subframe,
uint16_t *max_preamble,
@@ -274,16 +271,14 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
void rx_nr_prach_ru(RU_t *ru,
int prach_fmt,
int numRA,
int beam,
int prachStartSymbol,
int prachStartSlot,
int prachOccasion,
int frame,
int subframe);
void nr_fill_prach_ru(RU_t *ru,
int SFN,
int Slot,
nfapi_nr_prach_pdu_t *prach_pdu);
void nr_fill_prach_ru(RU_t *ru,int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu, int *beam_nb);
int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame,int slot, find_type_t type);
int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type);
@@ -309,7 +304,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
void init_prach_list(PHY_VARS_gNB *gNB);
void init_prach_ru_list(RU_t *ru);
void free_nr_ru_prach_entry(RU_t *ru, int prach_id);
uint8_t get_nr_prach_duration(uint8_t prach_format);
int get_nr_prach_duration(uint8_t prach_format);
void free_nr_prach_entry(PHY_VARS_gNB *gNB, int prach_id);

View File

@@ -76,7 +76,13 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_pusch_pdu_t
if (gNB->common_vars.beam_id) {
int fapi_beam_idx = ulsch_pdu->beamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx;
int bitmap = SL_to_bitmap(ulsch_pdu->start_symbol_index, ulsch_pdu->nr_of_symbols);
ulsch->beam_nb = beam_index_allocation(fapi_beam_idx, &gNB->common_vars, slot, NR_NUMBER_OF_SYMBOLS_PER_SLOT, bitmap);
ulsch->beam_nb = beam_index_allocation(gNB->enable_analog_das,
fapi_beam_idx,
&gNB->gNB_config.analog_beamforming_ve,
&gNB->common_vars,
slot,
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
bitmap);
}
ulsch->frame = frame;
ulsch->slot = slot;

View File

@@ -57,10 +57,7 @@
//#define DEBUG_NR_PUCCH_RX 1
void nr_fill_pucch(PHY_VARS_gNB *gNB,
int frame,
int slot,
nfapi_nr_pucch_pdu_t *pucch_pdu)
void nr_fill_pucch(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_pucch_pdu_t *pucch_pdu)
{
bool found = false;
for (int i = 0; i < gNB->max_nb_pucch; i++) {
@@ -73,7 +70,13 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB,
if (gNB->common_vars.beam_id) {
int fapi_beam_idx = pucch_pdu->beamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx;
int bitmap = SL_to_bitmap(pucch_pdu->start_symbol_index, pucch_pdu->nr_of_symbols);
pucch->beam_nb = beam_index_allocation(fapi_beam_idx, &gNB->common_vars, slot, NR_NUMBER_OF_SYMBOLS_PER_SLOT, bitmap);
pucch->beam_nb = beam_index_allocation(gNB->enable_analog_das,
fapi_beam_idx,
&gNB->gNB_config.analog_beamforming_ve,
&gNB->common_vars,
slot,
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
bitmap);
}
memcpy((void *)&pucch->pucch_pdu, (void *)pucch_pdu, sizeof(nfapi_nr_pucch_pdu_t));
LOG_D(PHY,

View File

@@ -59,7 +59,13 @@ void nr_fill_srs(PHY_VARS_gNB *gNB, frame_t frame, slot_t slot, nfapi_nr_srs_pdu
if (gNB->common_vars.beam_id) {
int bitmap = SL_to_bitmap(srs_pdu->time_start_position, 1 << srs_pdu->num_symbols);
int fapi_beam_idx = srs_pdu->beamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx;
srs->beam_nb = beam_index_allocation(fapi_beam_idx, &gNB->common_vars, slot, NR_NUMBER_OF_SYMBOLS_PER_SLOT, bitmap);
srs->beam_nb = beam_index_allocation(gNB->enable_analog_das,
fapi_beam_idx,
&gNB->gNB_config.analog_beamforming_ve,
&gNB->common_vars,
slot,
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
bitmap);
}
memcpy((void *)&srs->srs_pdu, (void *)srs_pdu, sizeof(nfapi_nr_srs_pdu_t));
break;

View File

@@ -323,7 +323,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
int G,
uint32_t nvar)
uint32_t nvar,
pdsch_scope_req_t *scope_req)
{
const int nl = dlsch[0].Nl;
const int matrixSz = ue->frame_parms.nb_antennas_rx * nl;
@@ -463,6 +464,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
csi_res_bitmap,
ue->chest_time);
stop_meas_nr_ue_phy(ue, DLSCH_EXTRACT_RBS_STATS);
if (scope_req->copy_chanest_to_scope) {
size_t size = sizeof(c16_t) * dlsch_config->number_rbs * NR_NB_SC_PER_RB;
int copy_index = symbol - dlsch_config->start_symbol;
int offset = copy_index * size;
UEscopeCopyUnsafe(ue, pdschChanEstimates, dl_ch_estimates_ext[0], size, offset, copy_index);
}
if (meas_enabled) {
LOG_D(PHY,
"[AbsSFN %u.%d] Slot%d Symbol %d: Pilot/Data extraction %5.2f \n",
@@ -481,6 +488,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nb_re_pdsch = (pilots == 1) ? ((config_type == NFAPI_NR_DMRS_TYPE1) ? nb_rb_pdsch * (12 - 6 * dlsch_config->n_dmrs_cdm_groups)
: nb_rb_pdsch * (12 - 4 * dlsch_config->n_dmrs_cdm_groups))
: (nb_rb_pdsch * 12);
if (scope_req->copy_rxdataF_to_scope) {
size_t size = sizeof(c16_t) * nb_re_pdsch;
int copy_index = symbol - dlsch_config->start_symbol;
UEscopeCopyUnsafe(ue, pdschRxdataF, rxdataF_ext[0], size, scope_req->scope_rxdataF_offset, copy_index);
scope_req->scope_rxdataF_offset += size;
}
//----------------------------------------------------------
//--------------------- Channel Scaling --------------------
//----------------------------------------------------------

View File

@@ -41,6 +41,13 @@
#define NR_PUSCH_x 2 // UCI placeholder bit TS 38.212 V15.4.0 subclause 5.3.3.1
#define NR_PUSCH_y 3 // UCI placeholder bit
// Specifies the data that should be copied to the scope during PDSCH RX
typedef struct pdsch_scope_req_s {
bool copy_chanest_to_scope;
bool copy_rxdataF_to_scope;
size_t scope_rxdataF_offset;
} pdsch_scope_req_t;
// Functions below implement 36-211 and 36-212
/** @addtogroup _PHY_TRANSPORT_
@@ -314,7 +321,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
int G,
uint32_t nvar);
uint32_t nvar,
pdsch_scope_req_t *scope_req);
int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot, c16_t **txData);

View File

@@ -248,6 +248,29 @@ class IQHist {
if (!ss.str().empty()) {
ImGui::Text("Data for %s", ss.str().c_str());
}
if (ImGui::Button("Save IQ")) {
std::stringstream ss;
ss << "iq_";
if (iq_data->meta.frame != -1) {
ss << iq_data->meta.frame << "_";
}
if (iq_data->meta.slot != -1) {
ss << iq_data->meta.slot << "_";
}
ss << scope_id_to_string(static_cast<enum scopeDataType>(iq_data->scope_id));
ss << ".csv";
std::ofstream file(ss.str());
if (file.is_open()) {
file << "real;imag\n";
for (int i = 0; i < iq_data->len; i++) {
file << iq_data->real[i] << ";" << iq_data->imag[i] << "\n";
}
file.close();
std::cout << "Saved IQ to file: " << ss.str() << std::endl;
} else {
std::cerr << "Unable to open file";
}
}
ImGui::EndGroup();
}
};
@@ -432,6 +455,29 @@ void ShowUeScope(void *data_void_ptr, float t)
}
ImGui::End();
if (ImGui::Begin("UE PDSCH Chan est")) {
static auto iq_data = new IQData();
static auto iq_hist = new IQHist("PDSCH Chan est IQ");
bool new_data = false;
if (iq_hist->ShouldReadData()) {
new_data = iq_data->TryCollect(&scope_array[pdschChanEstimates], t, iq_hist->GetEpsilon(), iq_procedure_timer);
}
iq_hist->Draw(iq_data, t, new_data);
}
ImGui::End();
if (ImGui::Begin("UE PDSCH IQ before compensation")) {
static auto iq_data = new IQData();
static auto iq_hist = new IQHist("PDSCH IQ before compensation");
bool new_data = false;
if (iq_hist->ShouldReadData()) {
new_data = iq_data->TryCollect(&scope_array[pdschRxdataF], t, iq_hist->GetEpsilon(), iq_procedure_timer);
}
iq_hist->Draw(iq_data, t, new_data);
}
ImGui::End();
if (ImGui::Begin("Time domain samples")) {
static auto iq_data = new IQData();
// Issue with imgui deferring draw calls until the end of the frame - cases segfault if scatterplot has too many points

Some files were not shown because too many files have changed in this diff Show More