Compare commits

...

234 Commits

Author SHA1 Message Date
Chieh-Chun Chen
d47ded101e Fix: avoid using id 0 for slice 2024-01-12 20:20:35 +01:00
Chieh-Chun Chen
f326c15d67 Add default slice sst 0 sd 0 for SRB
Note: assume default slice nssai is sst 0 and sd 0, which is reserved for SRB. it needs to be assigned to sched_ctrl before gnb created slice from RC control message in order to be able associated to the corresponding slice
2024-01-12 20:20:35 +01:00
Chieh-Chun Chen
88daeb39db Fix: remove released UE from slice before MAC removed 2024-01-12 20:20:35 +01:00
Chieh-Chun Chen
e2f35a2dcd Fix: add default slice while initializing slice 2024-01-12 20:20:35 +01:00
Chieh-Chun Chen
bdfea1d001 Fix RC ran func 2024-01-12 20:20:35 +01:00
Sakthivel Velumani
8954a140fd Remove UE from slice list(to be squashed) 2024-01-11 17:50:36 +01:00
Sakthivel Velumani
289c87d238 Add support for multiple slices per UE 2024-01-09 14:20:16 +01:00
Teodora
5bb186229e Fix warnings, read functions in SMs should return bool 2024-01-09 14:19:37 +01:00
Teodora
dbb08a9c85 Made it compile with FlexRIC release v2 2024-01-09 14:19:37 +01:00
Chieh-Chun Chen
3faaf888e7 Fix: correct the function pointer of preprocessor function for nr dlsim 2023-12-18 11:36:27 +01:00
Chieh-Chun Chen
3bc87342c6 Add README for nr slicing 2023-12-15 12:03:50 +01:00
Chieh-Chun Chen
3544c35c7a Fix: correct bytes_last_round to be the instantaneous transmission rate for each slice 2023-12-13 15:33:41 +01:00
Chieh-Chun Chen
b5177eb796 Fix: use min prb ratio as parameter for NVS algo 2023-12-13 14:43:30 +01:00
Chieh-Chun Chen
8eb350c5c8 Add new coming UEs to the corresponding slice if slice exists 2023-12-13 14:43:30 +01:00
Chieh-Chun Chen
d0b00aa53d Fix: save plmn info in RRCSetupComplete 2023-12-13 14:43:30 +01:00
Chieh-Chun Chen
477510cb53 Fix: get the correct nssai in ngap 2023-12-13 14:42:42 +01:00
Chieh-Chun Chen
3c8a95e767 Add slice in RC ran func 2023-12-13 14:42:42 +01:00
Chieh-Chun Chen
f02f3af722 Fixes for NR slicing
- correct return value of slice idx
- add/move UE in UE_list
- use rnti_t instead uint16_t
2023-12-13 14:42:42 +01:00
Chieh-Chun Chen
8f544acf20 Modify the return value of nr_pf_dl to int & remove the unused codes 2023-12-13 14:42:08 +01:00
Chieh-Chun Chen
09a2643518 Fix: correct the teidupf in GTP ran func 2023-12-13 14:42:08 +01:00
Robert Schmidt
2350bf56dd Add 5G preprocessor with NVS slicing 2023-12-13 14:41:53 +01:00
Robert Schmidt
790c3b999d Merge branch 'integration_2023_w49' into 'develop'
Integration: 2023.w49

See merge request oai/openairinterface5g!2470

* !2264 Improvements in f1ap for qos
* !2377 Store allowed NSSAIs from NAS message
* !2462 Hotfix: swap UIDs after RRCReestablishment
* !2449 Improve performance of polar initialization
* !2469 handling configuration of MAC-CellGroupConfig at UE
* !2395 `nr_generate_pdsch()` clean up and little performance improves
* !2461 CI: add FDD test to SA B200 pipeline
* !2424 Improvements in SDAP RRC management
2023-12-12 12:39:04 +00:00
Robert Schmidt
5249dd9670 Merge remote-tracking branch 'origin/NR_UE_SDAP_management' into integration_2023_w49 2023-12-12 09:31:11 +01:00
francescomani
d24a3d1a98 SDAP release DRB 2023-12-12 05:56:09 +01:00
Robert Schmidt
6cb52cf2ef Merge remote-tracking branch 'origin/ci-add-fdd-test' into integration_2023_w49 2023-12-12 05:42:42 +01:00
Robert Schmidt
889a116497 Merge remote-tracking branch 'origin/pdsch-layer-mapping-32bit-assign' into integration_2023_w49 2023-12-12 05:42:22 +01:00
Robert Schmidt
7cd6d36716 Merge remote-tracking branch 'origin/NR_UE_handle_MAC-CellGroupConfig' into integration_2023_w49 2023-12-11 14:56:42 +01:00
Robert Schmidt
6c2194038a Merge remote-tracking branch 'origin/enhance-polar-perf' into integration_2023_w49 2023-12-11 14:56:15 +01:00
Jaroslava Fiedlerova
a402e11b6f Modif in the conf file - reduce max_rxgain and att_tx 2023-12-11 14:25:16 +01:00
Jaroslava Fiedlerova
84ee651784 Adjust max_rxgain to improve UL throughput 2023-12-11 09:21:32 +01:00
Laurent THOMAS
175e835d05 update the polar codec function that creates the internal LUTs
to use faster code
- replaced hundreds mallocs by either local arrays or by the OAI multi-dimensionalarray (G_N_tab array)
- made in SIMD a one bit per byte packing function to packed (ordinary) bits in bytes
2023-12-08 17:11:16 +01:00
francescomani
eac9ec0547 handling MAC-CellGroupConfig at MAC UE 2023-12-08 16:15:00 +01:00
Jaroslava Fiedlerova
f92617b772 Add comment to the FDD conf file 2023-12-08 15:15:07 +01:00
Robert Schmidt
e161ca227f Merge remote-tracking branch 'origin/Hotfix_swap_UIDs_after_RRCReestablishment' into integration_2023_w49 2023-12-08 13:08:29 +01:00
luis_pereira87
f0df1ccb53 Hotfix: swap UIDs after RRCReestablishment
The CellGroup is created considering UID, for example:
'pucchres0->startingPRB = 8 + uid;' and since we keep the CellGroup from
the previous RNTI/UID we should keep also the previous UID.

Considering the scenario where a UE did successful RRCReestablishment,
it was getting uid = 1, and uid = 0 was removed.
When another UE connected, it was getting UID = 0 (because 0 was already
free), and so the PUCCH 0 resource was conflicting with the first UE.

On that occasion, also correct the comment that describes the code, as
it was wrong/misleading.
2023-12-08 11:09:52 +01:00
Robert Schmidt
4f653c8471 Merge remote-tracking branch 'origin/NR-UE-store-allowed-nssai' into integration_2023_w49 2023-12-08 09:53:23 +01:00
Robert Schmidt
1f0e5bd664 Merge remote-tracking branch 'origin/improvements_f1ap_for_QoS' into integration_2023_w49 2023-12-08 09:53:12 +01:00
Robert Schmidt
ff758dd029 Correct number of bands assert in Setup Request decoder 2023-12-07 15:07:38 +01:00
Jaroslava Fiedlerova
01c6377331 CI: add FDD test to SA B200 pipeline
- new cu and du config files for testing in band 1
- modification of yml file for CU DU deployment - with new config files
- modification of xml file for SA F1 testcase
2023-12-07 15:07:33 +01:00
Quency Lin
b240bc485f Feat: improve layer mapping by 32 bits assignment 2023-12-07 14:04:06 +01:00
Robert Schmidt
c5aeaf03dc Merge branch 'integration_2023_w48' into 'develop'
See merge request oai/openairinterface5g!2459

* !2419 chore(ci): running 5G RF simulator scenarios with address sanitizer
* !2455 Remove mac_LogicalChannelConfig from RLC (handled at MAC)
* !2456 Setting uniform periodicity for CSI-RS and measurement report
* !2429 LDPC encoding/decoding offload to the T2 card
* !2447 E2 agent: build in CI, fix slice support, add gNB-DU and gNB-CU-UP IDs
* !2452 Include sample advance option in UE tutorial
* !2430 bugfix: nr-ue: set first_tx=1 at first transmission of a harq process
* !2457 Fix scaling for FR2
2023-12-05 15:44:43 +00:00
Sakthivel Velumani
d61c4f1042 Change global variable to local 2023-12-05 13:04:23 +05:30
Sakthivel Velumani
f69f419a13 Remove duplicate declaration 2023-12-05 13:04:23 +05:30
Sakthivel Velumani
6bf954d35d Cast buffer intputs of order reversing macros 2023-12-05 13:04:23 +05:30
Sakthivel Velumani
3979879e9e Replace buffer conversion with macro 2023-12-05 13:04:23 +05:30
Sakthivel Velumani
8b118fd875 Remove hardcoding of default NSSAI selection
Check if NSSAI from config exists in allowed NSSAI list. Don't request
PDU session if not present in the list.
2023-12-05 13:04:13 +05:30
Robert Schmidt
ada4e8ebd8 Merge remote-tracking branch 'origin/NR_UE_USRP_tutorial_update' into integration_2023_w48 2023-12-05 07:40:15 +01:00
Robert Schmidt
3580ddb546 Merge remote-tracking branch 'origin/Fix_FR2_SSB_ARFCN_scalling' into integration_2023_w48 2023-12-05 07:40:02 +01:00
Robert Schmidt
b4b2389753 Merge remote-tracking branch 'origin/ue-fix-ul-first-tx' into integration_2023_w48 2023-12-05 07:39:51 +01:00
Robert Schmidt
fecb4bc3a9 Merge remote-tracking branch 'origin/fix-e2-agent' into integration_2023_w48 2023-12-04 17:23:54 +01:00
Robert Schmidt
5440d6671f Merge remote-tracking branch 'origin/t2-offload-mr' into integration_2023_w48 2023-12-04 17:16:51 +01:00
Robert Schmidt
39468ca98e Merge remote-tracking branch 'origin/NR_RRC_uniform_CSI_period' into integration_2023_w48 2023-12-04 07:56:36 +01:00
Robert Schmidt
581f280cd7 Merge remote-tracking branch 'origin/NR_RLC_remove_LogicalChannelConfig' into integration_2023_w48 2023-12-04 07:56:28 +01:00
Thomas Schlichter
aa555f9125 NR_UE: fix calculation of RA_contention_resolution_target_frame when SFN wraps 2023-12-01 16:02:17 +01:00
Thomas Schlichter
6ef5d27c08 NR_UE: fix usage of PUSCH new_data_indicator and cleanup 2023-12-01 16:02:17 +01:00
luis_pereira87
c80fc07719 Fix scaling for FR2
Position of SSB from Point A depends on offsetToPointA and Kssb, and for both, the unit for RB is expressed as 15KHz for FR1 and 60 KHz for FR2, so scaling must be 4 for FR2 frequencies
2023-12-01 14:27:01 +00:00
Sriharsha Korada
ed29252c6d F1AP and E1AP interface changes for QoS
- Implement: Extend the F1 encoding and decoding with Qos
- Implement: E1 decoding for QoS
- Fix: Modify the UE_MODIFICATION_REQUEST_MSG towards DU to contain QoS info based on E1AP context response
- Fix: Modify the E1AP and F1AP message structures
- Fill the Qos configuration to send to MAC
2023-11-30 17:41:12 +01:00
Robert Schmidt
8e990850c3 Correctly read node_id (gNB ID) for RRC
The node ID (which corresponds to the gNB ID) should be read in all
cases of execution, not only CU.
2023-11-30 17:10:11 +01:00
Robert Schmidt
72b485a2fe Bugfix: set pointer to NULL after free 2023-11-30 15:45:45 +01:00
Robert Schmidt
6104dbc749 Documentation: add description when it is DU, CU, gNB 2023-11-30 08:07:20 +01:00
Robert Schmidt
39df275fa4 Remove confusing macrlc_has_f1 variable
The macrlc_has_f1 (static) variable was introduced to signal when we use
F1 in the configuration. It is superfluous: the node_type already passes
this information in a unique manner; hence, remove.
2023-11-30 08:06:16 +01:00
Robert Schmidt
aec6170df4 Build E2 agent in Ubuntu images 2023-11-30 08:06:16 +01:00
Robert Schmidt
41c491a0fa Update E2 Agent submodule: use special FlexRIC commit before v2 2023-11-30 08:06:16 +01:00
Robert Schmidt
107c0c8d65 Reformat Dockerfile.build.ubuntu20 2023-11-30 08:06:16 +01:00
Robert Schmidt
e13a4813ee E2 Agent: Match UEs based on NSSAI
Correctly match UEs based on the NSSAI in MAC and RRC. There is a
convenience function capture_sst_sd() that extracts SST and SD (which
form the NSSAI). Because a previous version used integers to convey the
slice identifier, this function gracefully handles this case, although
it is not spec-compliant.
2023-11-30 08:06:16 +01:00
Robert Schmidt
89b776925d E2 agent: fix memory leak by not allocating memory
Prior to this commit, the RAN function for KPM is leaking memory: it
allocates using calloc() but never frees it.

The fix consists of not allocating this memory on the heap in the first
place, but on the stack. Therefore, there are changes to pass in a
pointer to various functions to the structure on the stack, instead of
passing the "container" for the heap memory by value.

Further, the MAC was allocating an excessive amount of memory (N times
sizeof(NR_UE_info_t)). Instead of copying the entire struct, the present
code stores a pointer to the MAC UE container (NR_UE_info_t *). For the
RRC, there is a similar simplification that consists in not storing the
entire struct f1_ue_data_t (which is not required), but only the RRC UE
ID.

Note that both MAC and RRC might suffer from race conditions. For the
MAC, we should lock the scheduler for the time we read statistics. For
the RRC, the problem is more delicate as no mutex exists; the RRC
assumes everything is executed synchronously in the ITTI task loop. In
both cases, this commit does not address this problem
2023-11-30 08:06:16 +01:00
Robert Schmidt
5168ef72d9 E2 agent: remove broken NSSAI filtering, simplify code
Filtering UEs by NSSAI is broken, so remove it. A later commit will
reestablish this functionality.

Simplify the code: we only handle one condition, so we can check for it
upfront.
2023-11-30 08:06:16 +01:00
Robert Schmidt
deac180224 Set correct gNB/gnB-DU/gNB-CU-UP ID for agent start 2023-11-30 08:06:16 +01:00
Robert Schmidt
7c6c4fc7d3 Start E2 agent only if configuration present
This commit introduces an additional (implicit) option that signals if
the E2 agent is to be activated or not. When reading the configuration,
we now check if all fields are set, and activate the E2 agent only if
this is the case. If not, we only print a warning and start the gNB
without the agent.

Note that previously, if not all fields are set correctly, the gNB
stopped.

To implement this behavior, it is necessary to change the defaults of
the RIC IP and the directory for SMs to a (non-NULL) default value.
Otherwise, the configuration system would not consider the field to be
set to the default, and wrongly assumes the field is set, even though it
is not; at least, this change is necessary to make config_isparamset()
return NULL if the configuration is not set.
2023-11-30 08:06:16 +01:00
Robert Schmidt
79c920cd81 Introduce separate gNB-CU-UP ID in configuration
3GPP has the concept of a gNB-CU-UP ID and a (separate) gNB ID (for gNB,
CU-CP). This commit introduces the gNB-CU-UP as a separate ID that has to be
set in the configuration file when running as a CU-UP. For the
CU/monolithic gNB, it is optional (but needs to be the same as the
gNB-ID if specified).

The CU-UP ID is necessary, as some entities, e.g., the e2 agent, need to
signal both IDs, e.g., to reconcile a CU-CP and (multiple) CU-UP(s)
belonging together.
2023-11-30 08:06:16 +01:00
Robert Schmidt
6f14b11847 Introduce separate gNB-DU ID in configuration
3GPP has the concept of a gNB-DU ID and a (separate) gNB ID (for gNB,
CU). This commit introduces the gNB-DU as a separate ID that has to be
set in the configuration file. It is necessary, as some entities, e.g.,
the e2 agent, need to signal both IDs, e.g., to reconcile a CU and
(multiple) DU(s) belonging together.
2023-11-30 08:06:16 +01:00
Robert Schmidt
ec24b9c3e9 Add License headers to all E2 RAN function files 2023-11-30 08:04:41 +01:00
Robert Schmidt
463115bf19 Remove redundant config code block 2023-11-30 08:04:41 +01:00
Robert Schmidt
6a91f49e9f Fix non-compiling lte-softmodem agent config 2023-11-30 08:04:41 +01:00
Robert Schmidt
b5e2c76d93 UE_iterator is a for_each macro, add to clang-format 2023-11-30 08:04:41 +01:00
Sakthivel Velumani
124c86f7b8 Include sample advance option in OAI-UE tutorial
With X410 and N310, the RA procedure would not succeed and a sample advance is required.
2023-11-29 21:01:11 -05:00
Jaroslava Fiedlerova
7d7dced70e T2 offload - documentation update 2023-11-29 09:12:30 +01:00
Robert Schmidt
463dfc6658 Avoid bitshifts on signed integers 2023-11-29 08:59:36 +01:00
Robert Schmidt
11c853e760 Fix: All UEs can have a UCI in each slot 2023-11-29 08:59:36 +01:00
Raphael Defosseux
8e35d8fe5b chore(ci): post-review changes
* Dockerfile argument is now a generic BUILD_OPTION for any build_oai available option
  * docker-compose files are only modified at deployment time. Not needed for undeployment
  * fixes for oai-nr-cuup
  * cleaner section for the private registry push

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
2023-11-29 08:59:36 +01:00
Raphael Defosseux
4db8dfaf5d chore(ci): enabling running sanitized images for 5G RF / L2 sim test scenarios
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
2023-11-29 08:59:36 +01:00
Raphael Defosseux
85befc1c71 chore(ci): enable ASAN images build and push on Ubuntu
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
2023-11-29 08:59:36 +01:00
Raphael Defosseux
2a82e36e71 chore(ci): adding support for address-sanitizer images' build in dockerfiles
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
2023-11-29 08:59:36 +01:00
Robert Schmidt
6debc5dd21 Make websrv compile 2023-11-28 13:28:36 +01:00
francescomani
31740f0d71 setting same periodicity for CSI-RS and CSI report 2023-11-28 12:52:21 +01:00
francescomani
466f753eb0 remove mac_LogicalChannelConfig from RLC (handled at MAC) 2023-11-28 10:46:08 +01:00
Jaroslava Fiedlerova
7c5b945766 Set RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE based on harq_to_be_cleared value 2023-11-28 09:37:37 +01:00
laurent
7bb529dcdf fix redundant member in ldpc decoder struct 2023-11-28 09:37:37 +01:00
laurent
10d7fe9cc6 fix regressions in cuda ldpc 2023-11-28 09:37:37 +01:00
Jaroslava Fiedlerova
697a7871d0 Fix T2 compilation, add T tracer dependency 2023-11-28 09:37:37 +01:00
Jaroslava Fiedlerova
4defabeb8d Remove T1 decoding offload - remove from docu, remove T1 lib build from pipeline 2023-11-28 09:37:37 +01:00
Jaroslava Fiedlerova
cf97acb8c7 Add T2 LDPC encoding/decoding offload 2023-11-28 09:37:37 +01:00
Laurent THOMAS
99ca87a1c1 Refactor LDPC API to make common API with various implementations 2023-11-28 09:37:37 +01:00
Jaroslava Fiedlerova
e945b260f8 Remove T1 decoding offload 2023-11-28 09:37:37 +01:00
Robert Schmidt
ee287d62f4 Merge branch 'integration_2023_w47' into 'develop'
See merge request oai/openairinterface5g!2450

* !2440 hotfix: set PDCP t-reordering to 100ms
* !2439 rfsimulator: ignore PIPE signal
* !2441 minor: documentation: advertise correct default value for --ssb
* !2446 chore(ci): displaying the ASN1C commit
* !2443 CI documentation: updates and how to reproduce
* !2355 NR UE improve handling of MSG4 feedback in default PUCCH
* !2408 NR UE MAC config improvements
* !2431 T: isolate generated .h files when using make
* !2442 nr pdcp: rework reestablishment
* !2448 lte: switch to RRC release 16.13.0
* !2088 Implementation of logical channel prioritization at UE
* correctly read timing advance option `-A` in gNB
* set sample advance for OAIUE test to make it more stable
* set gain for OAIUE test to make it more stable
* !2445 Correctly allocate SCC n_TimingAdvanceOffset
* !2454 bugfix: fix NSA CI test
2023-11-28 06:38:49 +00:00
Robert Schmidt
79a1b1cf69 Merge remote-tracking branch 'origin/ci-fix-nsa-sanitycheck-test' into integration_2023_w47 2023-11-27 17:52:48 +01:00
Robert Schmidt
728fc34296 Merge remote-tracking branch 'origin/Fix_n_TimingAdvanceOffset' into integration_2023_w47 2023-11-27 17:52:39 +01:00
Robert Schmidt
f3ff41befe Correct RX gain for OAI UE test 2023-11-27 14:36:50 +01:00
Cedric Roux
ff38130196 bugfix: fix NSA CI test
It seems like initialDLBWPcontrolResourceSetZero needs to be set
otherwise the quectel UE does not accept the Reconfiguration.
2023-11-27 12:29:48 +01:00
Robert Schmidt
9acfaaabcb Set timing advance for gNB & UE to make OAI UE test more stable 2023-11-27 11:42:06 +01:00
Robert Schmidt
b04e166e59 gNB: take into account timing_advance option -A 2023-11-27 11:41:58 +01:00
Robert Schmidt
3e9d310093 Merge remote-tracking branch 'origin/implement_logical_channel_prioritization_ue' into integration_2023_w47 2023-11-24 17:55:45 +01:00
Robert Schmidt
67b0c006f5 Merge remote-tracking branch 'origin/lte-rrc-rel16' into integration_2023_w47 2023-11-24 14:12:26 +01:00
Robert Schmidt
ec3de01377 Merge remote-tracking branch 'origin/nr-pdcp-reestablishment-procedure' into integration_2023_w47 2023-11-24 14:12:20 +01:00
Robert Schmidt
1b1c8e22a2 Merge remote-tracking branch 'origin/t-tracer-isolation' into integration_2023_w47 2023-11-24 14:12:13 +01:00
Cedric Roux
18e59d3c2e lte: switch to RRC release 16.13.0
A COTS UE is sending UE capabilities with accessStratumRelease "rel16"
which is not decoded by our RRC. Switching to RRC 16.13.0 lets our RRC
accept these capabilities (and as a positive side effect lets this
particular UE work nicely in NSA fr1).
2023-11-24 12:32:48 +01:00
luis_pereira87
d6abd0117a Add config file for FDD band 1 and 15 kHz SCS 2023-11-24 09:11:41 +00:00
Robert Schmidt
b704f45daa Merge remote-tracking branch 'origin/NR_UE_MAC_conifg_improvements' into integration_2023_w47 2023-11-24 10:08:40 +01:00
Robert Schmidt
e24145fd85 Merge remote-tracking branch 'origin/NR_UE_improve_handling_msg4_feedback' into integration_2023_w47 2023-11-24 10:08:32 +01:00
Robert Schmidt
75d8c05c24 Merge remote-tracking branch 'origin/doc-ci-repro' into integration_2023_w47 2023-11-23 14:21:47 +01:00
Robert Schmidt
3217a3745b Merge remote-tracking branch 'origin/ci-display-asn1c-commit' into integration_2023_w47 2023-11-23 14:21:36 +01:00
Robert Schmidt
041758a13a Merge remote-tracking branch 'origin/minor-fix-doc-ssb-default-value' into integration_2023_w47 2023-11-23 14:21:29 +01:00
Robert Schmidt
38d46be372 Merge remote-tracking branch 'origin/fix-sigpipe-rfsimulator' into integration_2023_w47 2023-11-23 14:21:21 +01:00
francescomani
d241506043 fix for L2 simulator 2023-11-23 12:14:39 +01:00
Raphael Defosseux
59125df278 CI Doc: correct CPP-Check pipeline resource
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
2023-11-23 11:12:27 +01:00
francescomani
65bcbabdca improve handling of MSG4 feedback in default PUCCH 2023-11-23 10:28:04 +01:00
Robert Schmidt
ea369e403d Separate Image Build and Test pipelines, list dockerfiles 2023-11-22 14:04:01 +01:00
Robert Schmidt
9ab67ad87c CI doc: clarify Interop-F1 pipeline purpose 2023-11-22 09:35:09 +00:00
francescomani
c6e5ead2a9 some more RRC cleanup 2023-11-21 11:07:21 +01:00
Raphael Defosseux
207f65992e chore(ci): displaying the ASN1C commit
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
2023-11-21 09:46:24 +01:00
luis_pereira87
088bdf234e Fix read n_TimingAdvanceOffset from the configuration file 2023-11-20 21:42:52 +00:00
Cedric Roux
9e46a6a6ae nr pdcp: introduce nr_pdcp_get_rb() and some cleanup
cleanup means:
- typo: susbend -> suspend
- call nr_pdcp_manager_unlock() where needed
- simplify LOG_XX (remove __FILE__, __LINE__, __FUNCTION__)

note:
nr_pdcp_release_srb() and nr_pdcp_release_drb() don't use
nr_pdcp_release_drb() because they modify the arrays, so
it does not make sense to "abstract" the accesses to
->srb and ->drb.
2023-11-20 14:55:34 +01:00
francescomani
273562f345 fix for do-ra and phy-test mode 2023-11-20 14:21:49 +01:00
francescomani
2715c7efdd improve MAC configuration from RRC 2023-11-20 14:21:01 +01:00
francescomani
848f5767d7 unified handling of cellgroup config at MAC 2023-11-20 14:21:01 +01:00
francescomani
df917624db function to configure cellgroup at RRC 2023-11-20 14:10:30 +01:00
francescomani
4d8bb4ef25 unify handling of reconfiguration with sync 2023-11-20 12:14:59 +01:00
francescomani
5661b20e9e improving init for dora and phytest 2023-11-20 12:14:59 +01:00
francescomani
8013d5d8cc removing CellGroup dependance from MAC common functions 2023-11-20 11:36:46 +01:00
Robert Schmidt
4599969f89 Describe how to reproduce CI 2023-11-20 11:32:09 +01:00
Robert Schmidt
36479a0ac5 TESTBenches.md: identify tags/labels to run pipeline 2023-11-20 11:31:47 +01:00
Robert Schmidt
623092e130 Update TESTBenches: add missing pipelines, remove networked deviewes, update machines 2023-11-20 11:07:59 +01:00
Cedric Roux
2c2915dad8 reestablish only exisiting RBs 2023-11-20 11:00:23 +01:00
Robert Schmidt
7ae790afb6 doc: Remove RAN-SA-AmariS-CN5G pipeline, superseded by RAN-SA-AW2S-CN5G 2023-11-20 10:43:54 +01:00
Cedric Roux
107913d6b2 nr pdcp: rework reestablishment
Security part needs to be checked, may fail to work.
But if it fails, it was probably not working before either.

This commit also contains adding 'static' to nr_pdcp_entity_release()
and nr_pdcp_entity_delete() (it was too complicated to do a separate
commit for this).

We also update stats in free_rx_list() (again, too complicated for
a separate commit).

openair2/RRC/NR/rrc_gNB.c probably needs some more work, it is a
bit ugly to reestablish all the drbs without checking if they
exit. It will generate warnings at runtime. I didn't do it because
I don't know the proper way.
2023-11-19 16:57:03 +01:00
Cedric Roux
7a7d8a1766 nr pdcp: stats: count delivered sdus 2023-11-19 16:49:55 +01:00
Cedric Roux
470af5f497 nr pdcp: bugfix: discard pdu if integrity fails 2023-11-19 16:49:11 +01:00
Cedric Roux
f265b04593 nr pdcp: bugfix: use proper size for t_reordering_start 2023-11-19 16:47:58 +01:00
Cedric Roux
7203e5aba8 nr pdcp: minor: set function scope to static 2023-11-19 16:46:08 +01:00
Cedric Roux
07ee33f024 nr pdcp: minor: fix spacing 2023-11-19 16:43:57 +01:00
Cedric Roux
69a2f103ea minor: documentation: advertise correct default value for --ssb 2023-11-18 22:16:53 +01:00
Cedric Roux
13757862fb hotfix: set PDCP t-reordering to 100ms
The function generateDRB() sets the value to 100ms but the function
rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ() sets it to 0ms.

So what happens is that the UE gets the value 100ms in the
RRC Reconfiguration but the gNB creates the PDCP entity with 0ms.
Let's create it with 100ms instead, to be aligned with how we configure
the UE.

And also avoid some PDCP warnings at runtime when some packets
are retransmitted but rejected because of the 0ms timer. This is
the warning:

    [PDCP]   discard NR PDU rcvd_count=68469, entity->rx_deliv 68481,sdu_in_list 0

This is just a hotfix. A real solution is to have the RB creation in
only one place. And we should also have those parameters configurable.
Work for later.
2023-11-18 21:56:42 +01:00
Cedric Roux
578cd23d59 rfsimulator: ignore PIPE signal
When au UE disconnects, a write on the rf simulator socket may
generate a PIPE signal in the gnb and crash it.

Let's ignore this signal.
2023-11-18 21:44:21 +01:00
Sriharsha Korada
31a63bc919 Update UE feature set 2023-11-16 09:20:14 +01:00
Sriharsha Korada
b0b8c90fd2 clean up 2023-11-16 09:07:05 +01:00
sriharsha
f248b2fdff fix: avoid freeing rlc config structure 2023-11-16 09:07:05 +01:00
sriharsha
e5ab3e022e Handling of mac-LogicalChannelConfig during reconfiguration 2023-11-16 09:07:05 +01:00
sriharsha
43036eb83d Add implementation of logical channel prioritization at UE
- Reorder the logical channels based on priority
- Handling of configuration and release of logical channel bearer
- Add changes in the implementation of lcp procedure for equal priority logical channels
- Restructure the lcp parameters as a separate structure
- Further code clean up
2023-11-16 09:07:05 +01:00
Robert Schmidt
0accb601e4 Merge branch 'integration_2023_w44' into 'develop'
Closes #685 and #698

See merge request oai/openairinterface5g!2425

* !2404 NR UE MCS for retransmission v2
* !2420 Scan build: Argument with 'nonnull' attribute passed null
* !2422 Fix AssertFatal when using NR band n1
* !2418 NR UE resynchronization fix
* !2376 Save NSSAI params of PDU session coming from AMF
* add `build_oai` option for thread sanitizer
* update 60 MHz 2x2 phytest-timing threshold
* !2423 Free F1 UE data struct only on UE release
* !2428 Prevent CU-UP UE ID management if integrated CU
* !2390 NR PTRS improvements
* !2291 Pass config object instead of using implicit global
* !2421 Change UL_TTI.request PRACH PDU beamforming pack/unpack handling
* !2406 CI:AW2S - test with 10 AmariUEs
* !2401 ue-rrc-coarse-cleaning
* !2366 Remove F1 BWP switching logic
* !2426 F1: support multiple DUs per CU
* !2432 Remove cblas dependency for 5G targets
2023-11-15 02:44:13 +00:00
Robert Schmidt
5e5ab86d47 Merge remote-tracking branch 'origin/remove-cblas-oai-5g' into integration_2023_w44 2023-11-14 15:12:41 +01:00
Laurent THOMAS
18951bad4d remove-cblas-oai-5g 2023-11-14 11:47:38 +01:00
Robert Schmidt
e989ae834a Merge remote-tracking branch 'origin/Fix-Zero-Member-Alloc-FAPI-PDU' into integration_2023_w44 2023-11-13 16:24:09 +01:00
Robert Schmidt
23597c9193 Merge remote-tracking branch 'origin/f1-multiple-du' into integration_2023_w44 2023-11-13 16:23:58 +01:00
Robert Schmidt
b07691643d Merge remote-tracking branch 'origin/f1-bwp-switching' into integration_2023_w44 2023-11-13 15:10:27 +01:00
Robert Schmidt
0c51db05ad Merge remote-tracking branch 'origin/UE-rrc-coarse-cleaning' into integration_2023_w44 2023-11-13 15:10:20 +01:00
Robert Schmidt
ad93072e0a Merge remote-tracking branch 'origin/ci-aw2s-add-ues' into integration_2023_w44 2023-11-13 15:10:09 +01:00
Cedric Roux
e98acd7c5a T: set dependancies for generated files
This commit follows the previous one and adds a dependancy for the
generated .h files so that when we change T_messages.txt to add a
T trace, the compilation succeeds when using ninja in
cmake_targets/ran_build/build.
2023-11-12 14:07:11 +01:00
Cedric Roux
1111eccac6 T: isolate generated .h files when using make
When using the make system to generate T files, if you change
T_messages.txt you may have problems compiling the gnb with ninja.

If you want to see the problem:
First run: cd cmake_targets; ./build_oai --ninja --gNB
Then: cd common/utils/T
edit T_messages.txt, add a trace, for example:
---
ID = ENB_PHY_UL_TOCK
    DESC = eNodeB uplink tick - one tick per ms at start of uplink processing
    GROUP = ALL:PHY:GRAPHIC:ENB
    FORMAT = int,eNB_ID : int,frame : int,subframe
---
then run: make
then: cd cmake_targets/ran_build/build; ninja nr-softmodem
You should have an error looking like this:
---
[3/81] Checking validity of VCD files
FAILED: common/utils/T/CMakeFiles/check_vcd /tmp/develop/cmake_targets/ran_build/build/common/utils/T/CMakeFiles/check_vcd
cd /tmp/develop/cmake_targets/ran_build/build/common/utils/T && /tmp/develop/cmake_targets/ran_build/build/common/utils/T/_check_vcd /tmp/develop/common/utils/T/T_messages.txt /tmp/develop/common/utils/T/../LOG/vcd_signal_dumper.h
error: VCD_FIRST_VARIABLE is not correct in T_defs.h

You probably added a VCD trace (variable or function) but you did not
update T_messages.txt and/or T_defs.h in common/utils/T/
[...]
---

Let's first isolate the generated T .h files when using make because
we have two versions of T_IDs.h and T_messages.txt.h when mixing
make/cmake.

A next commit will regenerate T_IDs.h and T_messages.txt.h when
T_messages.txt chages for the cmake system, because this commit
does not solve the problem.
2023-11-12 14:04:36 +01:00
Robert Schmidt
610a886da7 Merge remote-tracking branch 'origin/multi-config' into integration_2023_w44 2023-11-12 05:14:36 +01:00
Robert Schmidt
3fd45922b7 Merge remote-tracking branch 'origin/NR_PTRS_improvements' into integration_2023_w44 2023-11-12 05:14:25 +01:00
Laurent THOMAS
dd059343d9 ue-rrc-coarse-cleaning 2023-11-10 17:43:59 +01:00
Robert Schmidt
3bede49b9b Merge remote-tracking branch 'origin/fix-double-use-cudata' into integration_2023_w44 2023-11-10 17:29:40 +01:00
Robert Schmidt
8e4ff595a0 Merge remote-tracking branch 'origin/fix-no-f1uedata-when-in-mac' into integration_2023_w44 2023-11-10 17:29:28 +01:00
Robert Schmidt
45dd4813c9 Update FEP TX precoding time threshold for 60 MHz 2x2 phytest-timing test 2023-11-10 17:29:09 +01:00
Jaroslava Fiedlerova
c2255a4168 Change PRACH Configuration Index in AW2S gNB config file
- PRACH Configuration Index = 98 is not suSpported by the Amarisoft UE simulator, as a number of PRACH occasions within the PRACH slot is > 1
- for PRACH Configuration Index = 100, number of time-domain PRACH occasions within a PRACH slot is 1
2023-11-10 16:52:43 +01:00
Robert Schmidt
0d85903d09 Add build_oai/cmake option to build with thread sanitizer 2023-11-10 16:15:05 +01:00
Robert Schmidt
58edc4a57b Remove further unnecessary RRC references in gNB MAC scheduler 2023-11-10 16:01:41 +01:00
rmagueta
8551260243 Clean up previous BWP switching implementation that was not F1 compliant 2023-11-10 16:01:33 +01:00
Robert Schmidt
196e0a2c85 Rewrite F1 documentation 2023-11-10 15:29:45 +01:00
Robert Schmidt
39274212fe 5G RFsim F1 test: start 3 DUs, with 1 UE each, PING ONLY 2023-11-10 15:29:45 +01:00
Robert Schmidt
1e565f6b7b 5G RFsim F1 test: docker-compose: add two more DUs with one UE each 2023-11-10 15:29:45 +01:00
Robert Schmidt
eefffef55b UndeployGenObject(): allow multiple gNBs/DUs/CUs for log file analysis, like UE 2023-11-10 15:29:45 +01:00
Robert Schmidt
a6c95537fb Simplify F1 config files 2023-11-10 15:29:45 +01:00
Robert Schmidt
01a095a268 assoc_id only to be stored for DU 2023-11-10 15:29:45 +01:00
Robert Schmidt
e9d91de50b RFsimulator serverport is a number 2023-11-10 15:29:45 +01:00
Robert Schmidt
41c5ea94ae Start RRC ITTI task only in CU or monolithic 2023-11-10 15:29:45 +01:00
Robert Schmidt
96dfb44ae7 Print DU information in periodic RRC stats printing 2023-11-10 15:29:45 +01:00
Robert Schmidt
59a25c48ff RRC UE context lookup by RNTI: use assoc_id 2023-11-10 15:29:45 +01:00
Robert Schmidt
6520dbc95a Implement F1 Setup Failure to originate at RRC 2023-11-10 15:29:45 +01:00
Robert Schmidt
97d574229d Check PCI/nrCellID non-overlapping 2023-11-10 15:29:38 +01:00
Robert Schmidt
7c4ec50e23 PLMN check F1 Setup: cellId does not necessarily match
Multiple DUs host cells, whose cell ID cannot match (to identify them
uniquely). Hence, don't check for equality with CU, because otherwise,
we can never connect multiple DUs.
2023-11-10 15:29:38 +01:00
Robert Schmidt
ac5c4efd4e Merge remote-tracking branch 'origin/nssai-rlc-mac-if' into integration_2023_w44 2023-11-10 14:39:03 +01:00
Robert Schmidt
6fe68a574b Merge remote-tracking branch 'origin/NR_UE_resync_hotfix' into integration_2023_w44 2023-11-10 14:38:55 +01:00
Laurent THOMAS
f50d5f5a9b make multiple config instead of one implicit global 2023-11-10 10:23:11 +01:00
Sakthivel Velumani
3a7f17ebb8 Create functions for getting LCID 2023-11-09 09:02:59 -05:00
Rúben Soares da Silva
fff5497f45 Remove leftover comment 2023-11-09 10:18:00 +00:00
Robert Schmidt
c36eb7c9b4 Hack: Prevent CU-UP UE ID management if integrated CU
This is a workaround for a problem described in #706. In short, we
cannot reuse the cu_add/remove_f1_ue_data() functions if we are in an
integrated CU-UP/CP ("CU"), but then we can also not reliably use
different UE IDs in CU-UP and CU-CP (except if using even more hacks).
2023-11-08 17:34:42 +01:00
Robert Schmidt
c812cea143 Multiple DUs in a tree 2023-11-08 10:18:52 +01:00
Robert Schmidt
e155080ece Assoc ID CU->DU 2023-11-08 10:18:52 +01:00
Robert Schmidt
a377e5231c Set UE DU assoc_id to 0 on DU disconnect
An assoc_id of 0 is used to mark UEs whose DU is "offline" (not
connected). In this patch, if a DU disconnects, we go through all UEs
and set their assoc_id to 0 if they belong to a UE that just went
offline.
2023-11-08 10:18:52 +01:00
Robert Schmidt
e5684d217c Assoc ID DU->CU 2023-11-08 10:18:52 +01:00
Robert Schmidt
843a1dc0a3 Introduce lookup functions for DUs 2023-11-08 10:18:52 +01:00
Robert Schmidt
1af4e81951 Paging: not fully implemented, make clear is dummy 2023-11-08 10:18:52 +01:00
Robert Schmidt
8cdb23639b Bugfix: on reestablishment, save new gNB DU UE ID, not RNTI 2023-11-08 10:18:52 +01:00
Robert Schmidt
3a5cff17d7 Combine rrc_gNB_process_initial_ul_rrc_message() and nr_rrc_gNB_decode_ccch() 2023-11-08 10:18:52 +01:00
Robert Schmidt
9a092c1433 Put rrcSetupRequest/rrcReestablishmentRequest handling in separate functions 2023-11-08 10:18:52 +01:00
Robert Schmidt
1153e62e45 Move rrc gNB DU handling to separate file 2023-11-08 10:18:52 +01:00
Robert Schmidt
c00b287c60 Remove RRC UE context printing that depends on DU
This code printed BW masks (what is this) and number of MIMO layers. It
was dependent on the current DU, and only showed the information for the
current DU config (SCS, band). On DU disconnect, it leads to segfaults
to this dependency, and IMO is not useful in itself (it could rather be
printed when receiving the UE capabilities, for all bands etc.).
2023-11-08 10:18:52 +01:00
Robert Schmidt
4c2bfe7a1f F1AP: send() functions take assoc_id
To allow to send F1 messages to multiple DUs from the CU, we need to
send these messages via different assoc_id (SCTP association ID,
basically akin to a file descriptor). Currently, the assoc_id is stored
in a context at the F1 module and retrieved in
f1ap_itti_send_sctp_data_req().

To facilitate a later change towards indicating (from the RRC) to which
assoc_id (hence, DU) to send a message, we refactor all
CU_send_*()/DU_send_*() functions to take the assoc_id as a parameter to
which to send messages. In this commit, we then pass the assoc_id from
the context. A later commit changes this (at the CU) to pass the
assoc_id from the message to be sent.
2023-11-08 10:18:52 +01:00
Robert Schmidt
474c3507f1 Allow DUs to reconnect to CU
Previous to this commit, the CU creates an F1 instance and initializes
GTP after a successful connection establishment, and tears the F1
instance down after the DU disconnects. This does not work when trying
to connect multiple DUs, or have them reconnect, as e.g., GTP
re-initialization fails (socket already bound).

This commit makes the CU F1 instance creation and GTP init at CU task
init (only once), and also frees the F1 instance only after the CU task
exits, which is at termination of the application, typically.
2023-11-08 10:18:52 +01:00
Robert Schmidt
05aefb9aaa Correctly read PCI in F1 Setup Response 2023-11-08 10:18:52 +01:00
Robert Schmidt
808b7684a8 F1AP: Remove commented code 2023-11-08 10:18:52 +01:00
Robert Schmidt
11df08a8f0 clang-format: RB_FOREACH is a for_each macro 2023-11-08 10:18:52 +01:00
Robert Schmidt
4ad7e9c5c0 Remove dead code in GTP
Remove dead code, result of 2136ceec0d: we
cannot connect() in GTP on multiple remotes (as then only packets of one
host might be received), but might need to send to multiple remote
sockets.
2023-11-08 10:18:52 +01:00
Rúben Soares da Silva
e6d3a367de Remove PRACH PDU Beamforming allocation from pack procedure, Assert if it has values != 0 2023-11-07 15:37:02 +00:00
Rúben Soares da Silva
f993b075f8 Change Prach PDU Beamforming allocation for pack/unpack procedures 2023-11-07 10:35:11 +00:00
Robert Schmidt
0a05622a20 Merge remote-tracking branch 'origin/Bugfix_NR_Band_n1' into integration_2023_w44 2023-11-06 15:01:32 +01:00
Robert Schmidt
dc7743c4e8 Merge remote-tracking branch 'origin/scan_build_arg_attr_null' into integration_2023_w44 2023-11-06 07:33:37 +01:00
Robert Schmidt
e1e8e10d91 Merge remote-tracking branch 'origin/NR_UE_handling_MCS_for_retransmission_v2' into integration_2023_w44 2023-11-06 07:33:28 +01:00
Robert Schmidt
31ed25acd7 Only print UE caps if DU available
The DU UE capability printing depends on data on SCS and band, which
currently is only stored with the DU. To avoid any assert, we check
that the DU is present. A follow-up commit will rework this.
2023-11-04 16:37:59 +01:00
Robert Schmidt
102cbf0d0c Prevent possible deadlock between scheduler and F1 UE ID 2023-11-04 16:37:59 +01:00
Robert Schmidt
230258370b Free F1 UE data struct only on UE release
Before this commit, as visible in the handler of an F1 UE release, it
can happen that we forward the RRC Release message to a UE and start the
release timer, while also removing the F1 UE data (containing e.g., the
CU UE ID). This can lead to asserts, since there might still be
subsequent traffic for such UE during a short time, while the DU does
not have the secondary UE ID stored anymore.

This commit changes the logic. It introduces function
nr_mac_release_ue() that removes the UE at MAC and RLC, frees the F1 UE
data (if applicable), and sends the complete, after timing expiry. If
the UE is out of sync, this function is used to free the UE immediately.

This fixes #685 and #698.
2023-11-04 16:34:46 +01:00
francescomani
629825aca6 taking into account PTRS in computing G 2023-11-03 10:39:13 +01:00
francescomani
d247abb53d code cleanup 2023-11-03 10:15:25 +01:00
francescomani
a05baa3c77 fixes to avoid double synchronization call 2023-11-03 10:01:53 +01:00
luis_pereira87
5b5b0f9595 Fix AssertFatal when using NR band n1 2023-11-02 18:41:17 +00:00
Sakthivel Velumani
3ae665388a Declare variable outside of case: label 2023-11-02 10:28:51 -04:00
Jaroslava Fiedlerova
fb1dc668e5 CI:AW2S - use updated AmariUE SW 2023-11-02 15:02:18 +01:00
Jaroslava Fiedlerova
3d63dc0a7e CI:AW2S - modifications to test with 10 UEs 2023-11-02 15:02:18 +01:00
Rúben Soares da Silva
c22fe2bab6 Fix PRACH PDU beamforming allocation to allocate at least 1 member, avoiding creating vector of size 0 2023-11-02 10:55:50 +00:00
Sakthivel Velumani
8f79b4aeed Remove redundant typedef 2023-11-01 21:13:20 -04:00
Sakthivel Velumani
128bd3d3db Create macro to ntoh_int16 buffer input 2023-11-01 21:13:20 -04:00
Sakthivel Velumani
21b269fa99 Create macro to do ntoh for 3 bytes
use it in NSSAI parsing function
2023-11-01 21:13:20 -04:00
Sakthivel Velumani
dc95e838eb Improve NSSAI parsing
use review suggestions from Laurent
2023-11-01 21:13:20 -04:00
Sakthivel Velumani
19551d1254 Remove extern declaration from .c 2023-11-01 21:13:20 -04:00
Sakthivel Velumani
950becb423 Store allowed NSSAIs from NAS message
Request default PDU session with first NSSAI from the list
2023-11-01 21:13:19 -04:00
Sakthivel Velumani
5f78fa6eed NGAP: put mcc, mnc, nssai inside new plmn struct 2023-10-31 16:12:15 -04:00
Sakthivel Velumani
f381e93237 Set NSSAI config in MAC
Each active LCID at MAC is configured with NSSAI that is sent from AMF with PDU session setup request
2023-10-31 16:12:10 -04:00
Sakthivel Velumani
2bf40fbd17 Pass the NSSAI config via F1 2023-10-31 13:31:33 -04:00
Sakthivel Velumani
89fa5a18a8 Pass the NSSAI config via E1 2023-10-31 13:31:32 -04:00
Sakthivel Velumani
279a55c976 Save NSSAI params from AMF
The NSSAI of PDU sessions coming from AMF are stored in RRC to be sent to lower layers
2023-10-31 12:41:50 -04:00
mir
6a1a17bcff Enhance message 2023-10-31 12:41:10 +01:00
mir
e0ff84f67c Scan build: Argument with 'nonnull' attribute passed null 2023-10-31 11:53:42 +01:00
francescomani
73244eae4d storing TBS and R at MAC instead of PHY 2023-10-20 18:00:34 +02:00
363 changed files with 38264 additions and 9816 deletions

View File

@@ -60,6 +60,8 @@ ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
- RB_FOREACH
- UE_iterator
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'

View File

@@ -193,6 +193,13 @@ if (SANITIZE_ADDRESS)
# wrong in the pthread library, or something subtly wrong in this CMakeLists.txt. Use Ubuntu 20.04 instead.
endif ()
add_boolean_option(SANITIZE_THREAD False "enable the address sanitizer (TSan)" ON)
if (SANITIZE_THREAD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -fno-common")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -fno-common")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")
endif()
add_boolean_option(SANITIZE_UNDEFINED False "enable the undefined behavior sanitizer (UBSan)" ON)
if (SANITIZE_UNDEFINED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all")
@@ -293,8 +300,8 @@ 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" CACHE STRING "The KPM SM version to use")
set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2" "KPM_V3")
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}")
@@ -463,19 +470,23 @@ add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
set (CONFIG_ROOTDIR ${OPENAIR_DIR}/common/config)
add_library(config_internals OBJECT
${CONFIG_ROOTDIR}/config_common.c
)
add_library(CONFIG_LIB
${CONFIG_ROOTDIR}/config_load_configmodule.c
${CONFIG_ROOTDIR}/config_userapi.c
${CONFIG_ROOTDIR}/config_cmdline.c
)
target_link_libraries(CONFIG_LIB PRIVATE config_internals dl UTIL)
# CONFIG_LIB is a wrapper around a particular config implementation, default is
# libconfig in params_libconfig below
pkg_check_modules(libconfig REQUIRED libconfig)
target_link_libraries(CONFIG_LIB PRIVATE dl UTIL)
add_library(params_libconfig MODULE ${CONFIG_ROOTDIR}/libconfig/config_libconfig.c)
target_include_directories(params_libconfig PRIVATE ${libconfig_INCLUDE_DIRS})
target_link_libraries(params_libconfig PRIVATE ${libconfig_LIBRARIES})
target_link_libraries(params_libconfig PRIVATE config_internals ${libconfig_LIBRARIES})
# shared library loader
add_library(shlib_loader OBJECT common/utils/load_module_shlib.c)
@@ -483,20 +494,21 @@ target_link_libraries(shlib_loader PRIVATE CONFIG_LIB)
##########################################################
# LDPC offload library
# LDPC offload library - AMD T2 Accelerator Card
##########################################################
add_boolean_option(ENABLE_LDPC_T1 OFF "Build support for LDPC Offload to T1 library" OFF)
if (ENABLE_LDPC_T1)
pkg_check_modules(LIBDPDK_T1 REQUIRED libdpdk=20.05.0)
find_library(T1 NAMES rte_pmd_hpac_sdfec_pmd REQUIRED)
if (NOT T1)
message(FATAL_ERROR "Library rte_pmd_hpac_sdfec_pmd for T1 offload not found")
add_boolean_option(ENABLE_LDPC_T2 OFF "Build support for LDPC Offload to T2 library" OFF)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/x86_64-linux-gnu/pkgconfig")
if (ENABLE_LDPC_T2)
pkg_check_modules(LIBDPDK_T2 REQUIRED libdpdk=20.11.7)
find_library(PMD_T2 NAMES rte_baseband_accl_ldpc HINTS "/opt/dpdk-t2/lib/x86_64-linux-gnu/")
if (NOT PMD_T2)
message(FATAL_ERROR "could not find PMD T2")
endif()
add_library(ldpc_t1 MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
set_target_properties(ldpc_t1 PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
target_compile_options(ldpc_t1 PRIVATE ${LIBDPDK_T1_CFLAGS})
target_link_libraries(ldpc_t1 ${LIBDPDK_T1_LDFLAGS} ${T1})
message(STATUS "T2 build: use ${PMD_T2}")
add_library(ldpc_t2 MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
set_target_properties(ldpc_t2 PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
target_link_libraries(ldpc_t2 ${LIBDPDK_T2_LDFLAGS} ${PMD_T2})
endif()
##########################################################
@@ -808,19 +820,30 @@ set(PHY_LDPC_ORIG_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
)
add_library(ldpc_orig MODULE ${PHY_LDPC_ORIG_SRC} )
target_link_libraries(ldpc_orig PRIVATE ldpc_gen_HEADERS)
set(PHY_LDPC_OPTIM_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c
)
)
add_library(ldpc_optim MODULE ${PHY_LDPC_OPTIM_SRC} )
target_link_libraries(ldpc_optim PRIVATE ldpc_gen_HEADERS)
set(PHY_LDPC_OPTIM8SEG_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
)
add_library(ldpc_optim8seg MODULE ${PHY_LDPC_OPTIM8SEG_SRC} )
target_link_libraries(ldpc_optim8seg PRIVATE ldpc_gen_HEADERS)
set(PHY_LDPC_OPTIM8SEGMULTI_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
)
)
add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
target_link_libraries(ldpc PRIVATE ldpc_gen_HEADERS)
set(PHY_LDPC_CUDA_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
@@ -834,21 +857,13 @@ add_custom_target( nrLDPC_decoder_kernels_CL
COMMAND gcc ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c -dD -DNRLDPC_KERNEL_SOURCE -E -o ${CMAKE_CURRENT_BINARY_DIR}/nrLDPC_decoder_kernels_CL.clc
SOURCES ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c
)
set(PHY_NR_CODINGIF
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_load.c;
)
add_library(ldpc_orig MODULE ${PHY_LDPC_ORIG_SRC} )
target_link_libraries(ldpc_orig PRIVATE ldpc_gen_HEADERS)
add_library(ldpc_optim MODULE ${PHY_LDPC_OPTIM_SRC} )
target_link_libraries(ldpc_optim PRIVATE ldpc_gen_HEADERS)
add_library(ldpc_optim8seg MODULE ${PHY_LDPC_OPTIM8SEG_SRC} )
target_link_libraries(ldpc_optim8seg PRIVATE ldpc_gen_HEADERS)
add_library(ldpc_cl MODULE ${PHY_LDPC_CL_SRC} )
target_link_libraries(ldpc_cl OpenCL)
add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL)
set(PHY_NR_CODINGIF
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_load.c
)
##############################################
# Base CUDA setting
@@ -866,13 +881,6 @@ if (ENABLE_LDPC_CUDA)
endif()
endif()
add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
target_link_libraries(ldpc PRIVATE ldpc_gen_HEADERS)
add_library(ldpc_parityCheck MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
target_compile_definitions(ldpc_parityCheck PUBLIC NR_LDPC_ENABLE_PARITY_CHECK)
target_link_libraries(ldpc_parityCheck PRIVATE ldpc_gen_HEADERS)
add_library(coding MODULE ${PHY_TURBOSRC} )
add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts_neon.c)
@@ -1271,7 +1279,6 @@ set(L2_NR_SRC
${NR_SDAP_SRC}
${NR_RRC_DIR}/rrc_gNB.c
${NR_RRC_DIR}/nr_rrc_common.c
${NR_RRC_DIR}/L2_nr_interface.c
${NR_RRC_DIR}/mac_rrc_dl_direct.c
${NR_RRC_DIR}/mac_rrc_dl_f1ap.c
${NR_RRC_DIR}/nr_rrc_config.c
@@ -1282,6 +1289,7 @@ set(L2_NR_SRC
${NR_RRC_DIR}/rrc_gNB_NGAP.c
${NR_RRC_DIR}/rrc_gNB_radio_bearers.c
${NR_RRC_DIR}/rrc_gNB_cuup.c
${NR_RRC_DIR}/rrc_gNB_du.c
)
set(L2_SRC_UE
@@ -1358,6 +1366,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}/slicing/nr_slicing.c
)
@@ -1879,8 +1888,6 @@ set (SIMUSRC
)
add_library(SIMU STATIC ${SIMUSRC} )
target_include_directories(SIMU PUBLIC ${OPENAIR1_DIR}/SIMULATION/TOOLS ${OPENAIR1_DIR}/SIMULATION/RF)
target_link_libraries(SIMU PRIVATE ${blas_LIBRARIES} ${cblas_LIBRARIES} ${lapacke_LIBRARIES})
target_include_directories(SIMU PRIVATE ${blas_INCLUDE_DIRS} ${lapacke_INCLUDE_DIRS})
# Qt-based scope
add_boolean_option(ENABLE_NRQTSCOPE OFF "Build the Qt-Scope" OFF)
@@ -2081,8 +2088,8 @@ endif()
add_dependencies(nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc)
if (ENABLE_LDPC_T1)
add_dependencies(nr-softmodem ldpc_t1)
if (ENABLE_LDPC_T2)
add_dependencies(nr-softmodem ldpc_t2)
endif()
# force the generation of ASN.1 so that we don't need to wait during the build
@@ -2203,12 +2210,12 @@ add_executable(ldpctest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
)
add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc ldpc_parityCheck)
add_dependencies(ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc)
if (ENABLE_LDPC_CUDA)
add_dependencies(ldpctest ldpc_cuda)
endif()
target_link_libraries(ldpctest PRIVATE
-Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON -Wl,--end-group
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON -Wl,--end-group
m pthread dl shlib_loader ${T_LIB}
)
@@ -2298,8 +2305,8 @@ add_executable(nr_ulsim
${PHY_INTERFACE_DIR}/queue_t.c
)
if (ENABLE_LDPC_T1)
add_dependencies(nr_ulsim ldpc_t1)
if (ENABLE_LDPC_T2)
add_dependencies(nr_ulsim ldpc_t2)
endif()
target_link_libraries(nr_ulsim PRIVATE
@@ -2367,7 +2374,7 @@ if (${T_TRACER})
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_UE_NR ngap
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU SIMU_ETH OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts)
ldpc_orig ldpc_optim ldpc_optim8seg ldpc_t2 ldpc_cl ldpc_cuda ldpc dfts config_internals)
if (TARGET ${i})
add_dependencies(${i} generate_T)
endif()

View File

@@ -49,75 +49,75 @@ adb_ue_2:
amarisoft_ue:
Host: amariue
InitScript: /root/2023-06-10/lteue-linux-2023-06-10/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-multi-20897-2x2.cfg &
TermScript: /root/2023-06-10/libs/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
InitScript: /root/lteue-linux-2023-10-27/ue/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-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
amarisoft_ue_1:
Host: amariue
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":1}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":1}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":2}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":2}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":3}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":3}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":4}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":4}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":5}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":5}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":6}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":6}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":7}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":7}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":8}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":8}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":9}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":9}'
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}'
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-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":10}'
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":10}'
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}'
NetworkScript: ip netns exec ue10 ip a show dev pdn0
CmdPrefix: ip netns exec ue10
MTU: 1500

View File

@@ -58,7 +58,7 @@ import cls_oaicitest
# Helper functions used here and in other classes
# (e.g., cls_cluster.py)
#-----------------------------------------------------------
IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue']
IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue', 'oai-gnb-asan', 'oai-nr-ue-asan', 'oai-nr-cuup-asan']
def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTargetBranch, ranAllowMerge):
if ranCommitID == '':
@@ -364,25 +364,30 @@ class Containerize():
self.cliBuildOptions = '--no-cache --disable-compression'
# we always build the ran-build image with all targets
imageNames = [('ran-build', 'build')]
# Creating a tupple with the imageName, the DockerFile prefix pattern, targetName and sanitized option
imageNames = [('ran-build', 'build', 'ran-build', '')]
result = re.search('eNB', self.imageKind)
# Creating a tupple with the imageName and the DockerFile prefix pattern on obelix
if result is not None:
imageNames.append(('oai-enb', 'eNB'))
imageNames.append(('oai-enb', 'eNB', 'oai-enb', ''))
result = re.search('gNB', self.imageKind)
if result is not None:
imageNames.append(('oai-gnb', 'gNB'))
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb', ''))
result = re.search('all', self.imageKind)
if result is not None:
imageNames.append(('oai-enb', 'eNB'))
imageNames.append(('oai-gnb', 'gNB'))
imageNames.append(('oai-nr-cuup', 'nr-cuup'))
imageNames.append(('oai-lte-ue', 'lteUE'))
imageNames.append(('oai-nr-ue', 'nrUE'))
imageNames.append(('oai-enb', 'eNB', 'oai-enb', ''))
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb', ''))
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup', ''))
imageNames.append(('oai-lte-ue', 'lteUE', 'oai-lte-ue', ''))
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue', ''))
if self.host == 'Red Hat':
imageNames.append(('oai-physim', 'phySim'))
imageNames.append(('oai-physim', 'phySim', 'oai-physim', ''))
if self.host == 'Ubuntu':
imageNames.append(('oai-lte-ru', 'lteRU'))
imageNames.append(('oai-lte-ru', 'lteRU', 'oai-lte-ru', ''))
# Building again the 5G images with Address Sanitizer
imageNames.append(('ran-build', 'build', 'ran-build-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
result = re.search('build_cross_arm64', self.imageKind)
if result is not None:
self.dockerfileprefix = '.ubuntu20.cross-arm64'
@@ -421,8 +426,8 @@ class Containerize():
cmd.run(f"{self.cli} image prune --force")
if forceBaseImageBuild:
cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}")
for image,pattern in imageNames:
cmd.run(f"{self.cli} image rm {image}:{imageTag}")
for image,pattern,name,option in imageNames:
cmd.run(f"{self.cli} image rm {name}:{imageTag}")
# Build the base image only on Push Events (not on Merge Requests)
# On when the base image docker file is being modified.
@@ -460,46 +465,50 @@ class Containerize():
# Build the target image(s)
status = True
attemptedImages = ['ran-base']
for image,pattern in imageNames:
attemptedImages += [image]
for image,pattern,name,option in imageNames:
attemptedImages += [name]
# the archived Dockerfiles have "ran-base:latest" as base image
# we need to update them with proper tag
cmd.run(f'git checkout -- docker/Dockerfile.{pattern}{self.dockerfileprefix}')
cmd.run(f'sed -i -e "s#{baseImage}:latest#{baseImage}:{baseTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
if image != 'ran-build':
# target images should use the proper ran-build image
if image != 'ran-build' and "-asan" in name:
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build-asan:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
elif image != 'ran-build':
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {image}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} . > cmake_targets/log/{image}.log 2>&1', timeout=1200)
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 == 'ran-build' and ret.returncode == 0:
cmd.run(f"docker run --name test-log -d {image}:{imageTag} /bin/true")
cmd.run(f"docker cp test-log:/oai-ran/cmake_targets/log/ cmake_targets/log/{image}/")
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}/")
cmd.run(f"docker rm -f test-log")
else:
cmd.run(f"mkdir -p cmake_targets/log/{image}")
cmd.run(f"mkdir -p cmake_targets/log/{name}")
# check the status of the build
ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {image}:{imageTag}")
ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {name}:{imageTag}")
if ret.returncode != 0:
logging.error('\u001B[1m Could not build properly ' + image + '\u001B[0m')
logging.error('\u001B[1m Could not build properly ' + name + '\u001B[0m')
status = False
# Here we should check if the last container corresponds to a failed command and destroy it
cmd.run(f"{self.cli} ps --quiet --filter \"status=exited\" -n1 | xargs --no-run-if-empty {self.cli} rm -f")
allImagesSize[image] = 'N/A -- Build Failed'
allImagesSize[name] = 'N/A -- Build Failed'
break
else:
result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', cmd.getBefore())
if result is not None:
size = float(result.group("size")) / 1000000 # convert to MB
imageSizeStr = f'{size:.1f}'
logging.debug(f'\u001B[1m {image} size is {imageSizeStr} Mbytes\u001B[0m')
allImagesSize[image] = f'{imageSizeStr} Mbytes'
logging.debug(f'\u001B[1m {name} size is {imageSizeStr} Mbytes\u001B[0m')
allImagesSize[name] = f'{imageSizeStr} Mbytes'
else:
logging.debug(f'{image} size is unknown')
allImagesSize[image] = 'unknown'
logging.debug(f'{name} size is unknown')
allImagesSize[name] = 'unknown'
# Now pruning dangling images in between target builds
cmd.run(f"{self.cli} image prune --force")
# Remove all intermediate build images and clean up
if self.ranAllowMerge and forceBaseImageBuild:
cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}")
cmd.run(f"{self.cli} image rm ran-build:{imageTag}")
cmd.run(f"{self.cli} image rm ran-build:{imageTag} ran-build-asan:{imageTag}")
cmd.run(f"{self.cli} volume prune --force")
# create a zip with all logs
@@ -698,10 +707,11 @@ class Containerize():
orgTag = 'develop'
if self.ranAllowMerge:
orgTag = 'ci-temp'
imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup']
for image in imageNames:
for image in IMAGES:
tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
mySSH.command(f'docker image tag {image}:{orgTag} {imagePrefix}/{tagToUse}', '\$', 5)
if re.search('Error response from daemon: No such image:', mySSH.getBefore()) is not None:
continue
mySSH.command(f'docker push {imagePrefix}/{tagToUse}', '\$', 120)
if re.search(': digest:', mySSH.getBefore()) is None:
logging.debug(mySSH.getBefore())
@@ -1061,6 +1071,16 @@ class Containerize():
imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup']
for image in imageNames:
tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
# In the scenario, for 5G images, we have the choice of either pulling normal images
# or -asan images. We need to detect which kind we did pull.
if image == 'oai-gnb' or image == 'oai-nr-ue' or image == 'oai-nr-cuup':
ret = myCmd.run(f'docker image inspect oai-ci/{tagToUse}', reportNonZero=False, silent=self.displayedNewTags)
if ret.returncode != 0:
tagToUse = tagToUse.replace('oai-gnb', 'oai-gnb-asan')
tagToUse = tagToUse.replace('oai-nr-ue', 'oai-nr-ue-asan')
tagToUse = tagToUse.replace('oai-nr-cuup', 'oai-nr-cuup-asan')
if not self.displayedNewTags:
logging.debug(f'\u001B[1m Using sanitized version of {image} with {tagToUse}\u001B[0m')
cmd = f'sed -i -e "s@oaisoftwarealliance/{image}:develop@oai-ci/{tagToUse}@" docker-compose-ci.yml'
myCmd.run(cmd, silent=self.displayedNewTags)
self.displayedNewTags = True
@@ -1199,12 +1219,7 @@ class Containerize():
logPath = '../cmake_targets/log/' + ymlPath[1]
myCmd = cls_cmd.LocalCmd(d = self.yamlPath[0])
cmd = 'cp docker-compose.y*ml docker-compose-ci.yml'
myCmd.run(cmd, silent=self.displayedNewTags)
for image in IMAGES:
tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
cmd = f'sed -i -e "s@oaisoftwarealliance/{image}:develop@oai-ci/{tagToUse}@" docker-compose-ci.yml'
myCmd.run(cmd, silent=self.displayedNewTags)
self.displayedNewTags = True
myCmd.run(cmd)
# check which containers are running for log recovery later
cmd = 'docker-compose -f docker-compose-ci.yml ps --all'
@@ -1245,7 +1260,7 @@ class Containerize():
fullStatus = True
if anyLogs:
# Analyzing log file(s)!
listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du']
listOfPossibleRanContainers = ['enb*', 'gnb*', 'cu*', 'du*']
for container in listOfPossibleRanContainers:
filenames = './*-oai-' + container + '.log'
cmd = f'ls {filenames}'

View File

@@ -75,15 +75,11 @@ security = {
drb_ciphering = "yes";
drb_integrity = "no";
};
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="debug";
pdcp_log_level ="info";
rrc_log_level ="info";
f1ap_log_level ="debug";
ngap_log_level ="debug";
};
log_config : {
global_log_level = "info";
pdcp_log_level = "info";
rrc_log_level = "info";
f1ap_log_level = "info";
ngap_log_level = "info";
};

View File

@@ -78,12 +78,8 @@ security = {
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="debug";
pdcp_log_level ="info";
rrc_log_level ="info";
f1ap_log_level ="debug";
ngap_log_level ="debug";
f1ap_log_level ="info";
ngap_log_level ="info";
};

View File

@@ -8,6 +8,7 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_CU_UP_ID = 0xe00;
# cell_type = "CELL_MACRO_GNB";

View File

@@ -8,6 +8,7 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_CU_UP_ID = 0xe00;
# cell_type = "CELL_MACRO_GNB";

View File

@@ -7,6 +7,7 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_DU_ID = 0xe00;
# cell_type = "CELL_MACRO_GNB";
@@ -217,7 +218,7 @@ THREAD_STRUCT = (
rfsimulator: {
serveraddr = "server";
serverport = "4043";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"

View File

@@ -0,0 +1,218 @@
Active_gNBs = ( "gNB-Eurecom-DU");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
gNBs =
(
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_DU_ID = 0xe00;
# cell_type = "CELL_MACRO_GNB";
gNB_name = "gNB-Eurecom-DU";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
plmn_list = ({ mcc = 222; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1, sd = 0xffffff }) });
nr_cellid = 12345678L;
////////// Physical parameters:
min_rxtxtime = 6;
servingCellConfigCommon = (
{
#spCellConfigCommon
physCellId = 0;
# downlinkConfigCommon
#frequencyInfoDL
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 423130;
dl_frequencyBand = 1;
# this is 3600 MHz
dl_absoluteFrequencyPointA = 422194;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_subcarrierSpacing = 0;
dl_carrierBandwidth = 52;
#initialDownlinkBWP
#genericParameters
# this is RBstart=27,L=48 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 14025; # 6366 12925 12956 28875 12952
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 0;
#pdcch-ConfigCommon
initialDLBWPcontrolResourceSetZero = 7;
initialDLBWPsearchSpaceZero = 0;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 1;
ul_absoluteFrequencyPointA = 384194;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
ul_subcarrierSpacing = 0;
ul_carrierBandwidth = 52;
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 14025;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 0;
#rach-ConfigCommon
#rach-ConfigGeneric
prach_ConfigurationIndex = 98;
#prach_msg1_FDM
#0 = one, 1=two, 2=four, 3=eight
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 0;
zeroCorrelationZoneConfig = 12;
preambleReceivedTargetPower = -90;
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
preambleTransMax = 6;
#powerRampingStep
# 0=dB0,1=dB2,2=dB4,3=dB6
powerRampingStep = 1;
#ra_ReponseWindow
#1,2,4,8,10,20,40,80
ra_ResponseWindow = 4;
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
#oneHalf (0..15) 4,8,12,16,...60,64
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
#ra_ContentionResolutionTimer
#(0..7) 8,16,24,32,40,48,56,64
ra_ContentionResolutionTimer = 7;
rsrp_ThresholdSSB = 19;
#prach-RootSequenceIndex_PR
#1 = 839, 2 = 139
prach_RootSequenceIndex_PR = 2;
prach_RootSequenceIndex = 1;
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
#
msg1_SubcarrierSpacing = 0,
# restrictedSetConfig
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
# pucch-ConfigCommon setup :
# pucchGroupHopping
# 0 = neither, 1= group hopping, 2=sequence hopping
pucchGroupHopping = 0;
hoppingId = 40;
p0_nominal = -70;
n_TimingAdvanceOffset = 0;
# ssb_PositionsInBurs_BitmapPR
# 1=short, 2=medium, 3=long
ssb_PositionsInBurst_PR = 2;
ssb_PositionsInBurst_Bitmap = 1;
# ssb_periodicityServingCell
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
ssb_periodicityServingCell = 2;
# dmrs_TypeA_position
# 0 = pos2, 1 = pos3
dmrs_TypeA_Position = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
subcarrierSpacing = 0;
#tdd-UL-DL-ConfigurationCommon
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
referenceSubcarrierSpacing = 0;
ssPBCH_BlockPower = -25;
}
);
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
}
);
MACRLCs = (
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "f1";
local_n_if_name = "eth0";
local_n_address = "192.168.68.195";
remote_n_address = "192.168.68.194";
local_n_portc = 500;
local_n_portd = 2153;
remote_n_portc = 501;
remote_n_portd = 2153;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
}
);
L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
prach_dtx_threshold = 200;
pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
RUs = (
{
local_rf = "yes"
nb_tx = 1
nb_rx = 1
# The higher att for TX than RX is because we use a circulator (as for TDD),
# while we should use a duplexer in the FDD case. However, it uses the same setup.
att_tx = 18
att_rx = 0;
bands = [1];
max_pdschReferenceSignalPower = -27;
max_rxgain = 108;
eNB_instances = [0];
#beamforming 1x4 matrix:
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
clock_src = "internal";
}
);
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config : {
global_log_level = "info";
};

View File

@@ -7,6 +7,7 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_DU_ID = 0xe00;
# cell_type = "CELL_MACRO_GNB";
@@ -217,21 +218,17 @@ THREAD_STRUCT = (
);
rfsimulator: {
serveraddr = "server";
serverport = "4043";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
}
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="info";
pdcp_log_level ="info";
rrc_log_level ="info";
f1ap_log_level ="debug";
ngap_log_level ="debug";
};
log_config: {
global_log_level = "info";
hw_log_level = "info";
phy_log_level = "info";
mac_log_level = "info";
rlc_log_level = "info";
f1ap_log_level = "info";
};

View File

@@ -7,6 +7,7 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_DU_ID = 0xe00;
# cell_type = "CELL_MACRO_GNB";

View File

@@ -63,6 +63,7 @@ gNBs =
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
initialDLBWPcontrolResourceSetZero = 0;
#rach-ConfigCommon
#rach-ConfigGeneric
prach_ConfigurationIndex = 98;

View File

@@ -230,7 +230,7 @@ THREAD_STRUCT = (
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";

View File

@@ -240,7 +240,7 @@ THREAD_STRUCT = (
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";

View File

@@ -220,7 +220,7 @@ RUs = (
att_rx = 0;
bands = [78];
max_pdschReferenceSignalPower = -27;
max_rxgain = 75;
max_rxgain = 65;
eNB_instances = [0];
##beamforming 1x2 matrix: 1 layer x 2 antennas
bf_weights = [0x00007fff, 0x0000];

View File

@@ -232,7 +232,7 @@ THREAD_STRUCT = (
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";

View File

@@ -75,7 +75,7 @@ gNBs =
initialULBWPsubcarrierSpacing = 1;
#rach-ConfigCommon
#rach-ConfigGeneric
prach_ConfigurationIndex = 98;
prach_ConfigurationIndex = 100;
#prach_msg1_FDM
#0 = one, 1=two, 2=four, 3=eight
prach_msg1_FDM = 0;

View File

@@ -230,7 +230,7 @@ THREAD_STRUCT = (
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";

View File

@@ -229,7 +229,7 @@ THREAD_STRUCT = (
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";

View File

@@ -8,7 +8,7 @@ ColNames :
- Average vs Reference Deviation (Reference Value; Acceptability Threshold)
Ref :
feprx : 84.0
feptx_prec : 11.0
feptx_prec : 14.0
feptx_ofdm : 35.0
feptx_total : 100.0
L1 Tx processing : 400.0

View File

@@ -43,7 +43,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-cuup oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-cuup-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000020">

View File

@@ -32,9 +32,8 @@
000022
000023
000024
000025
020021
020022
030021
100021
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
@@ -43,7 +42,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000020">
@@ -72,33 +71,33 @@
<testCase id="000023">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G DU RF sim SA</desc>
<desc>Deploy 3 OAI 5G DUs RF sim SA</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<services>oai-du</services>
<nb_healthy>8</nb_healthy>
<services>oai-du oai-du2 oai-du3</services>
<nb_healthy>10</nb_healthy>
</testCase>
<testCase id="000024">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<services>oai-nr-ue</services>
<nb_healthy>9</nb_healthy>
<services>oai-nr-ue oai-nr-ue2</services>
<nb_healthy>12</nb_healthy>
</testCase>
<testCase id="000025">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<services>oai-nr-ue3</services>
<nb_healthy>13</nb_healthy>
</testCase>
<testCase id="020021">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<ping_args> -c 20 192.168.72.135</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
<testCase id="020022">
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<ping_args>-c 20 12.1.1.2</ping_args>
<desc>Ping ext-dn from all NR-UEs</desc>
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3</id>
<ping_args> -c 20 192.168.72.135 -i0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>

View File

@@ -44,7 +44,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000010">

View File

@@ -45,7 +45,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000000">

View File

@@ -58,7 +58,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000000">

View File

@@ -44,7 +44,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000000">

View File

@@ -44,7 +44,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000000">

View File

@@ -43,7 +43,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="004000">

View File

@@ -41,7 +41,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="004000">

View File

@@ -41,7 +41,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="004000">

View File

@@ -44,7 +44,7 @@
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000000">

View File

@@ -35,6 +35,11 @@
002003
002004
002005
002006
002007
002008
002009
002010
000100
000010
000020
@@ -97,12 +102,42 @@
<id>amarisoft_ue_5</id>
</testCase>
<testCase id="002006">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_6</id>
</testCase>
<testCase id="002007">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_7</id>
</testCase>
<testCase id="002008">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_8</id>
</testCase>
<testCase id="002009">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_9</id>
</testCase>
<testCase id="002010">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_10</id>
</testCase>
<testCase id="000010">
<class>Iperf</class>
<desc>iperf (DL/20Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<iperf_args>-u -b 60M -t 30 -i 1 -R</iperf_args>
<desc>iperf (DL/7Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<iperf_args>-u -b 70M -t 30 -i 1 -R</iperf_args>
<direction>IPERF3</direction>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3</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</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
<iperf_profile>balanced</iperf_profile>
@@ -110,10 +145,10 @@
<testCase id="000020">
<class>Iperf</class>
<desc>iperf (UL/5Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<iperf_args>-u -b 15M -t 30 -i 1 </iperf_args>
<desc>iperf (UL/2Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<iperf_args>-u -b 20M -t 30 -i 1 </iperf_args>
<direction>IPERF3</direction>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3</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</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
<iperf_profile>balanced</iperf_profile>
@@ -122,7 +157,7 @@
<testCase id="000100">
<class>Ping</class>
<desc>Ping: 20pings in 20sec, multi-ue</desc>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5</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</id>
<ping_args>-c 20 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>25</ping_rttavg_threshold>
@@ -131,7 +166,7 @@
<testCase id="000200">
<class>Ping</class>
<desc>Ping: 100pings in 20sec, multi-ue</desc>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5</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</id>
<ping_args>-c 100 -i 0.2 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>30</ping_rttavg_threshold>
@@ -140,7 +175,7 @@
<testCase id="003000">
<class>Detach_UE</class>
<desc>Detach UE</desc>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5</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</id>
</testCase>
<testCase id="004000">

View File

@@ -22,7 +22,7 @@
-->
<testCaseList>
<htmlTabRef>TEST-SA-FR1-F1-B200</htmlTabRef>
<htmlTabName>40 MHz TDD F1 SA</htmlTabName>
<htmlTabName>10 MHz FDD F1 SA</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
@@ -89,11 +89,11 @@
<testCase id="130102">
<class>Deploy_Object</class>
<desc>Deploy gNB-DU (TDD/Band78/40MHz/B200) in a container</desc>
<desc>Deploy gNB-DU (FDD/Band1/10MHz/B200) in a container</desc>
<yaml_path>ci-scripts/yaml_files/sa_f1_b200_gnb</yaml_path>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<services>gnb_du_tdd</services>
<services>gnb_du_fdd</services>
</testCase>
<testCase id="100000">
@@ -159,8 +159,8 @@
<testCase id="170000">
<class>Iperf</class>
<desc>iperf (DL/80Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 80M -t 30 -i 1 -fm</iperf_args>
<desc>iperf (DL/50Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 50M -t 30 -i 1 -fm</iperf_args>
<direction>DL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>10</iperf_packetloss_threshold>
@@ -170,8 +170,8 @@
<testCase id="170001">
<class>Iperf</class>
<desc>iperf (UL/8Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 8M -t 30 -i 1 -fm</iperf_args>
<desc>iperf (UL/25Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 25M -t 30 -i 1 -fm</iperf_args>
<direction>UL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
@@ -181,8 +181,8 @@
<testCase id="170002">
<class>Iperf</class>
<desc>iperf (BIDIR TCP)(20 sec)(single-ue profile)</desc>
<iperf_args>-t 20 --bidir</iperf_args>
<desc>iperf (BIDIR TCP)(60 sec)(single-ue profile)</desc>
<iperf_args>-t 60 --bidir</iperf_args>
<direction>BIDIR</direction>
<id>idefix</id>
<iperf_profile>single-ue</iperf_profile>

View File

@@ -35,7 +35,7 @@
<mode>TesteNB</mode>
<class>Build_eNB</class>
<desc>Build gNB (USRP)</desc>
<Build_eNB_args>--gNB -w USRP --ninja -c -P --build-lib "ldpc_cuda ldpc_t1" --cmake-opt -DASN1C_EXEC=/opt/asn1c/bin/asn1c</Build_eNB_args>
<Build_eNB_args>--gNB -w USRP --ninja -c -P --build-lib "ldpc_cuda" --cmake-opt -DASN1C_EXEC=/opt/asn1c/bin/asn1c</Build_eNB_args>
<forced_workspace_cleanup>True</forced_workspace_cleanup>
</testCase>

View File

@@ -1,102 +0,0 @@
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>test-t1-offload</htmlTabRef>
<htmlTabName>Test T1 Offload</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>000111 000112 000121 000122 000131 000132 000211 000212 000221 000222 000231 000232</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000111">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with CPU</desc>
<physim_run_args>-n100 -s30 -m5 -r106 -R106 -C10 -P</physim_run_args>
</testCase>
<testCase id="000112">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with T1 LDPC offload</desc>
<physim_run_args>-n100 -s30 -m5 -r106 -R106 -o -P</physim_run_args>
</testCase>
<testCase id="000121">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with CPU</desc>
<physim_run_args>-n100 -s30 -m15 -r106 -R106 -C10 -P</physim_run_args>
</testCase>
<testCase id="000122">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with T1 LDPC offload</desc>
<physim_run_args>-n100 -s30 -m15 -r106 -R106 -o -P</physim_run_args>
</testCase>
<testCase id="000131">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with CPU</desc>
<physim_run_args>-n100 -s30 -m25 -r106 -R106 -C10 -P</physim_run_args>
</testCase>
<testCase id="000132">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with T1 LDPC offload</desc>
<physim_run_args>-n100 -s30 -m25 -r106 -R106 -o -P</physim_run_args>
</testCase>
<testCase id="000211">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with CPU</desc>
<physim_run_args>-n100 -s30 -m5 -r273 -R273 -C10 -P</physim_run_args>
</testCase>
<testCase id="000212">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with T1 LDPC offload</desc>
<physim_run_args>-n100 -s30 -m5 -r273 -R273 -o -P</physim_run_args>
</testCase>
<testCase id="000221">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with CPU</desc>
<physim_run_args>-n100 -s30 -m15 -r273 -R273 -C10 -P</physim_run_args>
</testCase>
<testCase id="000222">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with T1 LDPC offload</desc>
<physim_run_args>-n100 -s30 -m15 -r273 -R273 -o -P</physim_run_args>
</testCase>
<testCase id="000231">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with CPU</desc>
<physim_run_args>-n100 -s30 -m25 -r273 -R273 -C10 -P</physim_run_args>
</testCase>
<testCase id="000232">
<class>Run_LDPCt1Test</class>
<desc>Run nr_ulsim with T1 LDPC offload</desc>
<physim_run_args>-n100 -s30 -m25 -r273 -R273 -o -P</physim_run_args>
</testCase>
</testCaseList>

View File

@@ -168,6 +168,7 @@ services:
container_name: rfsim5g-oai-cu
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-ext-dn
networks:
@@ -186,6 +187,7 @@ services:
container_name: rfsim5g-oai-du
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-cu
networks:
@@ -198,12 +200,51 @@ services:
interval: 10s
timeout: 5s
retries: 5
oai-du2:
image: oaisoftwarealliance/oai-gnb:develop
privileged: true
container_name: rfsim5g-oai-du2
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --gNBs.[0].gNB_DU_ID 0xe01 --gNBs.[0].nr_cellid 87654321 --gNBs.[0].servingCellConfigCommon.[0].physCellId 1 --MACRLCs.[0].local_n_address 192.168.71.143 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-cu
networks:
public_net:
ipv4_address: 192.168.71.143
volumes:
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
timeout: 5s
retries: 5
oai-du3:
image: oaisoftwarealliance/oai-gnb:develop
privileged: true
container_name: rfsim5g-oai-du3
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --gNBs.[0].gNB_DU_ID 0xe02 --gNBs.[0].nr_cellid 11111111 --gNBs.[0].servingCellConfigCommon.[0].physCellId 2 --MACRLCs.[0].local_n_address 192.168.71.144 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-cu
networks:
public_net:
ipv4_address: 192.168.71.144
volumes:
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
timeout: 5s
retries: 5
oai-nr-ue:
image: oaisoftwarealliance/oai-nr-ue:develop
privileged: true
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.serveraddr 192.168.71.142 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-du
networks:
@@ -216,6 +257,44 @@ services:
interval: 10s
timeout: 5s
retries: 5
oai-nr-ue2:
image: oaisoftwarealliance/oai-nr-ue:develop
privileged: true
container_name: rfsim5g-oai-nr-ue2
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3619200000 --rfsimulator.serveraddr 192.168.71.143 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-du2
networks:
public_net:
ipv4_address: 192.168.71.151
volumes:
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
healthcheck:
test: /bin/bash -c "pgrep nr-uesoftmodem"
interval: 10s
timeout: 5s
retries: 5
oai-nr-ue3:
image: oaisoftwarealliance/oai-nr-ue:develop
privileged: true
container_name: rfsim5g-oai-nr-ue3
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3619200000 --rfsimulator.serveraddr 192.168.71.144 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-du3
networks:
public_net:
ipv4_address: 192.168.71.152
volumes:
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
healthcheck:
test: /bin/bash -c "pgrep nr-uesoftmodem"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net:

File diff suppressed because one or more lines are too long

View File

@@ -168,6 +168,7 @@ services:
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-ext-dn
networks:
@@ -186,6 +187,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 --band 66 -C 2169090000 --CO -400000000 --ssb 378 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:

View File

@@ -170,6 +170,7 @@ services:
environment:
TZ: Europe/Paris
USE_ADDITIONAL_OPTIONS: --sa --nfapi VNF --emulate-l1 --log_config.global_log_options level,time,thread_id,nocolor
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-spgwu
- oai-amf
@@ -206,6 +207,7 @@ services:
TZ: Europe/Paris
OPENAIR_DIR: /opt/oai-nr-ue
USE_ADDITIONAL_OPTIONS: --nfapi STANDALONE_PNF --node-number 2 --sa --emulate-l1 --log_config.global_log_options level,time,thread_id,nocolor
ASAN_OPTIONS: detect_leaks=0
volumes:
- ../../conf_files/nrue.band78.106prb.l2sim.conf:/opt/oai-nr-ue/etc/nr-ue.conf
- ../../../openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results:/opt/oai-nr-ue/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results

View File

@@ -168,6 +168,7 @@ services:
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-ext-dn
networks:
@@ -186,6 +187,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -204,6 +206,7 @@ services:
container_name: rfsim5g-oai-nr-ue2
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -222,6 +225,7 @@ services:
container_name: rfsim5g-oai-nr-ue3
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -240,6 +244,7 @@ services:
container_name: rfsim5g-oai-nr-ue4
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001103 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -258,6 +263,7 @@ services:
container_name: rfsim5g-oai-nr-ue5
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001104 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -276,6 +282,7 @@ services:
container_name: rfsim5g-oai-nr-ue6
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001105 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -294,6 +301,7 @@ services:
container_name: rfsim5g-oai-nr-ue7
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001106 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -312,6 +320,7 @@ services:
container_name: rfsim5g-oai-nr-ue8
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001107 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -330,6 +339,7 @@ services:
container_name: rfsim5g-oai-nr-ue9
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001108 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:
@@ -348,6 +358,7 @@ services:
container_name: rfsim5g-oai-nr-ue10
environment:
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001109 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:

View File

@@ -168,6 +168,7 @@ services:
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-ext-dn
networks:
@@ -186,6 +187,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 24 --ssb 24 --numerology 1 -C 3604800000 --uicc0.imsi 208990100001100 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:

View File

@@ -168,6 +168,7 @@ services:
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-ext-dn
networks:
@@ -187,6 +188,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 2 --uicc0.imsi 208990100001100 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:

View File

@@ -170,6 +170,7 @@ services:
container_name: rfsim5g-oai-cucp
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-ext-dn
networks:
@@ -190,8 +191,8 @@ services:
privileged: true
container_name: rfsim5g-oai-cuup
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim
#--log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-cucp
networks:
@@ -213,6 +214,7 @@ services:
container_name: rfsim5g-oai-du
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
ran_net:
ipv4_address: 192.168.72.142
@@ -230,6 +232,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 -C 3619200000 --rfsimulator.serveraddr 192.168.72.142 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-du
networks:

View File

@@ -6,6 +6,7 @@ services:
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
public_net:
ipv4_address: 192.168.71.140
@@ -24,6 +25,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
volumes:
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
- rrc.config:/opt/oai-nr-ue/etc/rrc/

View File

@@ -6,6 +6,7 @@ services:
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
public_net:
ipv4_address: 192.168.71.140
@@ -24,6 +25,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
volumes:
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
- rrc.config:/opt/oai-nr-ue/etc/rrc/

View File

@@ -6,6 +6,7 @@ services:
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
public_net:
ipv4_address: 192.168.71.140
@@ -24,6 +25,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
volumes:
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
- rrc.config:/opt/oai-nr-ue/etc/rrc/

View File

@@ -168,6 +168,7 @@ services:
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-ext-dn
networks:
@@ -187,6 +188,7 @@ services:
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 25 --numerology 0 --uicc0.imsi 208990100001100 --band 66 -C 2152260000 --CO -400000000 --ssb 76 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-gnb
networks:

View File

@@ -7,7 +7,7 @@ services:
container_name: oai-gnb
environment:
TZ: Europe/Paris
USE_ADDITIONAL_OPTIONS: --sa --tune-offset 20000000 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --sa --tune-offset 20000000 -A 45 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/gnb.sa.band78.106prb.n310.7ds2u.conf:/opt/oai-gnb/etc/gnb.conf
healthcheck:

View File

@@ -8,7 +8,7 @@ services:
#entrypoint: /bin/bash -c "sleep infinity"
environment:
TZ: Europe/Paris
USE_ADDITIONAL_OPTIONS: --usrp-args type=n3xx,name=ni-n3xx-31641B9,addr=192.168.20.2 -r 106 --numerology 1 --band 78 -C 3511200000 --sa --ue-fo-compensation --ue-rxgain 65 --tune-offset 20000000 --log_config.global_log_options level,nocolor,time --uicc0.imsi 208970000000111 --uicc0.nssai_sd 16777215
USE_ADDITIONAL_OPTIONS: --usrp-args type=n3xx,name=ni-n3xx-31641B9,addr=192.168.20.2 -r 106 --numerology 1 --band 78 -C 3511200000 --sa --ue-fo-compensation --ue-rxgain 65 --tune-offset 20000000 -A 45 --log_config.global_log_options level,nocolor,time --uicc0.imsi 208970000000111 --uicc0.nssai_sd 16777215
volumes:
- ../../conf_files/ue.sa.conf:/opt/oai-nr-ue/etc/nr-ue.conf
healthcheck:

View File

@@ -8,7 +8,7 @@ services:
environment:
USE_ADDITIONAL_OPTIONS: --sa --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- ../../conf_files/gnb-cu.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
- ../../conf_files/gnb-cu.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf
networks:
public_net:
ipv4_address: 192.168.68.194
@@ -20,15 +20,15 @@ services:
timeout: 5s
retries: 5
gnb_du_tdd:
gnb_du_fdd:
image: oai-gnb:latest
privileged: true
container_name: sa-du-b200-gnb
environment:
USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx -E --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 1 --RUs.[0].att_rx 18 --RUs.[0].att_tx 18
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 0 --MACRLCs.[0].ul_max_mcs 28 --L1s.[0].max_ldpc_iterations 20
volumes:
- ../../conf_files/gnb-du.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
- ../../conf_files/gnb-du.sa.band1.52prb.usrpb210.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev
networks:
public_net:

View File

@@ -46,7 +46,7 @@ BUILD_DOXYGEN=0
DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CMD="$CMAKE"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope nrqtscope ldpc_cuda ldpc_t1 websrv oai_iqplayer"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope nrqtscope ldpc_cuda ldpc_t2 websrv oai_iqplayer"
TARGET_LIST=""
function print_help() {
@@ -158,6 +158,8 @@ Options:
Enable the memory sanitizer on all targets. Requires clang, and is
incompatible with ASan/UBSan. To build, issue:
CC=/usr/bin/clang CXX=/usr/bin/clang++ ./build_oai ... --sanitize-memory
--sanitize-thread | -fsanitize=thread
Enable the thread sanitizer on all targets
-h | --help
Print this help"
}
@@ -416,6 +418,9 @@ function main() {
CMAKE_CMD="$CMAKE_CMD -DTRACE_ASN1C_ENC_DEC=ON"
echo_info "Enabling asn1c internal traces via OAI logging system"
shift 1;;
--sanitize-thread | -fthread=address)
CMAKE_CMD="$CMAKE_CMD -DSANITIZE_THREAD=True"
shift;;
-h | --help)
print_help
exit 1;;

View File

@@ -667,6 +667,8 @@ install_asn1c_from_source(){
git clone https://github.com/mouse07410/asn1c /tmp/asn1c
cd /tmp/asn1c
git checkout vlm_master
# Showing which version is used
git log -n1
autoreconf -iv
./configure --prefix /opt/asn1c/
make -j`nproc`

View File

@@ -11,7 +11,7 @@ paramdef_t someoptions[] = {
{"opt1", "<help opt1>", 0, uptr:&varopt1, defuintval:0, TYPE_UINT, 0 },
};
config_get( someoptions,sizeof(someoptions)/sizeof(paramdef_t),"somesection");
config_get( someoptions,sizeofArray(someoptions),"somesection");
```
new code:
@@ -31,7 +31,7 @@ paramdef_t someoptions[] = {
{"opt2", "<help opt2>", 0, strptr:&varopt2,defstrval:"",TYPE_STRING,0 },
};
config_get( someoptions,sizeof(someoptions)/sizeof(paramdef_t),"somesection");
config_get( someoptions,sizeofArray(someoptions),"somesection");
```

View File

@@ -105,7 +105,7 @@ character string, used as a prefix for the section name. It has to be specified
list to be read is under another section.
*/
config_getlist( &NbIoT_MacRLC_ParamList,NbIoT_MacRLC_Params,
sizeof(NbIoT_MacRLC_Params)/sizeof(paramdef_t),
sizeofArray(NbIoT_MacRLC_Params),
NULL);
/*

View File

@@ -37,9 +37,11 @@
#include <errno.h>
#include <platform_types.h>
#include "config_userapi.h"
#include "config_common.h"
#include "../utils/LOG/log.h"
int parse_stringlist(paramdef_t *cfgoptions, char *val) {
static int parse_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *val)
{
char *atoken;
char *tokctx = NULL;
char *tmpval=strdup(val);
@@ -57,21 +59,22 @@ int parse_stringlist(paramdef_t *cfgoptions, char *val) {
AssertFatal(MAX_LIST_SIZE > numelt,
"This piece of code use fixed size arry of constant #define MAX_LIST_SIZE %d\n",
MAX_LIST_SIZE );
config_check_valptr(cfgoptions, sizeof(char*), numelt);
config_check_valptr(cfg, cfgoptions, sizeof(char *), numelt);
cfgoptions->numelt=numelt;
atoken=strtok_r(val, ",",&tokctx);
for( int i=0; i<cfgoptions->numelt && atoken != NULL ; i++) {
snprintf(cfgoptions->strlistptr[i],DEFAULT_EXTRA_SZ,"%s",atoken);
printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]);
printf_params(cfg, "[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname, i, cfgoptions->strlistptr[i]);
atoken=strtok_r(NULL, ",",&tokctx);
}
return (cfgoptions->numelt > 0);
}
int processoption(paramdef_t *cfgoptions, char *value) {
static int processoption(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *value)
{
char *tmpval = value;
int optisset=0;
char defbool[2]="1";
@@ -79,6 +82,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
if ( value == NULL) {
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
AssertFatal(false, "[CONFIG] command line, requires an argument\n");
} else { /* boolean value option without argument, set value to true*/
tmpval = defbool;
}
@@ -89,19 +93,18 @@ int processoption(paramdef_t *cfgoptions, char *value) {
case TYPE_STRING:
if (cfgoptions->numelt == 0 )
config_check_valptr(cfgoptions, 1,
strlen(tmpval)+1);
config_check_valptr(cfg, cfgoptions, 1, strlen(tmpval) + 1);
if (cfgoptions->numelt < (strlen(tmpval)+1)) {
CONFIG_PRINTF_ERROR("[CONFIG] command line option %s value too long\n",
cfgoptions->optname);
}
snprintf(*cfgoptions->strptr, cfgoptions->numelt ,"%s",tmpval);
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
printf_cmdl(cfg, "[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
optisset=1;
break;
case TYPE_STRINGLIST:
optisset=parse_stringlist(cfgoptions,tmpval);
optisset = parse_stringlist(cfg, cfgoptions, tmpval);
break;
case TYPE_UINT32:
@@ -110,8 +113,8 @@ int processoption(paramdef_t *cfgoptions, char *value) {
case TYPE_INT16:
case TYPE_UINT8:
case TYPE_INT8:
config_check_valptr(cfgoptions, sizeof(*cfgoptions->iptr), 1);
config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,&charptr,0));
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->iptr), 1);
config_assign_int(cfg, cfgoptions, cfgoptions->optname, (int32_t)strtol(tmpval, &charptr, 0));
if( *charptr != 0) {
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an integer argument\n",cfgoptions->optname);
@@ -122,14 +125,14 @@ int processoption(paramdef_t *cfgoptions, char *value) {
case TYPE_UINT64:
case TYPE_INT64:
config_check_valptr(cfgoptions, sizeof(*cfgoptions->i64ptr), 1);
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->i64ptr), 1);
*(cfgoptions->i64ptr)=strtoll(tmpval,&charptr,0);
if( *charptr != 0) {
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an integer argument\n",cfgoptions->optname);
}
printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*cfgoptions->i64ptr);
printf_cmdl(cfg, "[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*cfgoptions->i64ptr);
optisset=1;
break;
@@ -138,14 +141,14 @@ int processoption(paramdef_t *cfgoptions, char *value) {
break;
case TYPE_DOUBLE:
config_check_valptr(cfgoptions, sizeof(*cfgoptions->dblptr), 1);
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->dblptr), 1);
*cfgoptions->dblptr = strtof(tmpval,&charptr);
if( *charptr != 0) {
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires a double argument\n",cfgoptions->optname);
}
printf_cmdl("[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr));
printf_cmdl(cfg, "[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr));
optisset=1;
break;
@@ -167,7 +170,8 @@ int processoption(paramdef_t *cfgoptions, char *value) {
/*--------------------------------------------------------------------*/
/* check unknown options in the command line
*/
int config_check_unknown_cmdlineopt(char *prefix) {
int config_check_unknown_cmdlineopt(configmodule_interface_t *cfg, char *prefix)
{
int unknowndetected=0;
char testprefix[CONFIG_MAXOPTLENGTH];
int finalcheck = 0;
@@ -182,18 +186,21 @@ int config_check_unknown_cmdlineopt(char *prefix) {
}
}
for (int i=1; i<config_get_if()->argc ; i++) {
if ( !finalcheck && strstr(config_get_if()->argv[i],testprefix) == NULL ) continue;
for (int i = 1; i < cfg->argc; i++) {
if (!finalcheck && strstr(cfg->argv[i], testprefix) == NULL)
continue;
if ( !finalcheck && testprefix[0]==0 && index(config_get_if()->argv[i],'.') != NULL) continue;
if (!finalcheck && testprefix[0] == 0 && index(cfg->argv[i], '.') != NULL)
continue;
if ( !finalcheck && isdigit(config_get_if()->argv[i][0])) continue;
if (!finalcheck && isdigit(cfg->argv[i][0]))
continue;
if ( !finalcheck && config_get_if()->argv[i][0] == '-' && isdigit(config_get_if()->argv[i][1])) continue;
if (!finalcheck && cfg->argv[i][0] == '-' && isdigit(cfg->argv[i][1]))
continue;
if ( (config_get_if()->argv_info[i] & CONFIG_CMDLINEOPT_PROCESSED) == 0 ) {
fprintf(stderr,"[CONFIG] unknown option: %s\n",
config_get_if()->argv[i] );
if ((cfg->argv_info[i] & CONFIG_CMDLINEOPT_PROCESSED) == 0) {
fprintf(stderr, "[CONFIG] unknown option: %s\n", cfg->argv[i]);
unknowndetected++;
}
}
@@ -204,10 +211,11 @@ int config_check_unknown_cmdlineopt(char *prefix) {
}
return unknowndetected;
} /* config_check_unknown_cmdlineopt */
} /* config_check_unknown_cmdlineopt */
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
int c = config_get_if()->argc;
int config_process_cmdline(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int numoptions, char *prefix)
{
int c = cfg->argc;
int i,j;
char *pp;
char cfgpath[CONFIG_MAXOPTLENGTH];
@@ -215,15 +223,16 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
i = 0;
while (c > 0 ) {
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
char *oneargv =
strdup(cfg->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
if(!oneargv) abort();
/* first check help options, either --help, -h or --help_<section> */
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
char *tokctx = NULL;
pp=strtok_r(oneargv, "_",&tokctx);
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
cfg->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) {
if (pp == NULL || strcasecmp(pp, cfg->argv[i]) == 0) {
if( prefix == NULL) {
config_printhelp(cfgoptions,numoptions,"(root section)");
@@ -263,10 +272,10 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
((strlen(oneargv) > 2) && (strcmp(oneargv + 2, cfgoptions[n].optname) == 0 ) && (cfgoptions[n].paramflags & PARAMFLAG_CMDLINE_NOPREFIXENABLED )) ) {
char *valptr=NULL;
int ret;
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
cfg->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
if (c > 0) {
pp = config_get_if()->argv[i+1];
pp = cfg->argv[i + 1];
if (pp != NULL ) {
ret = strlen(pp);
@@ -280,11 +289,11 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
}
}
j += processoption(&(cfgoptions[n]), valptr);
j += processoption(cfg, &(cfgoptions[n]), valptr);
if ( valptr != NULL ) {
i++;
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
cfg->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
c--;
}
@@ -298,6 +307,6 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
c--;
} /* fin du while */
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
printf_cmdl(cfg, "[CONFIG] %s %i options set from command line\n", ((prefix == NULL) ? "(root)" : prefix), j);
return j;
} /* parse_cmdline*/
} /* parse_cmdline*/

View File

@@ -0,0 +1,313 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <dlfcn.h>
#include <arpa/inet.h>
#include <platform_types.h>
#include "config_common.h"
#include "../utils/LOG/log.h"
static int managed_ptr_sz(configmodule_interface_t *cfg, void *ptr)
{
AssertFatal(cfg->numptrs < CONFIG_MAX_ALLOCATEDPTRS,
"This code use fixed size array as #define CONFIG_MAX_ALLOCATEDPTRS %d\n",
CONFIG_MAX_ALLOCATEDPTRS);
int i;
pthread_mutex_lock(&cfg->memBlocks_mutex);
int numptrs=cfg->numptrs;
for (i=0; i<numptrs; i++ )
if (cfg->oneBlock[i].ptrs == ptr)
break;
pthread_mutex_unlock(&cfg->memBlocks_mutex);
if ( i == numptrs )
return -1;
else
return cfg->oneBlock[i].sz;
}
void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int elt_sz, int nb_elt)
{
const bool toFree=!(cfgoptions->paramflags & PARAMFLAG_NOFREE);
// let's see if the value has been read
// the datamodel is more difficult than it should be
// and it is not thread safe
if (cfgoptions->voidptr) {
int sz;
if ( cfgoptions-> type == TYPE_STRING)
sz = managed_ptr_sz(cfg, *cfgoptions->strptr);
else
sz = managed_ptr_sz(cfg, cfgoptions->voidptr);
if ( sz != -1 ) // the same variable pointer has been used!
cfgoptions->numelt=sz;
}
if (cfgoptions->voidptr != NULL
&& (cfgoptions->type == TYPE_INTARRAY
|| cfgoptions->type == TYPE_UINTARRAY
|| cfgoptions->type == TYPE_STRINGLIST )) {
int sz;
if (cfgoptions->type == TYPE_STRING || cfgoptions->type == TYPE_STRINGLIST)
sz = managed_ptr_sz(cfg, *cfgoptions->strptr);
else
sz = managed_ptr_sz(cfg, cfgoptions->voidptr);
if ( sz == -1) {
fprintf(stderr,"[CONFIG] %s NOT SUPPORTED not NULL pointer with array types", cfgoptions->optname);
return ;
}
}
if (cfgoptions->voidptr == NULL ) {
if (cfgoptions->type == TYPE_STRING) {
// difficult datamodel
cfgoptions->strptr = config_allocate_new(cfg, sizeof(*cfgoptions->strptr), toFree);
} else if ( cfgoptions->type == TYPE_STRINGLIST) {
AssertFatal(nb_elt<MAX_LIST_SIZE,
"This piece of code use fixed size arry of constant #define MAX_LIST_SIZE %d\n",
MAX_LIST_SIZE );
cfgoptions->strlistptr = config_allocate_new(cfg, sizeof(char *) * MAX_LIST_SIZE, toFree);
for (int i=0; i<MAX_LIST_SIZE; i++)
cfgoptions->strlistptr[i] = config_allocate_new(cfg, DEFAULT_EXTRA_SZ, toFree);
} else {
if ( cfgoptions->type == TYPE_INTARRAY || cfgoptions->type == TYPE_UINTARRAY )
nb_elt=max(nb_elt, MAX_LIST_SIZE); // make room if the list is larger than the default one
cfgoptions->voidptr = config_allocate_new(cfg, elt_sz * nb_elt, toFree);
}
}
if (cfgoptions->type == TYPE_STRING && *cfgoptions->strptr == NULL) {
*cfgoptions->strptr = config_allocate_new(cfg, nb_elt + DEFAULT_EXTRA_SZ, toFree);
cfgoptions->numelt=nb_elt+DEFAULT_EXTRA_SZ;
}
}
void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree)
{
void *ptr = calloc(sz, 1);
AssertFatal(ptr, "calloc fails\n");
// add the memory piece in the managed memory pieces list
pthread_mutex_lock(&cfg->memBlocks_mutex);
int newBlockIdx=cfg->numptrs++;
oneBlock_t* tmp=&cfg->oneBlock[newBlockIdx];
tmp->ptrs = (char *)ptr;
tmp->ptrsAllocated = true;
tmp->sz=sz;
tmp->toFree=autoFree;
pthread_mutex_unlock(&cfg->memBlocks_mutex);
return ptr;
}
int config_setdefault_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
{
int status = 0;
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->iptr), 1);
if (((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
config_assign_int(cfg, cfgoptions, cfgoptions->optname, cfgoptions->defintval);
status=1;
printf_params(cfg, "[CONFIG] %s.%s set to default value\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname);
}
return status;
}
int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
{
int status = 0;
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->i64ptr), 1);
if (((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
*(cfgoptions->u64ptr) = cfgoptions->defuintval;
status=1;
printf_params(cfg,
"[CONFIG] %s.%s set to default value %llu\n",
((prefix == NULL) ? "" : prefix),
cfgoptions->optname,
(long long unsigned)(*(cfgoptions->u64ptr)));
}
return status;
}
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
{
int status = 0;
if (cfgoptions->defintarrayval != NULL) {
config_check_valptr(cfg, cfgoptions, sizeof(cfgoptions->iptr), cfgoptions->numelt);
cfgoptions->iptr = cfgoptions->defintarrayval;
status=1;
for (int j = 0; j < cfgoptions->numelt; j++) {
printf_params(cfg, "[CONFIG] %s[%i] set to default value %i\n", cfgoptions->optname, j, (int)cfgoptions->iptr[j]);
}
}
return status;
}
int config_setdefault_string(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
{
int status = 0;
if (cfgoptions->defstrval != NULL) {
status=1;
if (cfgoptions->numelt == 0)
config_check_valptr(cfg, cfgoptions, 1, strlen(cfgoptions->defstrval) + 1);
if (cfgoptions->numelt < strlen(cfgoptions->defstrval) + 1) {
fprintf(stderr,"[CONFIG] %s size too small\n", cfgoptions->optname);
}
snprintf(*cfgoptions->strptr, cfgoptions->numelt, "%s", cfgoptions->defstrval);
printf_params(cfg,
"[CONFIG] %s.%s set to default value \"%s\"\n",
((prefix == NULL) ? "" : prefix),
cfgoptions->optname,
*cfgoptions->strptr);
}
return status;
}
int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
{
int status = 0;
if (cfgoptions->defstrlistval != NULL) {
cfgoptions->strlistptr = cfgoptions->defstrlistval;
status=1;
for (int j = 0; j < cfgoptions->numelt; j++)
printf_params(cfg,
"[CONFIG] %s.%s[%i] set to default value %s\n",
((prefix == NULL) ? "" : prefix),
cfgoptions->optname,
j,
cfgoptions->strlistptr[j]);
}
return status;
}
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
{
int status = 0;
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->dblptr), 1);
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
*(cfgoptions->dblptr)=cfgoptions->defdblval;
status=1;
printf_params(cfg, "[CONFIG] %s set to default value %lf\n", cfgoptions->optname, *(cfgoptions->dblptr));
}
return status;
}
int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *ipv4addr)
{
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->uptr), 1);
int rst=inet_pton(AF_INET, ipv4addr,cfgoptions->uptr );
if (rst == 1 && *(cfgoptions->uptr) > 0) {
printf_params(cfg, "[CONFIG] %s: %s\n", cfgoptions->optname, ipv4addr);
return 1;
} else {
if ( strncmp(ipv4addr,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) {
printf_params(cfg, "[CONFIG] %s:%s (INADDR_ANY) \n", cfgoptions->optname, ipv4addr);
*cfgoptions->uptr=INADDR_ANY;
return 1;
} else {
fprintf(stderr,"[CONFIG] %s not valid for %s \n", ipv4addr, cfgoptions->optname);
return -1;
}
}
return 0;
}
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
{
int status = 0;
if (cfgoptions->defstrval != NULL) {
status = config_assign_ipv4addr(cfg, cfgoptions, cfgoptions->defstrval);
}
return status;
}
void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *fullname, int val)
{
int tmpval=val;
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >0) {
tmpval =1;
}
switch (cfgoptions->type) {
case TYPE_UINT8:
*(cfgoptions->u8ptr) = (uint8_t)tmpval;
printf_params(cfg, "[CONFIG] %s: %u\n", fullname, (uint8_t)tmpval);
break;
case TYPE_INT8:
*(cfgoptions->i8ptr) = (int8_t)tmpval;
printf_params(cfg, "[CONFIG] %s: %i\n", fullname, (int8_t)tmpval);
break;
case TYPE_UINT16:
*(cfgoptions->u16ptr) = (uint16_t)tmpval;
printf_params(cfg, "[CONFIG] %s: %hu\n", fullname, (uint16_t)tmpval);
break;
case TYPE_INT16:
*(cfgoptions->i16ptr) = (int16_t)tmpval;
printf_params(cfg, "[CONFIG] %s: %hi\n", fullname, (int16_t)tmpval);
break;
case TYPE_UINT32:
*(cfgoptions->uptr) = (uint32_t)tmpval;
printf_params(cfg, "[CONFIG] %s: %u\n", fullname, (uint32_t)tmpval);
break;
case TYPE_MASK:
*(cfgoptions->uptr) = *(cfgoptions->uptr) | (uint32_t)tmpval;
printf_params(cfg, "[CONFIG] %s: 0x%08x\n", fullname, (uint32_t)tmpval);
break;
case TYPE_INT32:
*(cfgoptions->iptr) = (int32_t)tmpval;
printf_params(cfg, "[CONFIG] %s: %i\n", fullname, (int32_t)tmpval);
break;
default:
fprintf (stderr,"[CONFIG] %s %i type %i non integer parameter %s not assigned\n",__FILE__, __LINE__,cfgoptions->type,fullname);
break;
}
}

View File

@@ -0,0 +1,58 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/config_userapi.h
* \brief: configuration module, include file to be used by the source code calling the
* configuration module to access configuration parameters
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#ifndef INCLUDE_CONFIG_COMMON_H
#define INCLUDE_CONFIG_COMMON_H
#include "config_load_configmodule.h"
#include "common/utils/utils.h"
#ifdef __cplusplus
extern "C"
{
#endif
void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int elt_sz, int nb_elt);
/* functions to set a parameter to its default value */
int config_setdefault_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
int config_setdefault_string(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
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);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -44,6 +44,25 @@
#include "../utils/LOG/log.h"
#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so"
#include "nfapi/oai_integration/vendor_ext.h"
#include "config_common.h"
// clang-format off
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugflags]><:incp[path]>\n \
debugflags can also be defined in the config section of the config file\n \
debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \
4->print command line processing debug messages\n \
incp parameter can be used to define the include path used for config files (@include directive)\n \
defaults is set to the path of the main config file.\n";
static paramdef_t Config_Params[] = {
/*--------------------------------------------------------------------------------------------------------------------------*/
/* config parameters for config module */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------*/
{CONFIGP_DEBUGFLAGS, config_helpstr, 0, .uptr = NULL, .defintval = 0, TYPE_MASK, 0},
{CONFIGP_TMPDIR, CONFIG_HELP_TMPDIR, PARAMFLAG_NOFREE, .strptr = NULL, .defstrval = "/tmp", TYPE_STRING, 0},
};
// clang-format on
int load_config_sharedlib(configmodule_interface_t *cfgptr) {
void *lib_handle;
@@ -52,7 +71,7 @@ int load_config_sharedlib(configmodule_interface_t *cfgptr) {
int st;
st=0;
sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgptr->cfgmode);
lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
lib_handle = dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_NODELETE);
if (!lib_handle) {
fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror());
@@ -65,7 +84,7 @@ int load_config_sharedlib(configmodule_interface_t *cfgptr) {
printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode);
} else {
st=cfgptr->init(cfgptr->cfgP,cfgptr->num_cfgP);
st = cfgptr->init(cfgptr);
printf("[CONFIG] function %s returned %i\n",
fname, st);
}
@@ -121,14 +140,18 @@ int nooptfunc(void) {
return 0;
};
int config_cmdlineonly_getlist(paramlist_def_t *ParamList,
paramdef_t *params, int numparams, char *prefix) {
int config_cmdlineonly_getlist(configmodule_interface_t *cfg,
paramlist_def_t *ParamList,
paramdef_t *params,
int numparams,
char *prefix)
{
ParamList->numelt = 0;
return 0;
}
int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
int config_cmdlineonly_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int numoptions, char *prefix)
{
int defval;
int fatalerror=0;
int numdefvals=0;
@@ -138,11 +161,11 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
switch(cfgoptions[i].type) {
case TYPE_STRING:
defval=config_setdefault_string(&(cfgoptions[i]), prefix);
defval = config_setdefault_string(cfg, &cfgoptions[i], prefix);
break;
case TYPE_STRINGLIST:
defval=config_setdefault_stringlist(&(cfgoptions[i]), prefix);
defval = config_setdefault_stringlist(cfg, &cfgoptions[i], prefix);
break;
case TYPE_UINT8:
@@ -152,25 +175,25 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
case TYPE_UINT32:
case TYPE_INT32:
case TYPE_MASK:
defval=config_setdefault_int(&(cfgoptions[i]), prefix);
defval = config_setdefault_int(cfg, &cfgoptions[i], prefix);
break;
case TYPE_UINT64:
case TYPE_INT64:
defval=config_setdefault_int64(&(cfgoptions[i]), prefix);
defval = config_setdefault_int64(cfg, &cfgoptions[i], prefix);
break;
case TYPE_UINTARRAY:
case TYPE_INTARRAY:
defval=config_setdefault_intlist(&(cfgoptions[i]), prefix);
defval = config_setdefault_intlist(cfg, &cfgoptions[i], prefix);
break;
case TYPE_DOUBLE:
defval=config_setdefault_double(&(cfgoptions[i]), prefix);
defval = config_setdefault_double(cfg, &cfgoptions[i], prefix);
break;
case TYPE_IPV4ADDR:
defval=config_setdefault_ipv4addr(&(cfgoptions[i]), prefix);
defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i], prefix);
break;
default:
@@ -231,7 +254,7 @@ configmodule_interface_t *load_configmodule(int argc,
OWoptIdx = i;
}
if ( strstr(argv[i], "help_config") != NULL ) {
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME);
config_printhelp(Config_Params, sizeofArray(Config_Params), CONFIG_SECTIONNAME);
exit(0);
}
@@ -271,8 +294,12 @@ configmodule_interface_t *load_configmodule(int argc,
modeparams=cfgmode;
cfgmode=strdup(CONFIG_LIBCONFIGFILE);
}
if (cfgptr == NULL) {
cfgptr = calloc(sizeof(configmodule_interface_t),1);
static configmodule_interface_t *cfgptr;
if (cfgptr)
printf("ERROR: Call load_configmodule more than one time\n");
// The macros are not thread safe print_params and similar
cfgptr = calloc(sizeof(configmodule_interface_t), 1);
/* argv_info is used to memorize command line options which have been recognized */
/* and to detect unrecognized command line options which might have been specified */
cfgptr->argv_info = calloc(sizeof(int32_t), argc+10);
@@ -314,11 +341,10 @@ configmodule_interface_t *load_configmodule(int argc,
atoken = strtok_r(NULL,":",&strtokctx);
}
printf("[CONFIG] get parameters from %s ",cfgmode);
}
for (i=0; i<cfgptr->num_cfgP; i++) {
printf("%s ",cfgptr->cfgP[i]);
}
printf("[CONFIG] get parameters from %s ", cfgmode);
for (i = 0; i < cfgptr->num_cfgP; i++) {
printf("%s ", cfgptr->cfgP[i]);
}
if (cfgptr->rtflags & CONFIG_PRINTPARAMS) {
cfgptr->status = malloc(sizeof(configmodule_status_t));
@@ -328,11 +354,11 @@ configmodule_interface_t *load_configmodule(int argc,
if (i == 0) {
printf("[CONFIG] config module %s loaded\n",cfgmode);
int idx = config_paramidx_fromname(Config_Params, CONFIG_PARAMLENGTH(Config_Params), CONFIGP_DEBUGFLAGS);
int idx = config_paramidx_fromname(Config_Params, sizeofArray(Config_Params), CONFIGP_DEBUGFLAGS);
Config_Params[idx].uptr = &(cfgptr->rtflags);
idx = config_paramidx_fromname(Config_Params, CONFIG_PARAMLENGTH(Config_Params), CONFIGP_TMPDIR);
idx = config_paramidx_fromname(Config_Params, sizeofArray(Config_Params), CONFIGP_TMPDIR);
Config_Params[idx].strptr = &(cfgptr->tmpdir);
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
config_get(cfgptr, Config_Params, sizeofArray(Config_Params), CONFIG_SECTIONNAME);
} else {
fprintf(stderr,"[CONFIG] %s %d config module \"%s\" couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
cfgptr->rtflags = cfgptr->rtflags | CONFIG_HELP | CONFIG_ABORT;
@@ -351,7 +377,7 @@ configmodule_interface_t *load_configmodule(int argc,
if (cfgmode != NULL) free(cfgmode);
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME );
config_printhelp(Config_Params, sizeofArray(Config_Params), CONFIG_SECTIONNAME);
// exit(-1);
}
@@ -359,10 +385,11 @@ configmodule_interface_t *load_configmodule(int argc,
}
/* Possibly write config file, with parameters which have been read and after command line parsing */
void write_parsedcfg(void)
void write_parsedcfg(configmodule_interface_t *cfgptr)
{
if (cfgptr->status && (cfgptr->rtflags & CONFIG_SAVERUNCFG)) {
printf_params("[CONFIG] Runtime params creation status: %i null values, %i errors, %i empty list or array, %i successfull \n",
printf_params(cfgptr,
"[CONFIG] Runtime params creation status: %i null values, %i errors, %i empty list or array, %i successfull \n",
cfgptr->status->num_err_nullvalue,
cfgptr->status->num_err_write,
cfgptr->status->emptyla,
@@ -371,19 +398,20 @@ void write_parsedcfg(void)
if (cfgptr != NULL) {
if (cfgptr->write_parsedcfg != NULL) {
printf("[CONFIG] calling config module write_parsedcfg function...\n");
cfgptr->write_parsedcfg();
cfgptr->write_parsedcfg(cfgptr);
}
}
}
/* free memory allocated when reading parameters */
/* config module could be initialized again after this call */
void end_configmodule(void) {
write_parsedcfg();
void end_configmodule(configmodule_interface_t *cfgptr)
{
write_parsedcfg(cfgptr);
if (cfgptr != NULL) {
if (cfgptr->end != NULL) {
printf ("[CONFIG] calling config module end function...\n");
cfgptr->end();
cfgptr->end(cfgptr);
}
pthread_mutex_lock(&cfgptr->memBlocks_mutex);
@@ -408,8 +436,3 @@ void end_configmodule(void) {
cfgptr=NULL;
}
}

View File

@@ -59,11 +59,14 @@
#define CONFIG_HELP (1<<20) // print help message
#define CONFIG_ABORT (1<<21) // config failed,abort execution
#define CONFIG_NOOOPT (1<<22) // no -O option found when parsing command line
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix);
struct configmodule_interface;
typedef int (*configmodule_getfunc_t)(struct configmodule_interface *, paramdef_t *, int numparams, char *prefix);
typedef int (
*configmodule_getlistfunc_t)(struct configmodule_interface *, paramlist_def_t *, paramdef_t *, int numparams, char *prefix);
typedef int (*configmodule_setfunc_t)(paramdef_t *cfgoptions, int numoptions, char *prefix);
typedef void(*configmodule_endfunc_t)(void);
typedef void (*configmodule_endfunc_t)(struct configmodule_interface *cfg);
typedef int (*configmodule_initfunc_t)(struct configmodule_interface *cfg);
typedef struct configmodule_status {
int num_paramgroups;
@@ -105,41 +108,23 @@ typedef struct configmodule_interface {
configmodule_status_t *status; // allocated in debug mode only
} configmodule_interface_t;
#ifdef CONFIG_LOADCONFIG_MAIN
configmodule_interface_t *cfgptr=NULL;
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugflags]><:incp[path]>\n \
debugflags can also be defined in the config section of the config file\n \
debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \
4->print command line processing debug messages\n \
incp parameter can be used to define the include path used for config files (@include directive)\n \
defaults is set to the path of the main config file.\n";
#define CONFIG_HELP_TMPDIR "<Repository to create temporary file>"
#define CONFIG_SECTIONNAME "config"
#define CONFIGP_DEBUGFLAGS "debugflags"
#define CONFIGP_TMPDIR "tmpdir"
// clang-format off
static paramdef_t Config_Params[] = {
/*--------------------------------------------------------------------------------------------------------------------------*/
/* config parameters for config module */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------*/
{CONFIGP_DEBUGFLAGS, config_helpstr, 0, .uptr = NULL, .defintval = 0, TYPE_MASK, 0},
{CONFIGP_TMPDIR, CONFIG_HELP_TMPDIR, PARAMFLAG_NOFREE, .strptr = NULL, .defstrval = "/tmp", TYPE_STRING, 0},
};
// clang-format on
// extern configmodule_interface_t *cfgptr;
#else
extern configmodule_interface_t *cfgptr;
#endif
#define printf_params(cfg, ...) \
if ((cfg->rtflags & (CONFIG_PRINTPARAMS)) != 0) { \
printf(__VA_ARGS__); \
}
#define printf_params(...) if ( (cfgptr->rtflags & (CONFIG_PRINTPARAMS)) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_cmdl(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGCMDLINE)) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_cmdl(cfg, ...) \
if ((cfg->rtflags & (CONFIG_DEBUGCMDLINE)) != 0) { \
printf(__VA_ARGS__); \
}
#define CONFIG_ENABLECMDLINEONLY (1<<1)
extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags);
@@ -148,8 +133,8 @@ extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32
* should be used as soon as there is no need to read parameters but doesn't prevent
* a new config module init
*/
extern void end_configmodule(void);
extern void write_parsedcfg(void);
void end_configmodule(configmodule_interface_t *cfg);
void write_parsedcfg(configmodule_interface_t *cfg);
/* free all config module memory, to be used at end of program as
* it will free parameters values even those specified with the PARAMFLAG_NOFREE flag */

View File

@@ -33,7 +33,6 @@
#ifndef INCLUDE_CONFIG_PARAMDESC_H
#define INCLUDE_CONFIG_PARAMDESC_H
#define MAX_OPTNAME_SIZE 64
#define CONFIG_MAXOPTLENGTH 512 /* max full option length, full option name exemple: (prefix1.[<index>].prefix2.optname */
@@ -56,42 +55,47 @@
/* checkedparam_t is possibly used in paramdef_t for specific parameter value validation */
#define CONFIG_MAX_NUMCHECKVAL 20
typedef struct paramdef paramdef_t;
typedef struct configmodule_interface configmodule_interface_t;
typedef union checkedparam {
struct {
int (*f1)(paramdef_t *param); /* check an integer against a list of authorized values */
int (*f1)(configmodule_interface_t *cfg, paramdef_t *param); /* check an integer against a list of authorized values */
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values */
int num_okintval; /* number of valid values in the checkingval array */
} s1;
struct {
int (*f1a)(paramdef_t *param); /* check an integer against a list of authorized values and set param value */
int (*f1a)(configmodule_interface_t *cfg,
paramdef_t *param); /* check an integer against a list of authorized values and set param value */
/* to the corresponding item in setintval array (mainly for RRC params) */
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values in config file */
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
int num_okintval; /* number of valid values in the checkingval array */
} s1a;
struct {
int (*f2)(paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
int (*f2)(configmodule_interface_t *cfg,
paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
int okintrange[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store min and max values */
} s2;
struct {
int (*f3)(paramdef_t *param); /* check a string against a list of authorized values */
int (*f3)(configmodule_interface_t *cfg, paramdef_t *param); /* check a string against a list of authorized values */
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
int num_okstrval; /* number of valid values in the checkingval array */
} s3;
struct {
int (*f3a)(paramdef_t *param); /* check a string against a list of authorized values and set param value */
int (*f3a)(configmodule_interface_t *cfg,
paramdef_t *param); /* check a string against a list of authorized values and set param value */
/* to the corresponding item in setintval array (mainly for RRC params) */
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
int num_okstrval; /* number of valid values in the checkingval array */
} s3a;
struct {
int (*f4)(paramdef_t *param); /* generic check function, no arguments but the param description */
int (*f4)(configmodule_interface_t *cfg,
paramdef_t *param); /* generic check function, no arguments but the param description */
} s4;
struct {
void (*checkfunc)(void) ;
void (*checkfunc)(configmodule_interface_t *cfg);
} s5;
} checkedparam_t;
@@ -157,13 +161,10 @@ typedef struct paramdef {
#define TYPE_LIST 55
#define ANY_IPV4ADDR_STRING "0.0.0.0"
typedef struct paramlist_def {
char listname[MAX_OPTNAME_SIZE];
paramdef_t **paramarray;
int numelt ;
} paramlist_def_t;
/* macro helpers for module users */
#define CONFIG_PARAMLENGTH(A) (sizeof(A)/sizeof(paramdef_t))
#endif /* INCLUDE_CONFIG_PARAMDESC_H */

View File

@@ -41,160 +41,12 @@
#include <arpa/inet.h>
#include <platform_types.h>
#include "config_userapi.h"
#include "config_common.h"
#include "../utils/LOG/log.h"
configmodule_interface_t *config_get_if(void) {
if (cfgptr == NULL) {
if (isLogInitDone())
LOG_W(ENB_APP,"[CONFIG] %s %d config module not initialized\n",__FILE__,__LINE__);
}
return cfgptr;
}
static int managed_ptr_sz(void* ptr) {
configmodule_interface_t * cfg=config_get_if();
AssertFatal(cfg->numptrs < CONFIG_MAX_ALLOCATEDPTRS,
"This code use fixed size array as #define CONFIG_MAX_ALLOCATEDPTRS %d\n",
CONFIG_MAX_ALLOCATEDPTRS);
int i;
pthread_mutex_lock(&cfg->memBlocks_mutex);
int numptrs=cfg->numptrs;
for (i=0; i<numptrs; i++ )
if (cfg->oneBlock[i].ptrs == ptr)
break;
pthread_mutex_unlock(&cfg->memBlocks_mutex);
if ( i == numptrs )
return -1;
else
return cfg->oneBlock[i].sz;
}
void *config_allocate_new(int sz, bool autoFree) {
void *ptr = calloc(sz,1);
AssertFatal(ptr, "calloc fails\n");
configmodule_interface_t * cfg=config_get_if();
// add the memory piece in the managed memory pieces list
pthread_mutex_lock(&cfg->memBlocks_mutex);
int newBlockIdx=cfg->numptrs++;
oneBlock_t* tmp=&cfg->oneBlock[newBlockIdx];
tmp->ptrs = (char *)ptr;
tmp->ptrsAllocated = true;
tmp->sz=sz;
tmp->toFree=autoFree;
pthread_mutex_unlock(&cfg->memBlocks_mutex);
return ptr;
}
void config_check_valptr(paramdef_t *cfgoptions, int elt_sz, int nb_elt) {
const bool toFree=!(cfgoptions->paramflags & PARAMFLAG_NOFREE);
// let's see if the value has been read
// the datamodel is more difficult than it should be
// and it is not thread safe
if (cfgoptions->voidptr) {
int sz;
if ( cfgoptions-> type == TYPE_STRING)
sz=managed_ptr_sz(*cfgoptions->strptr);
else
sz=managed_ptr_sz(cfgoptions->voidptr);
if ( sz != -1 ) // the same variable pointer has been used!
cfgoptions->numelt=sz;
}
if (cfgoptions->voidptr != NULL
&& (cfgoptions->type == TYPE_INTARRAY
|| cfgoptions->type == TYPE_UINTARRAY
|| cfgoptions->type == TYPE_STRINGLIST )) {
int sz;
if ( cfgoptions->type == TYPE_STRING ||
cfgoptions->type == TYPE_STRINGLIST )
sz=managed_ptr_sz(*cfgoptions->strptr);
else
sz=managed_ptr_sz(cfgoptions->voidptr);
if ( sz == -1) {
CONFIG_PRINTF_ERROR("[CONFIG] %s NOT SUPPORTED not NULL pointer with array types", cfgoptions->optname);
return ;
}
}
if (cfgoptions->voidptr == NULL ) {
if (cfgoptions->type == TYPE_STRING) {
// difficult datamodel
cfgoptions->strptr = config_allocate_new(sizeof(*cfgoptions->strptr), toFree);
} else if ( cfgoptions->type == TYPE_STRINGLIST) {
AssertFatal(nb_elt<MAX_LIST_SIZE,
"This piece of code use fixed size arry of constant #define MAX_LIST_SIZE %d\n",
MAX_LIST_SIZE );
cfgoptions->strlistptr= config_allocate_new(sizeof(char*)*MAX_LIST_SIZE, toFree);
for (int i=0; i<MAX_LIST_SIZE; i++)
cfgoptions->strlistptr[i]= config_allocate_new(DEFAULT_EXTRA_SZ, toFree);
} else {
if ( cfgoptions->type == TYPE_INTARRAY || cfgoptions->type == TYPE_UINTARRAY )
nb_elt=max(nb_elt, MAX_LIST_SIZE); // make room if the list is larger than the default one
cfgoptions->voidptr = config_allocate_new(elt_sz*nb_elt, toFree);
}
}
if (cfgoptions->type == TYPE_STRING && *cfgoptions->strptr == NULL) {
*cfgoptions->strptr = config_allocate_new(nb_elt+DEFAULT_EXTRA_SZ, toFree);
cfgoptions->numelt=nb_elt+DEFAULT_EXTRA_SZ;
}
printf_ptrs("[CONFIG] %s ptr: %p requested size: elt_sz: %d, nb_elt: %d\n",cfgoptions->optname, cfgoptions->voidptr, elt_sz, nb_elt);
}
void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val) {
int tmpval=val;
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >0) {
tmpval =1;
}
switch (cfgoptions->type) {
case TYPE_UINT8:
*(cfgoptions->u8ptr) = (uint8_t)tmpval;
printf_params("[CONFIG] %s: %u\n", fullname, (uint8_t)tmpval);
break;
case TYPE_INT8:
*(cfgoptions->i8ptr) = (int8_t)tmpval;
printf_params("[CONFIG] %s: %i\n", fullname, (int8_t)tmpval);
break;
case TYPE_UINT16:
*(cfgoptions->u16ptr) = (uint16_t)tmpval;
printf_params("[CONFIG] %s: %hu\n", fullname, (uint16_t)tmpval);
break;
case TYPE_INT16:
*(cfgoptions->i16ptr) = (int16_t)tmpval;
printf_params("[CONFIG] %s: %hi\n", fullname, (int16_t)tmpval);
break;
case TYPE_UINT32:
*(cfgoptions->uptr) = (uint32_t)tmpval;
printf_params("[CONFIG] %s: %u\n", fullname, (uint32_t)tmpval);
break;
case TYPE_MASK:
*(cfgoptions->uptr) = *(cfgoptions->uptr) | (uint32_t)tmpval;
printf_params("[CONFIG] %s: 0x%08x\n", fullname, (uint32_t)tmpval);
break;
case TYPE_INT32:
*(cfgoptions->iptr) = (int32_t)tmpval;
printf_params("[CONFIG] %s: %i\n", fullname, (int32_t)tmpval);
break;
default:
fprintf (stderr,"[CONFIG] %s %i type %i non integer parameter %s not assigned\n",__FILE__, __LINE__,cfgoptions->type,fullname);
break;
}
}
void config_assign_processedint(paramdef_t *cfgoption, int val) {
cfgoption->processedvalue = config_allocate_new(sizeof(int),!(cfgoption->paramflags & PARAMFLAG_NOFREE));
static void config_assign_processedint(configmodule_interface_t *cfg, paramdef_t *cfgoption, int val)
{
cfgoption->processedvalue = config_allocate_new(cfg, sizeof(int), !(cfgoption->paramflags & PARAMFLAG_NOFREE));
if ( cfgoption->processedvalue != NULL) {
*(cfgoption->processedvalue) = val;
@@ -203,14 +55,15 @@ void config_assign_processedint(paramdef_t *cfgoption, int val) {
}
}
int config_get_processedint(paramdef_t *cfgoption) {
int config_get_processedint(configmodule_interface_t *cfg, paramdef_t *cfgoption)
{
int ret;
if ( cfgoption->processedvalue != NULL) {
ret=*(cfgoption->processedvalue);
free( cfgoption->processedvalue);
cfgoption->processedvalue=NULL;
printf_params("[CONFIG] %s: set from %s to %i\n",cfgoption->optname, *cfgoption->strptr, ret);
printf_params(cfg, "[CONFIG] %s: set from %s to %i\n", cfgoption->optname, *cfgoption->strptr, ret);
} else {
fprintf (stderr,"[CONFIG] %s %d %s has no processed integer availablle\n",__FILE__, __LINE__, cfgoption->optname);
ret=0;
@@ -231,7 +84,8 @@ void config_printhelp(paramdef_t *params,int numparams, char *prefix) {
printf("--------------------------------------------------------------------\n\n");
}
int config_execcheck(paramdef_t *params, int numparams, char *prefix) {
int config_execcheck(configmodule_interface_t *cfg, paramdef_t *params, int numparams, char *prefix)
{
int st=0;
for (int i=0 ; i<numparams ; i++) {
@@ -240,7 +94,7 @@ int config_execcheck(paramdef_t *params, int numparams, char *prefix) {
}
if (params[i].chkPptr->s4.f4 != NULL) {
st += params[i].chkPptr->s4.f4(&(params[i]));
st += params[i].chkPptr->s4.f4(cfg, &(params[i]));
}
}
@@ -261,7 +115,8 @@ int config_paramidx_fromname(paramdef_t *params, int numparams, char *name) {
return -1;
}
int config_get(paramdef_t *params, int numparams, char *prefix) {
int config_get(configmodule_interface_t *cfgif, paramdef_t *params, int numparams, char *prefix)
{
int ret= -1;
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
@@ -269,16 +124,15 @@ int config_get(paramdef_t *params, int numparams, char *prefix) {
return ret;
}
configmodule_interface_t *cfgif = config_get_if();
if (cfgif != NULL) {
ret = config_get_if()->get(params, numparams, prefix);
ret = cfgif->get(cfgif, params, numparams, prefix);
if (ret >= 0) {
config_process_cmdline(params, numparams, prefix);
config_process_cmdline(cfgif, params, numparams, prefix);
if (cfgif->rtflags & CONFIG_SAVERUNCFG) {
config_get_if()->set(params, numparams, prefix);
cfgif->set(params, numparams, prefix);
}
config_execcheck(params, numparams, prefix);
config_execcheck(cfgif, params, numparams, prefix);
}
return ret;
@@ -287,16 +141,13 @@ int config_get(paramdef_t *params, int numparams, char *prefix) {
return ret;
}
int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix) {
int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix)
{
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
fprintf(stderr,"[CONFIG] config_get skipped, config module not properly initialized\n");
return -1;
}
if (!config_get_if())
return -1;
const int ret = config_get_if()->getlist(ParamList, params, numparams, prefix);
const int ret = cfg->getlist(cfg, ParamList, params, numparams, prefix);
if (ret >= 0 && params) {
char *newprefix;
@@ -314,11 +165,11 @@ int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams
for (int i = 0; i < ParamList->numelt; ++i) {
// TODO config_process_cmdline?
sprintf(cfgpath, "%s.[%i]", newprefix, i);
config_process_cmdline(ParamList->paramarray[i],numparams,cfgpath);
if (config_get_if()->rtflags & CONFIG_SAVERUNCFG) {
config_get_if()->set(ParamList->paramarray[i], numparams, cfgpath);
config_process_cmdline(cfg, ParamList->paramarray[i], numparams, cfgpath);
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
cfg->set(ParamList->paramarray[i], numparams, cfgpath);
}
config_execcheck(ParamList->paramarray[i], numparams, cfgpath);
config_execcheck(cfg, ParamList->paramarray[i], numparams, cfgpath);
}
if (prefix)
@@ -347,7 +198,8 @@ void print_intvalueerror(paramdef_t *param, char *fname, int *okval, int numokva
fprintf(stderr, " \n");
}
int config_check_intval(paramdef_t *param) {
int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param)
{
if ( param == NULL ) {
fprintf(stderr,"[CONFIG] config_check_intval: NULL param argument\n");
return -1;
@@ -363,10 +215,15 @@ int config_check_intval(paramdef_t *param) {
return -1;
}
int config_check_modify_integer(paramdef_t *param) {
int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param)
{
for (int i=0; i < param->chkPptr->s1a.num_okintval ; i++) {
if (*(param->uptr) == param->chkPptr->s1a.okintval[i] ) {
printf_params("[CONFIG] %s: read value %i, set to %i\n",param->optname,*(param->uptr),param->chkPptr->s1a.setintval [i]);
printf_params(cfg,
"[CONFIG] %s: read value %i, set to %i\n",
param->optname,
*(param->uptr),
param->chkPptr->s1a.setintval[i]);
*(param->uptr) = param->chkPptr->s1a.setintval [i];
return 0;
}
@@ -376,7 +233,8 @@ int config_check_modify_integer(paramdef_t *param) {
return -1;
}
int config_check_intrange(paramdef_t *param) {
int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param)
{
if( *(param->iptr) >= param->chkPptr->s2.okintrange[0] && *(param->iptr) <= param->chkPptr->s2.okintrange[1] ) {
return 0;
}
@@ -397,7 +255,8 @@ void print_strvalueerror(paramdef_t *param, char *fname, char **okval, int numok
fprintf(stderr, " \n");
}
int config_check_strval(paramdef_t *param) {
int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param)
{
if ( param == NULL ) {
fprintf(stderr,"[CONFIG] config_check_strval: NULL param argument\n");
return -1;
@@ -413,10 +272,11 @@ int config_check_strval(paramdef_t *param) {
return -1;
}
int config_checkstr_assign_integer(paramdef_t *param) {
int config_checkstr_assign_integer(configmodule_interface_t *cfg, paramdef_t *param)
{
for (int i=0; i < param->chkPptr->s3a.num_okstrval ; i++) {
if (strcasecmp(*param->strptr,param->chkPptr->s3a.okstrval[i] ) == 0) {
config_assign_processedint(param, param->chkPptr->s3a.setintval[i]);
config_assign_processedint(cfg, param, param->chkPptr->s3a.setintval[i]);
return 0;
}
}
@@ -430,123 +290,3 @@ void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunction
params[i].chkPptr = &(checkfunctions[i]);
}
}
int config_setdefault_string(paramdef_t *cfgoptions, char *prefix) {
int status = 0;
if( cfgoptions->defstrval != NULL) {
status=1;
if (cfgoptions->numelt == 0 )
config_check_valptr(cfgoptions, 1, strlen(cfgoptions->defstrval)+1);
if ( cfgoptions->numelt < strlen(cfgoptions->defstrval)+1 ) {
CONFIG_PRINTF_ERROR("[CONFIG] %s size too small\n", cfgoptions->optname);
}
snprintf(*cfgoptions->strptr, cfgoptions->numelt, "%s",cfgoptions->defstrval);
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, *cfgoptions->strptr);
}
return status;
}
int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix) {
int status = 0;
if( cfgoptions->defstrlistval != NULL) {
cfgoptions->strlistptr=cfgoptions->defstrlistval;
status=1;
for(int j=0; j<cfgoptions->numelt; j++)
printf_params("[CONFIG] %s.%s[%i] set to default value %s\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname,j, cfgoptions->strlistptr[j]);
}
return status;
}
int config_setdefault_int(paramdef_t *cfgoptions, char *prefix) {
int status = 0;
config_check_valptr(cfgoptions, sizeof(*cfgoptions->iptr), 1);
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
config_assign_int(cfgoptions,cfgoptions->optname,cfgoptions->defintval);
status=1;
printf_params("[CONFIG] %s.%s set to default value\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname);
}
return status;
}
int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix) {
int status = 0;
config_check_valptr(cfgoptions, sizeof(*cfgoptions->i64ptr), 1);
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
*(cfgoptions->u64ptr)=cfgoptions->defuintval;
status=1;
printf_params("[CONFIG] %s.%s set to default value %llu\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (long long unsigned)(*(cfgoptions->u64ptr)));
}
return status;
}
int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix) {
int status = 0;
if( cfgoptions->defintarrayval != NULL) {
config_check_valptr(cfgoptions, sizeof(cfgoptions->iptr), cfgoptions->numelt);
cfgoptions->iptr=cfgoptions->defintarrayval;
status=1;
for (int j=0; j<cfgoptions->numelt ; j++) {
printf_params("[CONFIG] %s[%i] set to default value %i\n",cfgoptions->optname,j,(int)cfgoptions->iptr[j]);
}
}
return status;
}
int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
int status = 0;
config_check_valptr(cfgoptions, sizeof(*cfgoptions->dblptr), 1);
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
*(cfgoptions->dblptr)=cfgoptions->defdblval;
status=1;
printf_params("[CONFIG] %s set to default value %lf\n",cfgoptions->optname, *(cfgoptions->dblptr));
}
return status;
}
int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr) {
config_check_valptr(cfgoptions, sizeof(*cfgoptions->uptr), 1);
int rst=inet_pton(AF_INET, ipv4addr,cfgoptions->uptr );
if (rst == 1 && *(cfgoptions->uptr) > 0) {
printf_params("[CONFIG] %s: %s\n",cfgoptions->optname, ipv4addr);
return 1;
} else {
if ( strncmp(ipv4addr,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) {
printf_params("[CONFIG] %s:%s (INADDR_ANY) \n",cfgoptions->optname,ipv4addr);
*cfgoptions->uptr=INADDR_ANY;
return 1;
} else {
fprintf(stderr,"[CONFIG] %s not valid for %s \n", ipv4addr, cfgoptions->optname);
return -1;
}
}
return 0;
}
int config_setdefault_ipv4addr(paramdef_t *cfgoptions, char *prefix) {
int status = 0;
if (cfgoptions->defstrval != NULL) {
status = config_assign_ipv4addr(cfgoptions, cfgoptions->defstrval);
}
return status;
}

View File

@@ -33,60 +33,49 @@
#ifndef INCLUDE_CONFIG_USERAPI_H
#define INCLUDE_CONFIG_USERAPI_H
#include "config_load_configmodule.h"
#include "common/utils/utils.h"
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef NOT_uniqCfg
extern configmodule_interface_t *uniqCfg;
#define config_get_if() uniqCfg // Existing code implicit uniq configuration context
#endif
/* utility functions to ease usage of config module structures */
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
#define CONFIG_GETSOURCE ((config_get_if() == NULL) ? NULL : config_get_if()->cfgmode)
#define CONFIG_ISFLAGSET(P) ( (config_get_if()==NULL) ? 0 : !!(config_get_if()->rtflags & P))
#define CONFIG_SETRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags |= P; }
#define CONFIG_CLEARRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags &= (~P); }
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
extern int config_paramidx_fromname(paramdef_t *params,int numparams, char *name);
int config_paramidx_fromname(paramdef_t *params, int numparams, char *name);
/* utility functions, to be used by configuration module and/or configuration libraries */
extern configmodule_interface_t *config_get_if(void);
void config_check_valptr(paramdef_t *cfgoptions, int elt_sz, int nb_elt);
extern void config_printhelp(paramdef_t *,int numparams, char *prefix);
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix);
extern void config_assign_processedint(paramdef_t *cfgoption, int val);
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
extern int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr);
void config_printhelp(paramdef_t *, int numparams, char *prefix);
int config_process_cmdline(configmodule_interface_t *cfg, paramdef_t *params, int numparams, char *prefix);
int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *ipv4addr);
/* apis to get/check parameters, to be used by oai modules, at configuration time */
#define CONFIG_CHECKALLSECTIONS "ALLSECTIONS"
extern int config_check_unknown_cmdlineopt(char *prefix);
extern int config_get(paramdef_t *params,int numparams, char *prefix);
extern int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix);
int config_check_unknown_cmdlineopt(configmodule_interface_t *cfg, char *prefix);
int config_get(configmodule_interface_t *cfg, paramdef_t *params, int numparams, char *prefix);
int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix);
/* apis to set some of the paramdef_t fields before using the get/getlist api's */
extern void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunctions, int numparams);
void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunctions, int numparams);
/* apis to retrieve parameters info after calling get or getlist functions */
extern int config_isparamset(paramdef_t *params,int paramidx);
extern int config_get_processedint(paramdef_t *cfgoption);
int config_isparamset(paramdef_t *params, int paramidx);
int config_get_processedint(configmodule_interface_t *cfg, paramdef_t *cfgoption);
/* functions to be used in parameters definition, to check parameters values */
extern int config_check_intval(paramdef_t *param);
extern int config_check_modify_integer(paramdef_t *param);
extern int config_check_intrange(paramdef_t *param);
extern int config_check_strval(paramdef_t *param);
extern int config_checkstr_assign_integer(paramdef_t *param);
int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param);
int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param);
int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param);
int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param);
int config_checkstr_assign_integer(configmodule_interface_t *cfg, paramdef_t *param);
/* functions to set a parameter to its default value */
extern int config_setdefault_string(paramdef_t *cfgoptions, char *prefix);
extern int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix);
extern int config_setdefault_int(paramdef_t *cfgoptions, char *prefix);
extern int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix);
extern int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix);
extern int config_setdefault_double(paramdef_t *cfgoptions, char *prefix);
extern int config_setdefault_ipv4addr(paramdef_t *cfgoptions, char *prefix);
void *config_allocate_new(int sz, bool autoFree);
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
#ifdef __cplusplus

View File

@@ -43,6 +43,8 @@
#include "config_libconfig.h"
#include "config_libconfig_private.h"
#define NOT_uniqCfg
#include "../config_common.h"
#include "../config_userapi.h"
#include "errno.h"
#include "assertions.h"
@@ -51,14 +53,15 @@
#define config_setting_lookup config_lookup_from
#endif
void config_libconfig_end(void );
void config_libconfig_end(configmodule_interface_t *cfg);
int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) {
int read_strlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, config_setting_t *setting, char *cfgpath)
{
const char *str;
int st;
int numelt;
numelt=config_setting_length(setting);
config_check_valptr(cfgoptions, sizeof(char *), numelt);
config_check_valptr(cfg, cfgoptions, sizeof(char *), numelt);
st=0;
AssertFatal(MAX_LIST_SIZE > numelt,
"This piece of code use fixed size arry of constant #define MAX_LIST_SIZE %d\n",
@@ -71,7 +74,7 @@ int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath
} else {
snprintf(cfgoptions->strlistptr[i], DEFAULT_EXTRA_SZ, "%s",str);
st++;
printf_params("[LIBCONFIG] %s%i: %s\n", cfgpath,i,cfgoptions->strlistptr[i]);
printf_params(cfg, "[LIBCONFIG] %s%i: %s\n", cfgpath, i, cfgoptions->strlistptr[i]);
}
}
@@ -79,22 +82,27 @@ int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath
return st;
}
int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) {
static int read_intarray(configmodule_interface_t *cfg, paramdef_t *cfgoptions, config_setting_t *setting, char *cfgpath)
{
cfgoptions->numelt=config_setting_length(setting);
if (cfgoptions->numelt > 0) {
cfgoptions->iptr=config_allocate_new(cfgoptions->numelt*sizeof(*cfgoptions->iptr),
!(cfgoptions->paramflags & PARAMFLAG_NOFREE) );
cfgoptions->iptr =
config_allocate_new(cfg, cfgoptions->numelt * sizeof(*cfgoptions->iptr), !(cfgoptions->paramflags & PARAMFLAG_NOFREE));
for (int i=0; i< cfgoptions->numelt && cfgoptions->iptr != NULL; i++) {
cfgoptions->iptr[i]=config_setting_get_int_elem(setting,i);
printf_params("[LIBCONFIG] %s[%i]: %i\n", cfgpath,i,cfgoptions->iptr[i]);
printf_params(cfg, "[LIBCONFIG] %s[%i]: %i\n", cfgpath, i, cfgoptions->iptr[i]);
} /* for loop on array element... */
}
return cfgoptions->numelt;
}
int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_setting_t *asetting, char *prefix)
int config_libconfig_setparams(configmodule_interface_t *cfg,
paramdef_t *cfgoptions,
int numoptions,
config_setting_t *asetting,
char *prefix)
{
int status;
int errors = 0;
@@ -106,7 +114,7 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
for (int i = 0; i < numoptions; i++) {
if (cfgoptions[i].paramflags & PARAMFLAG_CMDLINEONLY) {
continue;
printf_params("[LIBCONFIG] setting %s.%s skipped (command line only) \n", secprefix, cfgoptions[i].optname);
printf_params(cfg, "[LIBCONFIG] setting %s.%s skipped (command line only) \n", secprefix, cfgoptions[i].optname);
}
status = CONFIG_FALSE;
config_setting_t *psetting;
@@ -115,7 +123,7 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
psetting = config_lookup(&(libconfig_privdata.runtcfg), spath);
free(spath);
if (psetting != NULL) {
printf_params("[LIBCONFIG] setting %s.%s already created \n", secprefix, cfgoptions[i].optname);
printf_params(cfg, "[LIBCONFIG] setting %s.%s already created \n", secprefix, cfgoptions[i].optname);
continue;
}
switch (cfgoptions[i].type) {
@@ -137,7 +145,7 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
if (psetting != NULL) {
if (cfgoptions[i].numelt <= 0) {
emptyla++;
printf_params("[LIBCONFIG], no element in list %s\n", cfgoptions[i].optname);
printf_params(cfg, "[LIBCONFIG], no element in list %s\n", cfgoptions[i].optname);
status = CONFIG_TRUE;
}
for (int j = 0; j < cfgoptions[i].numelt; j++) {
@@ -176,7 +184,7 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
if (psetting != NULL) {
if (cfgoptions[i].numelt <= 0) {
emptyla++;
printf_params("[LIBCONFIG], no element in array %s.%s\n", secprefix, cfgoptions[i].optname);
printf_params(cfg, "[LIBCONFIG], no element in array %s.%s\n", secprefix, cfgoptions[i].optname);
status = CONFIG_TRUE;
}
for (int j = 0; j < cfgoptions[i].numelt; j++) {
@@ -222,24 +230,24 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
fprintf(stderr, "[LIBCONFIG] Error creating setting %i: %s.%s type %i\n", i, secprefix, cfgoptions[i].optname, cfgoptions[i].type);
}
}
printf_params("[LIBCONFIG], in group \"%s\" %i settings \n", secprefix, numoptions);
printf_params(cfg, "[LIBCONFIG], in group \"%s\" %i settings \n", secprefix, numoptions);
if (notused > 0)
printf_params("[LIBCONFIG], ..... %i settings with NULL value pointer\n", notused);
printf_params(cfg, "[LIBCONFIG], ..... %i settings with NULL value pointer\n", notused);
if (errors > 0)
fprintf(stderr, "[LIBCONFIG] .....%i settings creation errors \n", errors);
if (emptyla > 0)
fprintf(stderr, "[LIBCONFIG] .....%i empty lists or arrays settings \n", emptyla);
if (cfgptr->status) {
cfgptr->status->num_err_nullvalue += notused;
cfgptr->status->num_err_write += errors;
cfgptr->status->num_write += numoptions;
cfgptr->status->emptyla += emptyla;
if (cfg->status) {
cfg->status->num_err_nullvalue += notused;
cfg->status->num_err_write += errors;
cfg->status->num_write += numoptions;
cfg->status->emptyla += emptyla;
}
return errors;
}
int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
int config_libconfig_set(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int numoptions, char *prefix)
{
char *tokctx1 = NULL;
int listidx = -1;
@@ -250,13 +258,13 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
prefixbck = strdup(prefix);
prefix_elem1 = strtok_r(prefixbck, ".", &tokctx1);
}
printf_params("[LIBCONFIG], processing prefix %s\n", (prefix == NULL) ? "NULL" : prefix);
printf_params(cfg, "[LIBCONFIG], processing prefix %s\n", (prefix == NULL) ? "NULL" : prefix);
/* parse the prefix , possibly creating groups, lists and list elements */
while (prefix_elem1 != NULL) {
int n1 = strlen(prefix_elem1);
char *prefix_elem2 = prefix_elem1 + n1 + 1;
printf_params("[LIBCONFIG], processing elem1 %s elem2 %s\n", prefix_elem1, prefix_elem2);
printf_params(cfg, "[LIBCONFIG], processing elem1 %s elem2 %s\n", prefix_elem1, prefix_elem2);
/* prefix (the path to the parameter name) may contain groups and elements from a list, which are specified with [] */
if (prefix_elem2[0] != '[') { // not a list
@@ -265,11 +273,11 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
asetting = config_setting_add(asetting, prefix_elem1, CONFIG_TYPE_GROUP);
else
asetting = tmpset;
printf_params("[LIBCONFIG], creating or looking for group %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
printf_params(cfg, "[LIBCONFIG], creating or looking for group %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
} else { // a list
listidx = (int)strtol(prefix_elem2 + 1, NULL, 10);
if (errno == EINVAL || errno == ERANGE) {
printf_params("[LIBCONFIG], Error %s looking for list index in %s \n", strerror(errno), prefix_elem2);
printf_params(cfg, "[LIBCONFIG], Error %s looking for list index in %s \n", strerror(errno), prefix_elem2);
break;
}
config_setting_t *tmpset = config_setting_lookup(asetting, prefix_elem1);
@@ -277,14 +285,17 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
asetting = config_setting_add(asetting, prefix_elem1, CONFIG_TYPE_LIST);
else
asetting = tmpset;
printf_params("[LIBCONFIG], creating or looking for list %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
printf_params(cfg, "[LIBCONFIG], creating or looking for list %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
if (asetting != NULL) {
tmpset = config_setting_get_elem(asetting, listidx);
if (tmpset == NULL)
asetting = config_setting_add(asetting, NULL, CONFIG_TYPE_GROUP);
else
asetting = tmpset;
printf_params("[LIBCONFIG], creating or looking for list element %i: %s\n", listidx, (asetting == NULL) ? "NOK" : "OK");
printf_params(cfg,
"[LIBCONFIG], creating or looking for list element %i: %s\n",
listidx,
(asetting == NULL) ? "NOK" : "OK");
}
prefix_elem1 = strtok_r(NULL, ".", &tokctx1); // skip the [x] elements we already took care of it
if (prefix_elem1 == NULL) {
@@ -299,8 +310,8 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
}
free(prefixbck);
if (asetting != NULL) {
config_libconfig_setparams(cfgoptions, numoptions, asetting, prefix);
printf_params("[LIBCONFIG] %i settings added in group %s\n", numoptions, (prefix == NULL) ? "" : prefix);
config_libconfig_setparams(cfg, cfgoptions, numoptions, asetting, prefix);
printf_params(cfg, "[LIBCONFIG] %i settings added in group %s\n", numoptions, (prefix == NULL) ? "" : prefix);
return 0;
} else {
fprintf(stderr, "[LIBCONFIG] Error parsing %s params, skipped...\n", (prefix == NULL) ? "" : prefix);
@@ -308,7 +319,8 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
}
}
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int numoptions, char *prefix)
{
config_setting_t *setting;
char *str;
int i,u;
@@ -330,7 +342,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
}
if( (cfgoptions->paramflags & PARAMFLAG_DONOTREAD) != 0) {
printf_params("[LIBCONFIG] %s.%s ignored\n", cfgpath,cfgoptions[i].optname );
printf_params(cfg, "[LIBCONFIG] %s.%s ignored\n", cfgpath, cfgoptions[i].optname);
continue;
}
@@ -340,14 +352,14 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
switch(cfgoptions[i].type) {
case TYPE_STRING:
if ( config_lookup_string(&(libconfig_privdata.cfg), cfgpath, (const char**)&str)) {
config_check_valptr(&(cfgoptions[i]), 1, strlen(str)+1);
config_check_valptr(cfg, &cfgoptions[i], 1, strlen(str) + 1);
if ( strlen(str)+1 > cfgoptions[i].numelt )
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
cfgpath,str,cfgoptions[i].numelt);
snprintf( *cfgoptions[i].strptr , cfgoptions[i].numelt, "%s", str);
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath, *cfgoptions[i].strptr);
printf_params(cfg, "[LIBCONFIG] %s: \"%s\"\n", cfgpath, *cfgoptions[i].strptr);
} else {
defval=config_setdefault_string(&cfgoptions[i],prefix);
defval = config_setdefault_string(cfg, &cfgoptions[i], prefix);
}
break;
@@ -356,9 +368,9 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
if ( setting != NULL) {
read_strlist(&cfgoptions[i],setting,cfgpath);
read_strlist(cfg, &cfgoptions[i], setting, cfgpath);
} else {
defval=config_setdefault_stringlist(&(cfgoptions[i]),prefix);
defval = config_setdefault_stringlist(cfg, &(cfgoptions[i]), prefix);
}
break;
@@ -371,10 +383,10 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
case TYPE_INT32:
case TYPE_MASK:
if ( config_lookup_int(&(libconfig_privdata.cfg),cfgpath, &u)) {
config_check_valptr(&(cfgoptions[i]), sizeof(*cfgoptions[i].iptr), 1);
config_assign_int(&(cfgoptions[i]),cfgpath,u);
config_check_valptr(cfg, &(cfgoptions[i]), sizeof(*cfgoptions[i].iptr), 1);
config_assign_int(cfg, &(cfgoptions[i]), cfgpath, u);
} else {
defval=config_setdefault_int(&(cfgoptions[i]),prefix);
defval = config_setdefault_int(cfg, &(cfgoptions[i]), prefix);
}
break;
@@ -382,17 +394,17 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
case TYPE_UINT64:
case TYPE_INT64:
if ( config_lookup_int64(&(libconfig_privdata.cfg),cfgpath, &llu)) {
config_check_valptr(&cfgoptions[i], sizeof(*cfgoptions[i].i64ptr), 1);
config_check_valptr(cfg, &cfgoptions[i], sizeof(*cfgoptions[i].i64ptr), 1);
if(cfgoptions[i].type==TYPE_UINT64) {
*(cfgoptions[i].u64ptr) = (uint64_t)llu;
printf_params("[LIBCONFIG] %s: %lu\n", cfgpath,*cfgoptions[i].u64ptr);
printf_params(cfg, "[LIBCONFIG] %s: %lu\n", cfgpath, *cfgoptions[i].u64ptr);
} else {
*(cfgoptions[i].i64ptr) = llu;
printf_params("[LIBCONFIG] %s: %ld\n", cfgpath,*cfgoptions[i].i64ptr);
printf_params(cfg, "[LIBCONFIG] %s: %ld\n", cfgpath, *cfgoptions[i].i64ptr);
}
} else {
defval=config_setdefault_int64(&(cfgoptions[i]),prefix);
defval = config_setdefault_int64(cfg, &(cfgoptions[i]), prefix);
}
break;
@@ -402,29 +414,29 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
if ( setting != NULL) {
read_intarray(&cfgoptions[i],setting,cfgpath);
read_intarray(cfg, &cfgoptions[i], setting, cfgpath);
} else {
defval=config_setdefault_intlist(&(cfgoptions[i]),prefix);
defval = config_setdefault_intlist(cfg, &(cfgoptions[i]), prefix);
}
break;
case TYPE_DOUBLE:
if ( config_lookup_float(&(libconfig_privdata.cfg),cfgpath, &dbl)) {
config_check_valptr(&cfgoptions[i],sizeof(*cfgoptions[i].dblptr), 1);
config_check_valptr(cfg, &cfgoptions[i], sizeof(*cfgoptions[i].dblptr), 1);
*cfgoptions[i].dblptr = dbl;
printf_params("[LIBCONFIG] %s: %lf\n", cfgpath,*(cfgoptions[i].dblptr) );
printf_params(cfg, "[LIBCONFIG] %s: %lf\n", cfgpath, *(cfgoptions[i].dblptr));
} else {
defval=config_setdefault_double(&(cfgoptions[i]),prefix);
defval = config_setdefault_double(cfg, &(cfgoptions[i]), prefix);
}
break;
case TYPE_IPV4ADDR:
if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
defval=config_setdefault_ipv4addr(&(cfgoptions[i]),prefix);
defval = config_setdefault_ipv4addr(cfg, &(cfgoptions[i]), prefix);
} else {
rst=config_assign_ipv4addr(cfgoptions, str);
rst = config_assign_ipv4addr(cfg, cfgoptions, str);
if (rst < 0) {
fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath);
@@ -478,15 +490,19 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
if (fatalerror == 1) {
fprintf(stderr,"[LIBCONFIG] fatal errors found when processing %s \n", libconfig_privdata.configfile );
config_libconfig_end();
end_configmodule();
config_libconfig_end(cfg);
end_configmodule(cfg);
}
return status;
}
int config_libconfig_getlist(paramlist_def_t *ParamList,
paramdef_t *params, int numparams, char *prefix) {
int config_libconfig_getlist(configmodule_interface_t *cfg,
paramlist_def_t *ParamList,
paramdef_t *params,
int numparams,
char *prefix)
{
config_setting_t *setting;
int i,j,status;
char *listpath=NULL;
@@ -502,8 +518,7 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
if ( setting) {
status = ParamList->numelt = config_setting_length(setting);
printf_params("[LIBCONFIG] %i %s in config file %s \n",
ParamList->numelt,listpath,libconfig_privdata.configfile );
printf_params(cfg, "[LIBCONFIG] %i %s in config file %s \n", ParamList->numelt, listpath, libconfig_privdata.configfile);
} else {
printf("[LIBCONFIG] list %s not found in config file %s \n",
listpath,libconfig_privdata.configfile );
@@ -512,10 +527,10 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
}
if (ParamList->numelt > 0 && params != NULL) {
ParamList->paramarray = config_allocate_new(ParamList->numelt * sizeof(paramdef_t *), true);
ParamList->paramarray = config_allocate_new(cfg, ParamList->numelt * sizeof(paramdef_t *), true);
for (i=0 ; i < ParamList->numelt ; i++) {
ParamList->paramarray[i] = config_allocate_new(numparams * sizeof(paramdef_t), true);
ParamList->paramarray[i] = config_allocate_new(cfg, numparams * sizeof(paramdef_t), true);
memcpy(ParamList->paramarray[i], params, sizeof(paramdef_t)*numparams);
for (j=0; j<numparams; j++) {
@@ -523,7 +538,7 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
}
sprintf(cfgpath,"%s.[%i]",listpath,i);
config_libconfig_get(ParamList->paramarray[i], numparams, cfgpath );
config_libconfig_get(cfg, ParamList->paramarray[i], numparams, cfgpath);
} /* for i... */
} /* ParamList->numelt > 0 && params != NULL */
@@ -533,12 +548,15 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
return status;
}
int config_libconfig_init(char *cfgP[], int numP) {
int config_libconfig_init(configmodule_interface_t *cfg)
{
char **cfgP = cfg->cfgP;
int numP = cfg->num_cfgP;
config_init(&(libconfig_privdata.cfg));
libconfig_privdata.configfile = strdup((char *)cfgP[0]);
config_get_if()->numptrs=0;
pthread_mutex_init(&config_get_if()->memBlocks_mutex, NULL);
memset(config_get_if()->oneBlock,0,sizeof(config_get_if()->oneBlock));
cfg->numptrs = 0;
pthread_mutex_init(&cfg->memBlocks_mutex, NULL);
memset(cfg->oneBlock, 0, sizeof(cfg->oneBlock));
/* search for include path parameter and set config file include path accordingly */
for (int i=0; i<numP; i++) {
if (strncmp(cfgP[i],"incp",4) == 0) {
@@ -569,7 +587,7 @@ int config_libconfig_init(char *cfgP[], int numP) {
}
/* possibly init a libconfig struct for saving really used params */
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
config_init(&(libconfig_privdata.runtcfg));
// config_set_options (&(libconfig_privdata.runtcfg), CONFIG_OPTION_ALLOW_OVERRIDES, CONFIG_TRUE);
}
@@ -577,25 +595,34 @@ int config_libconfig_init(char *cfgP[], int numP) {
return 0;
}
void config_libconfig_write_parsedcfg(void)
void config_libconfig_write_parsedcfg(configmodule_interface_t *cfg)
{
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
char *fname = strdup(libconfig_privdata.configfile);
int newcfgflen = strlen(libconfig_privdata.configfile) + strlen(cfgptr->tmpdir) + 20;
cfgptr->status->debug_cfgname = realloc(cfgptr->status->debug_cfgname, newcfgflen);
int newcfgflen = strlen(libconfig_privdata.configfile) + strlen(cfg->tmpdir) + 20;
cfg->status->debug_cfgname = realloc(cfg->status->debug_cfgname, newcfgflen);
time_t t = time(NULL);
struct tm tm = *localtime(&t);
snprintf(cfgptr->status->debug_cfgname, newcfgflen, "%s/%s-run%d_%02d_%02d_%02d%02d", cfgptr->tmpdir, basename(fname), tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min);
if (config_write_file(&(libconfig_privdata.runtcfg), cfgptr->status->debug_cfgname) != CONFIG_TRUE) {
snprintf(cfg->status->debug_cfgname,
newcfgflen,
"%s/%s-run%d_%02d_%02d_%02d%02d",
cfg->tmpdir,
basename(fname),
tm.tm_year + 1900,
tm.tm_mon + 1,
tm.tm_mday,
tm.tm_hour,
tm.tm_min);
if (config_write_file(&(libconfig_privdata.runtcfg), cfg->status->debug_cfgname) != CONFIG_TRUE) {
fprintf(stderr,
"[LIBCONFIG] %s %d file %s - line %d: %s\n",
__FILE__,
__LINE__,
cfgptr->status->debug_cfgname,
cfg->status->debug_cfgname,
config_error_line(&(libconfig_privdata.runtcfg)),
config_error_text(&(libconfig_privdata.runtcfg)));
} else {
printf("[LIBCONFIG] file %s created successfully\n", cfgptr->status->debug_cfgname);
printf("[LIBCONFIG] file %s created successfully\n", cfg->status->debug_cfgname);
}
free(fname);
} else {
@@ -603,9 +630,10 @@ void config_libconfig_write_parsedcfg(void)
}
}
void config_libconfig_end(void ) {
void config_libconfig_end(configmodule_interface_t *cfg)
{
config_destroy(&(libconfig_privdata.cfg));
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
config_destroy(&(libconfig_privdata.runtcfg));
}
if ( libconfig_privdata.configfile != NULL ) {

View File

@@ -89,7 +89,7 @@ const mapping log_options[] = {{"nocolor", FLAG_NOCOLOR},
{"wall_clock", FLAG_REAL_TIME},
{NULL, -1}};
mapping log_maskmap[] = LOG_MASKMAP_INIT;
const mapping log_maskmap[] = LOG_MASKMAP_INIT;
static const char *const log_level_highlight_start[] =
{LOG_RED, LOG_ORANGE, LOG_GREEN, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
@@ -283,7 +283,7 @@ void log_getconfig(log_t *g_log)
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_debug[sizeof(log_maskmap)/sizeof(mapping)];
paramdef_t logparams_dump[sizeof(log_maskmap)/sizeof(mapping)];
int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX);
int ret = config_get(config_get_if(), logparams_defaults, sizeofArray(logparams_defaults), CONFIG_STRING_LOG_PREFIX);
if (ret <0) {
fprintf(stderr,"[LOG] init aborted, configuration couldn't be performed\n");
@@ -337,8 +337,8 @@ void log_getconfig(log_t *g_log)
}
/* read the per component parameters */
config_get( logparams_level, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_logfile, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
config_get(config_get_if(), logparams_level, MAX_LOG_PREDEF_COMPONENTS, CONFIG_STRING_LOG_PREFIX);
config_get(config_get_if(), logparams_logfile, MAX_LOG_PREDEF_COMPONENTS, CONFIG_STRING_LOG_PREFIX);
/* now set the log levels and infile option, according to what we read */
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
@@ -367,10 +367,10 @@ void log_getconfig(log_t *g_log)
logparams_dump[i].numelt = 0;
}
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_get(config_get_if(), logparams_debug, sizeofArray(log_maskmap) - 1, CONFIG_STRING_LOG_PREFIX);
config_get(config_get_if(), logparams_dump, sizeofArray(log_maskmap) - 1, CONFIG_STRING_LOG_PREFIX);
if (config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX) > 0)
if (config_check_unknown_cmdlineopt(config_get_if(), CONFIG_STRING_LOG_PREFIX) > 0)
exit(1);
/* set the debug mask according to the debug parameters values */

View File

@@ -25,7 +25,7 @@ extern log_t *g_log;
extern const mapping log_level_names[];
extern const mapping log_options[];
extern mapping log_maskmap[];
extern const mapping log_maskmap[];
extern int log_mem_flag;
extern char * log_mem_filename;
extern char logmem_filename[1024];

View File

@@ -1,7 +1,5 @@
*.o
*.a
T_IDs.h
T_messages.txt.h
genids
tracer/enb
tracer/gnb
@@ -18,3 +16,4 @@ tracer/extract_output_subframe
tracer/extract
tracer/multi
tracee/tracee
incgen

View File

@@ -8,11 +8,12 @@ else()
endif()
add_custom_command(OUTPUT T_IDs.h
COMMAND genids ${CMAKE_CURRENT_SOURCE_DIR}/T_messages.txt T_IDs.h
DEPENDS genids
DEPENDS genids T_messages.txt
COMMENT "Generating T_IDs.h from T_messages.txt"
)
add_custom_command(OUTPUT T_messages.txt.h
COMMAND xxd -i T_messages.txt ${CMAKE_CURRENT_BINARY_DIR}/T_messages.txt.h
DEPENDS T_messages.txt
COMMENT "Generating T_messages.txt.h from T_messages.txt"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@@ -1,10 +1,10 @@
CC=gcc
CFLAGS=-Wall -g
CFLAGS=-Wall -g -Iincgen
GENIDS=genids
GENIDS_OBJS=genids.o
all : $(GENIDS) T_messages.txt.h T_IDs.h
all : $(GENIDS) incgen/T_messages.txt.h incgen/T_IDs.h
$(GENIDS): $(GENIDS_OBJS)
$(CC) $(CFLAGS) -o $(GENIDS) $(GENIDS_OBJS)
@@ -12,21 +12,24 @@ $(GENIDS): $(GENIDS_OBJS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
T_messages.txt.h: T_messages.txt
xxd -i T_messages.txt T_messages.txt.h
incgen/T_messages.txt.h: T_messages.txt
mkdir -p incgen
xxd -i T_messages.txt incgen/T_messages.txt.h
T_IDs.h: $(GENIDS) T_messages.txt
./$(GENIDS) T_messages.txt T_IDs.h
incgen/T_IDs.h: $(GENIDS) T_messages.txt
mkdir -p incgen
./$(GENIDS) T_messages.txt incgen/T_IDs.h
check_vcd: T_IDs.h T_messages.txt.h
check_vcd: incgen/T_IDs.h incgen/T_messages.txt.h
gcc -Wall -I. -I.. -I../itti -I../../../openair2/COMMON -Itracer -o _check_vcd check_vcd.c tracer/database.c tracer/utils.c -lm -pthread
./_check_vcd T_messages.txt ../LOG/vcd_signal_dumper.h || (rm -f ./_check_vcd ./T_IDs.h ./T_messages.txt.h && false)
./_check_vcd T_messages.txt ../LOG/vcd_signal_dumper.h || (rm -rf ./_check_vcd ./incgen && false)
rm -f ./_check_vcd
.PHONY: check_vcd
clean:
rm -f *.o $(GENIDS) core T_IDs.h T_messages.txt.h _check_vcd
rm -f *.o $(GENIDS) core _check_vcd
rm -rf incgen
cleanall: clean
cd tracer && $(MAKE) clean

View File

@@ -192,13 +192,9 @@ void T_Config_Init(void)
int T_nowait = 0;
paramdef_t ttraceparams[] = CMDLINE_TTRACEPARAMS_DESC;
config_get(ttraceparams,
sizeof(ttraceparams) / sizeof(paramdef_t),
TTRACER_CONFIG_PREFIX);
config_get(config_get_if(), ttraceparams, sizeofArray(ttraceparams), TTRACER_CONFIG_PREFIX);
/* compatibility: look for TTracer command line options in root section */
config_process_cmdline(ttraceparams,
sizeof(ttraceparams) / sizeof(paramdef_t),
NULL);
config_process_cmdline(config_get_if(), ttraceparams, sizeofArray(ttraceparams), NULL);
if (T_stdout < 0 || T_stdout > 2) {
printf("fatal error: T_stdout = %d but only values 0, 1, or 2 are allowed\n", T_stdout);

View File

@@ -1,8 +1,10 @@
CC=gcc
CFLAGS=-Wall -g -pthread -DT_TRACER -I.
CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I../incgen
PROG=tracee
OBJS=tracee.o ../T.o ../local_tracer.o
OBJS=tracee.o T.o ../local_tracer.o
all: T_dep $(PROG)
$(PROG): $(OBJS)
$(CC) $(CFLAGS) -o $(PROG) $(OBJS) -lrt
@@ -10,5 +12,11 @@ $(PROG): $(OBJS)
tracee.o: tracee.c
$(CC) $(CFLAGS) -c -o $@ $<
T.o: ../T.c
$(CC) $(CFLAGS) -c -o $@ $<
T_dep:
cd .. && make
clean:
rm -f *.o $(PROG) core

View File

@@ -0,0 +1,14 @@
#ifndef _CONFIG_USERAPI_H_
#define _CONFIG_USERAPI_H_
typedef int paramdef_t;
#ifdef CMDLINE_TTRACEPARAMS_DESC
#undef CMDLINE_TTRACEPARAMS_DESC
#endif
#define CMDLINE_TTRACEPARAMS_DESC {}
#define config_get(dummy, ...) (void)(dummy)
#define config_process_cmdline(...) /**/
#endif /* _CONFIG_USERAPI_H_ */

View File

@@ -6,7 +6,8 @@
int main(void)
{
int frame = 0;
T_init(2021, 1, 0);
T_init(2021, 1);
T_stdout = 0;
while (1) {
getchar();
T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(0), T_INT(0), T_INT(frame), T_INT(0), T_INT(0), T_INT(0));

View File

@@ -1,5 +1,5 @@
CC=gcc
CFLAGS=-Wall -g -pthread -DT_TRACER -I.
CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I../incgen
#CFLAGS += -O3 -ffast-math -fomit-frame-pointer
@@ -66,9 +66,9 @@ gnb: utils.o gnb.o database.o event.o handler.o configuration.o \
filter/filter.a
$(CC) $(CFLAGS) -o gnb $^ $(LIBS) $(XLIBS)
multi.o: ../T_IDs.h
multi.o: ../incgen/T_IDs.h
../T_IDs.h:
../incgen/T_IDs.h: ../T_messages.txt
cd .. && $(MAKE)
.PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a

View File

@@ -46,7 +46,7 @@ void loader_init(void) {
paramdef_t LoaderParams[] = LOADER_PARAMS_DESC;
loader_data.mainexec_buildversion = PACKAGE_VERSION;
int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),LOADER_CONFIG_PREFIX);
int ret = config_get(config_get_if(), LoaderParams, sizeofArray(LoaderParams), LOADER_CONFIG_PREFIX);
if (ret <0) {
printf("[LOADER] configuration couldn't be performed via config module, parameters set to default values\n");
if (loader_data.shlibpath == NULL) {
@@ -82,7 +82,7 @@ static char *loader_format_shlibpath(char *modname, char *version)
/* shared lib name is formatted as lib<module name><module version>.so */
char cfgprefix[sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16];
sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname);
ret = config_get(LoaderParams, sizeofArray(LoaderParams), cfgprefix);
ret = config_get(config_get_if(), LoaderParams, sizeofArray(LoaderParams), cfgprefix);
if (ret <0) {
fprintf(stderr, "[LOADER] %s %d couldn't retrieve config from section %s\n", __FILE__, __LINE__, cfgprefix);
}
@@ -214,7 +214,7 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *
int j = 0;
for (; j < shlib->numfunc; ++j) {
if (shlib->funcarray[j].fptr == farray[i].fptr) {
int rc = strcmp(shlib->funcarray[i].fname, farray[i].fname);
int rc = strcmp(shlib->funcarray[j].fname, farray[i].fname);
AssertFatal(rc == 0,
"reloading the same fptr with different fnames (%s, %s)\n",
shlib->funcarray[i].fname, farray[i].fname);

View File

@@ -450,7 +450,7 @@ int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
break;
}
AssertFatal(i > 0 && i < sizeofArray(nr_bandtable), "band is not existing: %d\n",nr_bandP);
AssertFatal(i >= 0 && i < sizeofArray(nr_bandtable), "band is not existing: %d\n",nr_bandP);
LOG_D(PHY, "NR band table index %d (Band %d, dl_min %lu, ul_min %lu)\n", i, nr_bandtable[i].band, nr_bandtable[i].dl_min,nr_bandtable[i].ul_min);
return i;

View File

@@ -43,6 +43,8 @@
#define NR_NB_REG_PER_CCE 6
#define NR_NB_SC_PER_RB 12
#define NR_MAX_NUM_LCID 32
#define NR_MAX_NUM_QFI 64
#define NR_MAX_NUM_SLICES 10
typedef enum {
nr_FR1 = 0,

View File

@@ -844,7 +844,7 @@ static bool exec_moduleinit(char *modname) {
int add_embeddedmodules(void) {
int ret=0;
int pindex = config_paramidx_fromname(telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t), TELNETSRV_OPTNAME_STATICMOD);
int pindex = config_paramidx_fromname(telnetoptions, sizeofArray(telnetoptions), TELNETSRV_OPTNAME_STATICMOD);
for(int i=0; i<telnetoptions[pindex].numelt; i++) {
bool success = exec_moduleinit(telnetoptions[pindex].strlistptr[i]);
if (success)
@@ -856,7 +856,7 @@ int add_embeddedmodules(void) {
int add_sharedmodules(void) {
int ret=0;
int pindex = config_paramidx_fromname(telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t), TELNETSRV_OPTNAME_SHRMOD);
int pindex = config_paramidx_fromname(telnetoptions, sizeofArray(telnetoptions), TELNETSRV_OPTNAME_SHRMOD);
for(int i=0; i<telnetoptions[pindex].numelt; i++) {
char *name = telnetoptions[pindex].strlistptr[i];
char libname[256];
@@ -875,7 +875,7 @@ int add_sharedmodules(void) {
*/
int telnetsrv_autoinit(void) {
memset(&telnetparams,0,sizeof(telnetparams));
config_get( telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t),"telnetsrv");
config_get(config_get_if(), telnetoptions, sizeofArray(telnetoptions), "telnetsrv");
/* possibly load a exec specific shared lib */
char *execfunc=get_softmodem_function(NULL);
char libname[64];

View File

@@ -71,7 +71,7 @@ int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
}
// verify it exists in RRC as well
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti(RC.nrrrc[0], rnti);
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti_any_du(RC.nrrrc[0], rnti);
if (!rrcue)
ERROR_MSG_RET("could not find UE with RNTI %04x\n", rnti);
@@ -95,7 +95,7 @@ int release_bearer(char *buf, int debug, telnet_printfunc_t prnt)
}
// verify it exists in RRC as well
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti(RC.nrrrc[0], rnti);
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti_any_du(RC.nrrrc[0], rnti);
if (!rrcue)
ERROR_MSG_RET("could not find UE with RNTI %04x\n", rnti);

View File

@@ -87,7 +87,7 @@ int get_reestab_count(char *buf, int debug, telnet_printfunc_t prnt)
rnti = strtol(buf, NULL, 16);
if (rnti < 1 || rnti >= 0xfffe)
ERROR_MSG_RET("RNTI needs to be [1,0xfffe]\n");
ue = rrc_gNB_get_ue_context_by_rnti(RC.nrrrc[0], rnti);
ue = rrc_gNB_get_ue_context_by_rnti_any_du(RC.nrrrc[0], rnti);
if (!ue)
ERROR_MSG_RET("could not find UE with RNTI %04x in RRC\n");
}

View File

@@ -511,9 +511,9 @@ int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt)
int proccmd_restart(char *buf, int debug, telnet_printfunc_t prnt)
{
if (debug > 0)
prnt("process module received %s\n", buf);
end_configmodule();
prnt("process module received %s\n", buf);
configmodule_interface_t *cfg = config_get_if();
end_configmodule(cfg);
execvpe(cfg->argv[0], cfg->argv, environ);
return 0;
}

View File

@@ -176,7 +176,7 @@ void initFloatingCoresTpool(int nbThreads,tpool_t *pool, bool performanceMeas, c
}
#ifdef TEST_THREAD_POOL
volatile int oai_exit=0;
int oai_exit = 0;
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{

View File

@@ -278,8 +278,8 @@ void run_cpumeasur(void) {
void init_meas(void) {
pthread_t thid;
paramdef_t cpumeasur_params[] = CPUMEASUR_PARAMS_DESC;
int numparams=sizeof(cpumeasur_params)/sizeof(paramdef_t);
int rt = config_get( cpumeasur_params,numparams,CPUMEASUR_SECTION);
int numparams = sizeofArray(cpumeasur_params);
int rt = config_get(config_get_if(), cpumeasur_params, numparams, CPUMEASUR_SECTION);
AssertFatal(rt >= 0, "cpumeasur configuration couldn't be performed");
measur_table=calloc(max_cpumeasur,sizeof( time_stats_t *));
AssertFatal(measur_table!=NULL, "couldn't allocate %u cpu measurements entries\n",max_cpumeasur);

View File

@@ -753,7 +753,7 @@ int websrv_callback_get_softmodemstatus(const struct _u_request *request, struct
}
websrv_add_modeminfo(modemvars, "command line", cmdline, "string");
if ((config_get_if()->rtflags & CONFIG_SAVERUNCFG) && (config_get_if()->write_parsedcfg != NULL)) {
config_get_if()->write_parsedcfg();
config_get_if()->write_parsedcfg(config_get_if());
websrv_add_modeminfo(modemvars, "Parsed config file", config_get_if()->status->debug_cfgname, "configfile");
}
@@ -819,7 +819,7 @@ void *websrv_autoinit()
{
int ret;
memset(&websrvparams, 0, sizeof(websrvparams));
config_get(websrvoptions, sizeof(websrvoptions) / sizeof(paramdef_t), "websrv");
config_get(config_get_if(), websrvoptions, sizeofArray(websrvoptions), "websrv");
/* check if telnet server is loaded or not */
add_telnetcmd_func_t addcmd = (add_telnetcmd_func_t)get_shlibmodule_fptr("telnetsrv", TELNET_ADDCMD_FNAME);
if (addcmd != NULL) {

View File

@@ -183,7 +183,6 @@ Some libraries have further dependencies and might not build on every system:
- `enbscope`, `uescope`, `nrscope`: libforms/X
- `nrqtscope`: Qt5
- `ldpc_cuda`: CUDA
- `ldpc_t1`: DPDK and VVDN T1
- `websrv`: npm and others
# Running `cmake` directly

View File

@@ -1901,7 +1901,6 @@ INPUT = \
@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/nr_rrc_extern.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/L2_nr_interface.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_reconfig.c \
@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

@@ -12,204 +12,44 @@
</tr>
</table>
# 1. Introduction
[[_TOC_]]
We use OpenAirInterface source code, and it's regular deployment scheme.
# Introduction
F1 specification is in 3GPP documents: TS 38.470 header document and all documents listed in chapter 2 References of TS 38.470.
The F1 interface is the functional split of 3GPP between the CU (centralized
unit: PDCP, RRC, SDAP) and the DU (distributed unit: RLC, MAC, PHY). It is
standardized in TS 38.470 - 38.473 for 5G NR. No equivalent for 4G exists.
This document explains how the source code works.
We assume that each DU handles only one cell. Multiple DUs connected to one CU
are supported. Mobility over F1 is not yet supported.
Offered features and deployment instructions are described in:
https://gitlab.eurecom.fr/oai/openairinterface5g/-/wikis/f1-interface
# Control plane status (F1-C)
# 2. Common multi-threading architecture #
## Implementation Status
The CU and DU interfaces are based on ITTI threads (see oai/common/utils/ocp_itti/itti.md)
Note that OAI uses F1 "internally". That means, that even if you run a
monolithic gNB, the internal information exchange uses F1. You can therefore
expect that everything working in a monolithic deployment should also work in
F1. The current implementation is based on R16.3.
All OAI upper layers use the ITTI framework to run isolated threads dedicated to one feature.
The lower layers adopt case by case specific software architecture.
Note that NSA does NOT follow this logic yet, and does not work with F1.
```mermaid
graph TD
Linux[configuration file] --> APP[gNB_app_task]
Socks[Linux UDP] --> GTP[nr_gtpv1u_gNB_task]
APP --> CU
APP --> DU
A[Linux SCTP] -->|sockets| SCTP(OAI itti thread TASK_SCTP)
SCTP-->|TASK_NGAP| NG[ngap_gNB_task]
NG-->|TASK_SCTP| SCTP
SCTP-->|TASK_DU_F1| DU[F1AP_DU_task]
SCTP-->|TASK_CU_F1| CU[F1AP_CU_task]
CU-->|TASK_RRC_GNB| RRC
RRC -->|non ITTI| PHY[OAI L1+L2]
RRC -->|API calls to create tunnels| GTP
PHY --> |user plane| GTP
CU --> |TASK_GTPV1_U| GTP
DU --> |TASK_GTPV1_U| GTP
```
A "task" is a Linux thread running infinite waiting loop on one ITTI queue
The following messages are currently implemented:
app task manages the initial configuration
- F1 Setup Request and F1 Setup Response/Failure
- Initial UL RRC, UL/DL RRC Message Transfer
- F1 UE Context management messages for the "good case"
* Setup Request/Response
* Modification Request/Response
* Release Request/Command/Complete
sctp task mamanges the SCTP Linux sockets
All other messages are not implemented or not working reliably:
CU code runs in the task F1AP_CU_task. It stores it's private data context in a static variable. No mutex is used, as the single interface to CU ITTI tast in incoming ITTI messages. CU task is a single ITTI queue, but multiple CU could exist in one Linux process, using the "instance id" (called "module id" also) to create separate contextual information for each CU instance.
- F1 CU/DU configuration updade
- Paging messages
- Warning Message transmissions
DU code runs in the task F1AP_DU_task. The design is similar to CU task
All GTP-U tunnels are managed in a Linux Thread, that have partially ITTI design:
1. tunnel creation/deletion is by C API functions direct calls (a mutex protects it)
2. outgoing packets are pushed in a ITTI queue to the gtp thread
3. incoming packets are sent to the tunnel creator using a C callback (the callback function is given in tunnel creation order). The callback should not block
# 3. CU F1AP messages #
## startup
CU thread starts when the CU starts. It opens listening socket on F1AP_PORT_NUMBER by sending the appropriate message to TASK_SCTP.
It will accept the first incoming connection on this port
## F1 SETUP
DU has connected, and sent this message.
The CU receives, decode it and send relevant information to RRC thread by message F1AP_SETUP_REQ
## F1 SETUP response
RRC sends two messages to CU F1 task: the information to encode the F1 setup response and a second message to encode F1AP_GNB_CU_CONFIGURATION_UPDATE
Upon reception of these two messages the CU task encodes and sends the messages to the DU
## UE entry
When CCH channel decoding finds a new UE identity, it call rrc_gNB_generate_RRCSetup() that will send F1AP_DL_RRC_MESSAGE to the CU task.
The CU encodes and sends to DU DLRRCMessageTransfer
## UE attach/detach
When rrc_gNB_process_RRCReconfigurationComplete() occurs, the RRC sends to CU task the message F1AP_UE_CONTEXT_SETUP_REQ. The CU task encodes the F1 message UEContextSetup and send it to the DU over F1AP.
This function rrc_gNB_process_RRCReconfigurationComplete() also creates the GTP-U user plane bearers.
## F1AP incoming messages
SCTP tasks sends a ITTI message SCTP_DATA_IND to the CU task.
A array of functions pointers and the F1AP standard identifier "procedureCode", the CU calls the appropriate function
Hereafter the most significant messages processing
### CU_handle_F1_SETUP_REQUEST
Transcodes information to the same message toward RRC (F1AP_SETUP_REQ)
### CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER
Transcodes information to the same message toward RRC (NR_RRC_MAC_CCCH_DATA_IND)
### CU_handle_UL_RRC_MESSAGE_TRANSFER
Encode and send data to PDCP (calling pdcp_data_ind ()) for processing UL data.
# DU F1 Messages
## Startup
The task "gNB app" after rzading the configuration file, sends a first message F1AP_SETUP_REQ to DU task
Using this message, the uniq DU task (Linux Thread) creates a DU instance context memory space, calls SCTP task to create a socket to the CU.
When it receives from the SCTP task the socket creation success, the DU task encodes+sends the F1 setup message to the CU.
## F1AP_INITIAL_UL_RRC_MESSAGE
When MAC layer push UL data to DU task, the DU sends to CU the message InitialULRRCMessageTransfer
## F1AP_UL_RRC_MESSAGE
In case of SRB bearer, the RLC layer use this message to push rlc bearer payload to DU task, that forward to CU
## pdcp_data_ind
This function call in RLC, when it is a DRB will be replaced by F1-U transport to CU
## F1AP incoming messages
SCTP tasks sends a ITTI message SCTP_DATA_IND to the DU task.
A array of functions pointers and the F1AP standard identifier "procedureCode", the DU calls the appropriate function
Hereafter the most significant messages processing
### DU_send_F1_SETUP_RESPONSE
Decode the CU message, then encode a message to TASK_GNB_APP. The thread "APP" extracts the system information block and reconfigure the DU with: du_extract_and_decode_SI(), configure_gnb_du_mac()
### DU_handle_gNB_CU_CONFIGURATION_UPDATE
No developped
### DU_handle_UE_CONTEXT_SETUP_REQUEST
Push data to RLC layer for transmisstion in DL (to the UE) by calling enqueue_rlc_data_req()
### DU_handle_DL_RRC_MESSAGE_TRANSFER
Depending on the content, adds UE context in DU low layers and/or send data to the UE with rlc_data_req()
# F1-U messages
The data path by itself doesn't make any difficulty:
1. for UL, rlc calls pdcp_data_ind (DRB) or sends a message to RRC (SRB). So, we can replace pdcp_data_ind() by du_pdcp_data_ind() that will push the message in the GTP tunnel. In CU, assuming the tunnel is in place, the right call back decapsulate the transport (cu_ul_recv()), then calls pdcp_data_ind() in CU
The SRB are sent in DU RRC tasks via itti F1AP_UL_RRC_MESSAGE (see above the processing)
2. For DL, pdcp (in CU for DRBs) calls rlc_data_req (by a decoupling queue and thread rlc_data_req_thread, so function du_rlc_data_req() or enqueue_rlc_data_req()). in DU, assuming the gtp-u tunnel exists, a reception call back (du_dl_recv()) decapsulate the gtp-u packet and calls du_rlc_data_req()
Hereafter the processing design, that doesn't require to setup a new context storage, as we can use the GTP-U internal tables: rnti+rb=>teid for outgoing gtp-u packets and teid=>rnti+rb for incoming gtp-u packets
In CU case, the DRB tunnel to DU and the tunnel on N3 have the same key (rnti, rb id), but they run in two different GTP-U instances.
Each instance binds on diffrent sockets.
For F1-U, both DU and CU binds on the full quadruplet (IP source, port source, IP destination, port destination) from the configuration file parameters:
local_s_address, remote_s_address,local_s_portd, remote_s_portd
These 4 values are in:
CU: at cell level (same level as nr_cellid parameter), they are read if tr_s_preference = "f1"; is set
DU: in block MACRLCs, if tr_n_preference = "f1"; is set in this block
## tunnels setup
In GTP-U, TS 29.281 specifies a option header (NR RAN Container This extension header may be transmitted in a G-PDU over the X2-U, Xn-U and F1-U user plane interfaces), but it is not mandatory optional header (as is the N3 one).
So, we can use this header a something reliable with other vendors implementation.
In DL, we need to associate the packet with: rnti, rb (radio bearer) and "mui" (a OAI internal id that is optional and may be removed soon) to call rlc_data_req()
In UL, we need also the RNTI, the rb
So, we need to create a gtp-u tunnel for each rb over F1, then manage in CU and DU the association between a uniq TEid and the pair(rnti, rb). This is already what we have in existing OAI GTP-U layer interface.
In F1AP, for each "DRB to Be Setup Item IEs", we have a field TNL (transport network layer) to set a specific GTP tunnel (@IP, TEid, udp port is always 2152). This is the same for each message related to DRBs. (F1AP carries the SRB payload inside F1AP).
So, For each F1AP containing DRB setup/modification/deletion, the related GTP-U tunnels will be modified one to one.
The exception is the intialisation of new tunnel: in the call to tunnel creation, we need to send the remote TEID, but we don't know yet if we are the initial source. In this case, we issue a dummy (0xFFFF) remote teid; when we receive the remote answer, we get the source teid, that we can inform GTP-U with (using update tunnel).
## processing on GTP-U incoming message
Du_dl_recv() or cu_ul_recv() are called because we have set this callbacks in creat/update tunnel calls to gtp-u. As gtp-u maintains a pair(rnti,rbid) associated to each tunnel, the functions can be very simple stateless callback that calls pdcp_data_ind() or rlc_data_req() to get back in normal processing path
## CU/DU outgoing
DU rlc north output goes to du_pdcp_data_ind() that push a outgoing packet request to gtp-u, using the rnti+rb as ids. GTP-U must have the tunnel existing, then it simply implement the same as in N3 for exemple.
CU pdcp south output calls cu_rlc_data_ind() that do the same symetric processing.
# High-level F1-C code structure
## High-level F1-C code structure
The F1 interface is used internally between CU (mostly RRC) and DU (mostly MAC)
to exchange information. In DL, the CU sends messages as defined by the
@@ -252,3 +92,241 @@ Monolithic: mac_rrc_dl_direct.c | |
| |
+-------------+
```
# Data plane status (F1-U)
F1-U uses GTP-U for information exchange. The GTP protocol uses some extensions
for NR-U protocol to report buffer status, but this is not properly tested and
might malfunction. One limitation is that the current implementation
acknowledges each packet individually.
Multiple DUs at one CU are supported in the data plane (as in the control plane).
# How to run
As mentioned earlier, OAI uses F1 internally. It is always compiled in.
To start CU/DU, you use `./nr-softmodem` with the appropriate configuration
files, for instance:
```
sudo cmake_targets/ran_build/build/nr-softmodem --sa -O ci-scripts/conf_files/gnb-cu.sa.band78.106prb.conf
sudo cmake_targets/ran_build/build/nr-softmodem --sa -O ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf
```
These files are tested in the CI, and are configured for use in docker,
see [this `docker-compose` file](../ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml).
The rules to decide if a config triggers a start of a DU, CU, or monolithic
gNB, are, in order:
1. If the `MACRLCs` section lists `f1` as northbound transport preference
(`tr_n_preference`), it is a DU.
2. If the `gNBs` section lists `f1` as a southound transport preference
(`tr_s_preference`), it is a CU.
3. It is a (monolithic) gNB.
## Configuration of F1 IP/port information
For a local deployment, you should update the following fields.
We assume that the CU will bind on `192.168.70.129` towards the core,
`127.0.0.3` towards the DU, and the DU `127.0.0.4` towards the CU.
In the CU file:
- Update the `gNBs.[0].amf_ip_address` and `gNBs.[0].NETWORK_INTERFACES`
section towards the core (typically, OAI CN is configured to provide a docker
bridge on `192.168.70.129` and the AMF is on `192.168.70.132`):
- `gNBs.[0].amf_ip_address.[0].ipv4 192.168.70.132`
- `gNBs.[0].NETWORK_INTERFACES.GNB_IPV4_ADDRESS_FOR_NG_AMF 192.168.70.129`
- `gNBs.[0].NETWORK_INTERFACES.GNB_IPV4_ADDRESS_FOR_NGU 192.168.70.132`
- Set `gNBs.[0].tr_s_preference` (transport south-bound) to `f1`
- Update the `gNBs.[0].local_s_address` (CU-local south address) for the F1-C
south-bound interface: `127.0.0.3`
- Note: the `gNBs.[0].remote_s_address` (CU-remote/DU south address) is
ignored, but we recommend to put `0.0.0.0` ("any")
- Ports should match the ones in the DU config, but for simplicity and
standards-conformity, simply set all to 2152:
- `local_s_portc` in CU should match `remote_n_portc` in DU
- `local_s_portd` in CU should match `remote_n_portd` in DU
- `remote_s_portc` in CU should match `local_n_portc` in DU
- `remote_s_portd` in CU should match `local_n_portd` in DU
In the DU file:
- Set `MACRLCs.[0].tr_n_preference` to `f1`
- Update `MACRLCs.[0].local_n_address` (local north-bound address of the DU) to
`127.0.0.4`
- Update `MACRLCs.[].remote_n_address` (remote north-bound address of the CU)
to `127.0.0.3`
Note: all `local_*_if_name` parameters are ignored.
## Configuration of multiple DUs
Upon F1 Setup Request of a new DU, the CU cross-checks that
- no DUs have the same gNB-DU IDs, taken from `gNBs.[0].gNB_ID`, and
- no cells have the same NR Cell ID, taken from `gNBs.[0].nr_cellid`, and
- no cells have the same physical cell IDs, taken from `gNBs.[0].servingCellConfigCommon.[0].physCellId`.
If any of these are the same, the CU will reject the DU with an F1 Setup
Failure. Thus, you should make sure that in the DU's configs, these parameters
are set differently.
You have to of course make sure that the local interface of the DU
(`MACRLCs.[0].local_n_address`) is different as well.
Assuming you use RFsim, you should make the RFsimulator server side (typically
the gNB) bind on different hosts (`rfsimulator.serverport`).
# Code documentation
## Common multi-threading architecture
The CU and DU interfaces are based on ITTI threads (see `common/utils/ocp_itti/itti.md`)
adopted by all OAI upper layers to run isolated threads dedicated to one feature.
```mermaid
graph TD
Linux[configuration file] --> APP[gNB_app_task]
Socks[Linux UDP] --> GTP[nr_gtpv1u_gNB_task]
APP --> CU
APP --> DU
A[Linux SCTP] -->|sockets| SCTP(OAI itti thread TASK_SCTP)
SCTP-->|TASK_NGAP| NG[ngap_gNB_task]
NG-->|TASK_SCTP| SCTP
SCTP-->|TASK_DU_F1| DU[F1AP_DU_task]
SCTP-->|TASK_CU_F1| CU[F1AP_CU_task]
CU-->|TASK_RRC_GNB| RRC
RRC -->|non ITTI| PHY[OAI L1+L2]
RRC -->|API calls to create tunnels| GTP
PHY --> |user plane| GTP
CU --> |TASK_GTPV1_U| GTP
DU --> |TASK_GTPV1_U| GTP
```
A "task" is a Linux thread running an infinite waiting loop on one ITTI queue.
The `app` task manages the initial configuration; the `sctp` task manages the
SCTP Linux sockets.
The CU encoding/decoding runs in the task executing `F1AP_CU_task()`. It stores its private data context in a static variable.
The DU encoding/decoding runs in the task executing `F1AP_DU_task()`. The design is similar to CU task.
All GTP-U tunnels are managed in a Linux Thread, that have partially ITTI design:
1. tunnel creation/deletion is by C API functions direct calls (a mutex protects it)
2. outgoing packets are pushed in a ITTI queue to the gtp thread
3. incoming packets are sent to the tunnel creator using a C callback (the callback function is given in tunnel creation order). The callback should not block
## F1-C messages towards the CU
The CU thread starts when the CU starts. It opens listening socket on the
configuration-specified IP/port by sending the appropriate message to
`TASK_SCTP`. It will accept any incoming connection and forward any F1 message
to RRC.
You can trace any message by looking up the handler
`cu_task_handle_sctp_data_ind()`, which ultimately triggers a corresponding
ITTI message sent to RRC. All ITTI messages arriving are dispatched in the ITTI
message handling function in `rrc_gNB.c`. For your convenience, find below a
table of same messages that might arrive from the DU and how they are
forwarded.
After handling messages, the RRC uses a callback that determines if messages go
directly to the MAC or are sent to the CU ITTI task (see
[above](#high-level-f1-c-code-structure))
You might also want to consult TS 38.401 regarding the message exchange.
| Incoming F1 message | ITTI message to RRC | RRC handler | Comments |
|---------------------|---------------------|-------------|----------|
| F1 Setup Request | `F1AP_SETUP_REQ` | `rrc_gNB_process_f1_setup_req()` | will trigger either a response or failure |
| Initial UL RRC Message Transfer | `F1AP_INITIAL_UL_RRC_MESSAGE` | `rrc_gNB_process_initial_ul_rrc_message()` | first message from UE, follows up with RRC Setup or Reestablishment |
| UL RRC Message Transfer | `F1AP_UL_RRC_MESSAGE` | `rrc_gNB_decode_dcch()` | UL RRC messages contain DCCH |
| UE Context Response | `F1AP_UE_CONTEXT_SETUP_RESP` | `rrc_CU_process_ue_context_setup_response()` | does not trigger a follow-up, as UE sends Security Response |
| UE Context Modification Response | `F1AP_UE_CONTEXT_MODIFICATION_RESP` | `rrc_CU_process_ue_context_modification_response()` | triggers Reconfiguration if CellGroup in answer |
| UE Context Modification Required | `F1AP_UE_CONTEXT_MODIFICATION_REQUIRED` | `rrc_CU_process_ue_modification_required()` | triggers Reconfiguration |
| UE Context Release Request | `F1AP_UE_CONTEXT_RELEASE_REQ` | `rrc_CU_process_ue_context_release_request()` | RRC will trigger UE release |
| UE Context Release Complete | `F1AP_UE_CONTEXT_RELEASE_COMPLETE` | `rrc_CU_process_ue_context_release_complete()` | frees UE Context, signals to NGAP |
## F1-C Messages towards the DU
The task "gNB app", after reading the configuration file, sends a message
`F1AP_DU_REGISTER_REQ` to the DU task. This message contains network
configuration for the establishment of the SCTP connection, as well as the F1
Setup Request to be sent to the CU.
Using the network configuration, the DU task sets up an SCTP connection via the
SCTP task. When it receives from the SCTP task the socket creation success,
the DU task encodes and sends the F1 setup message to the CU.
Similarly as for the CU, you can trace any message by looking up the handler
`du_task_handle_sctp_data_ind()`. Unlike in the CU, the decoders do NOT send an
ITTI message, but directly call into the scheduler via a message handling
function. This handler acquires the scheduler mutex and executes the
corresponding message handling functionality. All handlers are in
`mac_rrc_dl_handler.c`.
After handling messages, the MAC uses a callback that determines if messages
are sent back to RRC via ITTI, or are sent to the DU ITTI task (see
[above](#high-level-f1-c-code-structure))
You might also want to consult TS 38.401 regarding the message exchange.
| Incoming F1 message | MAC handler | Comments |
|---------------------|-------------|----------|
| F1 Setup Response | `f1_setup_response()` | the DU does not start the radio before receiving this message |
| DL RRC Message Transfer | `dl_rrc_message_transfer()` | Processing timer started if reconfiguration is present[^footnote-reconfig] |
| UE Context Setup Request | `ue_context_setup_request()` | |
| UE Context Modification Request | `ue_context_modification_request()` | |
| UE Context Modification Confirm | `ue_context_modification_confirm()` | |
| UE Context Modification Refuse | `ue_context_modification_refuse()` | Will trigger release request |
| UE Context Release Command | `ue_context_release_command()` | Starts timer for release if UE in sync |
[^footnote-reconfig]: The DU does not decode RRC messages, and does not know
whether an RRC message is a reconfiguration. However, the spec mandates that
a reconfiguration has to be triggered if the CU receives a CellGroupConfig,
originating at the DU. See also flag `expect_reconfiguration`.
## F1-U messages
### General
In the DU in UL, RLC checks in `deliver_sdu()` if we are operating in split
mode, and either (direct) calls `pdcp_data_ind` (DRB) or (f1ap) sends an
`GTPV1U_TUNNEL_DATA_REQ` ITTI message to the GTP task.
In the CU in UL, assuming the tunnel is in place, GTP decapsulates the packet
and calls the callback `cu_f1u_data_req()`, which calls `pdcp_data_ind()` in CU.
In the CU in DL, the PDCP function `deliver_pdu_drb_gnb()` either (direct) calls
into the RLC via `enqueue_rlc_data_req()`, or (f1ap) sends a
`GTPV1U_TUNNEL_DATA_REQ` ITTI message to the GTP task.
In the DU in DL, assuming the GTP-U tunnel exists, GTP decapsulates the packet
and calls the reception call back `du_rlc_data_req()`, which calls
`enqueue_rlc_data_req()` in turn.
## Tunnel Setup
In GTP-U, TS 29.281 specifies a optional header (NR RAN Container). This
extension header may be transmitted in a G-PDU over the X2-U, Xn-U and F1-U user
plane interfaces, but it is not mandatory.
Note that the GTP-U uses internal tables. Instead of exposing TEIDs, it uses the
UE ID (RNTI, RRC UE ID) and Radio Bearer ID to map to a TEID for outgoing GTP-U
packets. Upon receiving, it does the reverse and calls the callbacks. In the CU
case, the DRB tunnel to DU and the tunnel on N3 have the same keys (RRC UE ID,
RB ID), but they run in two different GTP-U instances. Each instance binds on
diffrent sockets, which is the reason you cannot have the same interface for
F1-U and N3/NG-U interfaces (this can be considered a design flaw).
In F1AP, for each "DRB to Be Setup Item IEs", we have a field TNL (transport
network layer) to set a specific GTP tunnel (@IP, TEid). This is the same for
each message related to DRBs.
So, For each F1AP containing DRB setup/modification/deletion, the related GTP-U
tunnels will be modified one to one. The exception is the intialisation of new
tunnel: in the call to tunnel creation, we need to send the remote TEID, but we
don't know yet if we are the initial source. In this case, we issue a dummy
(0xFFFF) remote TEID; when we receive the remote answer, we get the source teid,
with which the GTP-U endpoint is updadet.

View File

@@ -305,6 +305,7 @@ Furthermore, the gNB and UE support
- HARQ procedures
* ULSCH scheduler
- Configuration of fapi PDU according to DCI
- Logical channel prioritization of 'data from any logical channel'
* NR-CSIRS scheduler
- Scheduling of NR-CSIRS reception
- Fill UCI for CSI measurement reporting

View File

@@ -0,0 +1,149 @@
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OAI T1/T2 LDPC offload</font></b>
</td>
</tr>
</table>
**Table of Contents**
[[_TOC_]]
This documentation aims to provide a tutorial for AMD Xilinx T2 Telco card integration into OAI and its usage.
# Requirements
- bitstream image and PMD driver for the T2 card provided by AccelerComm
- DPDK 20.11.7 with patch from Accelercomm (also tested with DPDK 20.11.3)
- tested on RHEL7.9, RHEL9.2, Ubuntu 20.04, Ubuntu 22.04
# DPDK setup
## DPDK installation
```
# Get DPDK source code
git clone https://github.com/DPDK/dpdk-stable.git ~/dpdk-stable
cd ~/dpdk-stable
git checkout v20.11.7
git apply ~/ACL_BBDEV_DPDK20.11.3_xxx.patch
```
Replace `~/ACL_BBDEV_DPDK20.11.3_xxx.patch` by patch file provided by
Accelercomm.
```
cd ~/dpdk-stable
meson setup build
# meson setup --prefix=/opt/dpdk-t2 build for installation with non-default installation prefix
cd build
ninja
sudo ninja install
sudo ldconfig
```
## DPDK configuration
- load required kernel module
```
sudo modprobe igb_uio
sudo insmod ~/dpdk-stable/kernel/linux/igb_uio/igb_uio.ko
```
- check presence of the card and its PCI addres on the host machine
```
lspci | grep "Xilinx"
```
- bind the card with igb_uio driver
```
sudo python3 ~/dpdk-stable/usertools/dpdk-devbind.py -b igb_uio 41:00.0
```
Replace PCI address of the card *41:00.0* by address detected by *lspci | grep "Xilinx"* command
- hugepages setup (10 x 1GB hugepages)
```
sudo python3 ~/dpdk-stable/usertools/dpdk-hugepages.py -p 1G --setup 10G`
```
*Note: device binding and hugepages setup has to be done after every reboot of
the host machine*
# Modifications in the OAI code
## PMD path specification
Path to the PMD for operating the card is specified in `CMakeLists.txt` file in
*LDPC OFFLOAD library* section. Modify following line based on the location of
the PMD on your system. By deafult, path to the PMD is set to `/opt/dpdk-t2/lib/x86_64-linux-gnu/`.
```
find_library(PMD_T2 NAMES rte_baseband_accl_ldpc HINTS "/opt/dpdk-t2/lib/x86_64-linux-gnu/")
```
## T2 card DPDK initialization
Following lines in `openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c` file has to be
modified based on your system requirements. By default, PCI address of the T2 card is set to 41:00.0 and cores 14 and 15 are assigned to the DPDK.
```
char *dpdk_dev = "41:00.0"; //PCI address of the card
char *argv_re[] = {"bbdev", "-a", dpdk_dev, "-l", "14-15", "--file-prefix=b6", "--"};
```
For the DPDK EAL initialization, device is specified by `-a` option and list
of cores to run the DPDK application on is selected by `-l` option. PCI adress of
the T2 card can be detected by `lspci | grep "Xilinx"` command.
# OAI Build
OTA deployment is precisely described in the following tutorial:
- [NR_SA_Tutorial_COTS_UE](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_COTS_UE.md)
Instead of section *3.2 Build OAI gNB* from the tutorial, run following commands:
```
# Get openairinterface5g source code
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git ~/openairinterface5g
cd ~/openairinterface5g
git checkout develop
# Install OAI dependencies
cd ~/openairinterface5g/cmake_targets
./build_oai -I
# Build OAI gNB
cd ~/openairinterface5g
source oaienv
cd cmake_targets
./build_oai -w USRP --ninja --gNB -P -C --build-lib "ldpc_t2"
```
Shared object file *libldpc_t2.so* is created during the compilation. This object is conditionally compiled. Selection of the library to compile is done using *--build-lib ldpc_t2*.
*Required poll mode driver has to be present on the host machine and required DPDK version has to be installed on the host, prior to the build of OAI*
# 5G PHY simulators
## nr_ulsim test
Offload of the channel decoding to the T2 card is in nr_ulsim specified by *-o* option. Example command for running nr_ulsim with LDPC decoding offload to the T2 card:
```
cd ~/openairinterface5g
source oaienv
cd cmake_targets/ran_build/build
sudo ./nr_ulsim -n100 -s20 -m20 -r273 -R273 -o
```
## nr_dlsim test
Offload of the channel encoding to the AMD Xilinx T2 card is in nr_dlsim specified by *-c* option. Example command for running nr_dlsim with LDPC encoding offload to the T2 card:
```
cd ~/openairinterface5g
source oaienv
cd cmake_targets/ran_build/build
sudo ./nr_dlsim -n300 -s30 -R 106 -e 27 -c
```
# OTA test
Offload of the channel encoding and decoding to the AMD Xilinx T2 card is enabled by *--ldpc-offload-enable 1* option.
## Run OAI gNB with USRP B210
```
cd ~/openairinterface5g
source oaienv
cd cmake_targets/ran_build/build
sudo ./nr-softmodem --sa -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --ldpc-offload-enable 1
```
# Limitations
## AMD Xilinx T2 card
- offload of the LDPC encoding implemented for MCS > 2, OAI CPU encoder is used for MCS =< 2
- functionality of the LDPC encoding and decoding offload verified in OTA SISO setup with USRP N310 and Quectel RM500Q, blocking of the card reported for MIMO setup (2 layers)
*Note: AMD Xilinx T1 Telco card is not supported anymore.*

View File

@@ -207,3 +207,8 @@ sudo ethtool -G enp1s0f0 tx 4096 rx 4096
## 6.3 Uplink issues related with noise on the DC carriers
- There is noise on the DC carriers on N300 and especially the X300 in UL. To avoid their use or shift them away from the center to use more UL spectrum, use the `--tune-offset <Hz>` command line switch, where `<Hz>` is ideally half the bandwidth, or possibly less.
## 6.4 Timing-related Problems
- Sometimes, the nrUE would keep repeating RA procedure because of Msg3 failure at the gNB. If it happens, add the `-A` option at the nrUE and/or gNB side, e.g., `-A 45`. This modifies the timing advance (in samples). Adjust +/-5 if the issue persists.
- This can be necessary since certain USRPs have larger signal delays than others; it is therefore specific to the used USRP model.
- The x310 and B210 are found to work with the default configuration; N310 and x410 can benefit from setting this timing advance.

View File

@@ -95,7 +95,7 @@ Command line parameters for UE in --sa mode:
- `--numerology` : numerology index (default value 1)
- `-r` : bandwidth in terms of RBs (default value 106)
- `--band` : NR band number (default value 78)
- `--ssb` : SSB start subcarrier (default value 512)
- `--ssb` : SSB start subcarrier (default value 516)
You can run this, using USRPs, on two separate machines:

View File

@@ -274,7 +274,7 @@ nr_preprocessor_phytest()], multiple users in FR1
2) Checks the quantity of waiting data in RLC
3) Either set up resource allocation directly (e.g., for a single UE,
phytest), or call into a function to perform actual resource allocation.
Currently, this is done using pf_dl() which implements a basic
Currently, this is done using nr_pf_dl() which implements a basic
proportional fair scheduler:
* for every UE, check for retransmission and allocate as necessary
* Calculate the PF coefficient and put eligible UEs into a list

View File

@@ -6,7 +6,7 @@
| Machine | IP address | Lockable Resource | Function | Connected devices |
| ------------- | --------------- | --------------------- | ------------------ | ----------------------------------------------------- |
| asterix | 172.21.16.127 | CI-Asterix-Usage | gNB (n78) | 172.21.19.14 |
| asterix | 172.21.16.127 | CI-Asterix-Usage | *unused* | 172.21.19.14 |
| obelix | 172.21.16.128 | CI-Obelix-Usage | eNB (n40, n78), nrUE | 172.21.19.13, X300 (192.168.60.2) |
| porcepix | 172.21.16.136 | CI-Porcepix | Executor, EPC, 5GC | -- |
| nrmodule2 | 172.21.16.139 | CI-NrModule2 | Quectel | Quectel module |
@@ -15,25 +15,19 @@
| idefix | 172.21.16.135 | CI-Idefix | Quectel | Quectel module |
| caracal | 172.21.16.132 | CI-Caracal | gNB/phytest | N300 (192.168.10.2) |
| amariue | 172.21.16.144 | CI-Amarisoft-UE-Usage | nrUE | Amarisoft UE simulator |
| manarola | 172.21.8.116 | _None_ | gNB | AW2S |
| nano | 172.21.18.48 | CI-Nano-Legacy-EPC | Executor, EPC, adb | 2x COTS (adb) |
| hutch | 172.21.18.46 | CI-Hutch-Legacy-FDD-eNB | eNB (B7) | B200mini (30C5239) |
| starsky | 172.21.18.45 | CI-Starsky-Legacy-TDD-eNB | eNB (B40) | b200mini (30A3E3C) |
| carabe | 172.21.18.47 | CI-Carabe-Legacy-FDD-OAI-LTE-UE | UE (B7UE) | B200mini (30AE8C9) |
| nokiabox | 172.21.19.39 | _None_ | gNB (Nokia), 5GC | _Nokia RF integrated_ |
| avra | 172.21.16.124 | CI-Avra-Usage | gNB (n78) | AW2S Jaguar (192.168.80.239) |
| orion | 172.21.16.134 | CI-Orion-Build-Sanity-Check-Deploy-Test, CI-Orion-DsTester-Deploy-Test | Build | |
| bellatrix | 172.21.16.104 | CI-Bellatrix-RAN-Docker | Static Code Analysis | -- |
Note: The available resources, and their current usage, is indicated here:
- [Lockable resources of jenkins-oai](https://jenkins-oai.eurecom.fr/lockable-resources/):
"New" Jenkins, i.e., with RAN-Container-Parent
## Networked devices
| Type | IP address (mgmt) |
| ------------- | ----------------- |
| USRP N310 | 172.21.19.14 |
| USRP N310 | 172.21.19.13 |
## Testbenches
### 5G OTA Testbench
@@ -82,61 +76,116 @@ Note: The available resources, and their current usage, is indicated here:
### [RAN-Container-Parent](https://jenkins-oai.eurecom.fr/job/RAN-Container-Parent/)
**Purpose**: automatically triggered tests on MR creation or push, from Gitlab
Webhook
Webhook ~documentation ~BUILD-ONLY ~4G-LTE ~5G-NR
- [RAN-cppcheck](https://jenkins-oai.eurecom.fr/job/RAN-cppcheck/1664/)
- obelix
This pipeline has basically two main stages, as follows. For the image build,
please also refer to the [dedicated documentation](../docker/README.md) for
information on how the images are built.
#### Image Build pipelines
- [RAN-ARM-Cross-Compile-Builder](https://jenkins-oai.eurecom.fr/job/RAN-ARM-Cross-Compile-Builder/)
~BUILD-ONLY ~4G-LTE ~5G-NR
- orion: Cross-compilation from Intel to ARM
- base image from `Dockerfile.base.ubuntu20.cross-arm64`
- build image from `Dockerfile.build.ubuntu20.cross-arm64` (no target images)
- [RAN-cppcheck](https://jenkins-oai.eurecom.fr/job/RAN-cppcheck/)
~BUILD-ONLY ~4G-LTE ~5G-NR
- bellatrix
- performs static code analysis, currently not actively enforced
- [RAN-RHEL8-Cluster-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-RHEL8-Cluster-Image-Builder/)
~BUILD-ONLY ~4G-LTE ~5G-NR
- cluster (`Asterix-OC-oaicicd-session` resource): RHEL image build using the OpenShift Cluster (using gcc/clang)
- base image from `Dockerfile.build.rhel9`
- build image from `Dockerfile.build.rhel9`, followed by
- target image from `Dockerfile.eNB.rhel9`
- target image from `Dockerfile.gNB.rhel9`,
- target image from `Dockerfile.gNB.aw2s.rhel9`
- target image from `Dockerfile.nr-cuup.rhel9`
- target image from `Dockerfile.lteUE.rhel9`
- target image from `Dockerfile.nrUE.rhel9`
- build image from `Dockerfile.phySim.rhel9` (creates as direct target physical simulator
image)
- build image from `Dockerfile.clang.rhel9` (compilation only, artifacts not used currently)
- [RAN-Ubuntu18-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu18-Image-Builder/)
~BUILD-ONLY ~4G-LTE ~5G-NR
- obelix: Ubuntu 20 image build using docker (Note: builds U20 images while pipeline is named U18!)
- base image from `Dockerfile.base.ubuntu20`
- build image from `Dockerfile.build.ubuntu20`, followed by
- target image from `Dockerfile.eNB.ubuntu20`
- target image from `Dockerfile.gNB.ubuntu20`
- target image from `Dockerfile.nr-cuup.ubuntu20`
- target image from `Dockerfile.nrUE.ubuntu20`
- target image from `Dockerfile.lteUE.ubuntu20`
- target image from `Dockerfile.lteRU.ubuntu20`
#### Image Test pipelines
- [OAI-CN5G-COTS-UE-Test](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-COTS-UE-Test/)
~5G-NR
- using 5GC bench (resources `CI-Cetautomatix-OC-oaicicd-session`, `CI-Dogmatix-CN5G-gNB`): Attach/Detach of UE with multiple PDU sessions
- [RAN-gNB-N300-Timing-Phytest-LDPC](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-gNB-N300-Timing-Phytest-LDPC/)
~5G-NR
- caracal + N310
- pure performance test through phy-test scheduler, see command line for more details
- [RAN-Interop-F1](https://jenkins-oai.eurecom.fr/job/RAN-Interop-F1/)
~5G-NR
- ofqot (DU, 1x UE)
- F1 interoperability testing: sets up connection to Accelleran CU, UE connection and connectivity test
- F1 interoperability: set up connection between Accelleran CU and OAI DU and pass all traffic over F1
- 3rd-party gNB/CU interoperability: set up connection between Accelleran CU and OAI UE and test connectivity
- [RAN-L2-Sim-Test-4G](https://jenkins-oai.eurecom.fr/job/RAN-L2-Sim-Test-4G/)
~4G-LTE
- obelix (eNB, 1x UE, OAI EPC)
- L2simulator: skips physical layer and uses proxy between eNB and UE
- [RAN-L2-Sim-Test-5G](https://jenkins-oai.eurecom.fr/job/RAN-L2-Sim-Test-5G/)
~5G-NR
- obelix (gNB, 1x UE, OAI 5GC)
- L2simulator: skips physical layer and uses proxy between gNB and UE, currently only ping
- [RAN-LTE-FDD-LTEBOX-Container](https://jenkins-oai.eurecom.fr/job/RAN-LTE-FDD-LTEBOX-Container/)
~4G-LTE
- hutch + B210, nano w/ ltebox + 2x UE
- tests RRC inactivity timers, different bandwidths, IF4p5 fronthaul
- [RAN-LTE-FDD-OAIUE-OAICN4G-Container](https://jenkins-oai.eurecom.fr/job/RAN-LTE-FDD-OAIUE-OAICN4G-Container/)
~4G-LTE
- hutch + B210 (eNB), carabe + B210 (4G UE), nano w/ OAI 4GC
- tests OAI 4G for 10 MHz/TM1; known to be unstable
- [RAN-LTE-TDD-2x2-Container](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-LTE-TDD-2x2-Container/)
~4G-LTE
- obelix + N310, porcepix, nrmodule2 + Quectel
- TM1 and TM2 test, IF4p5 fronthaul
- [RAN-LTE-TDD-LTEBOX-Container](https://jenkins-oai.eurecom.fr/job/RAN-LTE-TDD-LTEBOX-Container/)
~4G-LTE
- starsky + B210, nano w/ ltebox + 2x UE
- TM1 over bandwidths 5, 10, 20 MHz in Band 40, default scheduler for 20 MHz
- [RAN-NSA-B200-Module-LTEBOX-Container](https://jenkins-oai.eurecom.fr/job/RAN-NSA-B200-Module-LTEBOX-Container/)
~4G-LTE ~5G-NR
- nepes + B200 (eNB), ofqot + B200 (gNB), idefix + Quectel, nepes w/ ltebox
- basic NSA test
- [RAN-PhySim-Cluster](https://jenkins-oai.eurecom.fr/job/RAN-PhySim-Cluster/)
~4G-LTE ~5G-NR
- cluster (`Asterix-OC-oaicicd-session` resource), tests in OpenShift Cluster
- unitary simulators (`nr_dlsim`, etc.)
- [RAN-RF-Sim-Test-4G](https://jenkins-oai.eurecom.fr/job/RAN-RF-Sim-Test-4G/)
~4G-LTE
- obelix (eNB, lteUE, OAI EPC)
- uses RFsimulator, for FDD 5, 10, 20MHz with core, 5MHz noS1
- [RAN-RF-Sim-Test-5G](https://jenkins-oai.eurecom.fr/job/RAN-RF-Sim-Test-5G/)
~5G-NR
- obelix (gNB, nrUE, OAI 5GC)
- uses RFsimulator, TDD 40MHz, FDD 40MHz, F1 split
- [RAN-RHEL8-Cluster-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-RHEL8-Cluster-Image-Builder/)
- cluster (`Asterix-OC-oaicicd-session` resource): RHEL 8 image build using the OpenShift Cluster
- [RAN-SA-AW2S-CN5G](https://jenkins-oai.eurecom.fr/job/RAN-SA-AW2S-CN5G/)
~5G-NR
- 5G-NR SA test setup: avra(RHEL9.1) + AW2S, amariue, OAI CN5G
- uses OpenShift cluster for CN deployment and container images for gNB deployment
- multi UE testing
- multi UE testing using Amarisoft UE simulator
- [RAN-SA-B200-Module-SABOX-Container](https://jenkins-oai.eurecom.fr/job/RAN-SA-B200-Module-SABOX-Container/)
~5G-NR
- ofqot + B200, idefix + Quectel, nepes w/ sabox
- basic SA test (20 MHz TDD), F1, reestablishment, ...
- [RAN-SA-OAIUE-CN5G](https://jenkins-oai.eurecom.fr/job/RAN-SA-OAIUE-CN5G/)
~5G-NR
- 5G-NR SA test setup: gNB on avra(RHEL9.2) + N310, OAIUE on caracal(RHEL9.1) + N310, OAI CN5G
- OpenShift cluster for CN deployment and container images for gNB and UE deployment
- [RAN-Ubuntu18-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu18-Image-Builder/)
- obelix: Ubuntu 20 image build using docker (Note: builds U20 images while pipeline is named U18!)
### RAN-CI-NSA-Trigger
@@ -148,6 +197,53 @@ Webhook
- [RAN-SA-Module-CN5G](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-Module-CN5G/)
- asterix + N310 (gNB), nrmodule2 + Quectel, porcepix w/ OAI 5GC
- NR 2x2 (standalone)
- [RAN-SA-AmariS-CN5G](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-AmariS-CN5G/)
- asterix + N310, amariue (1x UE), porcepix w/ OAI 5GC
- Amarisoft UE simulator: expected to be increased to more UEs
## How to reproduce CI results
The CI builds docker images at the beginning of every test run. To see the
exact command line steps, please refer to the `docker/Dockerfile.build.*`
files. Note that the console log of each pipeline run also lists the used
docker files.
The CI uses these images for *most* of the pipelines. It uses docker-compose to
orchestrate the images. To identify the docker-compose file, follow these
steps:
1. Each CI test run HTML lists the XML file used for a particular test run.
Open the corresponding XML file under `ci-scripts/xml_files/`.
2. The XML file has a "test case" that refers to deployment of the image; it
will reference a directory containing a YAML file (the docker-compose file)
using option `yaml_path`, which will be under `ci-scripts/yaml_files/`. Go
to this directory and open the docker-compose file.
3. The docker-compose file can be used to run images locally, or you can infer
the used configuration file and possible additional options that are to be
passed to the executable to run from source.
For instance, to see how the CI runs the multi-UE 5G RFsim test case, the above
steps look like this:
1. The first tab in the 5G RFsim test mentions
`xml_files/container_5g_rfsim.xml`, so open
`ci-scripts/xml_files/container_5g_rfsim.xml`.
2. This XML file has a `DeployGenObject` test case, referencing the directory
`yaml_files/5g_rfsimulator`. The corresponding docker-compose file path is
`ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml`.
3. To know how to run the gNB, realize that there is a section `oai-gnb`. It
mounts the configuration
`ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf` (note that the path
is relative to the directory in which the docker-compose file is located).
Further, an environment variable `USE_ADDITIONAL_OPTIONS` is declared,
referencing the relevant options `--sa -E --rfsim` (you can ignore logging
options). You would therefore run the gNB from source like this:
```
sudo ./cmake_targets/ran_build/build/nr-softmodem -O ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf --sa -E --rfsim
```
To run this on your local machine, assuming you have a 5GC installed, you
might need to change IP information in the config to match your core.
If you wish, you can rebuild CI images locally following [these
steps](../docker/README.md) and then use the docker-compose file directly.
Some tests are run from source (e.g.
`ci-scripts/xml_files/gnb_phytest_usrp_run.xml`), which directly give the
options they are run with.

View File

@@ -26,6 +26,7 @@
#---------------------------------------------------------------------
FROM ran-base:latest as ran-build
ARG BUILD_OPTION
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
@@ -35,4 +36,12 @@ COPY . .
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --eNB --gNB --RU --UE --nrUE --ninja --build-lib "telnetsrv enbscope uescope nrscope nrqtscope" -w USRP -t Ethernet --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror
./build_oai -c --ninja \
--eNB --gNB --RU --UE --nrUE \
--build-lib "telnetsrv enbscope uescope nrscope nrqtscope" \
-w USRP -t Ethernet \
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF \
--noavx512 \
--cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror $BUILD_OPTION && \
# Mainly to see if the sanitize option was perfectly executed
ldd ran_build/build/nr-softmodem

View File

@@ -32,6 +32,7 @@ FROM ran-build:latest AS enb-build
#start from scratch for target executable
FROM ubuntu:focal as oai-enb
ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
@@ -57,6 +58,11 @@ RUN apt-get update && \
python3-six \
python3-requests \
libusb-1.0-0 && \
# if the --sanitize option was used to build, additional packages are required
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
libasan5 \
libubsan1 \
liblapacke; fi' && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-enb/bin
@@ -93,8 +99,8 @@ COPY --from=enb-base \
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so /usr/local/lib/liboai_transpro.so" && \
ldconfig
ldconfig && \
ldd /opt/oai-enb/bin/lte-softmodem
WORKDIR /opt/oai-enb

View File

@@ -32,6 +32,7 @@ FROM ran-build:latest AS gnb-build
#start from scratch for target executable
FROM ubuntu:focal as oai-gnb
ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
@@ -56,6 +57,11 @@ RUN apt-get update && \
python3-six \
python3-requests \
libusb-1.0-0 && \
# if the --sanitize option was used to build, additional packages are required
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
libasan5 \
libubsan1 \
liblapacke; fi' && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-gnb/bin
@@ -91,7 +97,8 @@ COPY --from=gnb-base \
/usr/lib/x86_64-linux-gnu/
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
ldconfig
ldconfig && \
ldd /opt/oai-gnb/bin/nr-softmodem
WORKDIR /opt/oai-gnb
#EXPOSE 2152/udp # S1U, GTP/UDP

View File

@@ -32,6 +32,7 @@ FROM ran-build:latest AS lte-ue-build
#start from scratch for target executable
FROM ubuntu:focal as oai-lte-ue
ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
@@ -56,6 +57,11 @@ RUN apt-get update && \
iputils-ping \
iproute2 \
iperf && \
# if the --sanitize option was used to build, additional packages are required
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
libasan5 \
libubsan1 \
liblapacke; fi' && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-lte-ue/bin
@@ -94,7 +100,8 @@ COPY --from=lte-ue-base \
/usr/lib/x86_64-linux-gnu/
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
ldconfig
ldconfig && \
ldd /opt/oai-lte-ue/bin/lte-uesoftmodem
WORKDIR /opt/oai-lte-ue
CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem"]

View File

@@ -31,6 +31,7 @@ FROM ran-build:latest AS gnb-build
FROM ubuntu:focal as oai-nr-cuup
ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
@@ -40,6 +41,11 @@ RUN apt-get update && \
libsctp1 \
libconfig9 \
openssl && \
# if the --sanitize option was used to build, additional packages are required
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
libasan5 \
libubsan1 \
liblapacke; fi' && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-gnb/bin

View File

@@ -32,6 +32,7 @@ FROM ran-build:latest AS nr-ue-build
#start from scratch for target executable
FROM ubuntu:focal as oai-nr-ue
ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
@@ -56,6 +57,10 @@ RUN apt-get update && \
iputils-ping \
iproute2 \
iperf && \
# if the --sanitize option was used to build, additional packages are required
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
libasan5 \
libubsan1; fi' && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-nr-ue/bin
@@ -95,7 +100,8 @@ COPY --from=nr-ue-base \
/usr/lib/x86_64-linux-gnu/
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
ldconfig
ldconfig && \
ldd /opt/oai-nr-ue/bin/nr-uesoftmodem
WORKDIR /opt/oai-nr-ue
CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/nr-ue.conf"]

View File

@@ -46,16 +46,15 @@ For all platforms, the strategy for building docker/podman images is the same:
- Some tools (such as `ping`, `ifconfig`)
Note that on every push to develop (i.e., typically after integrating merge
requests), we build all images and push them to [Docker
Hub](https://hub.docker.com/u/oaisoftwarealliance). To pull them, do
requests), we build all images and push them to [Docker Hub](https://hub.docker.com/u/oaisoftwarealliance). To pull them, do
```
docker pull oaisoftwarealliance/oai-gnb:develop
docker pull oaisoftwarealliance/oai-nr-ue:develop
docker pull oaisoftwarealliance/oai-enb:develop
docker pull oaisoftwarealliance/oai-lte-ue:develop
```
Have a look at [this
README](../ci-scripts/yaml_files/5g_rfsimulator/README.md) to get some
Have a look at [this README](../ci-scripts/yaml_files/5g_rfsimulator/README.md) to get some
information on how to use the images.
# 2. File organization #
@@ -114,6 +113,34 @@ ran-base latest 5c9c02a5b4a8 1 minute ago
Note that the steps are identical for `rocky-linux`.
### 3.2.1. Additional build otions
This is only available for the Ubuntu-20 version.
You can, for example, create a `sanitizer` version of the ran-build image.
```bash
docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu20 --build-arg "BUILD_OPTION=--sanitize" .
```
Currently the `--sanitize` option for `build_oai` enables:
* [Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer)
* [Undefined Behavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html)
After building:
```bash
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
ran-build latest f2633a7f5102 1 minute ago 8.78GB
...
```
Note that the image is much bigger.
You can also use this docker build arguments to pass any available option(s) on the `build-oai` script.
## 3.3. Building any target image ##
For example, the eNB:
@@ -141,6 +168,14 @@ docker image prune --force
Note that the steps are identical for `rocky-linux`.
If you have used the sanitizer option, then you should also pass it when building the target image:
```bash
docker build --target oai-gnb --tag oai-gnb:latest --file docker/Dockerfile.gNB.ubuntu20 --build-arg "BUILD_OPTION=--sanitize" .
```
Normally the target image will be around 200 Mbytes bigger.
# 4. Building using `podman` under Red Hat Entreprise Linux 8.2 #
Analogous to the above steps:

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