diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7cc12d18c5..548325c68b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,7 +87,7 @@ pr reminder: trigger builder: stage: ci rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-builder/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-builder/ when: never - if: $ON_MR changes: @@ -102,7 +102,7 @@ trigger builder: trigger docker: stage: ci rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-docker/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-docker/ when: never - if: $ON_MR changes: diff --git a/.gitlab/ci-shared/e2e.yml b/.gitlab/ci-shared/e2e.yml index 4603254b20..11d37771c6 100644 --- a/.gitlab/ci-shared/e2e.yml +++ b/.gitlab/ci-shared/e2e.yml @@ -115,7 +115,9 @@ variables: cat $RETINA_CONFIG_ENV >> .gitlab/ci/e2e/.env # Modify request to shared the complete folder with the gnb container - | - yq -i '(.[] | select(.type == "gnb") | .shared_files) += [{"local_path": "../../", "remote_path": env(SRSRANDIR), "is_executable": false}]' ${SRSRANDIR}/.gitlab/ci/e2e/retina_request_${TESTBED}.yml + if [ "$CI_JOB_NAME_SLUG" != "smoke-zmq" ]; then + yq -i '(.[] | select(.type == "gnb") | .shared_files) += [{"local_path": "../../", "remote_path": env(SRSRANDIR), "is_executable": false}]' ${SRSRANDIR}/.gitlab/ci/e2e/retina_request_${TESTBED}.yml + fi # Set username for retina - | cd tests/e2e diff --git a/.gitlab/ci-shared/plugin.yml b/.gitlab/ci-shared/plugin.yml index 0461cd0b29..682c9dfb29 100644 --- a/.gitlab/ci-shared/plugin.yml +++ b/.gitlab/ci-shared/plugin.yml @@ -16,7 +16,7 @@ variables: SLACK_CHANNEL_INFO_MSG: "#ci_gnb_verbose" # srsRAN references SRSRANDIR: &srsran_dir ${CI_PROJECT_DIR}/srsgnb - SRSRAN_REPO_URL: https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/softwareradiosystems/srsgnb.git + SRSRAN_REPO_URL: https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_SHELL_SSH_HOST}/softwareradiosystems/srsgnb.git ###### # CI # diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index 5d57c80406..363d1143a0 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -229,6 +229,14 @@ variables: .smoke relwithdeb: extends: .build_and_unit + script: &smoke_script + - | + if [[ $CI_MERGE_REQUEST_LABELS != *"ci-no-plugin"* ]]; then + git submodule add https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_SHELL_SSH_HOST}/${PLUGIN_REPO}.git ${PLUGIN_PATH} + fi + - *srs_functions + - build_srsgnb + - launch_tests variables: OS: ubuntu-24.04 COMPILER: gcc @@ -240,6 +248,8 @@ variables: .smoke tsan: extends: .build_and_unit + script: + - *smoke_script variables: OS: ubuntu-24.04 COMPILER: clang @@ -275,6 +285,8 @@ variables: .smoke dpdk: extends: .build_and_unit + script: + - *smoke_script variables: OS: ubuntu-24.04 COMPILER: clang @@ -300,6 +312,8 @@ variables: .smoke avx512: extends: .build_and_unit + script: + - *smoke_script variables: OS: ubuntu-24.04 COMPILER: gcc @@ -311,6 +325,8 @@ variables: .smoke arm: extends: .build_and_unit + script: + - *smoke_script variables: OS: ubuntu-24.04 COMPILER: gcc @@ -322,6 +338,8 @@ variables: .smoke arm neon: extends: .build_and_unit + script: + - *smoke_script variables: OS: ubuntu-24.04 COMPILER: gcc @@ -348,7 +366,7 @@ smoke relwithdeb cached: extends: .smoke relwithdeb timeout: 1 hour rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR after_script: @@ -361,7 +379,7 @@ smoke relwithdeb cached: smoke split 7.2 cached: extends: smoke relwithdeb cached rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR changes: &split_changes @@ -383,7 +401,7 @@ smoke tsan cached: stage: manual timeout: 1 hour rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR == "true" && $CI_MERGE_REQUEST_APPROVED == "true" - if: $ON_MR @@ -397,7 +415,7 @@ smoke rhel cached: stage: manual timeout: 1 hour rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR == "true" && $CI_MERGE_REQUEST_APPROVED == "true" - if: $ON_MR @@ -411,7 +429,7 @@ smoke archlinux cached: stage: manual timeout: 1 hour rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR == "true" && $CI_MERGE_REQUEST_APPROVED == "true" - if: $ON_MR @@ -425,7 +443,7 @@ smoke dpdk cached: stage: manual timeout: 1 hour rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR == "true" && $CI_MERGE_REQUEST_APPROVED == "true" - if: $ON_MR @@ -446,7 +464,7 @@ smoke avx512 cached: stage: manual timeout: 1 hour rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR == "true" && $CI_MERGE_REQUEST_APPROVED == "true" changes: @@ -464,7 +482,7 @@ smoke arm cached: stage: manual timeout: 1 hour rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR == "true" && $CI_MERGE_REQUEST_APPROVED == "true" changes: @@ -482,7 +500,7 @@ smoke arm neon cached: stage: manual timeout: 1 hour rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR == "true" && $CI_MERGE_REQUEST_APPROVED == "true" changes: @@ -498,7 +516,7 @@ smoke arm neon cached: smoke relwithdeb clean: extends: .smoke relwithdeb rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ after_script: - *build_after_script artifacts: @@ -507,7 +525,7 @@ smoke relwithdeb clean: smoke split 7.2 clean: extends: smoke relwithdeb clean rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ changes: <<: *split_changes variables: @@ -524,41 +542,41 @@ smoke split 8 clean: smoke tsan clean: extends: .smoke tsan rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ smoke rhel clean: extends: .smoke rhel rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ smoke archlinux clean: extends: .smoke archlinux rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ smoke dpdk clean: extends: .smoke dpdk rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ smoke avx512 clean: extends: .smoke avx512 rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ changes: <<: *instruction_set_changes smoke arm clean: extends: .smoke arm rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ changes: <<: *instruction_set_changes smoke arm neon clean: extends: .smoke arm neon rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ changes: <<: *instruction_set_changes @@ -567,7 +585,7 @@ smoke arm neon clean: intermediate commits cached: extends: .smoke release rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ when: never - if: $ON_MR timeout: 2 hour @@ -598,7 +616,7 @@ valgrind changed tests: allow_failure: exit_codes: 124 # timeout command's exit code when the time is reached rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /urgent/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-memcheck/ when: never - if: $ON_MR == "true" && $CI_MERGE_REQUEST_APPROVED == "true" - if: $ON_MR @@ -635,7 +653,7 @@ valgrind changed tests: intermediate commits clean: extends: intermediate commits cached rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /no-cache/ + - if: $CI_MERGE_REQUEST_LABELS =~ /ci-no-cache/ ################# # Build Nightly # diff --git a/.gitlab/ci/e2e.yml b/.gitlab/ci/e2e.yml index 16964687f8..d48ef2c1a4 100644 --- a/.gitlab/ci/e2e.yml +++ b/.gitlab/ci/e2e.yml @@ -338,7 +338,6 @@ test mode ru tsan: artifacts: true - *txrx-lib - *retina-needs - allow_failure: true test mode ru asan: extends: test mode ru diff --git a/.gitlab/ci/e2e/.env b/.gitlab/ci/e2e/.env index b1609c6f3b..e3d704fd48 100644 --- a/.gitlab/ci/e2e/.env +++ b/.gitlab/ci/e2e/.env @@ -1,6 +1,6 @@ SRSGNB_REGISTRY_URI=registry.gitlab.com/softwareradiosystems/srsgnb RETINA_REGISTRY_PREFIX=registry.gitlab.com/softwareradiosystems/ci/retina -RETINA_VERSION=0.54.16 +RETINA_VERSION=0.55.1 UBUNTU_VERSION=24.04 AMARISOFT_VERSION=2023-09-08 SRSUE_VERSION=23.11 diff --git a/apps/cu/cu.cpp b/apps/cu/cu.cpp index 643ab81a4b..1c6614aca2 100644 --- a/apps/cu/cu.cpp +++ b/apps/cu/cu.cpp @@ -20,7 +20,6 @@ * */ -#include "apps/cu/adapters/e2_gateways.h" #include "apps/cu/cu_appconfig_cli11_schema.h" #include "apps/services/application_message_banners.h" #include "apps/services/application_tracer.h" @@ -42,6 +41,7 @@ #include "cu_appconfig_yaml_writer.h" #include "srsran/cu_up/cu_up.h" #include "srsran/e1ap/gateways/e1_local_connector_factory.h" +#include "srsran/e2/e2ap_config_translators.h" #include "srsran/f1ap/gateways/f1c_network_server_factory.h" #include "srsran/f1u/cu_up/split_connector/f1u_split_connector_factory.h" #include "srsran/gateways/udp_network_gateway.h" @@ -142,8 +142,8 @@ static void register_app_logs(const logger_appconfig& log_cfg, config_logger.set_hex_dump_max_size(log_cfg.hex_max_size); auto& metrics_logger = srslog::fetch_basic_logger("METRICS", false); - metrics_logger.set_level(log_cfg.metrics_level); - metrics_logger.set_hex_dump_max_size(log_cfg.hex_max_size); + metrics_logger.set_level(log_cfg.metrics_level.level); + metrics_logger.set_hex_dump_max_size(log_cfg.metrics_level.hex_max_size); // Register units logs. cu_cp_app_unit.on_loggers_registration(); @@ -317,10 +317,10 @@ int main(int argc, char** argv) io_timer_source time_source{app_timers, *epoll_broker, std::chrono::milliseconds{1}}; // Instantiate E2AP client gateway. - std::unique_ptr e2_gw_cu_cp = - create_cu_e2_client_gateway(cu_cfg.e2_cfg, *epoll_broker, *cu_cp_dlt_pcaps.e2ap); - std::unique_ptr e2_gw_cu_up = - create_cu_e2_client_gateway(cu_cfg.e2_cfg, *epoll_broker, *cu_up_dlt_pcaps.e2ap); + std::unique_ptr e2_gw_cu_cp = create_e2_gateway_client(generate_e2_client_gateway_config( + cu_cp_app_unit->get_cu_cp_unit_config().e2_cfg, *epoll_broker, *cu_cp_dlt_pcaps.e2ap, E2_CP_PPID)); + std::unique_ptr e2_gw_cu_up = create_e2_gateway_client(generate_e2_client_gateway_config( + cu_up_app_unit->get_cu_up_unit_config().e2_cfg, *epoll_broker, *cu_up_dlt_pcaps.e2ap, E2_UP_PPID)); app_services::metrics_notifier_proxy_impl metrics_notifier_forwarder; diff --git a/apps/cu/cu_appconfig.h b/apps/cu/cu_appconfig.h index 3ddb4bf3a6..e71ae1392f 100644 --- a/apps/cu/cu_appconfig.h +++ b/apps/cu/cu_appconfig.h @@ -23,7 +23,6 @@ #pragma once #include "apps/services/buffer_pool/buffer_pool_appconfig.h" -#include "apps/services/e2/e2_appconfig.h" #include "apps/services/logger/logger_appconfig.h" #include "apps/services/worker_manager/worker_manager_appconfig.h" #include @@ -51,25 +50,16 @@ struct cu_f1ap_appconfig { struct cu_appconfig { /// Default constructor to update the log filename. cu_appconfig() { log_cfg.filename = "/tmp/cu.log"; } - /// Loggers configuration. logger_appconfig log_cfg; - /// Expert configuration. expert_execution_appconfig expert_execution_cfg; - /// NR-U srs_cu::cu_nru_appconfig nru_cfg; - /// F1AP srs_cu::cu_f1ap_appconfig f1ap_cfg; - /// Buffer pool configuration. buffer_pool_appconfig buffer_pool_config; - - /// E2 configuration. - e2_appconfig e2_cfg; - /// TODO fill in the rest of the configuration }; } // namespace srsran diff --git a/apps/cu/cu_appconfig_validator.cpp b/apps/cu/cu_appconfig_validator.cpp index a33fbc3b05..1b4c7c2d5c 100644 --- a/apps/cu/cu_appconfig_validator.cpp +++ b/apps/cu/cu_appconfig_validator.cpp @@ -28,11 +28,5 @@ using namespace srsran; bool srsran::validate_cu_appconfig(const cu_appconfig& config) { - if (config.e2_cfg.enable_du_e2) { - fmt::print("CU application cannot enable DU E2 agent\n"); - - return false; - } - return validate_logger_appconfig(config.log_cfg); } diff --git a/apps/du/du.cpp b/apps/du/du.cpp index 6b59bd9d8c..487f8c26cd 100644 --- a/apps/du/du.cpp +++ b/apps/du/du.cpp @@ -20,34 +20,7 @@ * */ -#include "srsran/gtpu/gtpu_config.h" -#include "srsran/support/cpu_features.h" -#include "srsran/support/signal_handling.h" -#include "srsran/support/tracing/event_tracing.h" -#include "srsran/support/versioning/build_info.h" -#include "srsran/support/versioning/version.h" - -#include "srsran/f1u/du/split_connector/f1u_split_connector_factory.h" -#include "srsran/gtpu/gtpu_demux_factory.h" - -#include "srsran/support/io/io_broker_factory.h" - #include "adapters/f1_gateways.h" -#include "srsran/support/backtrace.h" -#include "srsran/support/config_parsers.h" - -#include "du_appconfig.h" -#include "du_appconfig_cli11_schema.h" -#include "du_appconfig_translators.h" -#include "du_appconfig_validators.h" - -#include "apps/services/worker_manager/worker_manager.h" -#include "apps/units/flexible_du/split_dynamic/dynamic_du_factory.h" - -#include "apps/du/adapters/e2_gateways.h" -#include "apps/services/e2/e2_metric_connector_manager.h" -#include "srsran/e2/gateways/e2_connection_client.h" - #include "apps/services/application_message_banners.h" #include "apps/services/application_tracer.h" #include "apps/services/buffer_pool/buffer_pool_manager.h" @@ -55,11 +28,30 @@ #include "apps/services/metrics/metrics_manager.h" #include "apps/services/metrics/metrics_notifier_proxy.h" #include "apps/services/stdin_command_dispatcher.h" +#include "apps/services/worker_manager/worker_manager.h" #include "apps/units/flexible_du/flexible_du_application_unit.h" #include "apps/units/flexible_du/o_du_high/du_high/du_high_config.h" #include "apps/units/flexible_du/o_du_high/du_high/pcap_factory.h" +#include "du_appconfig.h" +#include "du_appconfig_cli11_schema.h" +#include "du_appconfig_translators.h" +#include "du_appconfig_validators.h" #include "du_appconfig_yaml_writer.h" #include "srsran/du/du_power_controller.h" +#include "srsran/e2/e2ap_config_translators.h" +#include "srsran/e2/gateways/e2_connection_client.h" +#include "srsran/e2/gateways/e2_network_client_factory.h" +#include "srsran/f1u/du/split_connector/f1u_split_connector_factory.h" +#include "srsran/gtpu/gtpu_config.h" +#include "srsran/gtpu/gtpu_demux_factory.h" +#include "srsran/support/backtrace.h" +#include "srsran/support/config_parsers.h" +#include "srsran/support/cpu_features.h" +#include "srsran/support/io/io_broker_factory.h" +#include "srsran/support/signal_handling.h" +#include "srsran/support/tracing/event_tracing.h" +#include "srsran/support/versioning/build_info.h" +#include "srsran/support/versioning/version.h" #include #ifdef DPDK_FOUND #include "srsran/hal/dpdk/dpdk_eal_factory.h" @@ -136,8 +128,8 @@ static void register_app_logs(const logger_appconfig& log_cfg, flexible_du_appli config_logger.set_hex_dump_max_size(log_cfg.hex_max_size); auto& metrics_logger = srslog::fetch_basic_logger("METRICS", false); - metrics_logger.set_level(log_cfg.metrics_level); - metrics_logger.set_hex_dump_max_size(log_cfg.hex_max_size); + metrics_logger.set_level(log_cfg.metrics_level.level); + metrics_logger.set_hex_dump_max_size(log_cfg.metrics_level.hex_max_size); auto& e2ap_logger = srslog::fetch_basic_logger("E2AP", false); e2ap_logger.set_level(log_cfg.e2ap_level); @@ -297,8 +289,8 @@ int main(int argc, char** argv) srslog::fetch_udp_sink(du_cfg.metrics_cfg.addr, du_cfg.metrics_cfg.port, srslog::create_json_formatter()); // Instantiate E2AP client gateway. - std::unique_ptr e2_gw = - create_du_e2_client_gateway(du_cfg.e2_cfg, *epoll_broker, *du_pcaps.e2ap); + std::unique_ptr e2_gw = create_e2_gateway_client(generate_e2_client_gateway_config( + du_app_unit->get_du_high_unit_config().e2_cfg, *epoll_broker, *du_pcaps.e2ap, E2_DU_PPID)); app_services::metrics_notifier_proxy_impl metrics_notifier_forwarder; du_unit_dependencies du_dependencies; diff --git a/apps/du/du_appconfig.h b/apps/du/du_appconfig.h index e7814f8048..df833e883d 100644 --- a/apps/du/du_appconfig.h +++ b/apps/du/du_appconfig.h @@ -23,7 +23,6 @@ #pragma once #include "apps/services/buffer_pool/buffer_pool_appconfig.h" -#include "apps/services/e2/e2_appconfig.h" #include "apps/services/hal/hal_appconfig.h" #include "apps/services/logger/logger_appconfig.h" #include "apps/services/worker_manager/worker_manager_appconfig.h" @@ -65,8 +64,6 @@ struct du_appconfig { logger_appconfig log_cfg; /// Metrics configuration. srs_du::metrics_appconfig metrics_cfg; - /// E2 configuration. - e2_appconfig e2_cfg; /// F1-C configuration. srs_du::f1ap_appconfig f1ap_cfg; /// F1-U configuration. diff --git a/apps/du/du_appconfig_cli11_schema.cpp b/apps/du/du_appconfig_cli11_schema.cpp index a1bc0f10bb..2ff53ffaee 100644 --- a/apps/du/du_appconfig_cli11_schema.cpp +++ b/apps/du/du_appconfig_cli11_schema.cpp @@ -22,7 +22,6 @@ #include "du_appconfig_cli11_schema.h" #include "apps/services/buffer_pool/buffer_pool_appconfig_cli11_schema.h" -#include "apps/services/e2/e2_cli11_schema.h" #include "apps/services/hal/hal_cli11_schema.h" #include "apps/services/logger/logger_appconfig_cli11_schema.h" #include "apps/services/worker_manager/worker_manager_cli11_schema.h" @@ -88,9 +87,6 @@ void srsran::configure_cli11_with_du_appconfig_schema(CLI::App& app, du_appconfi CLI::App* metrics_subcmd = app.add_subcommand("metrics", "Metrics configuration")->configurable(); configure_cli11_metrics_args(*metrics_subcmd, du_cfg.metrics_cfg); - // E2 section. - configure_cli11_with_e2_appconfig_schema(app, du_cfg.e2_cfg); - // HAL section. du_cfg.hal_config.emplace(); configure_cli11_with_hal_appconfig_schema(app, *du_cfg.hal_config); diff --git a/apps/du/du_appconfig_validators.cpp b/apps/du/du_appconfig_validators.cpp index 84408b4821..bdecf9ef89 100644 --- a/apps/du/du_appconfig_validators.cpp +++ b/apps/du/du_appconfig_validators.cpp @@ -36,11 +36,5 @@ bool srsran::validate_appconfig(const du_appconfig& config) return false; } - if (config.e2_cfg.enable_cu_e2) { - fmt::print("DU application cannot enable CU E2 agent\n"); - - return false; - } - return true; } diff --git a/apps/du/du_appconfig_yaml_writer.cpp b/apps/du/du_appconfig_yaml_writer.cpp index 8c4ee0215b..abba404fc7 100644 --- a/apps/du/du_appconfig_yaml_writer.cpp +++ b/apps/du/du_appconfig_yaml_writer.cpp @@ -32,21 +32,6 @@ static void fill_du_appconfig_metrics_section(YAML::Node node, const srs_du::met node["port"] = config.port; } -static void fill_du_appconfig_e2_section(YAML::Node node, const e2_appconfig& config) -{ - node["enable_du_e2"] = config.enable_du_e2; - node["addr"] = config.ip_addr; - node["port"] = config.port; - node["bind_addr"] = config.bind_addr; - node["sctp_rto_initial"] = config.sctp_rto_initial; - node["sctp_rto_min"] = config.sctp_rto_min; - node["sctp_rto_max"] = config.sctp_rto_max; - node["sctp_init_max_attempts"] = config.sctp_init_max_attempts; - node["sctp_max_init_timeo"] = config.sctp_max_init_timeo; - node["e2sm_kpm_enabled"] = config.e2sm_kpm_enabled; - node["e2sm_rc_enabled"] = config.e2sm_rc_enabled; -} - static void fill_du_appconfig_hal_section(YAML::Node node, const std::optional& config) { if (!config.has_value()) { @@ -103,7 +88,6 @@ void srsran::fill_du_appconfig_in_yaml_schema(YAML::Node& node, const du_appconf { fill_logger_appconfig_in_yaml_schema(node, config.log_cfg); fill_du_appconfig_metrics_section(node["metrics"], config.metrics_cfg); - fill_du_appconfig_e2_section(node["e2"], config.e2_cfg); fill_du_appconfig_hal_section(node, config.hal_config); fill_du_appconfig_expert_execution_section(node["expert_execution"], config.expert_execution_cfg); fill_du_appconfig_buffer_pool_section(node["buffer_pool"], config.buffer_pool_config); diff --git a/apps/examples/ofh/ru_emulator.cpp b/apps/examples/ofh/ru_emulator.cpp index c63f936dda..1285c2dfd4 100644 --- a/apps/examples/ofh/ru_emulator.cpp +++ b/apps/examples/ofh/ru_emulator.cpp @@ -29,12 +29,15 @@ #include "ru_emulator_transceiver.h" #include "srsran/adt/circular_map.h" #include "srsran/adt/expected.h" +#include "srsran/adt/to_array.h" #include "srsran/ofh/compression/compression_params.h" #include "srsran/ofh/ecpri/ecpri_constants.h" #include "srsran/ofh/ecpri/ecpri_packet_properties.h" #include "srsran/ofh/ethernet/dpdk/dpdk_ethernet_factories.h" #include "srsran/ofh/ofh_constants.h" +#include "srsran/ofh/ofh_factories.h" #include "srsran/ofh/serdes/ofh_message_properties.h" +#include "srsran/ran/cyclic_prefix.h" #include "srsran/ran/resource_block.h" #include "srsran/ran/slot_point.h" #include "srsran/srslog/logger.h" @@ -46,9 +49,6 @@ #include "fmt/chrono.h" #include #include -#include -#include -#include #ifdef DPDK_FOUND #include "srsran/hal/dpdk/dpdk_eal_factory.h" #endif diff --git a/apps/examples/ofh/ru_emulator_appconfig.h b/apps/examples/ofh/ru_emulator_appconfig.h index 3a4ae443e9..1ddffca237 100644 --- a/apps/examples/ofh/ru_emulator_appconfig.h +++ b/apps/examples/ofh/ru_emulator_appconfig.h @@ -23,7 +23,7 @@ #pragma once #include "srsran/ran/bs_channel_bandwidth.h" -#include +#include "srsran/srslog/srslog.h" #include #include diff --git a/apps/examples/ofh/ru_emulator_seq_id_checker.h b/apps/examples/ofh/ru_emulator_seq_id_checker.h index b7a88827cb..4d3038ee26 100644 --- a/apps/examples/ofh/ru_emulator_seq_id_checker.h +++ b/apps/examples/ofh/ru_emulator_seq_id_checker.h @@ -25,7 +25,7 @@ #include "helpers.h" #include "srsran/adt/circular_map.h" #include "srsran/ofh/ofh_constants.h" -#include +#include "srsran/ofh/receiver/ofh_sequence_id_checker.h" namespace srsran { diff --git a/apps/gnb/gnb.cpp b/apps/gnb/gnb.cpp index 223a7c251c..eaee1da2ae 100644 --- a/apps/gnb/gnb.cpp +++ b/apps/gnb/gnb.cpp @@ -20,8 +20,6 @@ * */ -#include "apps/cu/adapters/e2_gateways.h" -#include "apps/du/adapters/e2_gateways.h" #include "apps/services/application_message_banners.h" #include "apps/services/application_tracer.h" #include "apps/services/buffer_pool/buffer_pool_manager.h" @@ -48,6 +46,8 @@ #include "gnb_appconfig_yaml_writer.h" #include "srsran/du/du_power_controller.h" #include "srsran/e1ap/gateways/e1_local_connector_factory.h" +#include "srsran/e2/e2ap_config_translators.h" +#include "srsran/e2/gateways/e2_network_client_factory.h" #include "srsran/f1ap/gateways/f1c_local_connector_factory.h" #include "srsran/f1u/local_connector/f1u_local_connector.h" #include "srsran/gtpu/ngu_gateway.h" @@ -146,8 +146,8 @@ static void register_app_logs(const logger_appconfig& log_cfg, config_logger.set_hex_dump_max_size(log_cfg.hex_max_size); auto& metrics_logger = srslog::fetch_basic_logger("METRICS", false); - metrics_logger.set_level(log_cfg.metrics_level); - metrics_logger.set_hex_dump_max_size(log_cfg.hex_max_size); + metrics_logger.set_level(log_cfg.metrics_level.level); + metrics_logger.set_hex_dump_max_size(log_cfg.metrics_level.hex_max_size); auto& e2ap_logger = srslog::fetch_basic_logger("E2AP", false); e2ap_logger.set_level(log_cfg.e2ap_level); @@ -369,12 +369,12 @@ int main(int argc, char** argv) std::vector metrics_configs; // Instantiate E2AP client gateways. - std::unique_ptr e2_gw_du = - create_du_e2_client_gateway(gnb_cfg.e2_cfg, *epoll_broker, *du_pcaps.e2ap); - std::unique_ptr e2_gw_cu_cp = - create_cu_e2_client_gateway(gnb_cfg.e2_cfg, *epoll_broker, *cu_cp_dlt_pcaps.e2ap); - std::unique_ptr e2_gw_cu_up = - create_cu_e2_client_gateway(gnb_cfg.e2_cfg, *epoll_broker, *cu_up_dlt_pcaps.e2ap); + std::unique_ptr e2_gw_du = create_e2_gateway_client(generate_e2_client_gateway_config( + du_app_unit->get_du_high_unit_config().e2_cfg, *epoll_broker, *du_pcaps.e2ap, E2_DU_PPID)); + std::unique_ptr e2_gw_cu_cp = create_e2_gateway_client(generate_e2_client_gateway_config( + cu_cp_app_unit->get_cu_cp_unit_config().e2_cfg, *epoll_broker, *cu_cp_dlt_pcaps.e2ap, E2_CP_PPID)); + std::unique_ptr e2_gw_cu_up = create_e2_gateway_client(generate_e2_client_gateway_config( + cu_up_app_unit->get_cu_up_unit_config().e2_cfg, *epoll_broker, *cu_up_dlt_pcaps.e2ap, E2_UP_PPID)); // Create CU-CP dependencies. cu_cp_build_dependencies cu_cp_dependencies; diff --git a/apps/gnb/gnb_appconfig.h b/apps/gnb/gnb_appconfig.h index 8e8935dbc1..68d5ada4b0 100644 --- a/apps/gnb/gnb_appconfig.h +++ b/apps/gnb/gnb_appconfig.h @@ -23,7 +23,6 @@ #pragma once #include "apps/services/buffer_pool/buffer_pool_appconfig.h" -#include "apps/services/e2/e2_appconfig.h" #include "apps/services/hal/hal_appconfig.h" #include "apps/services/logger/logger_appconfig.h" #include "apps/services/worker_manager/worker_manager_appconfig.h" @@ -58,8 +57,6 @@ struct gnb_appconfig { gnb_id_t gnb_id = {411, 22}; /// Node name. std::string ran_node_name = "srsgnb01"; - /// E2 configuration. - e2_appconfig e2_cfg; /// Buffer pool configuration. buffer_pool_appconfig buffer_pool_config; /// Expert configuration. diff --git a/apps/gnb/gnb_appconfig_cli11_schema.cpp b/apps/gnb/gnb_appconfig_cli11_schema.cpp index c03fb871b5..ffc175b03e 100644 --- a/apps/gnb/gnb_appconfig_cli11_schema.cpp +++ b/apps/gnb/gnb_appconfig_cli11_schema.cpp @@ -22,7 +22,6 @@ #include "gnb_appconfig_cli11_schema.h" #include "apps/services/buffer_pool/buffer_pool_appconfig_cli11_schema.h" -#include "apps/services/e2/e2_cli11_schema.h" #include "apps/services/hal/hal_cli11_schema.h" #include "apps/services/logger/logger_appconfig_cli11_schema.h" #include "apps/services/worker_manager/worker_manager_cli11_schema.h" @@ -72,9 +71,6 @@ void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appcon CLI::App* metrics_subcmd = app.add_subcommand("metrics", "Metrics configuration")->configurable(); configure_cli11_metrics_args(*metrics_subcmd, gnb_cfg.metrics_cfg); - // E2 section. - configure_cli11_with_e2_appconfig_schema(app, gnb_cfg.e2_cfg); - // HAL section. gnb_cfg.hal_config.emplace(); configure_cli11_with_hal_appconfig_schema(app, *gnb_cfg.hal_config); diff --git a/apps/gnb/gnb_appconfig_yaml_writer.cpp b/apps/gnb/gnb_appconfig_yaml_writer.cpp index 55a9c56d11..269751cb9f 100644 --- a/apps/gnb/gnb_appconfig_yaml_writer.cpp +++ b/apps/gnb/gnb_appconfig_yaml_writer.cpp @@ -32,21 +32,6 @@ static void fill_gnb_appconfig_metrics_section(YAML::Node node, const metrics_ap node["port"] = config.port; } -static void fill_gnb_appconfig_e2_section(YAML::Node node, const e2_appconfig& config) -{ - node["enable_du_e2"] = config.enable_du_e2; - node["addr"] = config.ip_addr; - node["port"] = config.port; - node["bind_addr"] = config.bind_addr; - node["sctp_rto_initial"] = config.sctp_rto_initial; - node["sctp_rto_min"] = config.sctp_rto_min; - node["sctp_rto_max"] = config.sctp_rto_max; - node["sctp_init_max_attempts"] = config.sctp_init_max_attempts; - node["sctp_max_init_timeo"] = config.sctp_max_init_timeo; - node["e2sm_kpm_enabled"] = config.e2sm_kpm_enabled; - node["e2sm_rc_enabled"] = config.e2sm_rc_enabled; -} - static void fill_gnb_appconfig_hal_section(YAML::Node node, const std::optional& config) { if (!config.has_value()) { @@ -94,7 +79,6 @@ void srsran::fill_gnb_appconfig_in_yaml_schema(YAML::Node& node, const gnb_appco fill_logger_appconfig_in_yaml_schema(node, config.log_cfg); fill_gnb_appconfig_metrics_section(node["metrics"], config.metrics_cfg); - fill_gnb_appconfig_e2_section(node["e2"], config.e2_cfg); fill_gnb_appconfig_hal_section(node, config.hal_config); fill_gnb_appconfig_expert_execution_section(node["expert_execution"], config.expert_execution_cfg); fill_gnb_appconfig_buffer_pool_section(node["buffer_pool"], config.buffer_pool_config); diff --git a/apps/services/application_message_banners.h b/apps/services/application_message_banners.h index e26f2bfc24..e5db5f15ca 100644 --- a/apps/services/application_message_banners.h +++ b/apps/services/application_message_banners.h @@ -23,6 +23,7 @@ #pragma once #include "external/fmt/include/fmt/core.h" +#include "srsran/srslog/logger.h" #include "srsran/support/versioning/build_info.h" namespace srsran { diff --git a/apps/services/e2/CMakeLists.txt b/apps/services/e2/CMakeLists.txt index fdde5f7083..a202ecc45f 100644 --- a/apps/services/e2/CMakeLists.txt +++ b/apps/services/e2/CMakeLists.txt @@ -19,7 +19,6 @@ # set(SOURCES - e2_appconfig_translators.cpp e2_cli11_schema.cpp) add_library(srsran_e2_app_service STATIC ${SOURCES}) diff --git a/apps/services/e2/e2_appconfig.h b/apps/services/e2/e2_appconfig.h deleted file mode 100644 index 88eb52dff6..0000000000 --- a/apps/services/e2/e2_appconfig.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * Copyright 2021-2024 Software Radio Systems Limited - * - * This file is part of srsRAN. - * - * srsRAN is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * srsRAN is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * A copy of the GNU Affero General Public License can be found in - * the LICENSE file in the top-level directory of this distribution - * and at http://www.gnu.org/licenses/. - * - */ - -#pragma once - -#include -#include - -namespace srsran { -/// E2 Agent configuration -struct e2_appconfig { - bool enable_du_e2 = false; ///< Whether to enable DU E2 agent - bool enable_cu_e2 = false; ///< Whether to enable CU E2 agent - std::string ip_addr = "127.0.0.1"; ///< RIC IP address - uint16_t port = 36421; ///< RIC port - std::string bind_addr = "127.0.0.1"; ///< Local IP address to bind for RIC connection - int sctp_rto_initial = 120; ///< SCTP initial RTO value for RIC connection - int sctp_rto_min = 120; ///< SCTP RTO min for RIC connection - int sctp_rto_max = 500; ///< SCTP RTO max for RIC connection - int sctp_init_max_attempts = 3; ///< SCTP init max attempts for RIC connection - int sctp_max_init_timeo = 500; ///< SCTP max init timeout for RIC connection - bool e2sm_kpm_enabled = false; ///< Whether to enable KPM service module - bool e2sm_rc_enabled = false; ///< Whether to enable RC service module -}; - -} // namespace srsran diff --git a/apps/services/e2/e2_appconfig_translators.cpp b/apps/services/e2/e2_appconfig_translators.cpp deleted file mode 100644 index 4cc031fb27..0000000000 --- a/apps/services/e2/e2_appconfig_translators.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Copyright 2021-2024 Software Radio Systems Limited - * - * This file is part of srsRAN. - * - * srsRAN is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * srsRAN is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * A copy of the GNU Affero General Public License can be found in - * the LICENSE file in the top-level directory of this distribution - * and at http://www.gnu.org/licenses/. - * - */ - -#include "e2_appconfig_translators.h" -#include "e2_appconfig.h" - -using namespace srsran; - -sctp_network_connector_config srsran::generate_e2ap_nw_config(const e2_appconfig& config, int ppid) -{ - sctp_network_connector_config out_cfg; - out_cfg.dest_name = "NearRT-RIC"; - out_cfg.if_name = "E2"; - out_cfg.connect_address = config.ip_addr; - out_cfg.connect_port = config.port; - out_cfg.bind_address = config.bind_addr; - out_cfg.ppid = ppid; - - if (config.sctp_rto_initial >= 0) { - out_cfg.rto_initial = config.sctp_rto_initial; - } - if (config.sctp_rto_min >= 0) { - out_cfg.rto_min = config.sctp_rto_min; - } - if (config.sctp_rto_max >= 0) { - out_cfg.rto_max = config.sctp_rto_max; - } - if (config.sctp_init_max_attempts >= 0) { - out_cfg.init_max_attempts = config.sctp_init_max_attempts; - } - if (config.sctp_max_init_timeo >= 0) { - out_cfg.max_init_timeo = config.sctp_max_init_timeo; - } - - return out_cfg; -} diff --git a/apps/services/e2/e2_cli11_schema.cpp b/apps/services/e2/e2_cli11_schema.cpp index 44822d6d9a..2bd5b901bf 100644 --- a/apps/services/e2/e2_cli11_schema.cpp +++ b/apps/services/e2/e2_cli11_schema.cpp @@ -21,15 +21,17 @@ */ #include "e2_cli11_schema.h" -#include "e2_appconfig.h" +#include "srsran/e2/e2ap_configuration.h" #include "srsran/support/cli11_utils.h" using namespace srsran; -static void configure_cli11_e2_args(CLI::App& app, e2_appconfig& e2_params) +static void configure_cli11_e2_args(CLI::App& app, + e2_config& e2_params, + const std::string& option_name, + const std::string& option_description) { - add_option(app, "--enable_du_e2", e2_params.enable_du_e2, "Enable DU E2 agent")->capture_default_str(); - add_option(app, "--enable_cu_e2", e2_params.enable_cu_e2, "Enable CU E2 agent")->capture_default_str(); + add_option(app, option_name, e2_params.enable_unit_e2, option_description)->capture_default_str(); add_option(app, "--addr", e2_params.ip_addr, "RIC IP address")->capture_default_str(); add_option(app, "--port", e2_params.port, "RIC port")->check(CLI::Range(20000, 40000))->capture_default_str(); add_option(app, "--bind_addr", e2_params.bind_addr, "Local IP address to bind for RIC connection") @@ -46,8 +48,11 @@ static void configure_cli11_e2_args(CLI::App& app, e2_appconfig& e2_params) add_option(app, "--e2sm_rc_enabled", e2_params.e2sm_rc_enabled, "Enable RC service module")->capture_default_str(); } -void srsran::configure_cli11_with_e2_appconfig_schema(CLI::App& app, e2_appconfig& config) +void srsran::configure_cli11_with_e2_config_schema(CLI::App& app, + e2_config& config, + const std::string& option_name, + const std::string& option_description) { CLI::App* e2_subcmd = add_subcommand(app, "e2", "E2 parameters")->configurable(); - configure_cli11_e2_args(*e2_subcmd, config); + configure_cli11_e2_args(*e2_subcmd, config, option_name, option_description); } diff --git a/apps/services/e2/e2_cli11_schema.h b/apps/services/e2/e2_cli11_schema.h index 01acf1a0d5..783a8fd427 100644 --- a/apps/services/e2/e2_cli11_schema.h +++ b/apps/services/e2/e2_cli11_schema.h @@ -26,9 +26,17 @@ namespace srsran { -struct e2_appconfig; +struct e2_config; -/// Configures the given CLI11 application with the E2 application configuration schema. -void configure_cli11_with_e2_appconfig_schema(CLI::App& app, e2_appconfig& config); +/// \brief Configures the given CLI11 application with the E2 application configuration schema. +/// +/// \param[out] app CLI11 application to configure. +/// \param[out] config E2 configuration that stores the parameters. +/// \param[in] option_name Option name for the E2 unit property. +/// \param[out] option_description Option description for the E2 unit property. +void configure_cli11_with_e2_config_schema(CLI::App& app, + e2_config& config, + const std::string& option_name, + const std::string& option_description); } // namespace srsran diff --git a/apps/services/logger/CMakeLists.txt b/apps/services/logger/CMakeLists.txt index 4c43450507..7f495f7083 100644 --- a/apps/services/logger/CMakeLists.txt +++ b/apps/services/logger/CMakeLists.txt @@ -18,6 +18,11 @@ # and at http://www.gnu.org/licenses/. # + + +add_library(srsran_metrics_logger_utils STATIC metrics_logger_appconfig_cli11_schema.cpp metrics_logger_appconfig_yaml_writer.cpp) +target_include_directories(srsran_metrics_logger_utils PRIVATE ${CMAKE_SOURCE_DIR}) + set(SOURCES logger_appconfig_cli11_schema.cpp logger_appconfig_validator.cpp @@ -25,3 +30,5 @@ set(SOURCES add_library(srsran_logger_app_service STATIC ${SOURCES}) target_include_directories(srsran_logger_app_service PRIVATE ${CMAKE_SOURCE_DIR}) +target_link_libraries(srsran_logger_app_service PRIVATE srsran_metrics_logger_utils) + diff --git a/apps/services/logger/logger_appconfig.h b/apps/services/logger/logger_appconfig.h index 83893e3ece..7534ef2aa9 100644 --- a/apps/services/logger/logger_appconfig.h +++ b/apps/services/logger/logger_appconfig.h @@ -22,6 +22,7 @@ #pragma once +#include "metrics_logger_appconfig.h" #include "srsran/srslog/logger.h" #include @@ -34,10 +35,10 @@ struct logger_appconfig { /// Default log level for all layers. srslog::basic_levels all_level = srslog::basic_levels::warning; /// Generic log level assigned to library components without layer-specific level. - srslog::basic_levels lib_level = srslog::basic_levels::warning; - srslog::basic_levels e2ap_level = srslog::basic_levels::warning; - srslog::basic_levels config_level = srslog::basic_levels::none; - srslog::basic_levels metrics_level = srslog::basic_levels::none; + srslog::basic_levels lib_level = srslog::basic_levels::warning; + srslog::basic_levels e2ap_level = srslog::basic_levels::warning; + srslog::basic_levels config_level = srslog::basic_levels::none; + metrics_logger_appconfig metrics_level; /// Maximum number of bytes to write when dumping hex arrays. int hex_max_size = 0; /// Set to a valid file path to enable tracing and write the trace to the file. diff --git a/apps/services/logger/logger_appconfig_cli11_schema.cpp b/apps/services/logger/logger_appconfig_cli11_schema.cpp index 50d861f602..c514f99322 100644 --- a/apps/services/logger/logger_appconfig_cli11_schema.cpp +++ b/apps/services/logger/logger_appconfig_cli11_schema.cpp @@ -23,13 +23,14 @@ #include "logger_appconfig_cli11_schema.h" #include "logger_appconfig.h" #include "logger_appconfig_cli11_utils.h" +#include "metrics_logger_appconfig_cli11_schema.h" #include "srsran/support/cli11_utils.h" using namespace srsran; static void configure_cli11_log_args(CLI::App& app, logger_appconfig& log_params) { - auto metric_level_check = [](const std::string& value) -> std::string { + auto config_level_check = [](const std::string& value) -> std::string { if (auto level = srslog::str_to_basic_level(value); !level.has_value() || level.value() == srslog::basic_levels::error || level.value() == srslog::basic_levels::warning) { @@ -49,11 +50,7 @@ static void configure_cli11_log_args(CLI::App& app, logger_appconfig& log_params add_option_function( app, " --config_level", app_services::capture_log_level_function(log_params.config_level), "Config log level") ->default_str(srslog::basic_level_to_string(log_params.config_level)) - ->check(metric_level_check); - add_option_function( - app, "--metrics_level", app_services::capture_log_level_function(log_params.metrics_level), "Metrics log level") - ->default_str(srslog::basic_level_to_string(log_params.metrics_level)) - ->check(metric_level_check); + ->check(config_level_check); add_option( app, "--hex_max_size", log_params.hex_max_size, "Maximum number of bytes to print in hex (zero for no hex dumps)") ->capture_default_str() @@ -80,14 +77,27 @@ static void configure_cli11_log_args(CLI::App& app, logger_appconfig& log_params continue; } - // Config and metrics loggers have only subset of levels. - if (option->check_name("--config_level") || option->check_name("--metrics_level")) { + // Config logger have only subset of levels. + if (option->check_name("--config_level")) { if (log_params.all_level == srslog::basic_levels::error) { option->default_val("none"); continue; } } + // Metrics logger have only subset of levels. + if (option->check_name("--metrics_level") && !is_valid_metrics_levels(log_params.all_level)) { + // When all level is debug, set the metrics to info. + if (log_params.all_level == srslog::basic_levels::debug) { + option->default_val("info"); + continue; + } + + // For the rest of not valid cases, disable the metrics logger. + option->default_val("none"); + continue; + } + option->default_val(srslog::basic_level_to_string(log_params.all_level)); } }); @@ -95,7 +105,9 @@ static void configure_cli11_log_args(CLI::App& app, logger_appconfig& log_params void srsran::configure_cli11_with_logger_appconfig_schema(CLI::App& app, logger_appconfig& config) { + configure_cli11_with_metrics_logger_appconfig_schema(app, config.metrics_level); + // Logging section. - CLI::App* log_subcmd = app.add_subcommand("log", "Logging configuration")->configurable(); + CLI::App* log_subcmd = add_subcommand(app, "log", "Logging configuration")->configurable(); configure_cli11_log_args(*log_subcmd, config); } diff --git a/apps/services/logger/logger_appconfig_yaml_writer.cpp b/apps/services/logger/logger_appconfig_yaml_writer.cpp index 27b5feea2e..aaf9f909f5 100644 --- a/apps/services/logger/logger_appconfig_yaml_writer.cpp +++ b/apps/services/logger/logger_appconfig_yaml_writer.cpp @@ -22,18 +22,20 @@ #include "logger_appconfig_yaml_writer.h" #include "logger_appconfig.h" +#include "metrics_logger_appconfig_yaml_writer.h" using namespace srsran; void srsran::fill_logger_appconfig_in_yaml_schema(YAML::Node& node, const logger_appconfig& config) { - YAML::Node log_node = node["log"]; - log_node["filename"] = config.filename; - log_node["lib_level"] = srslog::basic_level_to_string(config.lib_level); - log_node["e2ap_level"] = srslog::basic_level_to_string(config.e2ap_level); - log_node["config_level"] = srslog::basic_level_to_string(config.config_level); - log_node["metrics_level"] = srslog::basic_level_to_string(config.metrics_level); - log_node["hex_max_size"] = config.hex_max_size; + fill_metrics_logger_appconfig_in_yaml_schema(node, config.metrics_level); + + YAML::Node log_node = node["log"]; + log_node["filename"] = config.filename; + log_node["lib_level"] = srslog::basic_level_to_string(config.lib_level); + log_node["e2ap_level"] = srslog::basic_level_to_string(config.e2ap_level); + log_node["config_level"] = srslog::basic_level_to_string(config.config_level); + log_node["hex_max_size"] = config.hex_max_size; if (!config.tracing_filename.empty()) { log_node["tracing_filename"] = config.tracing_filename; diff --git a/apps/services/logger/metrics_logger_appconfig.h b/apps/services/logger/metrics_logger_appconfig.h new file mode 100644 index 0000000000..e5e6de4cb3 --- /dev/null +++ b/apps/services/logger/metrics_logger_appconfig.h @@ -0,0 +1,52 @@ +/* + * + * Copyright 2021-2024 Software Radio Systems Limited + * + * This file is part of srsRAN. + * + * srsRAN is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsRAN is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#pragma once + +#include "srsran/adt/to_array.h" +#include "srsran/srslog/logger.h" + +namespace srsran { + +/// List of possible log levels for the metrics. +constexpr auto valid_metrics_levels = + to_array({srslog::basic_levels::none, srslog::basic_levels::info}); + +/// List of possible log levels for the metrics in string format. +constexpr auto valid_metrics_levels_names = to_array({"none", "info"}); + +/// Returns true if the given level is defined inside de valid metrics level, otherwise false. +inline bool is_valid_metrics_levels(srslog::basic_levels level) +{ + return std::find_if(valid_metrics_levels.cbegin(), valid_metrics_levels.cend(), [level](const auto& lvl) { + return level == lvl; + }) != valid_metrics_levels.cend(); +} + +/// Metrics logger configuration. +struct metrics_logger_appconfig { + srslog::basic_levels level = srslog::basic_levels::none; + /// Maximum number of bytes to write when dumping hex arrays. + int hex_max_size = 0; +}; + +} // namespace srsran diff --git a/apps/services/logger/metrics_logger_appconfig_cli11_schema.cpp b/apps/services/logger/metrics_logger_appconfig_cli11_schema.cpp new file mode 100644 index 0000000000..6c2cd96dc8 --- /dev/null +++ b/apps/services/logger/metrics_logger_appconfig_cli11_schema.cpp @@ -0,0 +1,58 @@ +/* + * + * Copyright 2021-2024 Software Radio Systems Limited + * + * This file is part of srsRAN. + * + * srsRAN is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsRAN is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include "metrics_logger_appconfig_cli11_schema.h" +#include "logger_appconfig_cli11_utils.h" +#include "metrics_logger_appconfig.h" +#include "srsran/adt/span.h" +#include "srsran/srslog/logger.h" +#include "srsran/support/cli11_utils.h" + +using namespace srsran; + +static void configure_cli11_log_args(CLI::App& app, metrics_logger_appconfig& log_params) +{ + auto metric_level_check = [](const std::string& value) -> std::string { + if (auto level = srslog::str_to_basic_level(value); !level.has_value() || !is_valid_metrics_levels(level.value())) { + return fmt::format("Log level value not supported. Accepted values [{}]", + span(valid_metrics_levels_names)); + } + + return {}; + }; + + add_option_function( + app, "--metrics_level", app_services::capture_log_level_function(log_params.level), "Metrics log level") + ->default_str(srslog::basic_level_to_string(log_params.level)) + ->check(metric_level_check); + add_option( + app, "--hex_max_size", log_params.hex_max_size, "Maximum number of bytes to print in hex (zero for no hex dumps)") + ->capture_default_str() + ->check(CLI::Range(0, 1024)); +} + +void srsran::configure_cli11_with_metrics_logger_appconfig_schema(CLI::App& app, metrics_logger_appconfig& config) +{ + // Logging section. + CLI::App* log_subcmd = add_subcommand(app, "log", "Logging configuration")->configurable(); + configure_cli11_log_args(*log_subcmd, config); +} diff --git a/apps/services/e2/e2_appconfig_translators.h b/apps/services/logger/metrics_logger_appconfig_cli11_schema.h similarity index 75% rename from apps/services/e2/e2_appconfig_translators.h rename to apps/services/logger/metrics_logger_appconfig_cli11_schema.h index 1030a59a27..078aa56b46 100644 --- a/apps/services/e2/e2_appconfig_translators.h +++ b/apps/services/logger/metrics_logger_appconfig_cli11_schema.h @@ -22,13 +22,13 @@ #pragma once -#include "srsran/gateways/sctp_network_gateway.h" +#include namespace srsran { -struct e2_appconfig; +struct metrics_logger_appconfig; -/// Converts and returns the given gnb application configuration to a E2AP Network Gateway configuration. -sctp_network_connector_config generate_e2ap_nw_config(const e2_appconfig& config, int ppid); +/// Configures the given CLI11 application with the metrics logger application configuration schema. +void configure_cli11_with_metrics_logger_appconfig_schema(CLI::App& app, metrics_logger_appconfig& config); } // namespace srsran diff --git a/apps/services/logger/metrics_logger_appconfig_yaml_writer.cpp b/apps/services/logger/metrics_logger_appconfig_yaml_writer.cpp new file mode 100644 index 0000000000..d62a6a643f --- /dev/null +++ b/apps/services/logger/metrics_logger_appconfig_yaml_writer.cpp @@ -0,0 +1,34 @@ +/* + * + * Copyright 2021-2024 Software Radio Systems Limited + * + * This file is part of srsRAN. + * + * srsRAN is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsRAN is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include "metrics_logger_appconfig_yaml_writer.h" +#include "metrics_logger_appconfig.h" +#include "srsran/srslog/logger.h" + +using namespace srsran; + +void srsran::fill_metrics_logger_appconfig_in_yaml_schema(YAML::Node& node, const metrics_logger_appconfig& config) +{ + YAML::Node log_node = node["log"]; + log_node["metrics_level"] = srslog::basic_level_to_string(config.level); + log_node["hex_max_size"] = config.hex_max_size; +} diff --git a/apps/cu/adapters/e2_gateways.h b/apps/services/logger/metrics_logger_appconfig_yaml_writer.h similarity index 55% rename from apps/cu/adapters/e2_gateways.h rename to apps/services/logger/metrics_logger_appconfig_yaml_writer.h index 833da4a036..1f389c0dd1 100644 --- a/apps/cu/adapters/e2_gateways.h +++ b/apps/services/logger/metrics_logger_appconfig_yaml_writer.h @@ -22,23 +22,13 @@ #pragma once -#include "apps/services/e2/e2_appconfig.h" -#include "srsran/e2/gateways/e2_network_client_factory.h" +#include namespace srsran { -/// Instantiates an E2AP client. -std::unique_ptr -create_cu_e2_client_gateway(const e2_appconfig& e2_cfg, io_broker& broker, dlt_pcap& f1ap_pcap) -{ - sctp_network_connector_config e2ap_sctp{}; - e2ap_sctp.if_name = "E2AP"; - e2ap_sctp.dest_name = "Near-RT-RIC"; - e2ap_sctp.connect_address = e2_cfg.ip_addr; - e2ap_sctp.connect_port = e2_cfg.port; - e2ap_sctp.ppid = E2_CP_PPID; - e2ap_sctp.bind_address = e2_cfg.bind_addr; - return create_e2_gateway_client(e2_sctp_gateway_config{e2ap_sctp, broker, f1ap_pcap}); -} +struct metrics_logger_appconfig; + +/// Fills the given node with the metrics logger application configuration values. +void fill_metrics_logger_appconfig_in_yaml_schema(YAML::Node& node, const metrics_logger_appconfig& config); } // namespace srsran diff --git a/apps/units/cu_cp/CMakeLists.txt b/apps/units/cu_cp/CMakeLists.txt index f96aa17ef1..11e3234f34 100644 --- a/apps/units/cu_cp/CMakeLists.txt +++ b/apps/units/cu_cp/CMakeLists.txt @@ -31,3 +31,4 @@ set(SOURCES add_library(srsran_cu_cp_app_unit STATIC ${SOURCES}) target_include_directories(srsran_cu_cp_app_unit PRIVATE ${CMAKE_SOURCE_DIR}) +target_link_libraries(srsran_cu_cp_app_unit srsran_e2_app_service) diff --git a/apps/units/cu_cp/cu_cp_unit_config_cli11_schema.cpp b/apps/units/cu_cp/cu_cp_unit_config_cli11_schema.cpp index b365bcb5b9..22d801b7e4 100644 --- a/apps/units/cu_cp/cu_cp_unit_config_cli11_schema.cpp +++ b/apps/units/cu_cp/cu_cp_unit_config_cli11_schema.cpp @@ -21,6 +21,7 @@ */ #include "cu_cp_unit_config_cli11_schema.h" +#include "apps/services/e2/e2_cli11_schema.h" #include "apps/services/logger/logger_appconfig_cli11_utils.h" #include "cu_cp_unit_config.h" #include "srsran/ran/nr_cell_identity.h" @@ -538,25 +539,6 @@ static void configure_cli11_metrics_args(CLI::App& app, cu_cp_unit_metrics_confi ->capture_default_str(); } -static void configure_cli11_e2_args(CLI::App& app, e2_config& e2_params) -{ - add_option(app, "--enable_cu_cp_e2", e2_params.enable_unit_e2, "Enable CU E2 agent")->capture_default_str(); - add_option(app, "--addr", e2_params.ip_addr, "RIC IP address")->capture_default_str(); - add_option(app, "--port", e2_params.port, "RIC port")->capture_default_str()->check(CLI::Range(20000, 40000)); - add_option(app, "--bind_addr", e2_params.bind_addr, "Local IP address to bind for RIC connection") - ->capture_default_str() - ->check(CLI::ValidIPV4); - add_option(app, "--sctp_rto_initial", e2_params.sctp_rto_initial, "SCTP initial RTO value")->capture_default_str(); - add_option(app, "--sctp_rto_min", e2_params.sctp_rto_min, "SCTP RTO min")->capture_default_str(); - add_option(app, "--sctp_rto_max", e2_params.sctp_rto_max, "SCTP RTO max")->capture_default_str(); - add_option(app, "--sctp_init_max_attempts", e2_params.sctp_init_max_attempts, "SCTP init max attempts") - ->capture_default_str(); - add_option(app, "--sctp_max_init_timeo", e2_params.sctp_max_init_timeo, "SCTP max init timeout") - ->capture_default_str(); - add_option(app, "--e2sm_kpm_enabled", e2_params.e2sm_kpm_enabled, "Enable KPM service module")->capture_default_str(); - add_option(app, "--e2sm_rc_enabled", e2_params.e2sm_rc_enabled, "Enable RC service module")->capture_default_str(); -} - void srsran::configure_cli11_with_cu_cp_unit_config_schema(CLI::App& app, cu_cp_unit_config& unit_cfg) { add_option(app, "--gnb_id", unit_cfg.gnb_id.id, "gNodeB identifier")->capture_default_str(); @@ -582,8 +564,7 @@ void srsran::configure_cli11_with_cu_cp_unit_config_schema(CLI::App& app, cu_cp_ configure_cli11_metrics_args(*metrics_subcmd, unit_cfg.metrics); // E2 section. - CLI::App* e2_subcmd = add_subcommand(app, "e2", "E2 parameters")->configurable(); - configure_cli11_e2_args(*e2_subcmd, unit_cfg.e2_cfg); + configure_cli11_with_e2_config_schema(app, unit_cfg.e2_cfg, "--enable_cu_cp_e2", "Enable CU E2 agent"); // QoS section. auto qos_lambda = [&unit_cfg](const std::vector& values) { diff --git a/apps/units/cu_cp/cu_cp_unit_config_cli11_schema.h b/apps/units/cu_cp/cu_cp_unit_config_cli11_schema.h index ac19b6a822..fcfe0f0da5 100644 --- a/apps/units/cu_cp/cu_cp_unit_config_cli11_schema.h +++ b/apps/units/cu_cp/cu_cp_unit_config_cli11_schema.h @@ -23,7 +23,6 @@ #pragma once #include "srsran/adt/span.h" - #include "CLI/CLI11.hpp" namespace srsran { diff --git a/apps/units/cu_cp/cu_cp_wrapper.h b/apps/units/cu_cp/cu_cp_wrapper.h index 060b60f8b6..b27e818a87 100644 --- a/apps/units/cu_cp/cu_cp_wrapper.h +++ b/apps/units/cu_cp/cu_cp_wrapper.h @@ -25,7 +25,6 @@ #include "apps/services/e2/e2_metric_connector_manager.h" #include "srsran/cu_cp/cu_cp.h" #include "srsran/e2/e2_cu_metrics_connector.h" - #include "srsran/ngap/gateways/n2_connection_client.h" namespace srsran { diff --git a/apps/units/cu_up/CMakeLists.txt b/apps/units/cu_up/CMakeLists.txt index bbff37bfe2..92f04b17e6 100644 --- a/apps/units/cu_up/CMakeLists.txt +++ b/apps/units/cu_up/CMakeLists.txt @@ -31,4 +31,4 @@ set(SOURCES add_library(srsran_cu_up_app_unit STATIC ${SOURCES}) target_include_directories(srsran_cu_up_app_unit PRIVATE ${CMAKE_SOURCE_DIR}) -target_link_libraries(srsran_cu_up_app_unit srsran_cu_up srsran_cu_up_unit_metrics_helpers) +target_link_libraries(srsran_cu_up_app_unit srsran_cu_up srsran_cu_up_unit_metrics_helpers srsran_e2_app_service) diff --git a/apps/units/cu_up/cu_up_unit_config_cli11_schema.cpp b/apps/units/cu_up/cu_up_unit_config_cli11_schema.cpp index ce1db32acd..a6ad521ed7 100644 --- a/apps/units/cu_up/cu_up_unit_config_cli11_schema.cpp +++ b/apps/units/cu_up/cu_up_unit_config_cli11_schema.cpp @@ -21,6 +21,7 @@ */ #include "cu_up_unit_config_cli11_schema.h" +#include "apps/services/e2/e2_cli11_schema.h" #include "apps/services/logger/logger_appconfig_cli11_utils.h" #include "apps/units/cu_up/cu_up_unit_config.h" #include "apps/units/cu_up/cu_up_unit_pcap_config.h" @@ -108,25 +109,6 @@ static void configure_cli11_metrics_args(CLI::App& app, cu_up_unit_metrics_confi ->capture_default_str(); } -static void configure_cli11_e2_args(CLI::App& app, e2_config& e2_params) -{ - add_option(app, "--enable_cu_up_e2", e2_params.enable_unit_e2, "Enable CU E2 agent")->capture_default_str(); - add_option(app, "--addr", e2_params.ip_addr, "RIC IP address")->capture_default_str(); - add_option(app, "--port", e2_params.port, "RIC port")->capture_default_str()->check(CLI::Range(20000, 40000)); - add_option(app, "--bind_addr", e2_params.bind_addr, "Local IP address to bind for RIC connection") - ->capture_default_str() - ->check(CLI::ValidIPV4); - add_option(app, "--sctp_rto_initial", e2_params.sctp_rto_initial, "SCTP initial RTO value")->capture_default_str(); - add_option(app, "--sctp_rto_min", e2_params.sctp_rto_min, "SCTP RTO min")->capture_default_str(); - add_option(app, "--sctp_rto_max", e2_params.sctp_rto_max, "SCTP RTO max")->capture_default_str(); - add_option(app, "--sctp_init_max_attempts", e2_params.sctp_init_max_attempts, "SCTP init max attempts") - ->capture_default_str(); - add_option(app, "--sctp_max_init_timeo", e2_params.sctp_max_init_timeo, "SCTP max init timeout") - ->capture_default_str(); - add_option(app, "--e2sm_kpm_enabled", e2_params.e2sm_kpm_enabled, "Enable KPM service module")->capture_default_str(); - add_option(app, "--e2sm_rc_enabled", e2_params.e2sm_rc_enabled, "Enable RC service module")->capture_default_str(); -} - static void configure_cli11_f1u_cu_up_args(CLI::App& app, cu_cp_unit_f1u_config& f1u_cu_up_params) { app.add_option("--backoff_timer", f1u_cu_up_params.t_notify, "F1-U backoff timer (ms)")->capture_default_str(); @@ -172,8 +154,7 @@ void srsran::configure_cli11_with_cu_up_unit_config_schema(CLI::App& app, cu_up_ configure_cli11_metrics_args(*metrics_subcmd, unit_cfg.metrics); // E2 section. - CLI::App* e2_subcmd = add_subcommand(app, "e2", "E2 parameters")->configurable(); - configure_cli11_e2_args(*e2_subcmd, unit_cfg.e2_cfg); + configure_cli11_with_e2_config_schema(app, unit_cfg.e2_cfg, "--enable_cu_up_e2", "Enable CU-UP E2 agent"); // QoS section. auto qos_lambda = [&unit_cfg](const std::vector& values) { diff --git a/apps/units/cu_up/cu_up_wrapper.h b/apps/units/cu_up/cu_up_wrapper.h index 61e8a6902b..01f926cc66 100644 --- a/apps/units/cu_up/cu_up_wrapper.h +++ b/apps/units/cu_up/cu_up_wrapper.h @@ -21,6 +21,7 @@ */ #pragma once + #include "apps/services/e2/e2_metric_connector_manager.h" #include "srsran/cu_up/cu_up.h" #include "srsran/e2/e2_cu_metrics_connector.h" diff --git a/apps/units/flexible_du/o_du_high/du_high/CMakeLists.txt b/apps/units/flexible_du/o_du_high/du_high/CMakeLists.txt index 9dcdc81afa..9413301ee8 100644 --- a/apps/units/flexible_du/o_du_high/du_high/CMakeLists.txt +++ b/apps/units/flexible_du/o_du_high/du_high/CMakeLists.txt @@ -28,4 +28,4 @@ set(SOURCES add_library(srsran_du_high_unit_helpers STATIC ${SOURCES}) target_include_directories(srsran_du_high_unit_helpers PRIVATE ${CMAKE_SOURCE_DIR}) -target_link_libraries(srsran_du_high_unit_helpers sched_config srsran_du_high_unit_metrics_helpers srsran_cpu_affinities_helper) +target_link_libraries(srsran_du_high_unit_helpers sched_config srsran_du_high_unit_metrics_helpers srsran_cpu_affinities_helper srsran_e2_app_service) diff --git a/apps/units/flexible_du/o_du_high/du_high/du_high_config.h b/apps/units/flexible_du/o_du_high/du_high/du_high_config.h index befa09a1ea..6c1beb3263 100644 --- a/apps/units/flexible_du/o_du_high/du_high/du_high_config.h +++ b/apps/units/flexible_du/o_du_high/du_high/du_high_config.h @@ -22,6 +22,7 @@ #pragma once +#include "apps/services/logger/metrics_logger_appconfig.h" #include "apps/services/worker_manager/os_sched_affinity_manager.h" #include "srsran/e2/e2ap_configuration.h" #include "srsran/ran/band_helper.h" @@ -53,13 +54,14 @@ namespace srsran { /// DU high logging functionalities. struct du_high_unit_logger_config { - srslog::basic_levels du_level = srslog::basic_levels::warning; - srslog::basic_levels mac_level = srslog::basic_levels::warning; - srslog::basic_levels rlc_level = srslog::basic_levels::warning; - srslog::basic_levels f1ap_level = srslog::basic_levels::warning; - srslog::basic_levels f1u_level = srslog::basic_levels::warning; - srslog::basic_levels gtpu_level = srslog::basic_levels::warning; - srslog::basic_levels metrics_level = srslog::basic_levels::none; + srslog::basic_levels du_level = srslog::basic_levels::warning; + srslog::basic_levels mac_level = srslog::basic_levels::warning; + srslog::basic_levels rlc_level = srslog::basic_levels::warning; + srslog::basic_levels f1ap_level = srslog::basic_levels::warning; + srslog::basic_levels f1u_level = srslog::basic_levels::warning; + srslog::basic_levels gtpu_level = srslog::basic_levels::warning; + + metrics_logger_appconfig metrics_level; /// Maximum number of bytes to write when dumping hex arrays. int hex_max_size = 0; diff --git a/apps/units/flexible_du/o_du_high/du_high/du_high_config_cli11_schema.cpp b/apps/units/flexible_du/o_du_high/du_high/du_high_config_cli11_schema.cpp index 1cddbcbca2..a1269bed74 100644 --- a/apps/units/flexible_du/o_du_high/du_high/du_high_config_cli11_schema.cpp +++ b/apps/units/flexible_du/o_du_high/du_high/du_high_config_cli11_schema.cpp @@ -21,7 +21,9 @@ */ #include "du_high_config_cli11_schema.h" +#include "apps/services/e2/e2_cli11_schema.h" #include "apps/services/logger/logger_appconfig_cli11_utils.h" +#include "apps/services/logger/metrics_logger_appconfig_cli11_schema.h" #include "apps/services/worker_manager/cli11_cpu_affinities_parser_helper.h" #include "du_high_config.h" #include "srsran/ran/du_types.h" @@ -75,21 +77,6 @@ static void configure_cli11_log_args(CLI::App& app, du_high_unit_logger_config& app_services::add_log_option(app, log_params.gtpu_level, "--gtpu_level", "GTPU log level"); app_services::add_log_option(app, log_params.du_level, "--du_level", "Log level for the DU"); - auto metric_level_check = [](const std::string& value) -> std::string { - if (auto level = srslog::str_to_basic_level(value); - !level.has_value() || level.value() == srslog::basic_levels::debug || - level.value() == srslog::basic_levels::error || level.value() == srslog::basic_levels::warning) { - return "Log level value not supported. Accepted values [none,info]"; - } - - return {}; - }; - - add_option_function( - app, "--metrics_level", app_services::capture_log_level_function(log_params.metrics_level), "Metrics log level") - ->default_str(srslog::basic_level_to_string(log_params.metrics_level)) - ->check(metric_level_check); - add_option( app, "--hex_max_size", log_params.hex_max_size, "Maximum number of bytes to print in hex (zero for no hex dumps)") ->capture_default_str() @@ -1623,25 +1610,6 @@ static void configure_cli11_qos_args(CLI::App& app, du_high_unit_qos_config& qos app.needs(f1u_du_subcmd); } -static void configure_cli11_e2_args(CLI::App& app, e2_config& e2_params) -{ - add_option(app, "--enable_du_e2", e2_params.enable_unit_e2, "Enable DU E2 agent")->capture_default_str(); - add_option(app, "--addr", e2_params.ip_addr, "RIC IP address")->capture_default_str(); - add_option(app, "--port", e2_params.port, "RIC port")->check(CLI::Range(20000, 40000))->capture_default_str(); - add_option(app, "--bind_addr", e2_params.bind_addr, "Local IP address to bind for RIC connection") - ->capture_default_str() - ->check(CLI::ValidIPV4); - add_option(app, "--sctp_rto_initial", e2_params.sctp_rto_initial, "SCTP initial RTO value")->capture_default_str(); - add_option(app, "--sctp_rto_min", e2_params.sctp_rto_min, "SCTP RTO min")->capture_default_str(); - add_option(app, "--sctp_rto_max", e2_params.sctp_rto_max, "SCTP RTO max")->capture_default_str(); - add_option(app, "--sctp_init_max_attempts", e2_params.sctp_init_max_attempts, "SCTP init max attempts") - ->capture_default_str(); - add_option(app, "--sctp_max_init_timeo", e2_params.sctp_max_init_timeo, "SCTP max init timeout") - ->capture_default_str(); - add_option(app, "--e2sm_kpm_enabled", e2_params.e2sm_kpm_enabled, "Enable KPM service module")->capture_default_str(); - add_option(app, "--e2sm_rc_enabled", e2_params.e2sm_rc_enabled, "Enable RC service module")->capture_default_str(); -} - void srsran::configure_cli11_with_du_high_config_schema(CLI::App& app, du_high_parsed_config& parsed_cfg) { add_option(app, "--gnb_id", parsed_cfg.config.gnb_id.id, "gNodeB identifier")->capture_default_str(); @@ -1655,6 +1623,7 @@ void srsran::configure_cli11_with_du_high_config_schema(CLI::App& app, du_high_p ->check(CLI::Range(static_cast(0U), static_cast(pow(2, 36) - 1))); // Loggers section. + configure_cli11_with_metrics_logger_appconfig_schema(app, parsed_cfg.config.loggers.metrics_level); CLI::App* log_subcmd = add_subcommand(app, "log", "Logging configuration")->configurable(); configure_cli11_log_args(*log_subcmd, parsed_cfg.config.loggers); @@ -1756,8 +1725,7 @@ void srsran::configure_cli11_with_du_high_config_schema(CLI::App& app, du_high_p configure_cli11_test_mode_args(*test_mode_subcmd, parsed_cfg.config.test_mode_cfg); // E2 section. - CLI::App* e2_subcmd = add_subcommand(app, "e2", "E2 parameters")->configurable(); - configure_cli11_e2_args(*e2_subcmd, parsed_cfg.config.e2_cfg); + configure_cli11_with_e2_config_schema(app, parsed_cfg.config.e2_cfg, "--enable_du_e2", "Enable DU E2 agent"); } static void manage_ntn_optional(CLI::App& app, du_high_unit_config& gnb_cfg) diff --git a/apps/units/flexible_du/o_du_high/du_high/du_high_config_yaml_writer.cpp b/apps/units/flexible_du/o_du_high/du_high/du_high_config_yaml_writer.cpp index 778ceb3289..bcee6d1d31 100644 --- a/apps/units/flexible_du/o_du_high/du_high/du_high_config_yaml_writer.cpp +++ b/apps/units/flexible_du/o_du_high/du_high/du_high_config_yaml_writer.cpp @@ -21,6 +21,7 @@ */ #include "du_high_config_yaml_writer.h" +#include "apps/services/logger/metrics_logger_appconfig_yaml_writer.h" #include "du_high_config.h" #include "srsran/adt/span.h" @@ -51,6 +52,8 @@ static void fill_du_high_pcap_section(YAML::Node node, const du_high_unit_pcap_c static void fill_du_high_log_section(YAML::Node node, const du_high_unit_logger_config& config) { + fill_metrics_logger_appconfig_in_yaml_schema(node, config.metrics_level); + node["mac_level"] = srslog::basic_level_to_string(config.mac_level); node["rlc_level"] = srslog::basic_level_to_string(config.rlc_level); node["f1ap_level"] = srslog::basic_level_to_string(config.f1ap_level); diff --git a/apps/units/flexible_du/o_du_high/du_high/metrics/du_high_scheduler_cell_metrics_consumers.cpp b/apps/units/flexible_du/o_du_high/du_high/metrics/du_high_scheduler_cell_metrics_consumers.cpp index 312e57d0ee..aebe110207 100644 --- a/apps/units/flexible_du/o_du_high/du_high/metrics/du_high_scheduler_cell_metrics_consumers.cpp +++ b/apps/units/flexible_du/o_du_high/du_high/metrics/du_high_scheduler_cell_metrics_consumers.cpp @@ -24,7 +24,6 @@ #include "du_high_rlc_metrics.h" #include "srsran/scheduler/scheduler_metrics.h" #include "srsran/support/engineering_notation.h" - #include "srsran/support/math/math_utils.h" #include #include diff --git a/apps/units/flexible_du/o_du_high/o_du_high_unit_factory.cpp b/apps/units/flexible_du/o_du_high/o_du_high_unit_factory.cpp index 2a5b35e36f..a78451cce8 100644 --- a/apps/units/flexible_du/o_du_high/o_du_high_unit_factory.cpp +++ b/apps/units/flexible_du/o_du_high/o_du_high_unit_factory.cpp @@ -135,8 +135,7 @@ build_scheduler_du_metrics(std::vector& unit_commands.push_back(std::make_unique(*metrics_stdout)); sched_metrics_cfg.consumers.push_back(std::move(metrics_stdout)); - if (du_high_unit_cfg.loggers.metrics_level == srslog::basic_levels::info || - du_high_unit_cfg.loggers.metrics_level == srslog::basic_levels::debug) { + if (du_high_unit_cfg.loggers.metrics_level.level == srslog::basic_levels::info) { sched_metrics_cfg.consumers.push_back( std::make_unique(srslog::fetch_basic_logger("METRICS"))); } @@ -166,7 +165,7 @@ static rlc_metrics_notifier* build_rlc_du_metrics(std::vector(srslog::fetch_basic_logger("METRICS"))); } diff --git a/apps/units/flexible_du/o_du_low/du_low_hal_factory.cpp b/apps/units/flexible_du/o_du_low/du_low_hal_factory.cpp index 3fd9da8168..a6f153ad89 100644 --- a/apps/units/flexible_du/o_du_low/du_low_hal_factory.cpp +++ b/apps/units/flexible_du/o_du_low/du_low_hal_factory.cpp @@ -27,58 +27,54 @@ #include "srsran/hal/phy/upper/channel_processors/hw_accelerator_factories.h" #include "srsran/hal/phy/upper/channel_processors/pusch/ext_harq_buffer_context_repository_factory.h" #include "srsran/hal/phy/upper/channel_processors/pusch/hw_accelerator_factories.h" +#include "srsran/srslog/srslog.h" #endif // DPDK_FOUND using namespace srsran; #ifdef DPDK_FOUND -std::shared_ptr -srsran::init_bbdev_hwacc(const bbdev_appconfig& bbdev_app_cfg, srslog::basic_logger& logger, unsigned nof_hwacc_dus) +static std::shared_ptr +init_bbdev_hwacc(const bbdev_appconfig& bbdev_app_cfg, srslog::basic_logger& logger, unsigned nof_hwacc_dus) { - // Initialize the bbdev-based hardware accelerator, if required. - static std::shared_ptr bbdev_accelerator = [bbdev_app_cfg, &logger, nof_hwacc_dus]() { - // Intefacing to the bbdev-based hardware-accelerator. - dpdk::bbdev_acc_configuration bbdev_config; - bbdev_config.id = bbdev_app_cfg.id; - if (bbdev_app_cfg.pdsch_enc && bbdev_app_cfg.pdsch_enc->nof_hwacc > 0) { - bbdev_config.nof_ldpc_enc_lcores = nof_hwacc_dus * bbdev_app_cfg.pdsch_enc->nof_hwacc; - } - if (bbdev_app_cfg.pusch_dec && bbdev_app_cfg.pusch_dec->nof_hwacc > 0) { - bbdev_config.nof_ldpc_dec_lcores = nof_hwacc_dus * bbdev_app_cfg.pusch_dec->nof_hwacc; - } - // If no msg_mbuf size is defined, a worst-case value will be used. - bbdev_config.msg_mbuf_size = bbdev_app_cfg.msg_mbuf_size.value_or(RTE_BBDEV_LDPC_E_MAX_MBUF); - // If no rm_mbuf size is defined, a worst-case value will be used. - bbdev_config.rm_mbuf_size = bbdev_app_cfg.rm_mbuf_size.value_or(RTE_BBDEV_LDPC_E_MAX_MBUF); - // If no number of mbufs is defined, a worst-case value will be used. - bbdev_config.nof_mbuf = bbdev_app_cfg.nof_mbuf.value_or(static_cast(pow2(log2_ceil(MAX_NOF_SEGMENTS)))); - std::shared_ptr bbdev_acc = create_bbdev_acc(bbdev_config, logger); - report_error_if_not(bbdev_acc, "Unable to open the {} hardware-accelerator.", bbdev_app_cfg.hwacc_type); - return bbdev_acc; - }(); + // Intefacing to the bbdev-based hardware-accelerator. + dpdk::bbdev_acc_configuration bbdev_config; + bbdev_config.id = bbdev_app_cfg.id; + if (bbdev_app_cfg.pdsch_enc && bbdev_app_cfg.pdsch_enc->nof_hwacc > 0) { + bbdev_config.nof_ldpc_enc_lcores = nof_hwacc_dus * bbdev_app_cfg.pdsch_enc->nof_hwacc; + } + if (bbdev_app_cfg.pusch_dec && bbdev_app_cfg.pusch_dec->nof_hwacc > 0) { + bbdev_config.nof_ldpc_dec_lcores = nof_hwacc_dus * bbdev_app_cfg.pusch_dec->nof_hwacc; + } + // If no msg_mbuf size is defined, a worst-case value will be used. + bbdev_config.msg_mbuf_size = bbdev_app_cfg.msg_mbuf_size.value_or(RTE_BBDEV_LDPC_E_MAX_MBUF); + // If no rm_mbuf size is defined, a worst-case value will be used. + bbdev_config.rm_mbuf_size = bbdev_app_cfg.rm_mbuf_size.value_or(RTE_BBDEV_LDPC_E_MAX_MBUF); + // If no number of mbufs is defined, a worst-case value will be used. + bbdev_config.nof_mbuf = bbdev_app_cfg.nof_mbuf.value_or(static_cast(pow2(log2_ceil(MAX_NOF_SEGMENTS)))); + std::shared_ptr bbdev_acc = create_bbdev_acc(bbdev_config, logger); + report_error_if_not(bbdev_acc, "Unable to open the {} hardware-accelerator.", bbdev_app_cfg.hwacc_type); - return bbdev_accelerator; + return bbdev_acc; } #endif // DPDK_FOUND -o_du_low_hal_dependencies srsran::make_du_low_hal_dependencies(const du_low_unit_config& du_low_unit_cfg, - unsigned nof_cells) +o_du_low_hal_dependencies srsran::make_du_low_hal_dependencies(const std::optional& hal_config, + unsigned nof_cells) { o_du_low_hal_dependencies hal_dependencies; // Initialize hardware-accelerator (only once and if needed). #ifdef DPDK_FOUND - if (du_low_unit_cfg.hal_config && du_low_unit_cfg.hal_config->bbdev_hwacc && - !du_low_unit_cfg.hal_config->bbdev_hwacc->hwacc_type.empty()) { - const bbdev_appconfig& bbdev_app_cfg = du_low_unit_cfg.hal_config->bbdev_hwacc.value(); - srslog::basic_logger& hwacc_logger = srslog::fetch_basic_logger("HWACC", false); - hwacc_logger.set_level(du_low_unit_cfg.loggers.hal_level); + if (hal_config && hal_config->bbdev_hwacc && !hal_config->bbdev_hwacc->hwacc_type.empty()) { + const bbdev_appconfig& bbdev_app_cfg = hal_config->bbdev_hwacc.value(); + srslog::basic_logger& hwacc_logger = srslog::fetch_basic_logger("HWACC"); + auto accelerator = init_bbdev_hwacc(bbdev_app_cfg, hwacc_logger, nof_cells); // Create a hardware-accelerated PDSCH encoder factory (only if needed). if (bbdev_app_cfg.pdsch_enc && bbdev_app_cfg.pdsch_enc->nof_hwacc > 0) { hal::bbdev_hwacc_pdsch_enc_factory_configuration hwacc_pdsch_enc_cfg; hwacc_pdsch_enc_cfg.acc_type = bbdev_app_cfg.hwacc_type; - hwacc_pdsch_enc_cfg.bbdev_accelerator = init_bbdev_hwacc(bbdev_app_cfg, hwacc_logger, nof_cells); + hwacc_pdsch_enc_cfg.bbdev_accelerator = accelerator; hwacc_pdsch_enc_cfg.cb_mode = bbdev_app_cfg.pdsch_enc->cb_mode; // If no maximum buffer size is defined, a worst-case value will be used. hwacc_pdsch_enc_cfg.max_tb_size = bbdev_app_cfg.pdsch_enc->max_buffer_size.value_or(RTE_BBDEV_LDPC_E_MAX_MBUF); @@ -91,8 +87,8 @@ o_du_low_hal_dependencies srsran::make_du_low_hal_dependencies(const du_low_unit hal::bbdev_hwacc_pusch_dec_factory_configuration hwacc_pusch_dec_cfg; std::shared_ptr harq_buffer_context = nullptr; hwacc_pusch_dec_cfg.acc_type = bbdev_app_cfg.hwacc_type; - hwacc_pusch_dec_cfg.bbdev_accelerator = init_bbdev_hwacc(bbdev_app_cfg, hwacc_logger, nof_cells); - hwacc_pusch_dec_cfg.ext_softbuffer = bbdev_app_cfg.pusch_dec->ext_softbuffer; + hwacc_pusch_dec_cfg.bbdev_accelerator = accelerator; + hwacc_pusch_dec_cfg.ext_softbuffer = bbdev_app_cfg.pusch_dec->ext_softbuffer; if (hwacc_pusch_dec_cfg.ext_softbuffer) { // Set up an external HARQ buffer context repository. unsigned nof_cbs = bbdev_app_cfg.pusch_dec->harq_context_size.value_or(MAX_NOF_SEGMENTS); diff --git a/apps/units/flexible_du/o_du_low/du_low_hal_factory.h b/apps/units/flexible_du/o_du_low/du_low_hal_factory.h index e55101a2d5..6ea421d951 100644 --- a/apps/units/flexible_du/o_du_low/du_low_hal_factory.h +++ b/apps/units/flexible_du/o_du_low/du_low_hal_factory.h @@ -25,11 +25,6 @@ #include "du_low_config.h" #include "srsran/hal/phy/upper/channel_processors/hw_accelerator_pdsch_enc_factory.h" #include "srsran/hal/phy/upper/channel_processors/pusch/hw_accelerator_pusch_dec_factory.h" -#include "srsran/srslog/srslog.h" - -#ifdef DPDK_FOUND -#include "srsran/hal/dpdk/bbdev/bbdev_acc.h" -#endif // DPDK_FOUND namespace srsran { @@ -39,20 +34,11 @@ struct o_du_low_hal_dependencies { std::shared_ptr hw_decoder_factory = nullptr; }; -#ifdef DPDK_FOUND -/// \brief Creates and initializes a bbdev-based hardware accelerator. -/// \param[in] bbdev_app_cfg Struct containing the DU low HAL configuration. -/// \param[in] logger SRS logger. -/// \param[in] nof_hwacc_dus Number of DU-low instances to be managed by the hardware accelerator. -/// \return A pointer to the bbdev-based accelerator interface on success, nullptr otherwise. -static std::shared_ptr -init_bbdev_hwacc(const bbdev_appconfig& bbdev_app_cfg, srslog::basic_logger& logger, unsigned nof_hwacc_dus); -#endif // DPDK_FOUND - /// \brief Initializes the HAL depencies of the DU low unit. -/// \param[out] hal_dependencies Struct containing the DU low unit dependencies. -/// \param[in] du_low_unit_cfg Struct defining the DU low configuration. -/// \param[in] nof_cells Number of cells to be handled by the HAL. -o_du_low_hal_dependencies make_du_low_hal_dependencies(const du_low_unit_config& du_low_unit_cfg, unsigned nof_cells); +/// \param[out] hal_config Struct defining the DU low HAL configuration +/// \param[in] nof_cells Number of cells to be handled by the HAL. +/// \return Struct containing the DU low unit dependencies. +o_du_low_hal_dependencies make_du_low_hal_dependencies(const std::optional& hal_config, + unsigned nof_cells); } // namespace srsran diff --git a/apps/units/flexible_du/o_du_low/du_low_logger_registrator.h b/apps/units/flexible_du/o_du_low/du_low_logger_registrator.h index 6e4bd569d5..a59e856736 100644 --- a/apps/units/flexible_du/o_du_low/du_low_logger_registrator.h +++ b/apps/units/flexible_du/o_du_low/du_low_logger_registrator.h @@ -33,6 +33,9 @@ inline void register_du_low_loggers(const du_low_unit_logger_config& log_cfg) auto& phy_logger = srslog::fetch_basic_logger("PHY", true); phy_logger.set_level(log_cfg.phy_level); phy_logger.set_hex_dump_max_size(log_cfg.hex_max_size); + + srslog::basic_logger& hwacc_logger = srslog::fetch_basic_logger("HWACC", false); + hwacc_logger.set_level(log_cfg.hal_level); } } // namespace srsran diff --git a/apps/units/flexible_du/o_du_low/o_du_low_unit_factory.cpp b/apps/units/flexible_du/o_du_low/o_du_low_unit_factory.cpp index b504c25d69..0dc1fec171 100644 --- a/apps/units/flexible_du/o_du_low/o_du_low_unit_factory.cpp +++ b/apps/units/flexible_du/o_du_low/o_du_low_unit_factory.cpp @@ -71,8 +71,14 @@ static void generate_dl_processor_config(downlink_processor_factory_sw_config& o out_cfg.nof_concurrent_threads = upper_phy_threads_cfg.nof_dl_threads; } -o_du_low_unit srsran::make_o_du_low_unit(const o_du_low_unit_config& params, - const o_du_low_unit_dependencies& dependencies) +o_du_low_unit_factory::o_du_low_unit_factory(const std::optional& hal_config, + unsigned nof_cells) : + hal_dependencies(make_du_low_hal_dependencies(hal_config, nof_cells)) +{ +} + +o_du_low_unit o_du_low_unit_factory::create(const o_du_low_unit_config& params, + const o_du_low_unit_dependencies& dependencies) { srs_du::o_du_low_config o_du_low_cfg; o_du_low_cfg.du_low_cfg.logger = &srslog::fetch_basic_logger("DU"); @@ -80,9 +86,6 @@ o_du_low_unit srsran::make_o_du_low_unit(const o_du_low_unit_config& param generate_o_du_low_config( o_du_low_cfg, params.du_low_unit_cfg, params.du_cells, params.max_puschs_per_slot, params.du_id); - // Fill the HAL dependencies. - o_du_low_hal_dependencies hal_dependencies = make_du_low_hal_dependencies(params.du_low_unit_cfg, params.nof_cells); - // Fill the PRACH ports. o_du_low_cfg.prach_ports = params.prach_ports; diff --git a/apps/units/flexible_du/o_du_low/o_du_low_unit_factory.h b/apps/units/flexible_du/o_du_low/o_du_low_unit_factory.h index f47028f739..4452188192 100644 --- a/apps/units/flexible_du/o_du_low/o_du_low_unit_factory.h +++ b/apps/units/flexible_du/o_du_low/o_du_low_unit_factory.h @@ -22,6 +22,7 @@ #pragma once +#include "du_low_hal_factory.h" #include "srsran/adt/span.h" #include "srsran/du/du_low/o_du_low.h" #include "srsran/du/du_low/o_du_low_config.h" @@ -57,7 +58,16 @@ struct o_du_low_unit_dependencies { worker_manager& workers; }; -/// Creates an ORAN DU low unit with the given parameters. -o_du_low_unit make_o_du_low_unit(const o_du_low_unit_config& params, const o_du_low_unit_dependencies& dependencies); +/// ORAN DU low unit factory. +class o_du_low_unit_factory +{ + o_du_low_hal_dependencies hal_dependencies; + +public: + o_du_low_unit_factory(const std::optional& hal_config, unsigned nof_cells); + + /// Creates an ORAN DU low unit with the given parameters. + o_du_low_unit create(const o_du_low_unit_config& params, const o_du_low_unit_dependencies& dependencies); +}; } // namespace srsran diff --git a/apps/units/flexible_du/split_dynamic/dynamic_du_translators.cpp b/apps/units/flexible_du/split_dynamic/dynamic_du_translators.cpp index bca91875aa..27b9bc2615 100644 --- a/apps/units/flexible_du/split_dynamic/dynamic_du_translators.cpp +++ b/apps/units/flexible_du/split_dynamic/dynamic_du_translators.cpp @@ -28,7 +28,6 @@ #include "apps/units/flexible_du/split_7_2/helpers/ru_ofh_config_translator.h" #include "apps/units/flexible_du/split_8/helpers/ru_sdr_config_translator.h" #include "dynamic_du_unit_config.h" - #include "srsran/du/du_cell_config.h" using namespace srsran; diff --git a/apps/units/flexible_du/split_helpers/flexible_du_factory.cpp b/apps/units/flexible_du/split_helpers/flexible_du_factory.cpp index 7fb6854634..6558c7f1d9 100644 --- a/apps/units/flexible_du/split_helpers/flexible_du_factory.cpp +++ b/apps/units/flexible_du/split_helpers/flexible_du_factory.cpp @@ -37,8 +37,8 @@ using namespace srsran; o_du_unit flexible_du_factory::create_flexible_du(const du_unit_dependencies& dependencies) { - o_du_unit odu_unit; - unsigned nof_cells = config.odu_high_cfg.du_high_cfg.config.cells_cfg.size(); + o_du_unit odu_unit; + const unsigned nof_cells = config.odu_high_cfg.du_high_cfg.config.cells_cfg.size(); odu_unit.e2_metric_connectors = std::make_unique< e2_metric_connector_manager>(nof_cells); @@ -48,7 +48,7 @@ o_du_unit flexible_du_factory::create_flexible_du(const du_unit_dependencies& de auto du_cells = generate_du_cell_config(du_hi); std::vector> du_insts; - auto du_impl = std::make_unique(du_cells.size()); + auto du_impl = std::make_unique(nof_cells); std::vector prach_ports; std::vector max_pusch_per_slot; @@ -57,6 +57,9 @@ o_du_unit flexible_du_factory::create_flexible_du(const du_unit_dependencies& de max_pusch_per_slot.push_back(high.cell.pusch_cfg.max_puschs_per_slot); } + // O-DU low factory is common for all the cells. + o_du_low_unit_factory odu_low_factory(du_lo.hal_config, nof_cells); + // Create O-DU low. std::vector du_low_units; for (unsigned i = 0, e = du_cells.size(); i != e; ++i) { @@ -69,7 +72,7 @@ o_du_unit flexible_du_factory::create_flexible_du(const du_unit_dependencies& de o_du_low_unit_dependencies odu_low_dependencies = { du_impl->get_upper_ru_dl_rg_adapter(), du_impl->get_upper_ru_ul_request_adapter(), *dependencies.workers}; - du_low_units.push_back(make_o_du_low_unit(odu_low_cfg, odu_low_dependencies)); + du_low_units.push_back(odu_low_factory.create(odu_low_cfg, odu_low_dependencies)); } // Create O-DU high. diff --git a/apps/units/flexible_du/split_helpers/multicell_flexible_du_factory.cpp b/apps/units/flexible_du/split_helpers/multicell_flexible_du_factory.cpp index 5d0a4ac74d..59ff5403c4 100644 --- a/apps/units/flexible_du/split_helpers/multicell_flexible_du_factory.cpp +++ b/apps/units/flexible_du/split_helpers/multicell_flexible_du_factory.cpp @@ -35,17 +35,17 @@ using namespace srsran; o_du_unit multicell_flexible_du_factory::create_flexible_du(const du_unit_dependencies& dependencies) { - o_du_unit o_du; + o_du_unit o_du; + const unsigned nof_cells = config.odu_high_cfg.du_high_cfg.config.cells_cfg.size(); o_du.e2_metric_connectors = std::make_unique< - e2_metric_connector_manager>( - config.odu_high_cfg.du_high_cfg.config.cells_cfg.size()); + e2_metric_connector_manager>(nof_cells); const du_high_unit_config& du_hi = config.odu_high_cfg.du_high_cfg.config; const du_low_unit_config& du_lo = config.du_low_cfg; auto du_cells = generate_du_cell_config(du_hi); - auto du_impl = std::make_unique(du_cells.size()); + auto du_impl = std::make_unique(nof_cells); std::vector prach_ports; std::vector max_pusch_per_slot; @@ -57,10 +57,10 @@ o_du_unit multicell_flexible_du_factory::create_flexible_du(const du_unit_depend static constexpr unsigned du_id = 0U; o_du_low_unit_config odu_low_cfg = { du_lo, prach_ports, du_cells, max_pusch_per_slot, du_id, static_cast(du_cells.size())}; - o_du_low_unit_dependencies odu_low_dependencies = { du_impl->get_upper_ru_dl_rg_adapter(), du_impl->get_upper_ru_ul_request_adapter(), *dependencies.workers}; - auto odu_lo_unit = make_o_du_low_unit(odu_low_cfg, odu_low_dependencies); + o_du_low_unit_factory odu_low_factory(du_lo.hal_config, nof_cells); + auto odu_lo_unit = odu_low_factory.create(odu_low_cfg, odu_low_dependencies); o_du_high_unit_params odu_hi_unit_params = {config.odu_high_cfg, du_id}; diff --git a/include/srsran/adt/bf16.h b/include/srsran/adt/bf16.h index 3dea53fced..4261557f0b 100644 --- a/include/srsran/adt/bf16.h +++ b/include/srsran/adt/bf16.h @@ -22,7 +22,7 @@ #pragma once -#include "strong_type.h" +#include "srsran/adt/strong_type.h" #include #include #include diff --git a/include/srsran/adt/blocking_queue.h b/include/srsran/adt/blocking_queue.h index 0364ed734a..b9652dda7a 100644 --- a/include/srsran/adt/blocking_queue.h +++ b/include/srsran/adt/blocking_queue.h @@ -22,7 +22,7 @@ #pragma once -#include "ring_buffer.h" +#include "srsran/adt/ring_buffer.h" #include #include #include diff --git a/include/srsran/adt/byte_buffer.h b/include/srsran/adt/byte_buffer.h index cb41fa3d88..c78dc6db6c 100644 --- a/include/srsran/adt/byte_buffer.h +++ b/include/srsran/adt/byte_buffer.h @@ -22,6 +22,7 @@ #pragma once +#include "srsran/adt/detail/byte_buffer_memory_resource.h" #include "srsran/adt/detail/byte_buffer_range_helpers.h" #include "srsran/adt/detail/intrusive_ptr.h" #include "srsran/adt/expected.h" @@ -48,6 +49,12 @@ size_t get_byte_buffer_segment_pool_capacity(); /// allocation in the caller thread. size_t get_byte_buffer_segment_pool_current_size_approx(); +/// \brief Default byte buffer segment pool. +byte_buffer_memory_resource& get_default_byte_buffer_segment_pool(); + +/// \brief Default byte buffer segment pool with fallback to the heap on failure to allocate. +byte_buffer_memory_resource& get_default_fallback_byte_buffer_segment_pool(); + /// \brief Non-owning view to a byte sequence. /// /// The underlying byte sequence is not contiguous in memory. Instead, it is represented as an intrusive linked list of @@ -173,8 +180,8 @@ class byte_buffer node_t* segment_in_cb_memory_block = nullptr; /// Intrusive ptr reference counter. intrusive_ptr_atomic_ref_counter ref_count; - /// Whether failures to allocate segments using pool should fallback to malloc. - bool malloc_fallback = false; + /// Memory resource used to allocate/deallocate segments. + byte_buffer_memory_resource* segment_pool; void destroy_node(node_t* node) const; @@ -208,21 +215,23 @@ class byte_buffer /// Explicit copy ctor. User should use copy() method for copy assignments. explicit byte_buffer(const byte_buffer&) noexcept = default; + /// Move constructor. + byte_buffer(byte_buffer&& other) noexcept = default; + + /// Creates an empty byte_buffer with a custom segment memory pool. + static expected create(byte_buffer_memory_resource& segment_pool); + /// Creates a byte_buffer with contents provided by a span of bytes. - static expected create(span bytes) - { - byte_buffer buf; - if (not buf.append(bytes)) { - return make_unexpected(default_error_t{}); - } - return buf; - } + /// \param[in] bytes span of bytes to assign to the byte_buffer. + /// \param[in] segment_pool memory pool used to allocate segments. + static expected + create(span bytes, byte_buffer_memory_resource& segment_pool = get_default_byte_buffer_segment_pool()); - /// Creates a byte_buffer with data initialized via a initializer list. - static expected create(std::initializer_list lst) - { - return create(span(lst.begin(), lst.size())); - } + /// Creates a byte_buffer with data initialized via an initializer list. + /// \param[in] lst initializer list with bytes to assign to the byte_buffer. + /// \param[in] pool memory pool used to allocate segments. + static expected create(const std::initializer_list& lst, + byte_buffer_memory_resource& pool = get_default_byte_buffer_segment_pool()); /// Creates a byte_buffer with data assigned from a range of bytes. template @@ -235,9 +244,6 @@ class byte_buffer return buf; } - /// Move constructor. - byte_buffer(byte_buffer&& other) noexcept = default; - /// Creates a byte_buffer that in case it fails to allocate from the default pool, it resorts to malloc as fallback. byte_buffer(fallback_allocation_tag tag, span other = {}) noexcept; byte_buffer(fallback_allocation_tag tag, const std::initializer_list& other) noexcept; @@ -260,12 +266,12 @@ class byte_buffer template [[nodiscard]] bool append(Iterator begin, Iterator end) { - static_assert(std::is_same, uint8_t>::value or - std::is_same, const uint8_t>::value, + static_assert(std::is_same_v, uint8_t> or + std::is_same_v, const uint8_t>, "Iterator value type is not uint8_t"); using iter_category = typename std::iterator_traits::iterator_category; - if (std::is_same::value) { + if constexpr (std::is_same_v) { return append(span(&*begin, &*end)); } // TODO: use segment-wise copy if it is a byte buffer-like type. @@ -293,7 +299,7 @@ class byte_buffer [[nodiscard]] bool append(uint8_t byte) { if (empty() or ctrl_blk_ptr->segments.tail->tailroom() == 0) { - if (not append_segment(DEFAULT_FIRST_SEGMENT_HEADROOM)) { + if (not append_segment(DEFAULT_FIRST_SEGMENT_HEADROOM, byte_buffer_segment_pool_default_segment_size())) { return false; } } @@ -306,7 +312,7 @@ class byte_buffer [[nodiscard]] bool append(const byte_buffer_view& view); /// Appends an owning view of bytes into current byte buffer. - [[nodiscard]] bool append(const byte_buffer_slice& view); + [[nodiscard]] bool append(const byte_buffer_slice& slice); /// Prepends bytes to byte_buffer. This function may allocate new segments. [[nodiscard]] bool prepend(span bytes); @@ -384,7 +390,7 @@ class byte_buffer { return detail::compare_byte_buffer_range(lhs, r); } - template >::value, int> = 0> + template >, int> = 0> friend bool operator==(const T& r, const byte_buffer& rhs) { return detail::compare_byte_buffer_range(rhs, r); @@ -394,7 +400,7 @@ class byte_buffer { return !(lhs == r); } - template >::value, int> = 0> + template >, int> = 0> friend bool operator!=(const T& r, const byte_buffer& rhs) { return !(rhs == r); @@ -403,20 +409,22 @@ class byte_buffer private: bool has_ctrl_block() const { return ctrl_blk_ptr != nullptr; } - [[nodiscard]] node_t* add_head_segment(size_t headroom, bool use_fallback = false); + [[nodiscard]] bool default_construct_unsafe(byte_buffer_memory_resource& segment_pool, unsigned sz_hint); + + [[nodiscard]] bool append(span bytes, byte_buffer_memory_resource& segment_pool); - [[nodiscard]] node_t* create_segment(size_t headroom); + [[nodiscard]] node_t* add_head_segment(size_t headroom, byte_buffer_memory_resource& segment_pool, size_t sz_hint); - [[nodiscard]] bool append_segment(size_t headroom_suggestion); + [[nodiscard]] node_t* create_segment(size_t headroom, size_t sz_hint); - [[nodiscard]] bool prepend_segment(size_t headroom_suggestion); + [[nodiscard]] bool append_segment(size_t headroom_suggestion, size_t sz_hint); + + [[nodiscard]] bool prepend_segment(size_t headroom_suggestion, size_t sz_hint); /// \brief Removes last segment of the byte_buffer. /// Note: This operation is O(N), as it requires recomputing the tail. void pop_last_segment(); - static void warn_alloc_failure(); - intrusive_ptr ctrl_blk_ptr; }; diff --git a/include/srsran/adt/circular_map.h b/include/srsran/adt/circular_map.h index 8e63e5e30c..0882f5d3a0 100644 --- a/include/srsran/adt/circular_map.h +++ b/include/srsran/adt/circular_map.h @@ -22,8 +22,8 @@ #pragma once -#include "expected.h" #include "srsran/adt/detail/type_traits.h" +#include "srsran/adt/expected.h" #include "srsran/support/srsran_assert.h" #include #include diff --git a/include/srsran/adt/detail/byte_buffer_memory_resource.h b/include/srsran/adt/detail/byte_buffer_memory_resource.h new file mode 100644 index 0000000000..04e5dada2b --- /dev/null +++ b/include/srsran/adt/detail/byte_buffer_memory_resource.h @@ -0,0 +1,71 @@ +/* + * + * Copyright 2021-2024 Software Radio Systems Limited + * + * This file is part of srsRAN. + * + * srsRAN is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsRAN is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#pragma once + +#include "srsran/adt/span.h" +#include + +namespace srsran { + +/// Polymorphic memory resource used for allocating byte buffer segments of a byte buffer. +class byte_buffer_memory_resource +{ +public: + byte_buffer_memory_resource() = default; + byte_buffer_memory_resource(const byte_buffer_memory_resource&) = default; + virtual ~byte_buffer_memory_resource() = default; + + byte_buffer_memory_resource& operator=(const byte_buffer_memory_resource&) = default; + + /// Allocate a memory block with \c size_hint. + /// \return Range of bytes allocated that can be of size equal or different from \c size_hint. + span allocate(size_t size_hint, size_t alignment = alignof(max_align_t)) + { + return do_allocate(size_hint, alignment); + } + + /// Deallocate a memory block allocated by this pool. + void deallocate(void* p) { do_deallocate(p); } + + /// Verify that the memory resource is the same. + bool is_equal(const byte_buffer_memory_resource& other) const noexcept { return do_is_equal(other); } + +private: + virtual span do_allocate(size_t size_hint, size_t alignment) = 0; + + virtual void do_deallocate(void* p) = 0; + + virtual bool do_is_equal(const byte_buffer_memory_resource& other) const noexcept = 0; +}; + +inline bool operator==(const byte_buffer_memory_resource& lhs, const byte_buffer_memory_resource& rhs) noexcept +{ + return &lhs == &rhs || lhs.is_equal(rhs); +} + +inline bool operator!=(const byte_buffer_memory_resource& lhs, const byte_buffer_memory_resource& rhs) noexcept +{ + return not(lhs == rhs); +} + +} // namespace srsran \ No newline at end of file diff --git a/include/srsran/adt/detail/byte_buffer_range_helpers.h b/include/srsran/adt/detail/byte_buffer_range_helpers.h index 4d1f0ae03c..5dfffe7e74 100644 --- a/include/srsran/adt/detail/byte_buffer_range_helpers.h +++ b/include/srsran/adt/detail/byte_buffer_range_helpers.h @@ -22,7 +22,7 @@ #pragma once -#include "byte_buffer_segment_list.h" +#include "srsran/adt/detail/byte_buffer_segment_list.h" namespace srsran { namespace detail { @@ -109,4 +109,4 @@ bool compare_byte_buffer_range(const ByteBufferType1& lhs, const ByteBufferType2 } } // namespace detail -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/adt/slotted_array.h b/include/srsran/adt/slotted_array.h index 49115f8bf0..4950e4ffda 100644 --- a/include/srsran/adt/slotted_array.h +++ b/include/srsran/adt/slotted_array.h @@ -22,8 +22,8 @@ #pragma once -#include "span.h" -#include "tiny_optional.h" +#include "srsran/adt/span.h" +#include "srsran/adt/tiny_optional.h" #include "srsran/support/srsran_assert.h" #include diff --git a/include/srsran/adt/spsc_queue.h b/include/srsran/adt/spsc_queue.h index 92e0b42753..3fc85db13f 100644 --- a/include/srsran/adt/spsc_queue.h +++ b/include/srsran/adt/spsc_queue.h @@ -22,8 +22,8 @@ #pragma once -#include "concurrent_queue.h" #include "rigtorp/SPSCQueue.h" +#include "srsran/adt/concurrent_queue.h" #include "srsran/support/error_handling.h" #include #include diff --git a/include/srsran/asn1/e1ap/e1ap_pdu_contents.h b/include/srsran/asn1/e1ap/e1ap_pdu_contents.h index 503c8e88d9..8deccb58f2 100644 --- a/include/srsran/asn1/e1ap/e1ap_pdu_contents.h +++ b/include/srsran/asn1/e1ap/e1ap_pdu_contents.h @@ -28,7 +28,7 @@ #pragma once -#include "e1ap_ies.h" +#include "srsran/asn1/e1ap/e1ap_ies.h" namespace asn1 { namespace e1ap { diff --git a/include/srsran/asn1/e2sm/e2sm_kpm_ies.h b/include/srsran/asn1/e2sm/e2sm_kpm_ies.h index 5339d53d2e..b04b573ac3 100644 --- a/include/srsran/asn1/e2sm/e2sm_kpm_ies.h +++ b/include/srsran/asn1/e2sm/e2sm_kpm_ies.h @@ -28,7 +28,7 @@ #pragma once -#include "e2sm_common_ies.h" +#include "srsran/asn1/e2sm/e2sm_common_ies.h" namespace asn1 { namespace e2sm { diff --git a/include/srsran/asn1/e2sm/e2sm_rc_ies.h b/include/srsran/asn1/e2sm/e2sm_rc_ies.h index 4b8a485d1f..007dfe6a63 100644 --- a/include/srsran/asn1/e2sm/e2sm_rc_ies.h +++ b/include/srsran/asn1/e2sm/e2sm_rc_ies.h @@ -28,7 +28,7 @@ #pragma once -#include "e2sm_kpm_ies.h" +#include "srsran/asn1/e2sm/e2sm_kpm_ies.h" namespace asn1 { namespace e2sm { diff --git a/include/srsran/asn1/f1ap/f1ap_pdu_contents.h b/include/srsran/asn1/f1ap/f1ap_pdu_contents.h index e34f431b5f..21d54cf352 100644 --- a/include/srsran/asn1/f1ap/f1ap_pdu_contents.h +++ b/include/srsran/asn1/f1ap/f1ap_pdu_contents.h @@ -28,7 +28,7 @@ #pragma once -#include "f1ap_pdu_contents_ue.h" +#include "srsran/asn1/f1ap/f1ap_pdu_contents_ue.h" namespace asn1 { namespace f1ap { diff --git a/include/srsran/asn1/f1ap/f1ap_pdu_contents_ue.h b/include/srsran/asn1/f1ap/f1ap_pdu_contents_ue.h index 8dc88badbe..a704b359d0 100644 --- a/include/srsran/asn1/f1ap/f1ap_pdu_contents_ue.h +++ b/include/srsran/asn1/f1ap/f1ap_pdu_contents_ue.h @@ -28,7 +28,7 @@ #pragma once -#include "f1ap_pdu_items.h" +#include "srsran/asn1/f1ap/f1ap_pdu_items.h" namespace asn1 { namespace f1ap { diff --git a/include/srsran/asn1/f1ap/f1ap_pdu_items.h b/include/srsran/asn1/f1ap/f1ap_pdu_items.h index 35dbe1b372..194e3ed3f5 100644 --- a/include/srsran/asn1/f1ap/f1ap_pdu_items.h +++ b/include/srsran/asn1/f1ap/f1ap_pdu_items.h @@ -28,7 +28,7 @@ #pragma once -#include "f1ap_ies.h" +#include "srsran/asn1/f1ap/f1ap_ies.h" namespace asn1 { namespace f1ap { diff --git a/include/srsran/asn1/ngap/ngap_pdu_contents.h b/include/srsran/asn1/ngap/ngap_pdu_contents.h index 0cfd9a29e1..b36f50f545 100644 --- a/include/srsran/asn1/ngap/ngap_pdu_contents.h +++ b/include/srsran/asn1/ngap/ngap_pdu_contents.h @@ -28,7 +28,7 @@ #pragma once -#include "ngap_ies.h" +#include "srsran/asn1/ngap/ngap_ies.h" namespace asn1 { namespace ngap { diff --git a/include/srsran/asn1/rrc_nr/bwp_cfg.h b/include/srsran/asn1/rrc_nr/bwp_cfg.h index d6d6002e32..bb9158eaf8 100644 --- a/include/srsran/asn1/rrc_nr/bwp_cfg.h +++ b/include/srsran/asn1/rrc_nr/bwp_cfg.h @@ -28,7 +28,7 @@ #pragma once -#include "common.h" +#include "srsran/asn1/rrc_nr/common.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/cell_group_config.h b/include/srsran/asn1/rrc_nr/cell_group_config.h index 8d2b49d7b6..5ccd9f8fce 100644 --- a/include/srsran/asn1/rrc_nr/cell_group_config.h +++ b/include/srsran/asn1/rrc_nr/cell_group_config.h @@ -28,7 +28,7 @@ #pragma once -#include "ul_dcch_msg_ies.h" +#include "srsran/asn1/rrc_nr/ul_dcch_msg_ies.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/dl_ccch_msg_ies.h b/include/srsran/asn1/rrc_nr/dl_ccch_msg_ies.h index 1058e9d5ff..b398b2f124 100644 --- a/include/srsran/asn1/rrc_nr/dl_ccch_msg_ies.h +++ b/include/srsran/asn1/rrc_nr/dl_ccch_msg_ies.h @@ -28,8 +28,8 @@ #pragma once -#include "radio_bearer_cfg.h" -#include "serving_cell.h" +#include "srsran/asn1/rrc_nr/radio_bearer_cfg.h" +#include "srsran/asn1/rrc_nr/serving_cell.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/dl_dcch_msg_ies.h b/include/srsran/asn1/rrc_nr/dl_dcch_msg_ies.h index b3949e7f6f..0a347c0d7c 100644 --- a/include/srsran/asn1/rrc_nr/dl_dcch_msg_ies.h +++ b/include/srsran/asn1/rrc_nr/dl_dcch_msg_ies.h @@ -28,7 +28,7 @@ #pragma once -#include "meas_cfg.h" +#include "srsran/asn1/rrc_nr/meas_cfg.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/ho_prep_info.h b/include/srsran/asn1/rrc_nr/ho_prep_info.h index ab3954e4be..49e19c7b3e 100644 --- a/include/srsran/asn1/rrc_nr/ho_prep_info.h +++ b/include/srsran/asn1/rrc_nr/ho_prep_info.h @@ -28,7 +28,7 @@ #pragma once -#include "ul_dcch_msg_ies.h" +#include "srsran/asn1/rrc_nr/ul_dcch_msg_ies.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/meas_cfg.h b/include/srsran/asn1/rrc_nr/meas_cfg.h index 08670a20cb..ef9b8182f4 100644 --- a/include/srsran/asn1/rrc_nr/meas_cfg.h +++ b/include/srsran/asn1/rrc_nr/meas_cfg.h @@ -28,8 +28,8 @@ #pragma once -#include "dl_ccch_msg_ies.h" -#include "sys_info.h" +#include "srsran/asn1/rrc_nr/dl_ccch_msg_ies.h" +#include "srsran/asn1/rrc_nr/sys_info.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/meas_timing_cfg.h b/include/srsran/asn1/rrc_nr/meas_timing_cfg.h index 3d73812902..5d3afc26c8 100644 --- a/include/srsran/asn1/rrc_nr/meas_timing_cfg.h +++ b/include/srsran/asn1/rrc_nr/meas_timing_cfg.h @@ -28,7 +28,7 @@ #pragma once -#include "meas_cfg.h" +#include "srsran/asn1/rrc_nr/meas_cfg.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/nr_sidelink_preconf.h b/include/srsran/asn1/rrc_nr/nr_sidelink_preconf.h index 7e30ab4ed9..6fc7852517 100644 --- a/include/srsran/asn1/rrc_nr/nr_sidelink_preconf.h +++ b/include/srsran/asn1/rrc_nr/nr_sidelink_preconf.h @@ -28,7 +28,7 @@ #pragma once -#include "dl_ccch_msg_ies.h" +#include "srsran/asn1/rrc_nr/dl_ccch_msg_ies.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/nr_ue_variables.h b/include/srsran/asn1/rrc_nr/nr_ue_variables.h index 948530eea9..575bd360fb 100644 --- a/include/srsran/asn1/rrc_nr/nr_ue_variables.h +++ b/include/srsran/asn1/rrc_nr/nr_ue_variables.h @@ -28,7 +28,7 @@ #pragma once -#include "ul_dcch_msg_ies.h" +#include "srsran/asn1/rrc_nr/ul_dcch_msg_ies.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/pc5_rrc_definitions.h b/include/srsran/asn1/rrc_nr/pc5_rrc_definitions.h index 53db40324b..9ce9ce46b0 100644 --- a/include/srsran/asn1/rrc_nr/pc5_rrc_definitions.h +++ b/include/srsran/asn1/rrc_nr/pc5_rrc_definitions.h @@ -28,7 +28,7 @@ #pragma once -#include "ul_dcch_msg_ies.h" +#include "srsran/asn1/rrc_nr/ul_dcch_msg_ies.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/pcch_msg.h b/include/srsran/asn1/rrc_nr/pcch_msg.h index 1c269aa71e..0dfc06b209 100644 --- a/include/srsran/asn1/rrc_nr/pcch_msg.h +++ b/include/srsran/asn1/rrc_nr/pcch_msg.h @@ -28,7 +28,7 @@ #pragma once -#include "pcch_msg_ies.h" +#include "srsran/asn1/rrc_nr/pcch_msg_ies.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/pcch_msg_ies.h b/include/srsran/asn1/rrc_nr/pcch_msg_ies.h index d7f74b0bfe..226c784b3c 100644 --- a/include/srsran/asn1/rrc_nr/pcch_msg_ies.h +++ b/include/srsran/asn1/rrc_nr/pcch_msg_ies.h @@ -28,7 +28,7 @@ #pragma once -#include "radio_bearer_cfg.h" +#include "srsran/asn1/rrc_nr/radio_bearer_cfg.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/radio_bearer_cfg.h b/include/srsran/asn1/rrc_nr/radio_bearer_cfg.h index 0af74e2ab4..deb1f94d4c 100644 --- a/include/srsran/asn1/rrc_nr/radio_bearer_cfg.h +++ b/include/srsran/asn1/rrc_nr/radio_bearer_cfg.h @@ -28,7 +28,7 @@ #pragma once -#include "common.h" +#include "srsran/asn1/rrc_nr/common.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/rrc_nr.h b/include/srsran/asn1/rrc_nr/rrc_nr.h index bb121cf36a..61cb9ab532 100644 --- a/include/srsran/asn1/rrc_nr/rrc_nr.h +++ b/include/srsran/asn1/rrc_nr/rrc_nr.h @@ -28,9 +28,9 @@ #pragma once -#include "cell_group_config.h" -#include "ho_prep_info.h" -#include "nr_sidelink_preconf.h" +#include "srsran/asn1/rrc_nr/cell_group_config.h" +#include "srsran/asn1/rrc_nr/ho_prep_info.h" +#include "srsran/asn1/rrc_nr/nr_sidelink_preconf.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/serving_cell.h b/include/srsran/asn1/rrc_nr/serving_cell.h index 028add2bc5..64db0a5b87 100644 --- a/include/srsran/asn1/rrc_nr/serving_cell.h +++ b/include/srsran/asn1/rrc_nr/serving_cell.h @@ -28,7 +28,7 @@ #pragma once -#include "bwp_cfg.h" +#include "srsran/asn1/rrc_nr/bwp_cfg.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/sys_info.h b/include/srsran/asn1/rrc_nr/sys_info.h index 35abe4737f..7afbd7fd1f 100644 --- a/include/srsran/asn1/rrc_nr/sys_info.h +++ b/include/srsran/asn1/rrc_nr/sys_info.h @@ -28,7 +28,7 @@ #pragma once -#include "serving_cell.h" +#include "srsran/asn1/rrc_nr/serving_cell.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/ue_cap.h b/include/srsran/asn1/rrc_nr/ue_cap.h index 81c41cfd6e..3113907285 100644 --- a/include/srsran/asn1/rrc_nr/ue_cap.h +++ b/include/srsran/asn1/rrc_nr/ue_cap.h @@ -28,7 +28,7 @@ #pragma once -#include "common.h" +#include "srsran/asn1/rrc_nr/common.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/ul_ccch1_msg.h b/include/srsran/asn1/rrc_nr/ul_ccch1_msg.h index 6e94efff29..daf895f295 100644 --- a/include/srsran/asn1/rrc_nr/ul_ccch1_msg.h +++ b/include/srsran/asn1/rrc_nr/ul_ccch1_msg.h @@ -28,7 +28,7 @@ #pragma once -#include "ul_ccch_msg_ies.h" +#include "srsran/asn1/rrc_nr/ul_ccch_msg_ies.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/asn1/rrc_nr/ul_dcch_msg_ies.h b/include/srsran/asn1/rrc_nr/ul_dcch_msg_ies.h index b8ea66b404..43234c8a92 100644 --- a/include/srsran/asn1/rrc_nr/ul_dcch_msg_ies.h +++ b/include/srsran/asn1/rrc_nr/ul_dcch_msg_ies.h @@ -28,10 +28,10 @@ #pragma once -#include "bcch_bch_msg.h" -#include "dl_dcch_msg_ies.h" -#include "ue_cap.h" -#include "ul_ccch_msg_ies.h" +#include "srsran/asn1/rrc_nr/bcch_bch_msg.h" +#include "srsran/asn1/rrc_nr/dl_dcch_msg_ies.h" +#include "srsran/asn1/rrc_nr/ue_cap.h" +#include "srsran/asn1/rrc_nr/ul_ccch_msg_ies.h" namespace asn1 { namespace rrc_nr { diff --git a/include/srsran/cu_cp/cu_cp_configuration_helpers.h b/include/srsran/cu_cp/cu_cp_configuration_helpers.h index e052ac1fb5..8afe54f9c6 100644 --- a/include/srsran/cu_cp/cu_cp_configuration_helpers.h +++ b/include/srsran/cu_cp/cu_cp_configuration_helpers.h @@ -22,7 +22,7 @@ #pragma once -#include "cu_cp_configuration.h" +#include "srsran/cu_cp/cu_cp_configuration.h" namespace srsran { namespace config_helpers { diff --git a/include/srsran/cu_cp/up_context.h b/include/srsran/cu_cp/up_context.h index 95ebe7eb7a..c2152ead27 100644 --- a/include/srsran/cu_cp/up_context.h +++ b/include/srsran/cu_cp/up_context.h @@ -22,7 +22,7 @@ #pragma once -#include "cu_cp_types.h" +#include "srsran/cu_cp/cu_cp_types.h" #include "srsran/ran/rb_id.h" #include "srsran/rlc/rlc_config.h" diff --git a/include/srsran/e1ap/cu_cp/e1ap_cu_cp.h b/include/srsran/e1ap/cu_cp/e1ap_cu_cp.h index 6d09629e85..c0b63269f1 100644 --- a/include/srsran/e1ap/cu_cp/e1ap_cu_cp.h +++ b/include/srsran/e1ap/cu_cp/e1ap_cu_cp.h @@ -22,10 +22,10 @@ #pragma once -#include "e1ap_cu_cp_bearer_context_update.h" #include "srsran/cu_cp/cu_cp_types.h" #include "srsran/e1ap/common/e1_setup_messages.h" #include "srsran/e1ap/common/e1ap_common.h" +#include "srsran/e1ap/cu_cp/e1ap_cu_cp_bearer_context_update.h" #include "srsran/support/async/async_task.h" namespace srsran { diff --git a/include/srsran/e1ap/cu_cp/e1ap_cu_cp_factory.h b/include/srsran/e1ap/cu_cp/e1ap_cu_cp_factory.h index 61d8ad161f..fa85fb0ccf 100644 --- a/include/srsran/e1ap/cu_cp/e1ap_cu_cp_factory.h +++ b/include/srsran/e1ap/cu_cp/e1ap_cu_cp_factory.h @@ -22,7 +22,7 @@ #pragma once -#include "e1ap_cu_cp.h" +#include "srsran/e1ap/cu_cp/e1ap_cu_cp.h" #include "srsran/support/executors/task_executor.h" #include "srsran/support/timers.h" #include diff --git a/include/srsran/e1ap/cu_up/e1ap_cu_up.h b/include/srsran/e1ap/cu_up/e1ap_cu_up.h index 86541daba6..e00ec9a00f 100644 --- a/include/srsran/e1ap/cu_up/e1ap_cu_up.h +++ b/include/srsran/e1ap/cu_up/e1ap_cu_up.h @@ -22,12 +22,12 @@ #pragma once -#include "e1ap_cu_up_bearer_context_update.h" #include "srsran/adt/expected.h" #include "srsran/cu_up/cu_up_types.h" #include "srsran/e1ap/common/e1_setup_messages.h" #include "srsran/e1ap/common/e1ap_common.h" #include "srsran/e1ap/common/e1ap_types.h" +#include "srsran/e1ap/cu_up/e1ap_cu_up_bearer_context_update.h" #include "srsran/support/async/async_task.h" namespace srsran { diff --git a/include/srsran/e1ap/cu_up/e1ap_cu_up_factory.h b/include/srsran/e1ap/cu_up/e1ap_cu_up_factory.h index 14956dba5d..557de8ab77 100644 --- a/include/srsran/e1ap/cu_up/e1ap_cu_up_factory.h +++ b/include/srsran/e1ap/cu_up/e1ap_cu_up_factory.h @@ -22,7 +22,7 @@ #pragma once -#include "e1ap_cu_up.h" +#include "srsran/e1ap/cu_up/e1ap_cu_up.h" #include "srsran/e1ap/gateways/e1_connection_client.h" #include "srsran/support/executors/task_executor.h" #include "srsran/support/timers.h" diff --git a/include/srsran/e2/e2.h b/include/srsran/e2/e2.h index 8d16b8b47a..f9759662d6 100644 --- a/include/srsran/e2/e2.h +++ b/include/srsran/e2/e2.h @@ -22,13 +22,13 @@ #pragma once -#include "e2_event_manager.h" -#include "e2_messages.h" #include "srsran/adt/byte_buffer.h" #include "srsran/adt/expected.h" #include "srsran/asn1/e2ap/e2ap.h" #include "srsran/asn1/e2sm/e2sm_common_ies.h" #include "srsran/asn1/e2sm/e2sm_kpm_ies.h" +#include "srsran/e2/e2_event_manager.h" +#include "srsran/e2/e2_messages.h" #include "srsran/ran/rb_id.h" #include "srsran/support/async/async_task.h" #include "srsran/support/async/eager_async_task.h" diff --git a/include/srsran/e2/e2_cu.h b/include/srsran/e2/e2_cu.h index 0c53be8882..e310fda5a8 100644 --- a/include/srsran/e2/e2_cu.h +++ b/include/srsran/e2/e2_cu.h @@ -22,8 +22,8 @@ #pragma once -#include "e2.h" #include "srsran/cu_cp/cu_cp_types.h" +#include "srsran/e2/e2.h" #include "srsran/pdcp/pdcp_metrics.h" namespace srsran { diff --git a/include/srsran/e2/e2_cu_factory.h b/include/srsran/e2/e2_cu_factory.h index 8af1b648f8..bcdca8656f 100644 --- a/include/srsran/e2/e2_cu_factory.h +++ b/include/srsran/e2/e2_cu_factory.h @@ -22,8 +22,8 @@ #pragma once -#include "e2_cu.h" -#include "e2_factory.h" +#include "srsran/e2/e2_cu.h" +#include "srsran/e2/e2_factory.h" namespace srsran { /// Creates a instance of an E2 interface (with subscription manager) diff --git a/include/srsran/e2/e2_du.h b/include/srsran/e2/e2_du.h index d9e8624bd2..a23270fe40 100644 --- a/include/srsran/e2/e2_du.h +++ b/include/srsran/e2/e2_du.h @@ -22,7 +22,7 @@ #pragma once -#include "e2.h" +#include "srsran/e2/e2.h" #include "srsran/rlc/rlc_metrics.h" #include "srsran/scheduler/scheduler_metrics.h" diff --git a/include/srsran/e2/e2_du_factory.h b/include/srsran/e2/e2_du_factory.h index bf734c9d59..bb0922217f 100644 --- a/include/srsran/e2/e2_du_factory.h +++ b/include/srsran/e2/e2_du_factory.h @@ -22,9 +22,9 @@ #pragma once -#include "e2_du.h" -#include "e2_factory.h" #include "srsran/du/du_high/du_manager/du_configurator.h" +#include "srsran/e2/e2_du.h" +#include "srsran/e2/e2_factory.h" #include "srsran/f1ap/du/f1ap_du.h" namespace srsran { diff --git a/include/srsran/e2/e2_factory.h b/include/srsran/e2/e2_factory.h index afb43be70b..b2bd0da242 100644 --- a/include/srsran/e2/e2_factory.h +++ b/include/srsran/e2/e2_factory.h @@ -22,11 +22,11 @@ #pragma once -#include "e2.h" -#include "e2ap_configuration.h" -#include "e2sm/e2sm_manager.h" -#include "subscription/e2_subscription.h" +#include "srsran/e2/e2.h" +#include "srsran/e2/e2ap_configuration.h" +#include "srsran/e2/e2sm/e2sm_manager.h" #include "srsran/e2/gateways/e2_connection_client.h" +#include "srsran/e2/subscription/e2_subscription.h" #include "srsran/gateways/sctp_network_gateway.h" #include "srsran/pcap/dlt_pcap.h" #include "srsran/support/timers.h" diff --git a/apps/du/adapters/e2_gateways.h b/include/srsran/e2/e2ap_config_translators.h similarity index 77% rename from apps/du/adapters/e2_gateways.h rename to include/srsran/e2/e2ap_config_translators.h index 5dec1bd738..2ccad5969d 100644 --- a/apps/du/adapters/e2_gateways.h +++ b/include/srsran/e2/e2ap_config_translators.h @@ -22,24 +22,24 @@ #pragma once -#include "apps/services/e2/e2_appconfig.h" +#include "srsran/e2/e2ap_configuration.h" #include "srsran/e2/gateways/e2_network_client_factory.h" namespace srsran { -/// Instantiates an E2AP client. -std::unique_ptr -create_du_e2_client_gateway(const e2_appconfig& e2_cfg, io_broker& broker, dlt_pcap& f1ap_pcap) +/// Retuns the E2 SCTP gateway configuration from the given parameters. +inline e2_sctp_gateway_config +generate_e2_client_gateway_config(const e2_config& e2_cfg, io_broker& broker, dlt_pcap& f1ap_pcap, uint16_t ppid) { sctp_network_connector_config e2ap_sctp{}; e2ap_sctp.if_name = "E2AP"; e2ap_sctp.dest_name = "Near-RT-RIC"; e2ap_sctp.connect_address = e2_cfg.ip_addr; e2ap_sctp.connect_port = e2_cfg.port; - e2ap_sctp.ppid = E2_DU_PPID; + e2ap_sctp.ppid = ppid; e2ap_sctp.bind_address = e2_cfg.bind_addr; - return create_e2_gateway_client(e2_sctp_gateway_config{e2ap_sctp, broker, f1ap_pcap}); + return {e2ap_sctp, broker, f1ap_pcap}; } } // namespace srsran diff --git a/include/srsran/e2/e2sm/e2sm_factory.h b/include/srsran/e2/e2sm/e2sm_factory.h index 8aa8dec028..e068f4ce7c 100644 --- a/include/srsran/e2/e2sm/e2sm_factory.h +++ b/include/srsran/e2/e2sm/e2sm_factory.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/e2/e2sm/e2sm.h" #include "srsran/e2/e2sm/e2sm_kpm.h" diff --git a/include/srsran/e2/e2sm/e2sm_manager.h b/include/srsran/e2/e2sm/e2sm_manager.h index 89d513be57..91db34286c 100644 --- a/include/srsran/e2/e2sm/e2sm_manager.h +++ b/include/srsran/e2/e2sm/e2sm_manager.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/e2/e2sm/e2sm.h" #include @@ -55,4 +56,4 @@ class e2sm_manager std::map supported_ran_functions; srslog::basic_logger& logger; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/e2/gateways/e2_network_client_factory.h b/include/srsran/e2/gateways/e2_network_client_factory.h index fea35930f6..636a4dc51f 100644 --- a/include/srsran/e2/gateways/e2_network_client_factory.h +++ b/include/srsran/e2/gateways/e2_network_client_factory.h @@ -22,7 +22,7 @@ #pragma once -#include "e2_connection_client.h" +#include "srsran/e2/gateways/e2_connection_client.h" #include "srsran/gateways/sctp_network_gateway.h" namespace srsran { @@ -42,4 +42,4 @@ struct e2_sctp_gateway_config { /// \brief Create an E2AP gateway connector that the DU can use to connect to the Near-RT RIC. std::unique_ptr create_e2_gateway_client(const e2_sctp_gateway_config& params); -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/f1u/cu_up/f1u_bearer.h b/include/srsran/f1u/cu_up/f1u_bearer.h index 947ed184cc..de9f40f0f7 100644 --- a/include/srsran/f1u/cu_up/f1u_bearer.h +++ b/include/srsran/f1u/cu_up/f1u_bearer.h @@ -22,8 +22,8 @@ #pragma once -#include "f1u_rx_pdu_handler.h" -#include "f1u_tx_sdu_handler.h" +#include "srsran/f1u/cu_up/f1u_rx_pdu_handler.h" +#include "srsran/f1u/cu_up/f1u_tx_sdu_handler.h" #include "srsran/ran/up_transport_layer_info.h" namespace srsran { diff --git a/include/srsran/f1u/cu_up/f1u_bearer_factory.h b/include/srsran/f1u/cu_up/f1u_bearer_factory.h index e823e52d01..95abcd4072 100644 --- a/include/srsran/f1u/cu_up/f1u_bearer_factory.h +++ b/include/srsran/f1u/cu_up/f1u_bearer_factory.h @@ -22,11 +22,11 @@ #pragma once -#include "f1u_bearer.h" -#include "f1u_rx_delivery_notifier.h" -#include "f1u_rx_sdu_notifier.h" -#include "f1u_tx_pdu_notifier.h" +#include "srsran/f1u/cu_up/f1u_bearer.h" #include "srsran/f1u/cu_up/f1u_config.h" +#include "srsran/f1u/cu_up/f1u_rx_delivery_notifier.h" +#include "srsran/f1u/cu_up/f1u_rx_sdu_notifier.h" +#include "srsran/f1u/cu_up/f1u_tx_pdu_notifier.h" #include "srsran/ran/rb_id.h" #include "srsran/support/timers.h" diff --git a/include/srsran/f1u/cu_up/f1u_bearer_logger.h b/include/srsran/f1u/cu_up/f1u_bearer_logger.h index 37e65b1ecb..ee01d6805a 100644 --- a/include/srsran/f1u/cu_up/f1u_bearer_logger.h +++ b/include/srsran/f1u/cu_up/f1u_bearer_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/ran/rb_id.h" diff --git a/include/srsran/f1u/du/f1u_bearer.h b/include/srsran/f1u/du/f1u_bearer.h index 86e5d700d3..e2792460c3 100644 --- a/include/srsran/f1u/du/f1u_bearer.h +++ b/include/srsran/f1u/du/f1u_bearer.h @@ -22,9 +22,9 @@ #pragma once -#include "f1u_rx_pdu_handler.h" -#include "f1u_tx_delivery_handler.h" -#include "f1u_tx_sdu_handler.h" +#include "srsran/f1u/du/f1u_rx_pdu_handler.h" +#include "srsran/f1u/du/f1u_tx_delivery_handler.h" +#include "srsran/f1u/du/f1u_tx_sdu_handler.h" #include "srsran/ran/up_transport_layer_info.h" namespace srsran { diff --git a/include/srsran/f1u/du/f1u_bearer_factory.h b/include/srsran/f1u/du/f1u_bearer_factory.h index 991945a56e..359265ab59 100644 --- a/include/srsran/f1u/du/f1u_bearer_factory.h +++ b/include/srsran/f1u/du/f1u_bearer_factory.h @@ -22,10 +22,10 @@ #pragma once -#include "f1u_bearer.h" -#include "f1u_rx_sdu_notifier.h" -#include "f1u_tx_pdu_notifier.h" +#include "srsran/f1u/du/f1u_bearer.h" #include "srsran/f1u/du/f1u_config.h" +#include "srsran/f1u/du/f1u_rx_sdu_notifier.h" +#include "srsran/f1u/du/f1u_tx_pdu_notifier.h" #include "srsran/ran/rb_id.h" #include "srsran/ran/up_transport_layer_info.h" #include "srsran/support/timers.h" diff --git a/include/srsran/f1u/du/f1u_bearer_logger.h b/include/srsran/f1u/du/f1u_bearer_logger.h index 7bd548c3b3..8d58cd7923 100644 --- a/include/srsran/f1u/du/f1u_bearer_logger.h +++ b/include/srsran/f1u/du/f1u_bearer_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/ran/rb_id.h" diff --git a/include/srsran/fapi_adaptor/precoding_matrix_mapper.h b/include/srsran/fapi_adaptor/precoding_matrix_mapper.h index 7c8fad8146..d7b67eb6bf 100644 --- a/include/srsran/fapi_adaptor/precoding_matrix_mapper.h +++ b/include/srsran/fapi_adaptor/precoding_matrix_mapper.h @@ -24,7 +24,6 @@ #include "srsran/mac/mac_cell_result.h" #include "srsran/srslog/logger.h" - #include namespace srsran { diff --git a/include/srsran/gateways/addr_info.h b/include/srsran/gateways/addr_info.h index 84842ecb80..203140273d 100644 --- a/include/srsran/gateways/addr_info.h +++ b/include/srsran/gateways/addr_info.h @@ -22,7 +22,7 @@ #pragma once -#include "netinet/in.h" +#include inline const char* ipproto_to_string(int protocol) { diff --git a/include/srsran/gateways/baseband/baseband_gateway_receiver.h b/include/srsran/gateways/baseband/baseband_gateway_receiver.h index 3cce78bba4..8a5b8f66ca 100644 --- a/include/srsran/gateways/baseband/baseband_gateway_receiver.h +++ b/include/srsran/gateways/baseband/baseband_gateway_receiver.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/gateways/baseband/baseband_gateway_base.h" #include "srsran/gateways/baseband/baseband_gateway_timestamp.h" @@ -47,4 +48,4 @@ class baseband_gateway_receiver : public baseband_gateway_base virtual metadata receive(baseband_gateway_buffer_writer& data) = 0; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/gateways/baseband/baseband_gateway_timestamp.h b/include/srsran/gateways/baseband/baseband_gateway_timestamp.h index 83942ac85c..e72972668a 100644 --- a/include/srsran/gateways/baseband/baseband_gateway_timestamp.h +++ b/include/srsran/gateways/baseband/baseband_gateway_timestamp.h @@ -21,6 +21,7 @@ */ #pragma once + #include namespace srsran { @@ -28,4 +29,4 @@ namespace srsran { /// Describes a baseband gateway timestamp. It is expressed in multiples of the sample time. using baseband_gateway_timestamp = uint64_t; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/gateways/baseband/baseband_gateway_transmitter.h b/include/srsran/gateways/baseband/baseband_gateway_transmitter.h index d017d10cfd..d5b9712922 100644 --- a/include/srsran/gateways/baseband/baseband_gateway_transmitter.h +++ b/include/srsran/gateways/baseband/baseband_gateway_transmitter.h @@ -21,8 +21,9 @@ */ #pragma once -#include "baseband_gateway_transmitter_metadata.h" + #include "srsran/gateways/baseband/baseband_gateway_base.h" +#include "srsran/gateways/baseband/baseband_gateway_transmitter_metadata.h" namespace srsran { @@ -40,4 +41,4 @@ class baseband_gateway_transmitter : public baseband_gateway_base const baseband_gateway_transmitter_metadata& metadata) = 0; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/gateways/baseband/baseband_gateway_transmitter_metadata.h b/include/srsran/gateways/baseband/baseband_gateway_transmitter_metadata.h index 4e81792424..d99091da46 100644 --- a/include/srsran/gateways/baseband/baseband_gateway_transmitter_metadata.h +++ b/include/srsran/gateways/baseband/baseband_gateway_transmitter_metadata.h @@ -25,7 +25,7 @@ #pragma once -#include "baseband_gateway_timestamp.h" +#include "srsran/gateways/baseband/baseband_gateway_timestamp.h" #include namespace srsran { diff --git a/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader.h b/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader.h index 471e6fb60c..92e6ff88d9 100644 --- a/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader.h +++ b/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/complex.h" #include "srsran/adt/span.h" #include "srsran/support/srsran_assert.h" @@ -51,4 +52,4 @@ class baseband_gateway_buffer_reader span operator[](unsigned channel_index) const { return get_channel_buffer(channel_index); } }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader_view.h b/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader_view.h index 38d39b0942..82a8c27ad7 100644 --- a/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader_view.h +++ b/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader_view.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/complex.h" #include "srsran/adt/span.h" #include "srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader.h" @@ -66,4 +67,4 @@ class baseband_gateway_buffer_reader_view : public baseband_gateway_buffer_reade unsigned nof_samples; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer.h b/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer.h index a6de311fcc..70232dbc7a 100644 --- a/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer.h +++ b/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/complex.h" #include "srsran/adt/span.h" @@ -50,4 +51,4 @@ class baseband_gateway_buffer_writer span operator[](unsigned channel_index) { return get_channel_buffer(channel_index); } }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer_view.h b/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer_view.h index b63c8e1be5..235f341da3 100644 --- a/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer_view.h +++ b/include/srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer_view.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/complex.h" #include "srsran/adt/span.h" #include "srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer.h" @@ -66,4 +67,4 @@ class baseband_gateway_buffer_writer_view : public baseband_gateway_buffer_write unsigned nof_samples; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/gateways/sctp_network_gateway_factory.h b/include/srsran/gateways/sctp_network_gateway_factory.h index 89d7889179..1f2b8ce9ba 100644 --- a/include/srsran/gateways/sctp_network_gateway_factory.h +++ b/include/srsran/gateways/sctp_network_gateway_factory.h @@ -22,7 +22,7 @@ #pragma once -#include "sctp_network_gateway.h" +#include "srsran/gateways/sctp_network_gateway.h" #include #include diff --git a/include/srsran/gateways/udp_network_gateway_factory.h b/include/srsran/gateways/udp_network_gateway_factory.h index 935ca11725..9569a331d2 100644 --- a/include/srsran/gateways/udp_network_gateway_factory.h +++ b/include/srsran/gateways/udp_network_gateway_factory.h @@ -22,7 +22,7 @@ #pragma once -#include "udp_network_gateway.h" +#include "srsran/gateways/udp_network_gateway.h" #include "srsran/support/executors/task_executor.h" #include #include diff --git a/include/srsran/gtpu/gtpu_config.h b/include/srsran/gtpu/gtpu_config.h index 6d8d8ad66a..f090211c2f 100644 --- a/include/srsran/gtpu/gtpu_config.h +++ b/include/srsran/gtpu/gtpu_config.h @@ -22,7 +22,7 @@ #pragma once -#include "gtpu_teid.h" +#include "srsran/gtpu/gtpu_teid.h" #include "fmt/format.h" #include #include diff --git a/include/srsran/gtpu/gtpu_demux_factory.h b/include/srsran/gtpu/gtpu_demux_factory.h index c5ad620123..653fe81314 100644 --- a/include/srsran/gtpu/gtpu_demux_factory.h +++ b/include/srsran/gtpu/gtpu_demux_factory.h @@ -22,7 +22,7 @@ #pragma once -#include "gtpu_demux.h" +#include "srsran/gtpu/gtpu_demux.h" #include "srsran/pcap/dlt_pcap.h" #include "srsran/support/executors/task_executor.h" #include diff --git a/include/srsran/mac/mac_cell_control_information_handler.h b/include/srsran/mac/mac_cell_control_information_handler.h index b1356b8e5e..265f10d187 100644 --- a/include/srsran/mac/mac_cell_control_information_handler.h +++ b/include/srsran/mac/mac_cell_control_information_handler.h @@ -32,7 +32,6 @@ #include "srsran/ran/srs/srs_configuration.h" #include "srsran/ran/uci/uci_constants.h" #include "srsran/ran/uci/uci_mapping.h" - #include namespace srsran { diff --git a/include/srsran/mac/mac_cell_group_config.h b/include/srsran/mac/mac_cell_group_config.h index 87331b50a1..786419f179 100644 --- a/include/srsran/mac/mac_cell_group_config.h +++ b/include/srsran/mac/mac_cell_group_config.h @@ -22,9 +22,9 @@ #pragma once -#include "bsr_config.h" -#include "phr_config.h" #include "srsran/adt/static_vector.h" +#include "srsran/mac/bsr_config.h" +#include "srsran/mac/phr_config.h" #include "srsran/ran/sr_configuration.h" #include "srsran/ran/time_alignment_config.h" diff --git a/include/srsran/mac/mac_cell_manager.h b/include/srsran/mac/mac_cell_manager.h index adf3527868..1c70b9bf67 100644 --- a/include/srsran/mac/mac_cell_manager.h +++ b/include/srsran/mac/mac_cell_manager.h @@ -1,8 +1,8 @@ #pragma once -#include "cell_configuration.h" -#include "mac_ue_configurator.h" +#include "srsran/mac/cell_configuration.h" +#include "srsran/mac/mac_ue_configurator.h" #include "srsran/ran/du_types.h" #include "srsran/ran/slot_point.h" diff --git a/include/srsran/mac/mac_factory.h b/include/srsran/mac/mac_factory.h index f74e42f096..16795a5291 100644 --- a/include/srsran/mac/mac_factory.h +++ b/include/srsran/mac/mac_factory.h @@ -22,9 +22,9 @@ #pragma once -#include "mac.h" -#include "mac_cell_result.h" #include "srsran/du/du_high/du_high_executor_mapper.h" +#include "srsran/mac/mac.h" +#include "srsran/mac/mac_cell_result.h" #include "srsran/mac/mac_config.h" #include "srsran/scheduler/config/scheduler_expert_config.h" #include diff --git a/include/srsran/mac/mac_ue_configurator.h b/include/srsran/mac/mac_ue_configurator.h index d668d2e9c0..2d37bc6cb9 100644 --- a/include/srsran/mac/mac_ue_configurator.h +++ b/include/srsran/mac/mac_ue_configurator.h @@ -22,8 +22,8 @@ #pragma once -#include "mac_cell_group_config.h" #include "srsran/mac/bsr_config.h" +#include "srsran/mac/mac_cell_group_config.h" #include "srsran/mac/mac_sdu_handler.h" #include "srsran/mac/phr_config.h" #include "srsran/ran/logical_channel/lcid.h" diff --git a/include/srsran/ngap/ngap_configuration_helpers.h b/include/srsran/ngap/ngap_configuration_helpers.h index b3c7f51465..701e6f3f81 100644 --- a/include/srsran/ngap/ngap_configuration_helpers.h +++ b/include/srsran/ngap/ngap_configuration_helpers.h @@ -22,7 +22,7 @@ #pragma once -#include "ngap_configuration.h" +#include "srsran/ngap/ngap_configuration.h" #include "srsran/ran/s_nssai.h" namespace srsran { diff --git a/include/srsran/ngap/ngap_factory.h b/include/srsran/ngap/ngap_factory.h index d53926ead3..ea3ca06b94 100644 --- a/include/srsran/ngap/ngap_factory.h +++ b/include/srsran/ngap/ngap_factory.h @@ -22,8 +22,8 @@ #pragma once -#include "ngap.h" -#include "ngap_configuration.h" +#include "srsran/ngap/ngap.h" +#include "srsran/ngap/ngap_configuration.h" #include "srsran/support/executors/task_executor.h" #include diff --git a/include/srsran/ngap/ngap_handover.h b/include/srsran/ngap/ngap_handover.h index ce9d158f8c..b7559c1ffa 100644 --- a/include/srsran/ngap/ngap_handover.h +++ b/include/srsran/ngap/ngap_handover.h @@ -22,8 +22,8 @@ #pragma once -#include "ngap_types.h" #include "srsran/cu_cp/cu_cp_types.h" +#include "srsran/ngap/ngap_types.h" #include "srsran/security/security.h" #include "srsran/support/async/async_task.h" diff --git a/include/srsran/ngap/ngap_init_context_setup.h b/include/srsran/ngap/ngap_init_context_setup.h index 8b913ffb3f..7fb93861ab 100644 --- a/include/srsran/ngap/ngap_init_context_setup.h +++ b/include/srsran/ngap/ngap_init_context_setup.h @@ -22,8 +22,8 @@ #pragma once -#include "ngap_types.h" #include "srsran/cu_cp/cu_cp_types.h" +#include "srsran/ngap/ngap_types.h" #include "srsran/ran/crit_diagnostics.h" #include "srsran/security/security.h" diff --git a/include/srsran/ngap/ngap_reset.h b/include/srsran/ngap/ngap_reset.h index 956ffb46a5..ca7b59d924 100644 --- a/include/srsran/ngap/ngap_reset.h +++ b/include/srsran/ngap/ngap_reset.h @@ -22,8 +22,8 @@ #pragma once -#include "ngap_types.h" #include "srsran/cu_cp/cu_cp_types.h" +#include "srsran/ngap/ngap_types.h" #include "srsran/ran/cause/ngap_cause.h" #include #include diff --git a/include/srsran/ngap/ngap_setup.h b/include/srsran/ngap/ngap_setup.h index 7f1710ed73..c9146658e5 100644 --- a/include/srsran/ngap/ngap_setup.h +++ b/include/srsran/ngap/ngap_setup.h @@ -22,8 +22,8 @@ #pragma once -#include "ngap_types.h" #include "srsran/cu_cp/cu_cp_types.h" +#include "srsran/ngap/ngap_types.h" #include "srsran/ran/crit_diagnostics.h" #include diff --git a/include/srsran/ngap/ngap_types.h b/include/srsran/ngap/ngap_types.h index 4f2411e7e3..7147e8a565 100644 --- a/include/srsran/ngap/ngap_types.h +++ b/include/srsran/ngap/ngap_types.h @@ -23,7 +23,6 @@ #pragma once #include "srsran/ran/plmn_identity.h" - #include namespace srsran { diff --git a/include/srsran/nru/nru_message.h b/include/srsran/nru/nru_message.h index 6d19919345..9fb54bcb2f 100644 --- a/include/srsran/nru/nru_message.h +++ b/include/srsran/nru/nru_message.h @@ -25,7 +25,6 @@ #include "srsran/adt/byte_buffer.h" #include "srsran/adt/byte_buffer_chain.h" #include "srsran/adt/static_vector.h" - #include #include diff --git a/include/srsran/ofh/compression/compression_properties.h b/include/srsran/ofh/compression/compression_properties.h index 714412467b..86316e919c 100644 --- a/include/srsran/ofh/compression/compression_properties.h +++ b/include/srsran/ofh/compression/compression_properties.h @@ -22,7 +22,7 @@ #pragma once -#include "compression_params.h" +#include "srsran/ofh/compression/compression_params.h" #include "srsran/ran/resource_block.h" #include "srsran/support/units.h" diff --git a/include/srsran/ofh/ethernet/ethernet_frame_notifier.h b/include/srsran/ofh/ethernet/ethernet_frame_notifier.h index 8ef7eb883f..a4d960d15b 100644 --- a/include/srsran/ofh/ethernet/ethernet_frame_notifier.h +++ b/include/srsran/ofh/ethernet/ethernet_frame_notifier.h @@ -22,8 +22,8 @@ #pragma once -#include "ethernet_unique_buffer.h" #include "srsran/adt/span.h" +#include "srsran/ofh/ethernet/ethernet_unique_buffer.h" namespace srsran { namespace ether { diff --git a/include/srsran/pdcp/pdcp_rx.h b/include/srsran/pdcp/pdcp_rx.h index eae1d33179..e875d89733 100644 --- a/include/srsran/pdcp/pdcp_rx.h +++ b/include/srsran/pdcp/pdcp_rx.h @@ -47,6 +47,7 @@ * inherit or if a notifier that the PDCP will keep as a member. * */ + namespace srsran { /// This interface represents the data entry point of the receiving side of a PDCP entity. diff --git a/include/srsran/pdcp/pdcp_tx.h b/include/srsran/pdcp/pdcp_tx.h index 4802e655fa..3ac95f6e4d 100644 --- a/include/srsran/pdcp/pdcp_tx.h +++ b/include/srsran/pdcp/pdcp_tx.h @@ -44,6 +44,7 @@ * inherit or if a notifier that the PDCP will keep as a member. * */ + namespace srsran { /// This interface represents the data exit point of the transmitting side of a PDCP entity. diff --git a/include/srsran/phy/generic_functions/precoding/precoding_factories.h b/include/srsran/phy/generic_functions/precoding/precoding_factories.h index 813e9873a7..81a6ee6b11 100644 --- a/include/srsran/phy/generic_functions/precoding/precoding_factories.h +++ b/include/srsran/phy/generic_functions/precoding/precoding_factories.h @@ -26,7 +26,7 @@ #pragma once -#include "channel_precoder.h" +#include "srsran/phy/generic_functions/precoding/channel_precoder.h" namespace srsran { diff --git a/include/srsran/phy/lower/lower_phy_factory.h b/include/srsran/phy/lower/lower_phy_factory.h index b3fd86c3bb..270a02cf41 100644 --- a/include/srsran/phy/lower/lower_phy_factory.h +++ b/include/srsran/phy/lower/lower_phy_factory.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/phy/lower/lower_phy.h" diff --git a/include/srsran/phy/lower/lower_phy_rx_symbol_context.h b/include/srsran/phy/lower/lower_phy_rx_symbol_context.h index 7cb6979078..be494ff0b0 100644 --- a/include/srsran/phy/lower/lower_phy_rx_symbol_context.h +++ b/include/srsran/phy/lower/lower_phy_rx_symbol_context.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/slot_point.h" namespace srsran { diff --git a/include/srsran/phy/lower/lower_phy_timing_context.h b/include/srsran/phy/lower/lower_phy_timing_context.h index 21bc5e232a..d336f2b48c 100644 --- a/include/srsran/phy/lower/lower_phy_timing_context.h +++ b/include/srsran/phy/lower/lower_phy_timing_context.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/slot_point.h" namespace srsran { @@ -31,4 +32,4 @@ struct lower_phy_timing_context { slot_point slot; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/phy/lower/processors/downlink/pdxch/pdxch_processor_baseband.h b/include/srsran/phy/lower/processors/downlink/pdxch/pdxch_processor_baseband.h index 1e26e9390d..0a50854f63 100644 --- a/include/srsran/phy/lower/processors/downlink/pdxch/pdxch_processor_baseband.h +++ b/include/srsran/phy/lower/processors/downlink/pdxch/pdxch_processor_baseband.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/slot_point.h" namespace srsran { diff --git a/include/srsran/phy/lower/processors/downlink/pdxch/pdxch_processor_notifier.h b/include/srsran/phy/lower/processors/downlink/pdxch/pdxch_processor_notifier.h index fb23cebd86..fe45752854 100644 --- a/include/srsran/phy/lower/processors/downlink/pdxch/pdxch_processor_notifier.h +++ b/include/srsran/phy/lower/processors/downlink/pdxch/pdxch_processor_notifier.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/slot_point.h" namespace srsran { @@ -53,4 +54,4 @@ class pdxch_processor_notifier virtual void on_pdxch_request_late(const resource_grid_context& context) = 0; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/phy/support/precoding_formatters.h b/include/srsran/phy/support/precoding_formatters.h index a49d707c5f..54590fc125 100644 --- a/include/srsran/phy/support/precoding_formatters.h +++ b/include/srsran/phy/support/precoding_formatters.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/support/precoding_configuration.h" #include "srsran/ran/precoding/precoding_weight_matrix_formatters.h" @@ -60,4 +61,4 @@ struct formatter { } }; -} // namespace fmt \ No newline at end of file +} // namespace fmt diff --git a/include/srsran/phy/support/re_buffer.h b/include/srsran/phy/support/re_buffer.h index d1e8dc5ccb..e72121aaf3 100644 --- a/include/srsran/phy/support/re_buffer.h +++ b/include/srsran/phy/support/re_buffer.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/complex.h" #include "srsran/adt/tensor.h" diff --git a/include/srsran/phy/support/re_pattern_formatters.h b/include/srsran/phy/support/re_pattern_formatters.h index c7e8d3c479..67b849d063 100644 --- a/include/srsran/phy/support/re_pattern_formatters.h +++ b/include/srsran/phy/support/re_pattern_formatters.h @@ -21,8 +21,8 @@ */ #pragma once -#include "srsran/phy/support/re_pattern.h" +#include "srsran/phy/support/re_pattern.h" #include namespace fmt { diff --git a/include/srsran/phy/support/resource_grid_context.h b/include/srsran/phy/support/resource_grid_context.h index 303c06b66b..d9bfd57283 100644 --- a/include/srsran/phy/support/resource_grid_context.h +++ b/include/srsran/phy/support/resource_grid_context.h @@ -22,7 +22,7 @@ #pragma once -#include "resource_grid.h" +#include "srsran/phy/support/resource_grid.h" #include "srsran/ran/slot_point.h" namespace srsran { diff --git a/include/srsran/phy/support/resource_grid_pool.h b/include/srsran/phy/support/resource_grid_pool.h index 7563202f0f..6e742ecbe7 100644 --- a/include/srsran/phy/support/resource_grid_pool.h +++ b/include/srsran/phy/support/resource_grid_pool.h @@ -22,9 +22,9 @@ #pragma once -#include "resource_grid.h" -#include "resource_grid_context.h" -#include "shared_resource_grid.h" +#include "srsran/phy/support/resource_grid.h" +#include "srsran/phy/support/resource_grid_context.h" +#include "srsran/phy/support/shared_resource_grid.h" #include namespace srsran { diff --git a/include/srsran/phy/support/resource_grid_reader.h b/include/srsran/phy/support/resource_grid_reader.h index 0275f162b5..bfe3446968 100644 --- a/include/srsran/phy/support/resource_grid_reader.h +++ b/include/srsran/phy/support/resource_grid_reader.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/bounded_bitset.h" #include "srsran/adt/complex.h" #include "srsran/adt/span.h" diff --git a/include/srsran/phy/support/resource_grid_writer.h b/include/srsran/phy/support/resource_grid_writer.h index 616627c12f..ea808c01bf 100644 --- a/include/srsran/phy/support/resource_grid_writer.h +++ b/include/srsran/phy/support/resource_grid_writer.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/bounded_bitset.h" #include "srsran/adt/complex.h" #include "srsran/adt/span.h" diff --git a/include/srsran/phy/support/support_factories.h b/include/srsran/phy/support/support_factories.h index c521f91fee..9f8c9bef48 100644 --- a/include/srsran/phy/support/support_factories.h +++ b/include/srsran/phy/support/support_factories.h @@ -22,8 +22,8 @@ #pragma once -#include "interpolator.h" #include "srsran/phy/generic_functions/precoding/precoding_factories.h" +#include "srsran/phy/support/interpolator.h" #include "srsran/phy/support/prach_buffer.h" #include "srsran/phy/support/prach_buffer_pool.h" #include "srsran/phy/support/resource_grid_mapper.h" diff --git a/include/srsran/phy/upper/channel_coding/channel_coding_factories.h b/include/srsran/phy/upper/channel_coding/channel_coding_factories.h index 5486a67e65..e9fc459699 100644 --- a/include/srsran/phy/upper/channel_coding/channel_coding_factories.h +++ b/include/srsran/phy/upper/channel_coding/channel_coding_factories.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/phy/upper/channel_coding/crc_calculator.h" diff --git a/include/srsran/phy/upper/channel_coding/short/short_block_detector.h b/include/srsran/phy/upper/channel_coding/short/short_block_detector.h index 3034f41753..0c495cc87b 100644 --- a/include/srsran/phy/upper/channel_coding/short/short_block_detector.h +++ b/include/srsran/phy/upper/channel_coding/short/short_block_detector.h @@ -28,7 +28,6 @@ #include "srsran/adt/span.h" #include "srsran/phy/upper/log_likelihood_ratio.h" #include "srsran/ran/sch/modulation_scheme.h" - #include namespace srsran { diff --git a/include/srsran/phy/upper/channel_coding/short/short_block_encoder.h b/include/srsran/phy/upper/channel_coding/short/short_block_encoder.h index c6b666803f..567dc7af3e 100644 --- a/include/srsran/phy/upper/channel_coding/short/short_block_encoder.h +++ b/include/srsran/phy/upper/channel_coding/short/short_block_encoder.h @@ -27,7 +27,6 @@ #include "srsran/adt/span.h" #include "srsran/ran/sch/modulation_scheme.h" - #include namespace srsran { diff --git a/include/srsran/phy/upper/channel_processors/pusch/pusch_codeword_buffer.h b/include/srsran/phy/upper/channel_processors/pusch/pusch_codeword_buffer.h index 2847008330..cf3ed672c1 100644 --- a/include/srsran/phy/upper/channel_processors/pusch/pusch_codeword_buffer.h +++ b/include/srsran/phy/upper/channel_processors/pusch/pusch_codeword_buffer.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/span.h" #include "srsran/phy/upper/log_likelihood_ratio.h" @@ -57,4 +58,4 @@ class pusch_codeword_buffer virtual void on_end_codeword() = 0; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/phy/upper/channel_processors/pusch/pusch_decoder_buffer.h b/include/srsran/phy/upper/channel_processors/pusch/pusch_decoder_buffer.h index 3192cebbf6..d2527890bf 100644 --- a/include/srsran/phy/upper/channel_processors/pusch/pusch_decoder_buffer.h +++ b/include/srsran/phy/upper/channel_processors/pusch/pusch_decoder_buffer.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/span.h" #include "srsran/phy/upper/log_likelihood_ratio.h" @@ -57,4 +58,4 @@ class pusch_decoder_buffer virtual void on_end_softbits() = 0; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/phy/upper/channel_processors/uci/uci_decoder.h b/include/srsran/phy/upper/channel_processors/uci/uci_decoder.h index 26251f1753..b0e9d3f618 100644 --- a/include/srsran/phy/upper/channel_processors/uci/uci_decoder.h +++ b/include/srsran/phy/upper/channel_processors/uci/uci_decoder.h @@ -22,8 +22,8 @@ #pragma once -#include "uci_status.h" #include "srsran/adt/span.h" +#include "srsran/phy/upper/channel_processors/uci/uci_status.h" #include "srsran/phy/upper/log_likelihood_ratio.h" #include "srsran/ran/sch/modulation_scheme.h" diff --git a/include/srsran/phy/upper/codeblock_metadata.h b/include/srsran/phy/upper/codeblock_metadata.h index d78aa27464..ca010fe563 100644 --- a/include/srsran/phy/upper/codeblock_metadata.h +++ b/include/srsran/phy/upper/codeblock_metadata.h @@ -24,10 +24,10 @@ /// \brief Codeblock metadata and related types and constants. #pragma once -#include "log_likelihood_ratio.h" #include "srsran/adt/bit_buffer.h" #include "srsran/adt/span.h" #include "srsran/adt/static_vector.h" +#include "srsran/phy/upper/log_likelihood_ratio.h" // TODO(david,borja): fix dependency. #include "srsran/phy/upper/channel_coding/ldpc/ldpc.h" #include "srsran/ran/sch/modulation_scheme.h" diff --git a/include/srsran/phy/upper/signal_processors/signal_processor_factories.h b/include/srsran/phy/upper/signal_processors/signal_processor_factories.h index 20e8ada730..32a39ec5f2 100644 --- a/include/srsran/phy/upper/signal_processors/signal_processor_factories.h +++ b/include/srsran/phy/upper/signal_processors/signal_processor_factories.h @@ -1,6 +1,5 @@ #pragma once -#include "port_channel_estimator_parameters.h" #include "srsran/phy/support/support_factories.h" #include "srsran/phy/support/time_alignment_estimator/time_alignment_estimator_factories.h" #include "srsran/phy/upper/sequence_generators/sequence_generator_factories.h" @@ -11,6 +10,7 @@ #include "srsran/phy/upper/signal_processors/dmrs_pusch_estimator.h" #include "srsran/phy/upper/signal_processors/nzp_csi_rs_generator.h" #include "srsran/phy/upper/signal_processors/port_channel_estimator.h" +#include "srsran/phy/upper/signal_processors/port_channel_estimator_parameters.h" #include "srsran/phy/upper/signal_processors/pss_processor.h" #include "srsran/phy/upper/signal_processors/sss_processor.h" #include "srsran/srslog/srslog.h" diff --git a/include/srsran/phy/upper/unique_rx_buffer.h b/include/srsran/phy/upper/unique_rx_buffer.h index 28da5ae104..d7e88c8e9b 100644 --- a/include/srsran/phy/upper/unique_rx_buffer.h +++ b/include/srsran/phy/upper/unique_rx_buffer.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/upper/rx_buffer.h" #include "srsran/support/srsran_assert.h" diff --git a/include/srsran/psup/psup_message.h b/include/srsran/psup/psup_message.h index f318756264..3932cc7a05 100644 --- a/include/srsran/psup/psup_message.h +++ b/include/srsran/psup/psup_message.h @@ -23,7 +23,6 @@ #pragma once #include "srsran/ran/cu_types.h" - #include namespace srsran { diff --git a/include/srsran/ran/band_helper.h b/include/srsran/ran/band_helper.h index d7c732e056..ee0c3a65cf 100644 --- a/include/srsran/ran/band_helper.h +++ b/include/srsran/ran/band_helper.h @@ -31,7 +31,6 @@ #include "srsran/ran/n_ta_offset.h" #include "srsran/ran/nr_band.h" #include "srsran/ran/ssb_properties.h" - #include #include diff --git a/include/srsran/ran/cause/e1ap_cause.h b/include/srsran/ran/cause/e1ap_cause.h index 7af760c988..b820d383ab 100644 --- a/include/srsran/ran/cause/e1ap_cause.h +++ b/include/srsran/ran/cause/e1ap_cause.h @@ -22,7 +22,7 @@ #pragma once -#include "common.h" +#include "srsran/ran/cause/common.h" #include "fmt/format.h" #include diff --git a/include/srsran/ran/cause/e1ap_cause_converters.h b/include/srsran/ran/cause/e1ap_cause_converters.h index dd7997decf..4cdffe9d0c 100644 --- a/include/srsran/ran/cause/e1ap_cause_converters.h +++ b/include/srsran/ran/cause/e1ap_cause_converters.h @@ -22,8 +22,8 @@ #pragma once -#include "e1ap_cause.h" -#include "ngap_cause.h" +#include "srsran/ran/cause/e1ap_cause.h" +#include "srsran/ran/cause/ngap_cause.h" namespace srsran { diff --git a/include/srsran/ran/cause/f1ap_cause.h b/include/srsran/ran/cause/f1ap_cause.h index ca4aff1fce..3e0b1fa594 100644 --- a/include/srsran/ran/cause/f1ap_cause.h +++ b/include/srsran/ran/cause/f1ap_cause.h @@ -22,7 +22,7 @@ #pragma once -#include "common.h" +#include "srsran/ran/cause/common.h" #include "fmt/format.h" #include diff --git a/include/srsran/ran/cause/f1ap_cause_converters.h b/include/srsran/ran/cause/f1ap_cause_converters.h index 3744cea70c..666a64814b 100644 --- a/include/srsran/ran/cause/f1ap_cause_converters.h +++ b/include/srsran/ran/cause/f1ap_cause_converters.h @@ -22,8 +22,8 @@ #pragma once -#include "f1ap_cause.h" -#include "ngap_cause.h" +#include "srsran/ran/cause/f1ap_cause.h" +#include "srsran/ran/cause/ngap_cause.h" namespace srsran { diff --git a/include/srsran/ran/cause/ngap_cause.h b/include/srsran/ran/cause/ngap_cause.h index 3a7e74126e..9471f13620 100644 --- a/include/srsran/ran/cause/ngap_cause.h +++ b/include/srsran/ran/cause/ngap_cause.h @@ -22,7 +22,7 @@ #pragma once -#include "common.h" +#include "srsran/ran/cause/common.h" #include "fmt/format.h" #include diff --git a/include/srsran/ran/cause/ngap_cause_converters.h b/include/srsran/ran/cause/ngap_cause_converters.h index d6f7045c4e..286b31681f 100644 --- a/include/srsran/ran/cause/ngap_cause_converters.h +++ b/include/srsran/ran/cause/ngap_cause_converters.h @@ -22,9 +22,9 @@ #pragma once -#include "e1ap_cause.h" -#include "f1ap_cause.h" -#include "ngap_cause.h" +#include "srsran/ran/cause/e1ap_cause.h" +#include "srsran/ran/cause/f1ap_cause.h" +#include "srsran/ran/cause/ngap_cause.h" namespace srsran { diff --git a/include/srsran/ran/csi_report/csi_report_configuration.h b/include/srsran/ran/csi_report/csi_report_configuration.h index 976ac4f165..53d03eb6c6 100644 --- a/include/srsran/ran/csi_report/csi_report_configuration.h +++ b/include/srsran/ran/csi_report/csi_report_configuration.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/bounded_bitset.h" namespace srsran { diff --git a/include/srsran/ran/csi_report/csi_report_formatters.h b/include/srsran/ran/csi_report/csi_report_formatters.h index 5acbae68d3..3cee11a8f9 100644 --- a/include/srsran/ran/csi_report/csi_report_formatters.h +++ b/include/srsran/ran/csi_report/csi_report_formatters.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/csi_report/csi_report_configuration.h" #include "srsran/ran/csi_report/csi_report_data.h" #include "srsran/ran/csi_report/csi_report_pusch_size.h" diff --git a/include/srsran/ran/csi_report/csi_report_on_pucch_helpers.h b/include/srsran/ran/csi_report/csi_report_on_pucch_helpers.h index baaf6b3dd6..80da8e0a6c 100644 --- a/include/srsran/ran/csi_report/csi_report_on_pucch_helpers.h +++ b/include/srsran/ran/csi_report/csi_report_on_pucch_helpers.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/csi_report/csi_report_configuration.h" #include "srsran/ran/csi_report/csi_report_data.h" #include "srsran/ran/csi_report/csi_report_packed.h" @@ -54,4 +55,4 @@ bool validate_pucch_csi_payload(const csi_report_packed& packed, const csi_repor /// \return The CSI report data. csi_report_data csi_report_unpack_pucch(const csi_report_packed& packed, const csi_report_configuration& config); -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/ran/csi_report/csi_report_pusch_size.h b/include/srsran/ran/csi_report/csi_report_pusch_size.h index a94be3f817..7c1750d235 100644 --- a/include/srsran/ran/csi_report/csi_report_pusch_size.h +++ b/include/srsran/ran/csi_report/csi_report_pusch_size.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/uci/uci_part2_size_description.h" #include "srsran/support/units.h" @@ -52,4 +53,4 @@ struct csi_report_pusch_size { units::bits part2_max_size; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/ran/csi_rs/codebook_config.h b/include/srsran/ran/csi_rs/codebook_config.h index bfee754ec7..4a26eb6416 100644 --- a/include/srsran/ran/csi_rs/codebook_config.h +++ b/include/srsran/ran/csi_rs/codebook_config.h @@ -23,7 +23,6 @@ #pragma once #include "srsran/adt/bounded_bitset.h" - #include #include diff --git a/include/srsran/ran/csi_rs/csi_meas_config.h b/include/srsran/ran/csi_rs/csi_meas_config.h index c4ececbf1f..65ed9713fb 100644 --- a/include/srsran/ran/csi_rs/csi_meas_config.h +++ b/include/srsran/ran/csi_rs/csi_meas_config.h @@ -22,15 +22,14 @@ #pragma once -#include "csi_report_config.h" -#include "csi_resource_config.h" -#include "csi_rs_id.h" -#include "csi_rs_pattern.h" -#include "csi_rs_types.h" -#include "frequency_allocation_type.h" #include "srsran/adt/static_vector.h" +#include "srsran/ran/csi_rs/csi_report_config.h" +#include "srsran/ran/csi_rs/csi_resource_config.h" +#include "srsran/ran/csi_rs/csi_rs_id.h" +#include "srsran/ran/csi_rs/csi_rs_pattern.h" +#include "srsran/ran/csi_rs/csi_rs_types.h" +#include "srsran/ran/csi_rs/frequency_allocation_type.h" #include "srsran/ran/tci.h" - #include namespace srsran { diff --git a/include/srsran/ran/csi_rs/csi_report_config.h b/include/srsran/ran/csi_rs/csi_report_config.h index d6168c954e..7444b24bbd 100644 --- a/include/srsran/ran/csi_rs/csi_report_config.h +++ b/include/srsran/ran/csi_rs/csi_report_config.h @@ -22,9 +22,9 @@ #pragma once -#include "codebook_config.h" -#include "csi_resource_config.h" -#include "csi_rs_constants.h" +#include "srsran/ran/csi_rs/codebook_config.h" +#include "srsran/ran/csi_rs/csi_resource_config.h" +#include "srsran/ran/csi_rs/csi_rs_constants.h" #include "srsran/ran/pusch/pusch_configuration.h" #include "srsran/ran/pusch/pusch_constants.h" #include diff --git a/include/srsran/ran/csi_rs/csi_resource_config.h b/include/srsran/ran/csi_rs/csi_resource_config.h index eaa1ad9c95..9782f8fd7f 100644 --- a/include/srsran/ran/csi_rs/csi_resource_config.h +++ b/include/srsran/ran/csi_rs/csi_resource_config.h @@ -22,9 +22,9 @@ #pragma once -#include "csi_rs_constants.h" -#include "csi_rs_id.h" #include "srsran/adt/static_vector.h" +#include "srsran/ran/csi_rs/csi_rs_constants.h" +#include "srsran/ran/csi_rs/csi_rs_id.h" #include "srsran/scheduler/config/bwp_configuration.h" #include diff --git a/include/srsran/ran/cu_types.h b/include/srsran/ran/cu_types.h index 71b190a680..a63e2092d7 100644 --- a/include/srsran/ran/cu_types.h +++ b/include/srsran/ran/cu_types.h @@ -29,7 +29,6 @@ #include "srsran/ran/qos/qos_prio_level.h" #include "srsran/ran/s_nssai.h" #include "srsran/sdap/sdap_config.h" - #include "fmt/format.h" namespace srsran { diff --git a/include/srsran/ran/direct_current_offset.h b/include/srsran/ran/direct_current_offset.h index e22ab81a7b..6da90c2912 100644 --- a/include/srsran/ran/direct_current_offset.h +++ b/include/srsran/ran/direct_current_offset.h @@ -22,9 +22,9 @@ #pragma once -#include "resource_block.h" #include "srsran/adt/strong_type.h" #include "srsran/ran/resource_allocation/rb_interval.h" +#include "srsran/ran/resource_block.h" #include "srsran/support/srsran_assert.h" namespace srsran { diff --git a/include/srsran/ran/du_types.h b/include/srsran/ran/du_types.h index 8e352c557d..49da04255d 100644 --- a/include/srsran/ran/du_types.h +++ b/include/srsran/ran/du_types.h @@ -22,7 +22,7 @@ #pragma once -#include "serv_cell_index.h" +#include "srsran/ran/serv_cell_index.h" #include #include diff --git a/include/srsran/ran/du_ue_list.h b/include/srsran/ran/du_ue_list.h index 5848a71b62..0ff7e6d59f 100644 --- a/include/srsran/ran/du_ue_list.h +++ b/include/srsran/ran/du_ue_list.h @@ -22,8 +22,8 @@ #pragma once -#include "du_types.h" #include "srsran/adt/slotted_array.h" +#include "srsran/ran/du_types.h" namespace srsran { diff --git a/include/srsran/ran/logical_channel/lcid_dl_sch.h b/include/srsran/ran/logical_channel/lcid_dl_sch.h index fbe61ab6c1..771192d6a3 100644 --- a/include/srsran/ran/logical_channel/lcid_dl_sch.h +++ b/include/srsran/ran/logical_channel/lcid_dl_sch.h @@ -22,7 +22,7 @@ #pragma once -#include "lcid.h" +#include "srsran/ran/logical_channel/lcid.h" #include "srsran/support/srsran_assert.h" #include "fmt/format.h" diff --git a/include/srsran/ran/pdcch/downlink_preemption.h b/include/srsran/ran/pdcch/downlink_preemption.h index 411580cd02..abe3e569cb 100644 --- a/include/srsran/ran/pdcch/downlink_preemption.h +++ b/include/srsran/ran/pdcch/downlink_preemption.h @@ -25,7 +25,6 @@ #include "srsran/adt/static_vector.h" #include "srsran/ran/du_types.h" #include "srsran/ran/rnti.h" - #include "srsran/support/units.h" #include diff --git a/include/srsran/ran/pdcch/pdcch_candidates.h b/include/srsran/ran/pdcch/pdcch_candidates.h index 4eefcf2cc3..c757d00ede 100644 --- a/include/srsran/ran/pdcch/pdcch_candidates.h +++ b/include/srsran/ran/pdcch/pdcch_candidates.h @@ -22,9 +22,9 @@ #pragma once -#include "coreset.h" #include "srsran/adt/static_vector.h" #include "srsran/ran/pdcch/aggregation_level.h" +#include "srsran/ran/pdcch/coreset.h" #include "srsran/ran/rnti.h" #include "srsran/ran/subcarrier_spacing.h" diff --git a/include/srsran/ran/pdcch/pdcch_context.h b/include/srsran/ran/pdcch/pdcch_context.h index e33dc0bb71..01a9a69e73 100644 --- a/include/srsran/ran/pdcch/pdcch_context.h +++ b/include/srsran/ran/pdcch/pdcch_context.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/pdcch/search_space.h" #include "srsran/ran/rnti.h" diff --git a/include/srsran/ran/pdcch/pdcch_context_formatter.h b/include/srsran/ran/pdcch/pdcch_context_formatter.h index 9800bf07a3..f1c41415ef 100644 --- a/include/srsran/ran/pdcch/pdcch_context_formatter.h +++ b/include/srsran/ran/pdcch/pdcch_context_formatter.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/pdcch/pdcch_context.h" namespace fmt { @@ -50,4 +51,4 @@ struct formatter { srsran::delimited_formatter helper; }; -} // namespace fmt \ No newline at end of file +} // namespace fmt diff --git a/include/srsran/ran/pdsch/pdsch_constants.h b/include/srsran/ran/pdsch/pdsch_constants.h index 58fb8d692b..09ec962098 100644 --- a/include/srsran/ran/pdsch/pdsch_constants.h +++ b/include/srsran/ran/pdsch/pdsch_constants.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + ///\file ///\brief pdsch_constants - namespace containing constants related to PDSCH transmissions. diff --git a/include/srsran/ran/pdsch/pdsch_context.h b/include/srsran/ran/pdsch/pdsch_context.h index e242eb1be7..0362ca34e2 100644 --- a/include/srsran/ran/pdsch/pdsch_context.h +++ b/include/srsran/ran/pdsch/pdsch_context.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/rnti.h" #include "srsran/scheduler/harq_id.h" diff --git a/include/srsran/ran/pdsch/pdsch_context_formatter.h b/include/srsran/ran/pdsch/pdsch_context_formatter.h index 5b5bc4c591..5cc80b4c67 100644 --- a/include/srsran/ran/pdsch/pdsch_context_formatter.h +++ b/include/srsran/ran/pdsch/pdsch_context_formatter.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/pdsch/pdsch_context.h" #include "srsran/support/format/delimited_formatter.h" @@ -48,4 +49,4 @@ struct formatter { srsran::delimited_formatter helper; }; -} // namespace fmt \ No newline at end of file +} // namespace fmt diff --git a/include/srsran/ran/pdsch/pdsch_rate_match_pattern.h b/include/srsran/ran/pdsch/pdsch_rate_match_pattern.h index 4b355c52f6..25bbba9404 100644 --- a/include/srsran/ran/pdsch/pdsch_rate_match_pattern.h +++ b/include/srsran/ran/pdsch/pdsch_rate_match_pattern.h @@ -23,7 +23,6 @@ #pragma once #include "srsran/phy/constants.h" - #include namespace srsran { diff --git a/include/srsran/ran/physical_cell_group.h b/include/srsran/ran/physical_cell_group.h index df2470ec40..a26980a135 100644 --- a/include/srsran/ran/physical_cell_group.h +++ b/include/srsran/ran/physical_cell_group.h @@ -22,7 +22,7 @@ #pragma once -#include "rnti.h" +#include "srsran/ran/rnti.h" #include namespace srsran { diff --git a/include/srsran/ran/prach/prach_format_type.h b/include/srsran/ran/prach/prach_format_type.h index 5842d5a863..03b0e7db2b 100644 --- a/include/srsran/ran/prach/prach_format_type.h +++ b/include/srsran/ran/prach/prach_format_type.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/support/srsran_assert.h" namespace srsran { diff --git a/include/srsran/ran/prach/prach_helper.h b/include/srsran/ran/prach/prach_helper.h index cda2eaa87e..07956ad96c 100644 --- a/include/srsran/ran/prach/prach_helper.h +++ b/include/srsran/ran/prach/prach_helper.h @@ -22,11 +22,11 @@ #pragma once -#include "rach_config_common.h" #include "srsran/adt/expected.h" #include "srsran/adt/interval.h" #include "srsran/ran/cyclic_prefix.h" #include "srsran/ran/duplex_mode.h" +#include "srsran/ran/prach/rach_config_common.h" namespace srsran { diff --git a/include/srsran/ran/prach/rach_config_common.h b/include/srsran/ran/prach/rach_config_common.h index ae05c43157..c24147fe90 100644 --- a/include/srsran/ran/prach/rach_config_common.h +++ b/include/srsran/ran/prach/rach_config_common.h @@ -22,8 +22,8 @@ #pragma once -#include "restricted_set_config.h" #include "srsran/adt/bounded_integer.h" +#include "srsran/ran/prach/restricted_set_config.h" #include "srsran/ran/subcarrier_spacing.h" #include #include diff --git a/include/srsran/ran/precoding/precoding_constants.h b/include/srsran/ran/precoding/precoding_constants.h index 221c581826..7cbff8da08 100644 --- a/include/srsran/ran/precoding/precoding_constants.h +++ b/include/srsran/ran/precoding/precoding_constants.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/resource_block.h" #include "srsran/support/math/math_utils.h" @@ -42,4 +43,4 @@ static constexpr unsigned MAX_NOF_PORTS = 4; } // namespace precoding_constants -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/ran/precoding/precoding_weight_matrix.h b/include/srsran/ran/precoding/precoding_weight_matrix.h index 020eb1cd54..4c3c48a596 100644 --- a/include/srsran/ran/precoding/precoding_weight_matrix.h +++ b/include/srsran/ran/precoding/precoding_weight_matrix.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/complex.h" #include "srsran/adt/tensor.h" #include "srsran/ran/precoding/precoding_constants.h" diff --git a/include/srsran/ran/precoding/precoding_weight_matrix_formatters.h b/include/srsran/ran/precoding/precoding_weight_matrix_formatters.h index 6ec3d5285a..45e8251b50 100644 --- a/include/srsran/ran/precoding/precoding_weight_matrix_formatters.h +++ b/include/srsran/ran/precoding/precoding_weight_matrix_formatters.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/precoding/precoding_weight_matrix.h" #include "srsran/support/format/delimited_formatter.h" diff --git a/include/srsran/ran/ptrs.h b/include/srsran/ran/ptrs.h index a28d191064..7596da30c8 100644 --- a/include/srsran/ran/ptrs.h +++ b/include/srsran/ran/ptrs.h @@ -22,11 +22,10 @@ #pragma once -#include "ssb_configuration.h" #include "srsran/adt/static_vector.h" #include "srsran/ran/du_types.h" +#include "srsran/ran/ssb_configuration.h" #include "srsran/scheduler/config/bwp_configuration.h" - #include namespace srsran { diff --git a/include/srsran/ran/pucch/pucch_configuration.h b/include/srsran/ran/pucch/pucch_configuration.h index 27c08fd2cf..ac79896580 100644 --- a/include/srsran/ran/pucch/pucch_configuration.h +++ b/include/srsran/ran/pucch/pucch_configuration.h @@ -25,10 +25,9 @@ #pragma once -#include "pucch_mapping.h" #include "srsran/adt/static_vector.h" +#include "srsran/ran/pucch/pucch_mapping.h" #include "srsran/ran/sr_configuration.h" - #include #include #include diff --git a/include/srsran/ran/pucch/pucch_context.h b/include/srsran/ran/pucch/pucch_context.h index 11b058bd3c..40b0b67e3b 100644 --- a/include/srsran/ran/pucch/pucch_context.h +++ b/include/srsran/ran/pucch/pucch_context.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/rnti.h" namespace srsran { diff --git a/include/srsran/ran/pucch/pucch_context_formatter.h b/include/srsran/ran/pucch/pucch_context_formatter.h index 3728aaad07..2db8eb831e 100644 --- a/include/srsran/ran/pucch/pucch_context_formatter.h +++ b/include/srsran/ran/pucch/pucch_context_formatter.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/pucch/pucch_context.h" #include "srsran/support/format/delimited_formatter.h" diff --git a/include/srsran/ran/pucch/pucch_tpc.h b/include/srsran/ran/pucch/pucch_tpc.h index 63cdb88216..8900ba4ded 100644 --- a/include/srsran/ran/pucch/pucch_tpc.h +++ b/include/srsran/ran/pucch/pucch_tpc.h @@ -23,7 +23,6 @@ #pragma once #include "srsran/ran/du_types.h" - #include namespace srsran { diff --git a/include/srsran/ran/pucch/srs_tpc.h b/include/srsran/ran/pucch/srs_tpc.h index f372b2063b..9835336c0a 100644 --- a/include/srsran/ran/pucch/srs_tpc.h +++ b/include/srsran/ran/pucch/srs_tpc.h @@ -23,7 +23,6 @@ #pragma once #include "srsran/ran/du_types.h" - #include namespace srsran { diff --git a/include/srsran/ran/pusch/pusch_constants.h b/include/srsran/ran/pusch/pusch_constants.h index 7ba8ccc906..4326c657a6 100644 --- a/include/srsran/ran/pusch/pusch_constants.h +++ b/include/srsran/ran/pusch/pusch_constants.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + ///\file ///\brief pusch_constants - namespace containing constants related to PUSCH transmissions. diff --git a/include/srsran/ran/pusch/pusch_context.h b/include/srsran/ran/pusch/pusch_context.h index c5b9a5183d..f6628e5385 100644 --- a/include/srsran/ran/pusch/pusch_context.h +++ b/include/srsran/ran/pusch/pusch_context.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/rnti.h" #include "srsran/scheduler/harq_id.h" diff --git a/include/srsran/ran/pusch/pusch_context_formatter.h b/include/srsran/ran/pusch/pusch_context_formatter.h index 0c5dfdaf96..ffc6c3f826 100644 --- a/include/srsran/ran/pusch/pusch_context_formatter.h +++ b/include/srsran/ran/pusch/pusch_context_formatter.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/pusch/pusch_context.h" namespace fmt { diff --git a/include/srsran/ran/pusch/pusch_tpc.h b/include/srsran/ran/pusch/pusch_tpc.h index 9d0a753b09..ff5a569e65 100644 --- a/include/srsran/ran/pusch/pusch_tpc.h +++ b/include/srsran/ran/pusch/pusch_tpc.h @@ -23,7 +23,6 @@ #pragma once #include "srsran/ran/du_types.h" - #include namespace srsran { diff --git a/include/srsran/ran/pusch/pusch_tpmi_select.h b/include/srsran/ran/pusch/pusch_tpmi_select.h index 469ac1d7bc..db913fe952 100644 --- a/include/srsran/ran/pusch/pusch_tpmi_select.h +++ b/include/srsran/ran/pusch/pusch_tpmi_select.h @@ -22,12 +22,11 @@ #pragma once -#include "tx_scheme_configuration.h" #include "srsran/adt/interval.h" #include "srsran/adt/static_vector.h" #include "srsran/ran/pusch/pusch_constants.h" +#include "srsran/ran/pusch/tx_scheme_configuration.h" #include "srsran/ran/srs/srs_channel_matrix.h" - #include "srsran/support/srsran_assert.h" namespace srsran { diff --git a/include/srsran/ran/qos/five_qi_qos_mapping.h b/include/srsran/ran/qos/five_qi_qos_mapping.h index fcc4691b80..b4d6bc410a 100644 --- a/include/srsran/ran/qos/five_qi_qos_mapping.h +++ b/include/srsran/ran/qos/five_qi_qos_mapping.h @@ -22,7 +22,7 @@ #pragma once -#include "five_qi.h" +#include "srsran/ran/qos/five_qi.h" #include "srsran/ran/qos/packet_error_rate.h" #include diff --git a/include/srsran/ran/resource_allocation/ofdm_symbol_range.h b/include/srsran/ran/resource_allocation/ofdm_symbol_range.h index 7f59da8b77..4ec05533cb 100644 --- a/include/srsran/ran/resource_allocation/ofdm_symbol_range.h +++ b/include/srsran/ran/resource_allocation/ofdm_symbol_range.h @@ -22,9 +22,9 @@ #pragma once -#include "sliv.h" #include "srsran/adt/interval.h" #include "srsran/ran/frame_types.h" +#include "srsran/ran/resource_allocation/sliv.h" namespace srsran { diff --git a/include/srsran/ran/resource_block.h b/include/srsran/ran/resource_block.h index 7d21ff0e95..e674d2c7ba 100644 --- a/include/srsran/ran/resource_block.h +++ b/include/srsran/ran/resource_block.h @@ -22,7 +22,7 @@ #pragma once -#include "subcarrier_spacing.h" +#include "srsran/ran/subcarrier_spacing.h" #include namespace srsran { diff --git a/include/srsran/ran/sch/sch_segmentation.h b/include/srsran/ran/sch/sch_segmentation.h index 45a476dc8c..75aa61a9b0 100644 --- a/include/srsran/ran/sch/sch_segmentation.h +++ b/include/srsran/ran/sch/sch_segmentation.h @@ -22,7 +22,7 @@ #pragma once -#include "ldpc_base_graph.h" +#include "srsran/ran/sch/ldpc_base_graph.h" #include "srsran/support/units.h" namespace srsran { diff --git a/include/srsran/ran/sch/tbs_calculator.h b/include/srsran/ran/sch/tbs_calculator.h index 48d8565e72..9b1ed6da60 100644 --- a/include/srsran/ran/sch/tbs_calculator.h +++ b/include/srsran/ran/sch/tbs_calculator.h @@ -25,8 +25,7 @@ #pragma once -#include "sch_mcs.h" - +#include "srsran/ran/sch/sch_mcs.h" #include namespace srsran { diff --git a/include/srsran/ran/srs/srs_channel_matrix_formatters.h b/include/srsran/ran/srs/srs_channel_matrix_formatters.h index b29d745747..903d182afa 100644 --- a/include/srsran/ran/srs/srs_channel_matrix_formatters.h +++ b/include/srsran/ran/srs/srs_channel_matrix_formatters.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/srs/srs_channel_matrix.h" namespace fmt { diff --git a/include/srsran/ran/srs/srs_information.h b/include/srsran/ran/srs/srs_information.h index de5d843c94..caf865caa7 100644 --- a/include/srsran/ran/srs/srs_information.h +++ b/include/srsran/ran/srs/srs_information.h @@ -22,7 +22,8 @@ #pragma once -#include "srs_resource_configuration.h" +#include "srsran/ran/srs/srs_resource_configuration.h" + namespace srsran { /// \brief Collects Sounding Reference Signal information. diff --git a/include/srsran/ran/srs/srs_resource_configuration.h b/include/srsran/ran/srs/srs_resource_configuration.h index 956cc2b77e..61966097a8 100644 --- a/include/srsran/ran/srs/srs_resource_configuration.h +++ b/include/srsran/ran/srs/srs_resource_configuration.h @@ -24,7 +24,6 @@ #include "srsran/adt/bounded_integer.h" #include "srsran/ran/srs/srs_constants.h" - #include #include diff --git a/include/srsran/ran/ssb_mapping.h b/include/srsran/ran/ssb_mapping.h index 846b0888ee..42e7f191fc 100644 --- a/include/srsran/ran/ssb_mapping.h +++ b/include/srsran/ran/ssb_mapping.h @@ -22,8 +22,8 @@ #pragma once -#include "band_helper.h" #include "srsran/phy/constants.h" +#include "srsran/ran/band_helper.h" #include "srsran/ran/frequency_range.h" #include "srsran/ran/resource_allocation/rb_interval.h" #include "srsran/ran/slot_point.h" diff --git a/include/srsran/ran/tci.h b/include/srsran/ran/tci.h index 2131b77247..7013b6bf15 100644 --- a/include/srsran/ran/tci.h +++ b/include/srsran/ran/tci.h @@ -22,11 +22,10 @@ #pragma once -#include "ssb_configuration.h" #include "srsran/ran/csi_rs/csi_rs_id.h" #include "srsran/ran/du_types.h" +#include "srsran/ran/ssb_configuration.h" #include "srsran/scheduler/config/bwp_configuration.h" - #include namespace srsran { diff --git a/include/srsran/ran/uci/uci_formatters.h b/include/srsran/ran/uci/uci_formatters.h index 0a4c53852e..f9d1caff92 100644 --- a/include/srsran/ran/uci/uci_formatters.h +++ b/include/srsran/ran/uci/uci_formatters.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/uci/uci_part2_size_description.h" #include "srsran/support/format/delimited_formatter.h" diff --git a/include/srsran/ran/uci/uci_info.h b/include/srsran/ran/uci/uci_info.h index 9273b5c1a2..f0feec8938 100644 --- a/include/srsran/ran/uci/uci_info.h +++ b/include/srsran/ran/uci/uci_info.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/support/math/math_utils.h" namespace srsran { diff --git a/include/srsran/ran/uci/uci_part2_size_description.h b/include/srsran/ran/uci/uci_part2_size_description.h index 3fa7b31b5a..ff231fe8d1 100644 --- a/include/srsran/ran/uci/uci_part2_size_description.h +++ b/include/srsran/ran/uci/uci_part2_size_description.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/static_vector.h" namespace srsran { @@ -111,4 +112,4 @@ struct uci_part2_size_description { } }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/rlc/rlc_rx.h b/include/srsran/rlc/rlc_rx.h index ee6dba22fe..aa673d54bc 100644 --- a/include/srsran/rlc/rlc_rx.h +++ b/include/srsran/rlc/rlc_rx.h @@ -46,6 +46,7 @@ * inherit or a notifier that the RLC will keep as a member. * */ + namespace srsran { /*************************************** diff --git a/include/srsran/rlc/rlc_tx.h b/include/srsran/rlc/rlc_tx.h index b7330c958b..f5dd815445 100644 --- a/include/srsran/rlc/rlc_tx.h +++ b/include/srsran/rlc/rlc_tx.h @@ -43,6 +43,7 @@ * inherit or a notifier that the RLC will keep as a member. * */ + namespace srsran { /**************************************** diff --git a/include/srsran/rrc/meas_types_validators.h b/include/srsran/rrc/meas_types_validators.h index 90961f1e2c..98ac0e9e48 100644 --- a/include/srsran/rrc/meas_types_validators.h +++ b/include/srsran/rrc/meas_types_validators.h @@ -22,7 +22,7 @@ #pragma once -#include "meas_types.h" +#include "srsran/rrc/meas_types.h" namespace srsran { namespace srs_cu_cp { diff --git a/include/srsran/rrc/rrc_cell_context.h b/include/srsran/rrc/rrc_cell_context.h index a4c296c5c6..d0c3e1ab25 100644 --- a/include/srsran/rrc/rrc_cell_context.h +++ b/include/srsran/rrc/rrc_cell_context.h @@ -26,7 +26,6 @@ #include "srsran/ran/band_helper.h" #include "srsran/ran/nr_cgi.h" #include "srsran/ran/pci.h" - #include namespace srsran { diff --git a/include/srsran/rrc/rrc_config.h b/include/srsran/rrc/rrc_config.h index ba82ea2ec0..d6f0fcb666 100644 --- a/include/srsran/rrc/rrc_config.h +++ b/include/srsran/rrc/rrc_config.h @@ -22,7 +22,6 @@ #pragma once -#include "rrc_ue_config.h" #include "srsran/cu_cp/cu_cp_types.h" #include "srsran/ran/gnb_id.h" #include "srsran/rrc/rrc_ue_config.h" diff --git a/include/srsran/rrc/rrc_du.h b/include/srsran/rrc/rrc_du.h index fc0dd91c0e..0d1b3e2175 100644 --- a/include/srsran/rrc/rrc_du.h +++ b/include/srsran/rrc/rrc_du.h @@ -22,9 +22,9 @@ #pragma once -#include "rrc_cell_context.h" -#include "rrc_ue.h" #include "srsran/cu_cp/cell_meas_manager_config.h" +#include "srsran/rrc/rrc_cell_context.h" +#include "srsran/rrc/rrc_ue.h" namespace srsran { namespace srs_cu_cp { diff --git a/include/srsran/rrc/rrc_du_factory.h b/include/srsran/rrc/rrc_du_factory.h index 9309902577..088705528e 100644 --- a/include/srsran/rrc/rrc_du_factory.h +++ b/include/srsran/rrc/rrc_du_factory.h @@ -22,7 +22,7 @@ #pragma once -#include "rrc_config.h" +#include "srsran/rrc/rrc_config.h" #include "srsran/rrc/rrc_du.h" #include "srsran/rrc/rrc_ue.h" diff --git a/include/srsran/rrc/rrc_types.h b/include/srsran/rrc/rrc_types.h index 0ecbcd74b8..08bb5c16cc 100644 --- a/include/srsran/rrc/rrc_types.h +++ b/include/srsran/rrc/rrc_types.h @@ -22,14 +22,13 @@ #pragma once -#include "meas_types.h" #include "srsran/adt/byte_buffer.h" #include "srsran/adt/slotted_array.h" #include "srsran/pdcp/pdcp_config.h" #include "srsran/ran/cu_types.h" #include "srsran/ran/rb_id.h" +#include "srsran/rrc/meas_types.h" #include "srsran/security/security.h" - #include #include diff --git a/include/srsran/rrc/rrc_ue.h b/include/srsran/rrc/rrc_ue.h index 158037a753..e1fbe6e43d 100644 --- a/include/srsran/rrc/rrc_ue.h +++ b/include/srsran/rrc/rrc_ue.h @@ -22,7 +22,6 @@ #pragma once -#include "rrc_types.h" #include "srsran/adt/byte_buffer.h" #include "srsran/adt/static_vector.h" #include "srsran/asn1/rrc_nr/ue_cap.h" @@ -30,6 +29,7 @@ #include "srsran/cu_cp/cu_cp_types.h" #include "srsran/cu_cp/cu_cp_ue_messages.h" #include "srsran/ran/rnti.h" +#include "srsran/rrc/rrc_types.h" #include "srsran/rrc/rrc_ue_config.h" #include "srsran/security/security.h" #include "srsran/support/async/async_task.h" diff --git a/include/srsran/rrc/rrc_ue_config.h b/include/srsran/rrc/rrc_ue_config.h index 92aab18bb0..4fb4e1e720 100644 --- a/include/srsran/rrc/rrc_ue_config.h +++ b/include/srsran/rrc/rrc_ue_config.h @@ -22,8 +22,8 @@ #pragma once -#include "rrc_types.h" #include "srsran/pdcp/pdcp_t_reordering.h" +#include "srsran/rrc/rrc_types.h" namespace srsran { namespace srs_cu_cp { diff --git a/include/srsran/ru/ru_adapters.h b/include/srsran/ru/ru_adapters.h index 2104560527..fa29b623f2 100644 --- a/include/srsran/ru/ru_adapters.h +++ b/include/srsran/ru/ru_adapters.h @@ -22,10 +22,6 @@ #pragma once -#include "ru_downlink_plane.h" -#include "ru_error_notifier.h" -#include "ru_timing_notifier.h" -#include "ru_uplink_plane.h" #include "srsran/phy/support/prach_buffer_context.h" #include "srsran/phy/support/shared_resource_grid.h" #include "srsran/phy/upper/upper_phy_error_handler.h" @@ -33,6 +29,10 @@ #include "srsran/phy/upper/upper_phy_rx_symbol_handler.h" #include "srsran/phy/upper/upper_phy_rx_symbol_request_notifier.h" #include "srsran/phy/upper/upper_phy_timing_handler.h" +#include "srsran/ru/ru_downlink_plane.h" +#include "srsran/ru/ru_error_notifier.h" +#include "srsran/ru/ru_timing_notifier.h" +#include "srsran/ru/ru_uplink_plane.h" namespace srsran { diff --git a/include/srsran/scheduler/config/logical_channel_config_factory.h b/include/srsran/scheduler/config/logical_channel_config_factory.h index 7174951047..1fd2b27a65 100644 --- a/include/srsran/scheduler/config/logical_channel_config_factory.h +++ b/include/srsran/scheduler/config/logical_channel_config_factory.h @@ -22,7 +22,7 @@ #pragma once -#include "logical_channel_config.h" +#include "srsran/scheduler/config/logical_channel_config.h" namespace srsran { namespace config_helpers { @@ -31,4 +31,4 @@ namespace config_helpers { logical_channel_config create_default_logical_channel_config(lcid_t lcid); } // namespace config_helpers -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/scheduler/config/scheduler_expert_config.h b/include/srsran/scheduler/config/scheduler_expert_config.h index 4d0220756f..58eeddbeff 100644 --- a/include/srsran/scheduler/config/scheduler_expert_config.h +++ b/include/srsran/scheduler/config/scheduler_expert_config.h @@ -33,7 +33,6 @@ #include "srsran/ran/sch/sch_mcs.h" #include "srsran/ran/sib/sib_configuration.h" #include "srsran/ran/slot_pdu_capacity_constants.h" - #include #include diff --git a/include/srsran/scheduler/config/serving_cell_config.h b/include/srsran/scheduler/config/serving_cell_config.h index 75a83a1a86..8b69602ccd 100644 --- a/include/srsran/scheduler/config/serving_cell_config.h +++ b/include/srsran/scheduler/config/serving_cell_config.h @@ -22,7 +22,6 @@ #pragma once -#include "bwp_configuration.h" #include "srsran/ran/carrier_configuration.h" #include "srsran/ran/csi_rs/csi_meas_config.h" #include "srsran/ran/meas_gap_config.h" @@ -38,6 +37,7 @@ #include "srsran/ran/ssb_configuration.h" #include "srsran/ran/tci.h" #include "srsran/ran/time_alignment_config.h" +#include "srsran/scheduler/config/bwp_configuration.h" namespace srsran { diff --git a/include/srsran/scheduler/config/serving_cell_config_factory.h b/include/srsran/scheduler/config/serving_cell_config_factory.h index 794c7a6fab..5c8331e194 100644 --- a/include/srsran/scheduler/config/serving_cell_config_factory.h +++ b/include/srsran/scheduler/config/serving_cell_config_factory.h @@ -22,12 +22,12 @@ #pragma once -#include "cell_config_builder_params.h" -#include "serving_cell_config.h" #include "srsran/ran/csi_rs/csi_meas_config.h" #include "srsran/ran/pdcch/aggregation_level.h" #include "srsran/ran/sib/system_info_config.h" #include "srsran/ran/tdd/tdd_ul_dl_config.h" +#include "srsran/scheduler/config/cell_config_builder_params.h" +#include "srsran/scheduler/config/serving_cell_config.h" namespace srsran { namespace config_helpers { diff --git a/include/srsran/scheduler/config/serving_cell_config_validator.h b/include/srsran/scheduler/config/serving_cell_config_validator.h index 003907c2e8..63325ee4a3 100644 --- a/include/srsran/scheduler/config/serving_cell_config_validator.h +++ b/include/srsran/scheduler/config/serving_cell_config_validator.h @@ -22,8 +22,8 @@ #pragma once -#include "serving_cell_config.h" #include "srsran/ran/tdd/tdd_ul_dl_config.h" +#include "srsran/scheduler/config/serving_cell_config.h" #include "srsran/support/config/validator_result.h" namespace srsran { diff --git a/include/srsran/scheduler/config/slice_rrm_policy_config.h b/include/srsran/scheduler/config/slice_rrm_policy_config.h index 178291e403..2faeda03f0 100644 --- a/include/srsran/scheduler/config/slice_rrm_policy_config.h +++ b/include/srsran/scheduler/config/slice_rrm_policy_config.h @@ -22,9 +22,9 @@ #pragma once -#include "scheduler_expert_config.h" #include "srsran/ran/rrm.h" #include "srsran/ran/s_nssai.h" +#include "srsran/scheduler/config/scheduler_expert_config.h" namespace srsran { diff --git a/include/srsran/scheduler/mac_scheduler.h b/include/srsran/scheduler/mac_scheduler.h index 31821c4c6f..94e563ad83 100644 --- a/include/srsran/scheduler/mac_scheduler.h +++ b/include/srsran/scheduler/mac_scheduler.h @@ -22,11 +22,11 @@ #pragma once -#include "scheduler_configurator.h" -#include "scheduler_dl_buffer_state_indication_handler.h" -#include "scheduler_feedback_handler.h" -#include "scheduler_paging_handler.h" -#include "scheduler_slot_handler.h" +#include "srsran/scheduler/scheduler_configurator.h" +#include "srsran/scheduler/scheduler_dl_buffer_state_indication_handler.h" +#include "srsran/scheduler/scheduler_feedback_handler.h" +#include "srsran/scheduler/scheduler_paging_handler.h" +#include "srsran/scheduler/scheduler_slot_handler.h" namespace srsran { diff --git a/include/srsran/scheduler/scheduler_dci.h b/include/srsran/scheduler/scheduler_dci.h index dcd58e52b8..0b2fa3b3eb 100644 --- a/include/srsran/scheduler/scheduler_dci.h +++ b/include/srsran/scheduler/scheduler_dci.h @@ -22,11 +22,11 @@ #pragma once -#include "vrb_alloc.h" #include "srsran/ran/pdcch/aggregation_level.h" #include "srsran/ran/pdcch/dci_packing.h" #include "srsran/ran/rnti.h" #include "srsran/ran/slot_point.h" +#include "srsran/scheduler/vrb_alloc.h" #include namespace srsran { diff --git a/include/srsran/scheduler/scheduler_slot_handler.h b/include/srsran/scheduler/scheduler_slot_handler.h index 5fd053b33e..15dc7189c7 100644 --- a/include/srsran/scheduler/scheduler_slot_handler.h +++ b/include/srsran/scheduler/scheduler_slot_handler.h @@ -22,9 +22,6 @@ #pragma once -#include "sched_consts.h" -#include "scheduler_dci.h" -#include "vrb_alloc.h" #include "srsran/adt/static_vector.h" #include "srsran/ran/csi_report/csi_report_configuration.h" #include "srsran/ran/csi_report/csi_report_data.h" @@ -49,7 +46,10 @@ #include "srsran/scheduler/config/bwp_configuration.h" #include "srsran/scheduler/config/dmrs.h" #include "srsran/scheduler/harq_id.h" +#include "srsran/scheduler/sched_consts.h" +#include "srsran/scheduler/scheduler_dci.h" #include "srsran/scheduler/scheduler_pucch_format.h" +#include "srsran/scheduler/vrb_alloc.h" #include namespace srsran { diff --git a/include/srsran/scheduler/vrb_alloc.h b/include/srsran/scheduler/vrb_alloc.h index 2801376db9..a3fc513f06 100644 --- a/include/srsran/scheduler/vrb_alloc.h +++ b/include/srsran/scheduler/vrb_alloc.h @@ -22,11 +22,11 @@ #pragma once -#include "resource_block_group.h" #include "srsran/adt/bounded_bitset.h" #include "srsran/ran/resource_allocation/rb_interval.h" #include "srsran/ran/resource_allocation/sliv.h" #include "srsran/ran/resource_block.h" +#include "srsran/scheduler/resource_block_group.h" namespace srsran { diff --git a/include/srsran/security/ciphering.h b/include/srsran/security/ciphering.h index 6def1a5cd3..b883d9db81 100644 --- a/include/srsran/security/ciphering.h +++ b/include/srsran/security/ciphering.h @@ -22,11 +22,11 @@ #pragma once -#include "s3g.h" -#include "security.h" -#include "ssl.h" -#include "zuc.h" #include "srsran/adt/byte_buffer.h" +#include "srsran/security/s3g.h" +#include "srsran/security/security.h" +#include "srsran/security/ssl.h" +#include "srsran/security/zuc.h" namespace srsran { namespace security { diff --git a/include/srsran/security/ciphering_engine.h b/include/srsran/security/ciphering_engine.h index f165d2cacc..a39429157c 100644 --- a/include/srsran/security/ciphering_engine.h +++ b/include/srsran/security/ciphering_engine.h @@ -22,7 +22,7 @@ #pragma once -#include "security_engine.h" +#include "srsran/security/security_engine.h" namespace srsran { namespace security { diff --git a/include/srsran/security/integrity.h b/include/srsran/security/integrity.h index 63bf7965ac..7bc95a6291 100644 --- a/include/srsran/security/integrity.h +++ b/include/srsran/security/integrity.h @@ -22,12 +22,12 @@ #pragma once -#include "s3g.h" -#include "security.h" -#include "ssl.h" -#include "zuc.h" #include "srsran/adt/byte_buffer.h" #include "srsran/adt/span.h" +#include "srsran/security/s3g.h" +#include "srsran/security/security.h" +#include "srsran/security/ssl.h" +#include "srsran/security/zuc.h" namespace srsran { namespace security { diff --git a/include/srsran/security/integrity_engine.h b/include/srsran/security/integrity_engine.h index 1ea08af5b1..63953faaa5 100644 --- a/include/srsran/security/integrity_engine.h +++ b/include/srsran/security/integrity_engine.h @@ -22,7 +22,7 @@ #pragma once -#include "security_engine.h" +#include "srsran/security/security_engine.h" namespace srsran { namespace security { diff --git a/include/srsran/security/s3g.h b/include/srsran/security/s3g.h index b0d4c11dcf..d64aa3d0c4 100644 --- a/include/srsran/security/s3g.h +++ b/include/srsran/security/s3g.h @@ -32,7 +32,7 @@ #pragma once -#include "security.h" +#include "srsran/security/security.h" #include #include #include diff --git a/include/srsran/security/security.h b/include/srsran/security/security.h index b3a1a85604..4f331cc2a2 100644 --- a/include/srsran/security/security.h +++ b/include/srsran/security/security.h @@ -29,7 +29,6 @@ #include "srsran/adt/span.h" #include "srsran/ran/pci.h" #include "srsran/srslog/srslog.h" - #include "srsran/support/srsran_assert.h" #include "fmt/format.h" #include diff --git a/include/srsran/security/ssl.h b/include/srsran/security/ssl.h index 8d870d5b4f..57f4b790b5 100644 --- a/include/srsran/security/ssl.h +++ b/include/srsran/security/ssl.h @@ -22,9 +22,9 @@ #pragma once -#include "mbedtls/aes.h" -#include "mbedtls/cmac.h" -#include "mbedtls/md.h" +#include +#include +#include namespace srsran { namespace security { diff --git a/include/srsran/support/async/async_event_source.h b/include/srsran/support/async/async_event_source.h index 174f7b01e8..c634554ea5 100644 --- a/include/srsran/support/async/async_event_source.h +++ b/include/srsran/support/async/async_event_source.h @@ -22,8 +22,8 @@ #pragma once -#include "manual_event.h" #include "srsran/adt/expected.h" +#include "srsran/support/async/manual_event.h" #include "srsran/support/timers.h" namespace srsran { @@ -163,4 +163,4 @@ class async_single_event_observer manual_event event; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/support/async/async_no_op_task.h b/include/srsran/support/async/async_no_op_task.h index d6713b7ee2..996ade184b 100644 --- a/include/srsran/support/async/async_no_op_task.h +++ b/include/srsran/support/async/async_no_op_task.h @@ -22,7 +22,7 @@ #pragma once -#include "async_task.h" +#include "srsran/support/async/async_task.h" namespace srsran { diff --git a/include/srsran/support/async/async_procedure.h b/include/srsran/support/async/async_procedure.h index 20b93542fa..a488b6fc57 100644 --- a/include/srsran/support/async/async_procedure.h +++ b/include/srsran/support/async/async_procedure.h @@ -22,8 +22,8 @@ #pragma once -#include "async_task.h" -#include "coroutine.h" +#include "srsran/support/async/async_task.h" +#include "srsran/support/async/coroutine.h" namespace srsran { diff --git a/include/srsran/support/async/async_task.h b/include/srsran/support/async/async_task.h index 71c7d7b5ce..cbb0e1978b 100644 --- a/include/srsran/support/async/async_task.h +++ b/include/srsran/support/async/async_task.h @@ -22,7 +22,7 @@ #pragma once -#include "detail/base_task.h" +#include "srsran/support/async/detail/base_task.h" namespace srsran { diff --git a/include/srsran/support/async/async_test_utils.h b/include/srsran/support/async/async_test_utils.h index 6c614bf529..b18c8072c0 100644 --- a/include/srsran/support/async/async_test_utils.h +++ b/include/srsran/support/async/async_test_utils.h @@ -22,10 +22,10 @@ #pragma once -#include "async_no_op_task.h" -#include "async_task.h" -#include "eager_async_task.h" -#include "manual_event.h" +#include "srsran/support/async/async_no_op_task.h" +#include "srsran/support/async/async_task.h" +#include "srsran/support/async/eager_async_task.h" +#include "srsran/support/async/manual_event.h" #include namespace srsran { diff --git a/include/srsran/support/async/async_timer.h b/include/srsran/support/async/async_timer.h index 7b864703bf..39072535c5 100644 --- a/include/srsran/support/async/async_timer.h +++ b/include/srsran/support/async/async_timer.h @@ -22,7 +22,7 @@ #pragma once -#include "coroutine.h" +#include "srsran/support/async/coroutine.h" namespace srsran { diff --git a/include/srsran/support/async/coroutine.h b/include/srsran/support/async/coroutine.h index a7e91e4cfd..f715bf1bb3 100644 --- a/include/srsran/support/async/coroutine.h +++ b/include/srsran/support/async/coroutine.h @@ -22,7 +22,7 @@ #pragma once -#include "awaiter_memory_storage.h" +#include "srsran/support/async/awaiter_memory_storage.h" #include "srsran/support/async/detail/function_signature.h" #include "srsran/support/compiler.h" #include "srsran/support/srsran_assert.h" diff --git a/include/srsran/support/async/eager_async_task.h b/include/srsran/support/async/eager_async_task.h index c6b055efca..22c1d46d4b 100644 --- a/include/srsran/support/async/eager_async_task.h +++ b/include/srsran/support/async/eager_async_task.h @@ -22,8 +22,8 @@ #pragma once -#include "coroutine.h" -#include "detail/base_task.h" +#include "srsran/support/async/coroutine.h" +#include "srsran/support/async/detail/base_task.h" namespace srsran { diff --git a/include/srsran/support/async/event_signal.h b/include/srsran/support/async/event_signal.h index 1fcf6f8f84..6995b1ae68 100644 --- a/include/srsran/support/async/event_signal.h +++ b/include/srsran/support/async/event_signal.h @@ -22,8 +22,8 @@ #pragma once -#include "coroutine.h" -#include "detail/event_impl.h" +#include "srsran/support/async/coroutine.h" +#include "srsran/support/async/detail/event_impl.h" #include namespace srsran { diff --git a/include/srsran/support/async/execute_on.h b/include/srsran/support/async/execute_on.h index ff8a3f28f1..6ebb83beb3 100644 --- a/include/srsran/support/async/execute_on.h +++ b/include/srsran/support/async/execute_on.h @@ -22,8 +22,8 @@ #pragma once -#include "async_task.h" -#include "detail/function_signature.h" +#include "srsran/support/async/async_task.h" +#include "srsran/support/async/detail/function_signature.h" #include namespace srsran { diff --git a/include/srsran/support/async/fifo_async_task_scheduler.h b/include/srsran/support/async/fifo_async_task_scheduler.h index 6b60136a72..449c443e7c 100644 --- a/include/srsran/support/async/fifo_async_task_scheduler.h +++ b/include/srsran/support/async/fifo_async_task_scheduler.h @@ -22,10 +22,10 @@ #pragma once -#include "async_queue.h" -#include "async_task.h" -#include "eager_async_task.h" #include "srsran/adt/unique_function.h" +#include "srsran/support/async/async_queue.h" +#include "srsran/support/async/async_task.h" +#include "srsran/support/async/eager_async_task.h" #include "srsran/support/async/event_sender_receiver.h" namespace srsran { diff --git a/include/srsran/support/async/manual_event.h b/include/srsran/support/async/manual_event.h index c9b62d965a..75f77bcba5 100644 --- a/include/srsran/support/async/manual_event.h +++ b/include/srsran/support/async/manual_event.h @@ -22,8 +22,8 @@ #pragma once -#include "coroutine.h" -#include "detail/event_impl.h" +#include "srsran/support/async/coroutine.h" +#include "srsran/support/async/detail/event_impl.h" #include namespace srsran { diff --git a/include/srsran/support/async/protocol_transaction_manager.h b/include/srsran/support/async/protocol_transaction_manager.h index e49ecfc07b..7d6da66251 100644 --- a/include/srsran/support/async/protocol_transaction_manager.h +++ b/include/srsran/support/async/protocol_transaction_manager.h @@ -22,10 +22,10 @@ #pragma once -#include "async_event_source.h" -#include "manual_event.h" #include "srsran/adt/expected.h" #include "srsran/srslog/srslog.h" +#include "srsran/support/async/async_event_source.h" +#include "srsran/support/async/manual_event.h" #include "srsran/support/compiler.h" #include "srsran/support/timers.h" #include diff --git a/include/srsran/support/executors/blocking_task_worker.h b/include/srsran/support/executors/blocking_task_worker.h index 19b5be38b6..444505f106 100644 --- a/include/srsran/support/executors/blocking_task_worker.h +++ b/include/srsran/support/executors/blocking_task_worker.h @@ -22,8 +22,8 @@ #pragma once -#include "task_executor.h" #include "srsran/adt/blocking_queue.h" +#include "srsran/support/executors/task_executor.h" namespace srsran { diff --git a/include/srsran/support/executors/manual_task_worker.h b/include/srsran/support/executors/manual_task_worker.h index a41b1dc38e..c5673e7ec0 100644 --- a/include/srsran/support/executors/manual_task_worker.h +++ b/include/srsran/support/executors/manual_task_worker.h @@ -22,8 +22,8 @@ #pragma once -#include "task_executor.h" #include "srsran/adt/blocking_queue.h" +#include "srsran/support/executors/task_executor.h" namespace srsran { diff --git a/include/srsran/support/executors/priority_task_worker.h b/include/srsran/support/executors/priority_task_worker.h index f3d16f6143..023df4db1c 100644 --- a/include/srsran/support/executors/priority_task_worker.h +++ b/include/srsran/support/executors/priority_task_worker.h @@ -22,9 +22,9 @@ #pragma once -#include "detail/priority_task_queue.h" -#include "unique_thread.h" +#include "srsran/support/executors/detail/priority_task_queue.h" #include "srsran/support/executors/task_executor.h" +#include "srsran/support/executors/unique_thread.h" namespace srsran { diff --git a/include/srsran/support/executors/task_execution_manager.h b/include/srsran/support/executors/task_execution_manager.h index bb47b2bed3..3b00fc9fdc 100644 --- a/include/srsran/support/executors/task_execution_manager.h +++ b/include/srsran/support/executors/task_execution_manager.h @@ -22,10 +22,9 @@ #pragma once -#include "unique_thread.h" #include "srsran/adt/concurrent_queue.h" #include "srsran/support/executors/task_executor.h" - +#include "srsran/support/executors/unique_thread.h" #include #include diff --git a/include/srsran/support/executors/task_worker.h b/include/srsran/support/executors/task_worker.h index 9713fc6ad4..c6947031d9 100644 --- a/include/srsran/support/executors/task_worker.h +++ b/include/srsran/support/executors/task_worker.h @@ -22,7 +22,6 @@ #pragma once -#include "unique_thread.h" #include "srsran/adt/concurrent_queue.h" #include "srsran/adt/mpmc_queue.h" #include "srsran/adt/mutexed_mpmc_queue.h" @@ -32,6 +31,7 @@ #include "srsran/srslog/srslog.h" #include "srsran/support/compiler.h" #include "srsran/support/executors/task_executor.h" +#include "srsran/support/executors/unique_thread.h" namespace srsran { diff --git a/include/srsran/support/executors/task_worker_pool.h b/include/srsran/support/executors/task_worker_pool.h index 6abd4b0cb1..a97bc075a4 100644 --- a/include/srsran/support/executors/task_worker_pool.h +++ b/include/srsran/support/executors/task_worker_pool.h @@ -22,12 +22,12 @@ #pragma once -#include "unique_thread.h" #include "srsran/adt/mpmc_queue.h" #include "srsran/adt/mutexed_mpmc_queue.h" #include "srsran/srslog/srslog.h" #include "srsran/support/executors/detail/priority_task_queue.h" #include "srsran/support/executors/task_executor.h" +#include "srsran/support/executors/unique_thread.h" namespace srsran { namespace detail { diff --git a/include/srsran/support/io/transport_layer_address.h b/include/srsran/support/io/transport_layer_address.h index dd3449788c..4e9dc27c56 100644 --- a/include/srsran/support/io/transport_layer_address.h +++ b/include/srsran/support/io/transport_layer_address.h @@ -22,7 +22,7 @@ #pragma once -#include "sockets.h" +#include "srsran/support/io/sockets.h" #include "fmt/format.h" #include diff --git a/include/srsran/support/memory_pool/fixed_size_memory_block_pool.h b/include/srsran/support/memory_pool/fixed_size_memory_block_pool.h index 89a4ae814b..6b60468c22 100644 --- a/include/srsran/support/memory_pool/fixed_size_memory_block_pool.h +++ b/include/srsran/support/memory_pool/fixed_size_memory_block_pool.h @@ -23,13 +23,13 @@ #pragma once #ifdef ENABLE_TSAN -#include "sanitizer/tsan_interface.h" +#include #endif #include "cameron314/concurrentqueue.h" -#include "memory_block_list.h" #include "srsran/adt/static_vector.h" #include "srsran/support/error_handling.h" +#include "srsran/support/memory_pool/memory_block_list.h" #include "srsran/support/srsran_assert.h" #include #include diff --git a/include/srsran/support/memory_pool/memory_block_list.h b/include/srsran/support/memory_pool/memory_block_list.h index 35cec10ca8..aef9da5efc 100644 --- a/include/srsran/support/memory_pool/memory_block_list.h +++ b/include/srsran/support/memory_pool/memory_block_list.h @@ -22,7 +22,7 @@ #pragma once -#include "memory_pool_utils.h" +#include "srsran/support/memory_pool/memory_pool_utils.h" #include "srsran/support/srsran_assert.h" #include #include diff --git a/include/srsran/support/memory_pool/ring_buffer_pool.h b/include/srsran/support/memory_pool/ring_buffer_pool.h index cab795ec24..f9cc592082 100644 --- a/include/srsran/support/memory_pool/ring_buffer_pool.h +++ b/include/srsran/support/memory_pool/ring_buffer_pool.h @@ -22,9 +22,9 @@ #pragma once -#include "ring_memory_allocator.h" #include "srsran/support/compiler.h" #include "srsran/support/error_handling.h" +#include "srsran/support/memory_pool/ring_memory_allocator.h" namespace srsran { diff --git a/include/srsran/support/memory_pool/ring_memory_allocator.h b/include/srsran/support/memory_pool/ring_memory_allocator.h index b9f50e653b..e7c3467686 100644 --- a/include/srsran/support/memory_pool/ring_memory_allocator.h +++ b/include/srsran/support/memory_pool/ring_memory_allocator.h @@ -22,7 +22,7 @@ #pragma once -#include "heap_memory_resource.h" +#include "srsran/support/memory_pool/heap_memory_resource.h" #include "srsran/support/srsran_assert.h" namespace srsran { @@ -59,4 +59,4 @@ class ring_memory_allocator span mem_block; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/include/srsran/support/memory_pool/unbounded_object_pool.h b/include/srsran/support/memory_pool/unbounded_object_pool.h index f9eba0c059..a049c242bf 100644 --- a/include/srsran/support/memory_pool/unbounded_object_pool.h +++ b/include/srsran/support/memory_pool/unbounded_object_pool.h @@ -23,7 +23,7 @@ #pragma once #ifdef ENABLE_TSAN -#include "sanitizer/tsan_interface.h" +#include #endif #include "cameron314/concurrentqueue.h" diff --git a/include/srsran/support/memory_pool/unsync_fixed_size_memory_block_pool.h b/include/srsran/support/memory_pool/unsync_fixed_size_memory_block_pool.h index ea75b9a53d..e877b82578 100644 --- a/include/srsran/support/memory_pool/unsync_fixed_size_memory_block_pool.h +++ b/include/srsran/support/memory_pool/unsync_fixed_size_memory_block_pool.h @@ -22,7 +22,7 @@ #pragma once -#include "memory_block_list.h" +#include "srsran/support/memory_pool/memory_block_list.h" namespace srsran { diff --git a/include/srsran/support/tracing/event_tracing.h b/include/srsran/support/tracing/event_tracing.h index 0c206246d4..2f3b593ec7 100644 --- a/include/srsran/support/tracing/event_tracing.h +++ b/include/srsran/support/tracing/event_tracing.h @@ -22,9 +22,9 @@ #pragma once -#include "resource_usage.h" #include "srsran/adt/span.h" #include "srsran/support/compiler.h" +#include "srsran/support/tracing/resource_usage.h" #include #include #include diff --git a/lib/cu_cp/cell_meas_manager/measurement_context.h b/lib/cu_cp/cell_meas_manager/measurement_context.h index cd4f4c7425..25b1007348 100644 --- a/lib/cu_cp/cell_meas_manager/measurement_context.h +++ b/lib/cu_cp/cell_meas_manager/measurement_context.h @@ -27,7 +27,6 @@ #include "srsran/ran/pci.h" #include "srsran/rrc/meas_types.h" #include "srsran/srslog/srslog.h" - #include #include diff --git a/lib/cu_cp/cu_up_processor/cu_up_processor_impl_interface.h b/lib/cu_cp/cu_up_processor/cu_up_processor_impl_interface.h index 786bde3d33..66709ca71f 100644 --- a/lib/cu_cp/cu_up_processor/cu_up_processor_impl_interface.h +++ b/lib/cu_cp/cu_up_processor/cu_up_processor_impl_interface.h @@ -25,7 +25,6 @@ #include "cu_up_processor_context.h" #include "srsran/cu_cp/cu_cp_types.h" #include "srsran/e1ap/cu_cp/e1ap_cu_cp.h" - #include "srsran/support/timers.h" #include diff --git a/lib/cu_cp/routines/mobility/inter_cu_handover_target_routine.h b/lib/cu_cp/routines/mobility/inter_cu_handover_target_routine.h index 0ef2b00c11..c50a58dfeb 100644 --- a/lib/cu_cp/routines/mobility/inter_cu_handover_target_routine.h +++ b/lib/cu_cp/routines/mobility/inter_cu_handover_target_routine.h @@ -21,6 +21,7 @@ */ #pragma once + #include "../../ue_manager/ue_manager_impl.h" #include "srsran/ngap/ngap_handover.h" diff --git a/lib/cu_up/cu_up_ue_logger.h b/lib/cu_up/cu_up_ue_logger.h index d815e40662..01fc4c95b9 100644 --- a/lib/cu_up/cu_up_ue_logger.h +++ b/lib/cu_up/cu_up_ue_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/cu_up/cu_up_types.h" diff --git a/lib/cu_up/pdu_session_manager_impl.cpp b/lib/cu_up/pdu_session_manager_impl.cpp index b9b4460a94..496706674b 100644 --- a/lib/cu_up/pdu_session_manager_impl.cpp +++ b/lib/cu_up/pdu_session_manager_impl.cpp @@ -21,15 +21,13 @@ */ #include "pdu_session_manager_impl.h" - -#include - #include "srsran/e1ap/common/e1ap_types.h" #include "srsran/e1ap/cu_up/e1ap_config_converters.h" #include "srsran/f1u/cu_up/f1u_bearer_factory.h" #include "srsran/gtpu/gtpu_tunnel_ngu_factory.h" #include "srsran/pdcp/pdcp_factory.h" #include "srsran/sdap/sdap_factory.h" +#include using namespace srsran; using namespace srs_cu_up; diff --git a/lib/du/du_high/du_manager/du_ue/du_bearer.h b/lib/du/du_high/du_manager/du_ue/du_bearer.h index c63e229497..4e943fdd13 100644 --- a/lib/du/du_high/du_manager/du_ue/du_bearer.h +++ b/lib/du/du_high/du_manager/du_ue/du_bearer.h @@ -33,7 +33,6 @@ #include "srsran/ran/up_transport_layer_info.h" #include "srsran/rlc/rlc_config.h" #include "srsran/rlc/rlc_entity.h" - #include namespace srsran { diff --git a/lib/e1ap/cu_cp/ue_context/e1ap_ue_logger.h b/lib/e1ap/cu_cp/ue_context/e1ap_ue_logger.h index 5560003f53..e618f3784f 100644 --- a/lib/e1ap/cu_cp/ue_context/e1ap_ue_logger.h +++ b/lib/e1ap/cu_cp/ue_context/e1ap_ue_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/cu_cp/cu_cp_types.h" diff --git a/lib/e1ap/cu_up/ue_context/e1ap_ue_logger.h b/lib/e1ap/cu_up/ue_context/e1ap_ue_logger.h index 5eaca055a6..da78da63fa 100644 --- a/lib/e1ap/cu_up/ue_context/e1ap_ue_logger.h +++ b/lib/e1ap/cu_up/ue_context/e1ap_ue_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/cu_up/cu_up_types.h" diff --git a/lib/e2/e2sm/e2sm_kpm/e2sm_kpm_metric_defs.h b/lib/e2/e2sm/e2sm_kpm/e2sm_kpm_metric_defs.h index 6249c90989..a94b995cf2 100644 --- a/lib/e2/e2sm/e2sm_kpm/e2sm_kpm_metric_defs.h +++ b/lib/e2/e2sm/e2sm_kpm/e2sm_kpm_metric_defs.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/e2/e2sm/e2sm_kpm.h" diff --git a/lib/e2/procedures/e2_indication_procedure.cpp b/lib/e2/procedures/e2_indication_procedure.cpp index a372f0739a..d1c0f47873 100644 --- a/lib/e2/procedures/e2_indication_procedure.cpp +++ b/lib/e2/procedures/e2_indication_procedure.cpp @@ -22,7 +22,6 @@ #include "e2_indication_procedure.h" #include "srsran/asn1/e2ap/e2ap.h" - #include "srsran/support/async/async_timer.h" using namespace srsran; diff --git a/lib/e2/procedures/e2_indication_procedure.h b/lib/e2/procedures/e2_indication_procedure.h index c37efc2789..fc581e8b25 100644 --- a/lib/e2/procedures/e2_indication_procedure.h +++ b/lib/e2/procedures/e2_indication_procedure.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "../common/e2ap_asn1_utils.h" diff --git a/lib/e2/procedures/e2_ric_control_procedure.h b/lib/e2/procedures/e2_ric_control_procedure.h index bdb859ef1c..bb95fcd5f3 100644 --- a/lib/e2/procedures/e2_ric_control_procedure.h +++ b/lib/e2/procedures/e2_ric_control_procedure.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "../common/e2ap_asn1_utils.h" @@ -58,4 +59,4 @@ class e2_ric_control_procedure e2sm_ric_control_request ric_ctrl_req; e2sm_control_service* control_service; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/lib/e2/procedures/e2_setup_procedure.h b/lib/e2/procedures/e2_setup_procedure.h index 2dbaa907e8..bc23540ec3 100644 --- a/lib/e2/procedures/e2_setup_procedure.h +++ b/lib/e2/procedures/e2_setup_procedure.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "../common/e2ap_asn1_utils.h" @@ -64,4 +65,4 @@ class e2_setup_procedure std::chrono::seconds time_to_wait{0}; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/lib/e2/procedures/e2_subscription_delete_procedure.h b/lib/e2/procedures/e2_subscription_delete_procedure.h index db332b1d5e..e940f5d696 100644 --- a/lib/e2/procedures/e2_subscription_delete_procedure.h +++ b/lib/e2/procedures/e2_subscription_delete_procedure.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "../common/e2ap_asn1_utils.h" diff --git a/lib/e2/procedures/e2_subscription_setup_procedure.h b/lib/e2/procedures/e2_subscription_setup_procedure.h index d91ea6fe3a..912f6ac80a 100644 --- a/lib/e2/procedures/e2_subscription_setup_procedure.h +++ b/lib/e2/procedures/e2_subscription_setup_procedure.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "../common/e2ap_asn1_utils.h" diff --git a/lib/f1ap/cu_cp/f1ap_asn1_converters.h b/lib/f1ap/cu_cp/f1ap_asn1_converters.h index c8f2673c64..dadce32805 100644 --- a/lib/f1ap/cu_cp/f1ap_asn1_converters.h +++ b/lib/f1ap/cu_cp/f1ap_asn1_converters.h @@ -29,7 +29,6 @@ #include "srsran/f1ap/cu_cp/f1ap_cu_ue_context_update.h" #include "srsran/ran/cause/f1ap_cause.h" #include "srsran/ran/nr_cgi.h" - #include #include #include diff --git a/lib/f1ap/cu_cp/ue_context/f1ap_ue_logger.h b/lib/f1ap/cu_cp/ue_context/f1ap_ue_logger.h index 4fe1b36752..3f1999d739 100644 --- a/lib/f1ap/cu_cp/ue_context/f1ap_ue_logger.h +++ b/lib/f1ap/cu_cp/ue_context/f1ap_ue_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "../../proc_logger.h" diff --git a/lib/fapi/message_buffering/buffered_slot_gateway_impl.h b/lib/fapi/message_buffering/buffered_slot_gateway_impl.h index 94816f6b9f..f392ec9f89 100644 --- a/lib/fapi/message_buffering/buffered_slot_gateway_impl.h +++ b/lib/fapi/message_buffering/buffered_slot_gateway_impl.h @@ -27,7 +27,6 @@ #include "srsran/fapi/messages.h" #include "srsran/fapi/slot_message_gateway.h" #include "srsran/srslog/logger.h" - #include namespace srsran { diff --git a/lib/gateways/udp_network_gateway_impl.cpp b/lib/gateways/udp_network_gateway_impl.cpp index 0df5f38a9c..5c2180ad9c 100644 --- a/lib/gateways/udp_network_gateway_impl.cpp +++ b/lib/gateways/udp_network_gateway_impl.cpp @@ -30,7 +30,6 @@ #include #include #include - #include using namespace srsran; diff --git a/lib/gtpu/gtpu_pdu.cpp b/lib/gtpu/gtpu_pdu.cpp index 5df727af9d..51d083dacc 100644 --- a/lib/gtpu/gtpu_pdu.cpp +++ b/lib/gtpu/gtpu_pdu.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "gtpu_pdu.h" #include "gtpu_tunnel_logger.h" #include "srsran/support/bit_encoding.h" diff --git a/lib/gtpu/gtpu_pdu.h b/lib/gtpu/gtpu_pdu.h index d39413b9f6..cd2e7dce30 100644 --- a/lib/gtpu/gtpu_pdu.h +++ b/lib/gtpu/gtpu_pdu.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "gtpu_tunnel_logger.h" diff --git a/lib/gtpu/gtpu_tunnel_logger.h b/lib/gtpu/gtpu_tunnel_logger.h index 4abe9c4085..c0ca8af425 100644 --- a/lib/gtpu/gtpu_tunnel_logger.h +++ b/lib/gtpu/gtpu_tunnel_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/cu_up/cu_up_types.h" diff --git a/lib/ngap/procedures/ngap_handover_preparation_procedure.cpp b/lib/ngap/procedures/ngap_handover_preparation_procedure.cpp index d2f634584c..b3b84f2090 100644 --- a/lib/ngap/procedures/ngap_handover_preparation_procedure.cpp +++ b/lib/ngap/procedures/ngap_handover_preparation_procedure.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "ngap_handover_preparation_procedure.h" using namespace srsran; diff --git a/lib/ngap/ue_context/ngap_ue_logger.h b/lib/ngap/ue_context/ngap_ue_logger.h index 2db8e9b4ba..c574b9f843 100644 --- a/lib/ngap/ue_context/ngap_ue_logger.h +++ b/lib/ngap/ue_context/ngap_ue_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/cu_cp/cu_cp_types.h" diff --git a/lib/ofh/ofh_factories.cpp b/lib/ofh/ofh_factories.cpp index 8ee182f8ff..06269ff1ff 100644 --- a/lib/ofh/ofh_factories.cpp +++ b/lib/ofh/ofh_factories.cpp @@ -171,7 +171,7 @@ create_txrx(const sector_configuration& sector_cfg, std::unique_ptr srsran::ofh::create_ofh_sector(const sector_configuration& sector_cfg, sector_dependencies&& sector_deps) { - unsigned repository_size = sector_cfg.max_processing_delay_slots * 4; + unsigned repository_size = calculate_repository_size(sector_cfg.scs, sector_cfg.max_processing_delay_slots * 4); auto cp_repo = std::make_shared(repository_size); auto prach_repo = std::make_shared(repository_size); diff --git a/lib/ofh/support/context_repository_helpers.h b/lib/ofh/support/context_repository_helpers.h new file mode 100644 index 0000000000..0799eddaf1 --- /dev/null +++ b/lib/ofh/support/context_repository_helpers.h @@ -0,0 +1,54 @@ +/* + * + * Copyright 2021-2024 Software Radio Systems Limited + * + * This file is part of srsRAN. + * + * srsRAN is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsRAN is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#pragma once + +#include "srsran/ran/slot_point.h" + +namespace srsran { +namespace ofh { + +/// System frame number maximum value in the Open Fronthaul repositories. +static constexpr unsigned SFN_MAX_VALUE = 1U << 8; + +/// \brief Calculates the size of the repository using the given parameters. +/// +/// This function will find the minimum divisible value of the maximum number of slots that Open Fronthaul supports. +inline unsigned calculate_repository_size(subcarrier_spacing scs, unsigned minimum_repo_size) +{ + for (unsigned nof_slots = SFN_MAX_VALUE * get_nof_slots_per_subframe(scs) * NOF_SUBFRAMES_PER_FRAME; + nof_slots % minimum_repo_size != 0; + ++minimum_repo_size) { + } + + return minimum_repo_size; +} + +/// Calculates the repository local index for the given slot and repository size. +inline unsigned calculate_repository_index(slot_point slot, unsigned repo_size) +{ + slot_point entry_slot(slot.numerology(), slot.sfn() % SFN_MAX_VALUE, slot.slot_index()); + return entry_slot.system_slot() % repo_size; +} + +} // namespace ofh +} // namespace srsran diff --git a/lib/ofh/support/prach_context_repository.h b/lib/ofh/support/prach_context_repository.h index 35324c5945..b184f2f338 100644 --- a/lib/ofh/support/prach_context_repository.h +++ b/lib/ofh/support/prach_context_repository.h @@ -22,6 +22,7 @@ #pragma once +#include "context_repository_helpers.h" #include "srsran/adt/bounded_bitset.h" #include "srsran/adt/expected.h" #include "srsran/ofh/ofh_constants.h" @@ -187,9 +188,6 @@ class prach_context /// PRACH context repository. class prach_context_repository { - /// System frame number maximum value in this repository. - static constexpr unsigned SFN_MAX_VALUE = 1U << 8; - std::vector buffer; //: TODO: make this lock free mutable std::mutex mutex; @@ -197,16 +195,14 @@ class prach_context_repository /// Returns the entry of the repository for the given slot. prach_context& entry(slot_point slot) { - slot_point entry_slot(slot.numerology(), slot.sfn() % SFN_MAX_VALUE, slot.slot_index()); - unsigned index = entry_slot.system_slot() % buffer.size(); + unsigned index = calculate_repository_index(slot, buffer.size()); return buffer[index]; } /// Returns the entry of the repository for the given slot. const prach_context& entry(slot_point slot) const { - slot_point entry_slot(slot.numerology(), slot.sfn() % SFN_MAX_VALUE, slot.slot_index()); - unsigned index = entry_slot.system_slot() % buffer.size(); + unsigned index = calculate_repository_index(slot, buffer.size()); return buffer[index]; } diff --git a/lib/ofh/support/uplink_context_repository.h b/lib/ofh/support/uplink_context_repository.h index 4263e15031..09745358ff 100644 --- a/lib/ofh/support/uplink_context_repository.h +++ b/lib/ofh/support/uplink_context_repository.h @@ -22,6 +22,7 @@ #pragma once +#include "context_repository_helpers.h" #include "srsran/adt/expected.h" #include "srsran/ofh/ofh_constants.h" #include "srsran/phy/support/resource_grid.h" @@ -140,9 +141,6 @@ class uplink_context /// Uplink context repository. class uplink_context_repository { - /// System frame number maximum value in this repository. - static constexpr unsigned SFN_MAX_VALUE = 1U << 8; - std::vector> buffer; //: TODO: make this lock free mutable std::mutex mutex; @@ -152,8 +150,7 @@ class uplink_context_repository { srsran_assert(symbol < MAX_NSYMB_PER_SLOT, "Invalid symbol index '{}'", symbol); - slot_point entry_slot(slot.numerology(), slot.sfn() % SFN_MAX_VALUE, slot.slot_index()); - unsigned index = entry_slot.system_slot() % buffer.size(); + unsigned index = calculate_repository_index(slot, buffer.size()); return buffer[index][symbol]; } @@ -162,8 +159,7 @@ class uplink_context_repository { srsran_assert(symbol < MAX_NSYMB_PER_SLOT, "Invalid symbol index '{}'", symbol); - slot_point entry_slot(slot.numerology(), slot.sfn() % SFN_MAX_VALUE, slot.slot_index()); - unsigned index = entry_slot.system_slot() % buffer.size(); + unsigned index = calculate_repository_index(slot, buffer.size()); return buffer[index][symbol]; } diff --git a/lib/ofh/support/uplink_cplane_context_repository.h b/lib/ofh/support/uplink_cplane_context_repository.h index 4f4bf05556..8e0c99945c 100644 --- a/lib/ofh/support/uplink_cplane_context_repository.h +++ b/lib/ofh/support/uplink_cplane_context_repository.h @@ -22,6 +22,7 @@ #pragma once +#include "context_repository_helpers.h" #include "srsran/adt/expected.h" #include "srsran/ofh/ofh_constants.h" #include "srsran/ofh/serdes/ofh_cplane_message_properties.h" @@ -47,34 +48,28 @@ struct ul_cplane_context { /// Uplink Control-Plane context repository. class uplink_cplane_context_repository { - /// System frame number maximum value in this repository. - static constexpr unsigned SFN_MAX_VALUE = 1U << 8; - using repo_entry = std::array; std::vector repo; - unsigned size = 0; //: TODO: make this lock free mutable std::mutex mutex; /// Returns the entry of the repository for the given slot and eAxC. ul_cplane_context& entry(slot_point slot, unsigned eaxc) { - slot_point entry_slot(slot.numerology(), slot.sfn() % SFN_MAX_VALUE, slot.slot_index()); - unsigned index = entry_slot.system_slot() % size; + unsigned index = calculate_repository_index(slot, repo.size()); return repo[index][eaxc]; } /// Returns the entry of the repository for the given slot and eAxC. const ul_cplane_context& entry(slot_point slot, unsigned eaxc) const { - slot_point entry_slot(slot.numerology(), slot.sfn() % SFN_MAX_VALUE, slot.slot_index()); - unsigned index = entry_slot.system_slot() % size; + unsigned index = calculate_repository_index(slot, repo.size()); return repo[index][eaxc]; } public: - explicit uplink_cplane_context_repository(unsigned size_) : repo(size_), size(size_) {} + explicit uplink_cplane_context_repository(unsigned size_) : repo(size_) {} /// Add the given context to the repo at the given slot and eAxC. void add(slot_point slot, unsigned eaxc, const ul_cplane_context& context) diff --git a/lib/pdcp/pdcp_bearer_logger.h b/lib/pdcp/pdcp_bearer_logger.h index 65a714774c..af1253acbc 100644 --- a/lib/pdcp/pdcp_bearer_logger.h +++ b/lib/pdcp/pdcp_bearer_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/ran/rb_id.h" diff --git a/lib/phy/generic_functions/transform_precoding/CMakeLists.txt b/lib/phy/generic_functions/transform_precoding/CMakeLists.txt index 07858afd43..43bb10aa44 100644 --- a/lib/phy/generic_functions/transform_precoding/CMakeLists.txt +++ b/lib/phy/generic_functions/transform_precoding/CMakeLists.txt @@ -20,7 +20,7 @@ set(transform_precoding_sources transform_precoder_dft_impl.cpp - tansform_precoding_factories.cpp) + transform_precoding_factories.cpp) add_library(srsran_transform_precoding STATIC ${transform_precoding_sources}) diff --git a/lib/phy/generic_functions/transform_precoding/tansform_precoding_factories.cpp b/lib/phy/generic_functions/transform_precoding/transform_precoding_factories.cpp similarity index 98% rename from lib/phy/generic_functions/transform_precoding/tansform_precoding_factories.cpp rename to lib/phy/generic_functions/transform_precoding/transform_precoding_factories.cpp index fbad0bbd17..28dad92b80 100644 --- a/lib/phy/generic_functions/transform_precoding/tansform_precoding_factories.cpp +++ b/lib/phy/generic_functions/transform_precoding/transform_precoding_factories.cpp @@ -20,12 +20,11 @@ * */ -#include "transform_precoder_dft_impl.h" #include "srsran/phy/generic_functions/transform_precoding/transform_precoding_factories.h" +#include "transform_precoder_dft_impl.h" +#include "srsran/phy/constants.h" #include "srsran/ran/transform_precoding/transform_precoding_helpers.h" -#include - using namespace srsran; namespace { diff --git a/lib/phy/lower/lower_phy_baseband_processor.h b/lib/phy/lower/lower_phy_baseband_processor.h index 6e87f16a26..edbcff4e87 100644 --- a/lib/phy/lower/lower_phy_baseband_processor.h +++ b/lib/phy/lower/lower_phy_baseband_processor.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/blocking_queue.h" #include "srsran/gateways/baseband/baseband_gateway_receiver.h" #include "srsran/gateways/baseband/baseband_gateway_timestamp.h" diff --git a/lib/phy/lower/processors/downlink/downlink_processor_baseband_impl.h b/lib/phy/lower/processors/downlink/downlink_processor_baseband_impl.h index 1fd9084520..d42e07765b 100644 --- a/lib/phy/lower/processors/downlink/downlink_processor_baseband_impl.h +++ b/lib/phy/lower/processors/downlink/downlink_processor_baseband_impl.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/blocking_queue.h" #include "srsran/gateways/baseband/buffer/baseband_gateway_buffer_dynamic.h" #include "srsran/phy/lower/amplitude_controller/amplitude_controller.h" diff --git a/lib/phy/lower/processors/downlink/downlink_processor_impl.h b/lib/phy/lower/processors/downlink/downlink_processor_impl.h index 1b5b9f2ce9..96359cb43c 100644 --- a/lib/phy/lower/processors/downlink/downlink_processor_impl.h +++ b/lib/phy/lower/processors/downlink/downlink_processor_impl.h @@ -21,6 +21,7 @@ */ #pragma once + #include "downlink_processor_baseband_impl.h" #include "srsran/adt/blocking_queue.h" #include "srsran/gateways/baseband/buffer/baseband_gateway_buffer_dynamic.h" diff --git a/lib/phy/lower/processors/uplink/puxch/puxch_processor_impl.h b/lib/phy/lower/processors/uplink/puxch/puxch_processor_impl.h index 559dfffe27..36f4d2516b 100644 --- a/lib/phy/lower/processors/uplink/puxch/puxch_processor_impl.h +++ b/lib/phy/lower/processors/uplink/puxch/puxch_processor_impl.h @@ -21,6 +21,7 @@ */ #pragma once + #include "../../resource_grid_request_pool.h" #include "srsran/adt/circular_array.h" #include "srsran/gateways/baseband/buffer/baseband_gateway_buffer_dynamic.h" diff --git a/lib/phy/lower/processors/uplink/uplink_processor_impl.h b/lib/phy/lower/processors/uplink/uplink_processor_impl.h index 852e91e625..e98dd7fe53 100644 --- a/lib/phy/lower/processors/uplink/uplink_processor_impl.h +++ b/lib/phy/lower/processors/uplink/uplink_processor_impl.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/tensor.h" #include "srsran/gateways/baseband/buffer/baseband_gateway_buffer_dynamic.h" #include "srsran/phy/lower/processors/uplink/prach/prach_processor.h" diff --git a/lib/phy/support/resource_grid_mapper_impl.h b/lib/phy/support/resource_grid_mapper_impl.h index a67bcd6d1f..0222e8e4f2 100644 --- a/lib/phy/support/resource_grid_mapper_impl.h +++ b/lib/phy/support/resource_grid_mapper_impl.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/generic_functions/precoding/channel_precoder.h" #include "srsran/phy/support/re_buffer.h" #include "srsran/phy/support/resource_grid_mapper.h" diff --git a/lib/phy/support/resource_grid_reader_impl.h b/lib/phy/support/resource_grid_reader_impl.h index 62a1b22e47..6349870143 100644 --- a/lib/phy/support/resource_grid_reader_impl.h +++ b/lib/phy/support/resource_grid_reader_impl.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/support/resource_grid_dimensions.h" #include "srsran/phy/support/resource_grid_reader.h" diff --git a/lib/phy/support/resource_grid_writer_impl.cpp b/lib/phy/support/resource_grid_writer_impl.cpp index ab29dfc52b..7449cfd27e 100644 --- a/lib/phy/support/resource_grid_writer_impl.cpp +++ b/lib/phy/support/resource_grid_writer_impl.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "resource_grid_writer_impl.h" #include "srsran/adt/interval.h" #include "srsran/phy/support/resource_grid.h" diff --git a/lib/phy/support/resource_grid_writer_impl.h b/lib/phy/support/resource_grid_writer_impl.h index 13f5a05472..2f37a97fc1 100644 --- a/lib/phy/support/resource_grid_writer_impl.h +++ b/lib/phy/support/resource_grid_writer_impl.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/support/resource_grid_dimensions.h" #include "srsran/phy/support/resource_grid_writer.h" diff --git a/lib/phy/upper/channel_modulation/demodulation_mapper_qam16.cpp b/lib/phy/upper/channel_modulation/demodulation_mapper_qam16.cpp index b53f7ebfcd..5901570015 100644 --- a/lib/phy/upper/channel_modulation/demodulation_mapper_qam16.cpp +++ b/lib/phy/upper/channel_modulation/demodulation_mapper_qam16.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "demodulation_mapper_qam16.h" #include "srsran/phy/upper/log_likelihood_ratio.h" @@ -271,4 +272,4 @@ void srsran::demodulate_soft_QAM16(span llrs, ++symbols_it; ++noise_it; } -} \ No newline at end of file +} diff --git a/lib/phy/upper/channel_modulation/demodulation_mapper_qam256.cpp b/lib/phy/upper/channel_modulation/demodulation_mapper_qam256.cpp index 1c9a388003..a9f5b94868 100644 --- a/lib/phy/upper/channel_modulation/demodulation_mapper_qam256.cpp +++ b/lib/phy/upper/channel_modulation/demodulation_mapper_qam256.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "demodulation_mapper_qam256.h" #include "demodulation_mapper_intervals.h" #include "srsran/phy/upper/log_likelihood_ratio.h" diff --git a/lib/phy/upper/channel_modulation/demodulation_mapper_qam64.cpp b/lib/phy/upper/channel_modulation/demodulation_mapper_qam64.cpp index 0e3737da46..01fa66c421 100644 --- a/lib/phy/upper/channel_modulation/demodulation_mapper_qam64.cpp +++ b/lib/phy/upper/channel_modulation/demodulation_mapper_qam64.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "demodulation_mapper_qam64.h" #include "demodulation_mapper_intervals.h" #include "srsran/phy/upper/log_likelihood_ratio.h" diff --git a/lib/phy/upper/channel_modulation/demodulation_mapper_qpsk.cpp b/lib/phy/upper/channel_modulation/demodulation_mapper_qpsk.cpp index bb98af4d14..96fccdef8b 100644 --- a/lib/phy/upper/channel_modulation/demodulation_mapper_qpsk.cpp +++ b/lib/phy/upper/channel_modulation/demodulation_mapper_qpsk.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "demodulation_mapper_qpsk.h" #ifdef __AVX2__ @@ -167,4 +168,4 @@ void srsran::demodulate_soft_QPSK(span llrs, *llr_it++ = demod_QPSK_symbol(std::imag(this_symbol), *noise_it); ++noise_it; } -} \ No newline at end of file +} diff --git a/lib/phy/upper/channel_processors/pdsch/factories.cpp b/lib/phy/upper/channel_processors/pdsch/factories.cpp index 151523b9ce..fedd2c6fdb 100644 --- a/lib/phy/upper/channel_processors/pdsch/factories.cpp +++ b/lib/phy/upper/channel_processors/pdsch/factories.cpp @@ -32,7 +32,6 @@ #include "pdsch_processor_pool.h" #include "pdsch_processor_validator_impl.h" #include "srsran/phy/support/support_factories.h" - #include using namespace srsran; diff --git a/lib/phy/upper/channel_processors/pdsch/pdsch_processor_concurrent_impl.h b/lib/phy/upper/channel_processors/pdsch/pdsch_processor_concurrent_impl.h index 349759bea6..4b2ca4b099 100644 --- a/lib/phy/upper/channel_processors/pdsch/pdsch_processor_concurrent_impl.h +++ b/lib/phy/upper/channel_processors/pdsch/pdsch_processor_concurrent_impl.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "pdsch_codeblock_processor.h" diff --git a/lib/phy/upper/channel_processors/pdsch/pdsch_processor_impl.h b/lib/phy/upper/channel_processors/pdsch/pdsch_processor_impl.h index daf4b00e1b..9be2625560 100644 --- a/lib/phy/upper/channel_processors/pdsch/pdsch_processor_impl.h +++ b/lib/phy/upper/channel_processors/pdsch/pdsch_processor_impl.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/phy/upper/channel_processors/pdsch/pdsch_encoder.h" diff --git a/lib/phy/upper/channel_processors/pdsch/pdsch_processor_lite_impl.h b/lib/phy/upper/channel_processors/pdsch/pdsch_processor_lite_impl.h index 77394e1daf..9d5a573417 100644 --- a/lib/phy/upper/channel_processors/pdsch/pdsch_processor_lite_impl.h +++ b/lib/phy/upper/channel_processors/pdsch/pdsch_processor_lite_impl.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "pdsch_codeblock_processor.h" diff --git a/lib/phy/upper/channel_processors/prach_detector_generic_thresholds.cpp b/lib/phy/upper/channel_processors/prach_detector_generic_thresholds.cpp index 103c8cb617..634ca72576 100644 --- a/lib/phy/upper/channel_processors/prach_detector_generic_thresholds.cpp +++ b/lib/phy/upper/channel_processors/prach_detector_generic_thresholds.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "prach_detector_generic_thresholds.h" #include "srsran/adt/span.h" #include "srsran/adt/to_array.h" diff --git a/lib/phy/upper/channel_processors/pusch/logging_pusch_processor_decorator.h b/lib/phy/upper/channel_processors/pusch/logging_pusch_processor_decorator.h index 401527d1dd..107d321234 100644 --- a/lib/phy/upper/channel_processors/pusch/logging_pusch_processor_decorator.h +++ b/lib/phy/upper/channel_processors/pusch/logging_pusch_processor_decorator.h @@ -138,9 +138,10 @@ class logging_pusch_processor_decorator : public pusch_processor, private pusch_ } // Calculate the return latency if available. - std::chrono::nanoseconds time_return_ns(0); - if (time_return != std::chrono::time_point()) { - time_return_ns = time_return - time_start; + std::chrono::nanoseconds time_return_ns(0); + std::chrono::time_point time_return_local = time_return.load(); + if (time_return_local != std::chrono::time_point()) { + time_return_ns = time_return_local - time_start; } // Calculate the final time. @@ -184,15 +185,18 @@ class logging_pusch_processor_decorator : public pusch_processor, private pusch_ notifier_->on_sch(sch); } - srslog::basic_logger& logger; - std::unique_ptr processor; - span data; - pdu_t pdu; - pusch_processor_result_notifier* notifier; - std::chrono::time_point time_start; - std::chrono::time_point time_uci; - std::chrono::time_point time_return; - fmt::pusch_results_wrapper results; + srslog::basic_logger& logger; + std::unique_ptr processor; + span data; + pdu_t pdu; + pusch_processor_result_notifier* notifier; + std::chrono::time_point time_start; + std::chrono::time_point time_uci; + std::atomic> time_return; + fmt::pusch_results_wrapper results; + + // Makes sure atomics are lock free. + static_assert(std::atomic::is_always_lock_free); }; } // namespace srsran diff --git a/lib/phy/upper/channel_processors/pusch/pusch_decoder_buffer_dummy.h b/lib/phy/upper/channel_processors/pusch/pusch_decoder_buffer_dummy.h index e00e5d835f..2a745afe4c 100644 --- a/lib/phy/upper/channel_processors/pusch/pusch_decoder_buffer_dummy.h +++ b/lib/phy/upper/channel_processors/pusch/pusch_decoder_buffer_dummy.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/upper/channel_processors/pusch/pusch_decoder_buffer.h" namespace srsran { @@ -48,4 +49,4 @@ class pusch_decoder_buffer_dummy : public pusch_decoder_buffer } }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/lib/phy/upper/channel_processors/pusch/pusch_processor_impl.cpp b/lib/phy/upper/channel_processors/pusch/pusch_processor_impl.cpp index 3c4e7d16ba..7212255883 100644 --- a/lib/phy/upper/channel_processors/pusch/pusch_processor_impl.cpp +++ b/lib/phy/upper/channel_processors/pusch/pusch_processor_impl.cpp @@ -24,7 +24,6 @@ #include "pusch_decoder_buffer_dummy.h" #include "pusch_processor_notifier_adaptor.h" #include "pusch_processor_validator_impl.h" - #include "srsran/phy/upper/channel_processors/pusch/formatters.h" #include "srsran/phy/upper/channel_processors/pusch/pusch_codeword_buffer.h" #include "srsran/phy/upper/channel_processors/pusch/pusch_decoder_buffer.h" diff --git a/lib/phy/upper/channel_processors/pusch/pusch_processor_validator_impl.h b/lib/phy/upper/channel_processors/pusch/pusch_processor_validator_impl.h index caa5520a25..e2d0d3c0cb 100644 --- a/lib/phy/upper/channel_processors/pusch/pusch_processor_validator_impl.h +++ b/lib/phy/upper/channel_processors/pusch/pusch_processor_validator_impl.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/adt/expected.h" diff --git a/lib/phy/upper/channel_processors/pusch/pusch_uci_decoder_wrapper.h b/lib/phy/upper/channel_processors/pusch/pusch_uci_decoder_wrapper.h index ca1516184d..f9879408ee 100644 --- a/lib/phy/upper/channel_processors/pusch/pusch_uci_decoder_wrapper.h +++ b/lib/phy/upper/channel_processors/pusch/pusch_uci_decoder_wrapper.h @@ -21,6 +21,7 @@ */ #pragma once + #include "pusch_uci_decoder_notifier.h" #include "srsran/phy/upper/channel_processors/pusch/pusch_decoder_buffer.h" #include "srsran/phy/upper/channel_processors/uci/uci_decoder.h" diff --git a/lib/phy/upper/sequence_generators/pseudo_random_generator_sequence.h b/lib/phy/upper/sequence_generators/pseudo_random_generator_sequence.h index b83506fc1c..70a78bf55a 100644 --- a/lib/phy/upper/sequence_generators/pseudo_random_generator_sequence.h +++ b/lib/phy/upper/sequence_generators/pseudo_random_generator_sequence.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/adt/interval.h" namespace srsran { @@ -141,4 +142,4 @@ class pseudo_random_generator_sequence state_type x2; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/lib/radio/uhd/radio_uhd_impl.cpp b/lib/radio/uhd/radio_uhd_impl.cpp index 7e05cd3816..4a414e108c 100644 --- a/lib/radio/uhd/radio_uhd_impl.cpp +++ b/lib/radio/uhd/radio_uhd_impl.cpp @@ -23,7 +23,6 @@ #include "radio_uhd_impl.h" #include "radio_uhd_device.h" #include - #include using namespace srsran; diff --git a/lib/radio/zmq/radio_zmq_timer.h b/lib/radio/zmq/radio_zmq_timer.h index 882239b7f2..99773db366 100644 --- a/lib/radio/zmq/radio_zmq_timer.h +++ b/lib/radio/zmq/radio_zmq_timer.h @@ -21,6 +21,7 @@ */ #pragma once + #include namespace srsran { diff --git a/lib/radio/zmq/radio_zmq_tx_align_interface.h b/lib/radio/zmq/radio_zmq_tx_align_interface.h index 24aecf3451..139977890d 100644 --- a/lib/radio/zmq/radio_zmq_tx_align_interface.h +++ b/lib/radio/zmq/radio_zmq_tx_align_interface.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/gateways/baseband/baseband_gateway_timestamp.h" #include @@ -37,4 +38,4 @@ class radio_zmq_tx_align_interface virtual bool align(baseband_gateway_timestamp timestamp, std::chrono::milliseconds timeout) = 0; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/lib/ran/csi_report/csi_report_on_puxch_helpers.cpp b/lib/ran/csi_report/csi_report_on_puxch_helpers.cpp index 4c9d4a4cda..c98a1887fa 100644 --- a/lib/ran/csi_report/csi_report_on_puxch_helpers.cpp +++ b/lib/ran/csi_report/csi_report_on_puxch_helpers.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "csi_report_on_puxch_helpers.h" #include "srsran/adt/interval.h" #include "srsran/ran/csi_report/csi_report_on_puxch_utils.h" diff --git a/lib/ran/csi_report/csi_report_on_puxch_helpers.h b/lib/ran/csi_report/csi_report_on_puxch_helpers.h index d773928efb..950f149f48 100644 --- a/lib/ran/csi_report/csi_report_on_puxch_helpers.h +++ b/lib/ran/csi_report/csi_report_on_puxch_helpers.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/ran/csi_report/csi_report_configuration.h" #include "srsran/ran/csi_report/csi_report_data.h" #include "srsran/ran/csi_report/csi_report_packed.h" diff --git a/lib/ran/precoding/precoding_codebooks.cpp b/lib/ran/precoding/precoding_codebooks.cpp index 217b83b124..eb7920dee2 100644 --- a/lib/ran/precoding/precoding_codebooks.cpp +++ b/lib/ran/precoding/precoding_codebooks.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "srsran/ran/precoding/precoding_codebooks.h" #include "srsran/adt/interval.h" #include "srsran/support/math/math_utils.h" diff --git a/lib/rlc/rlc_am_pdu.h b/lib/rlc/rlc_am_pdu.h index 4eb5ef332d..a15018ad42 100644 --- a/lib/rlc/rlc_am_pdu.h +++ b/lib/rlc/rlc_am_pdu.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/adt/byte_buffer.h" diff --git a/lib/rlc/rlc_bearer_logger.h b/lib/rlc/rlc_bearer_logger.h index e043618a92..a43554c639 100644 --- a/lib/rlc/rlc_bearer_logger.h +++ b/lib/rlc/rlc_bearer_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/ran/gnb_du_id.h" diff --git a/lib/rlc/rlc_metrics_aggregator.cpp b/lib/rlc/rlc_metrics_aggregator.cpp index 54cada0545..25b4d6df30 100644 --- a/lib/rlc/rlc_metrics_aggregator.cpp +++ b/lib/rlc/rlc_metrics_aggregator.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "rlc_metrics_aggregator.h" using namespace srsran; diff --git a/lib/rlc/rlc_pdu_recycler.h b/lib/rlc/rlc_pdu_recycler.h index e9a1782104..4a2e9aa517 100644 --- a/lib/rlc/rlc_pdu_recycler.h +++ b/lib/rlc/rlc_pdu_recycler.h @@ -24,9 +24,9 @@ #include "rlc_bearer_logger.h" #include "srsran/adt/byte_buffer.h" +#include "srsran/adt/spsc_queue.h" #include "srsran/instrumentation/traces/up_traces.h" #include "srsran/support/executors/task_executor.h" -#include namespace srsran { @@ -39,32 +39,19 @@ class rlc_pdu_recycler public: rlc_pdu_recycler(size_t rlc_window_size, rlc_bearer_logger& logger_) : logger(logger_) { - for (std::vector& recycle_bin : recycle_bins) { - recycle_bin.reserve(rlc_window_size); - } + recycle_bin = std::make_unique>(rlc_window_size); } /// \brief Adds a discarded PDU to the recycler which shall be deleted later by another executor /// \param pdu The PDU that shall be deleted later /// \return True if the PDU was queued for later deletion; False if the PDU was deleted on the spot due to full queue. - bool add_discarded_pdu(byte_buffer pdu) - { - if (recycle_bin_to_fill->size() >= recycle_bin_to_fill->capacity()) { - // recycle bin is full; delete the PDUs upon return - return false; - } - recycle_bin_to_fill->push_back(std::move(pdu)); - return true; - } + bool add_discarded_pdu(byte_buffer pdu) { return recycle_bin->try_push(std::move(pdu)); } /// \brief Delegates the deletion of all stored PDUs to the given task_executor. void clear_by_executor(task_executor& executor) { - // Swap recycle bins under a lock - { - std::lock_guard recycle_bin_swap_lock(recycle_bin_swap_mutex); - std::swap(recycle_bin_to_fill, recycle_bin_to_swap); - } // Redirect recycling of unused byte_buffers to ue_executor auto handle_func = [this]() mutable { clear(); }; if (not executor.execute(std::move(handle_func))) { @@ -72,38 +59,32 @@ class rlc_pdu_recycler } } - /// \brief For unit-testing only: Expose inner recycle bins - /// \return Reference to inner recycle bins for testing purposes - std::array, 3>& get_recycle_bins() { return recycle_bins; } + /// \brief Get the pdu recycler queue. + /// Should only be used for testing + concurrent_queue& + get_recycle_queue() + { + return *recycle_bin; + } private: /// \brief Deletes the stored PDUs. This function shall be called from the executor in \c clear_by_executor. void clear() - { // swap recycle bins under a lock - trace_point clear_tp = up_tracer.now(); - { - std::lock_guard lock(recycle_bin_swap_mutex); - std::swap(recycle_bin_to_swap, recycle_bin_to_dump); + { + trace_point clear_tp = up_tracer.now(); + uint32_t queue_size = recycle_bin->size(); + for (uint32_t i = 0; i < queue_size; ++i) { + recycle_bin->try_pop(); } - // delete all PDUs to return their memory segments to the pool - recycle_bin_to_dump->clear(); up_tracer << trace_event{"rlc_clear_pdus", clear_tp}; } rlc_bearer_logger& logger; - /// Recycle bins for discarded PDUs - std::array, 3> recycle_bins; - - /// Pointer to an empty recycle bin that shall be filled with discarded PDUs by \c add_discarded_pdu. - std::vector* recycle_bin_to_fill = &recycle_bins[0]; - /// Pointer to a recycle bin that can be swapped with either the recycle_bin_to_fill or the recycle_bin_to_dump. - std::vector* recycle_bin_to_swap = &recycle_bins[1]; - /// Pointer to a recycle bin filled with PDUs that can be deleted (to return their memory segments to the pool). - std::vector* recycle_bin_to_dump = &recycle_bins[2]; - /// Mutex for swapping the recycle bins. - std::mutex recycle_bin_swap_mutex; + std::unique_ptr< + concurrent_queue> + recycle_bin; }; } // namespace srsran diff --git a/lib/rlc/rlc_um_pdu.h b/lib/rlc/rlc_um_pdu.h index ebd5ae4640..0f66947bd5 100644 --- a/lib/rlc/rlc_um_pdu.h +++ b/lib/rlc/rlc_um_pdu.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/adt/byte_buffer.h" diff --git a/lib/rrc/ue/rrc_measurement_types_asn1_converters.h b/lib/rrc/ue/rrc_measurement_types_asn1_converters.h index e56bad567f..975b46c6d1 100644 --- a/lib/rrc/ue/rrc_measurement_types_asn1_converters.h +++ b/lib/rrc/ue/rrc_measurement_types_asn1_converters.h @@ -29,7 +29,6 @@ #include "srsran/asn1/rrc_nr/ul_dcch_msg_ies.h" #include "srsran/ran/subcarrier_spacing.h" #include "srsran/rrc/meas_types.h" - #include #include diff --git a/lib/rrc/ue/rrc_ue_logger.h b/lib/rrc/ue/rrc_ue_logger.h index 3457478627..89c49fe091 100644 --- a/lib/rrc/ue/rrc_ue_logger.h +++ b/lib/rrc/ue/rrc_ue_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/cu_cp/cu_cp_types.h" diff --git a/lib/scheduler/common_scheduling/ra_scheduler.cpp b/lib/scheduler/common_scheduling/ra_scheduler.cpp index 612eababdf..846b97b422 100644 --- a/lib/scheduler/common_scheduling/ra_scheduler.cpp +++ b/lib/scheduler/common_scheduling/ra_scheduler.cpp @@ -244,6 +244,14 @@ void ra_scheduler::handle_rach_indication_impl(const rach_indication_message& ms const unsigned slot_idx = prach_format_is_long ? msg.slot_rx.subframe_index() : msg.slot_rx.slot_index(); const uint16_t ra_rnti = get_ra_rnti(slot_idx, prach_occ.start_symbol, prach_occ.frequency_index); + if (prach_occ.preambles.empty()) { + // As per FAPI, this should not occur. + logger.warning( + "ra-rnti={}: Discarding PRACH occasion. Cause: There are no preambles detected for this PRACH occasion", + ra_rnti); + continue; + } + pending_rar_t* rar_req = nullptr; for (pending_rar_t& rar : pending_rars) { if (to_value(rar.ra_rnti) == ra_rnti and rar.prach_slot_rx == msg.slot_rx) { @@ -495,6 +503,14 @@ void ra_scheduler::schedule_pending_rars(cell_resource_allocator& res_alloc, slo // RAR window hasn't started yet for this RAR. Given that the RARs are in order of slot, we can stop here. break; } + if (rar_req.tc_rntis.empty()) { + // This should never happen, unless there was some corruption of the queue. + logger.warning( + "ra-rnti={}: Discarding RAR scheduling request. Cause: There are no TC-RNTIs associated with this RAR", + rar_req.ra_rnti); + it = pending_rars.erase(it); + continue; + } // Try to schedule DCIs + RBGs for RAR Grants const size_t nof_allocs = schedule_rar(rar_req, res_alloc, pdcch_slot); diff --git a/lib/scheduler/config/serving_cell_config_factory.cpp b/lib/scheduler/config/serving_cell_config_factory.cpp index 6cf52115cd..ed91df21cc 100644 --- a/lib/scheduler/config/serving_cell_config_factory.cpp +++ b/lib/scheduler/config/serving_cell_config_factory.cpp @@ -32,7 +32,6 @@ #include "srsran/ran/resource_allocation/ofdm_symbol_range.h" #include "srsran/scheduler/config/csi_helper.h" #include "srsran/srslog/srslog.h" - #include #include diff --git a/lib/scheduler/config/ue_configuration.cpp b/lib/scheduler/config/ue_configuration.cpp index 216edab32e..9ae2b0bcf3 100644 --- a/lib/scheduler/config/ue_configuration.cpp +++ b/lib/scheduler/config/ue_configuration.cpp @@ -21,7 +21,6 @@ */ #include "ue_configuration.h" - #include "../support/pdcch/pdcch_mapping.h" #include "../support/pdsch/pdsch_default_time_allocation.h" #include "../support/pdsch/pdsch_resource_allocation.h" diff --git a/lib/scheduler/policy/scheduler_time_pf.cpp b/lib/scheduler/policy/scheduler_time_pf.cpp index af0c4fd1ef..1f93d332a3 100644 --- a/lib/scheduler/policy/scheduler_time_pf.cpp +++ b/lib/scheduler/policy/scheduler_time_pf.cpp @@ -25,6 +25,10 @@ using namespace srsran; +// [Implementation-defined] Limit for the coefficient of the proportional fair metric to avoid issues with double +// imprecision. +constexpr unsigned MAX_PF_COEFF = 10; + scheduler_time_pf::scheduler_time_pf(const scheduler_ue_expert_config& expert_cfg_) : fairness_coeff(std::get(expert_cfg_.strategy_cfg).pf_sched_fairness_coeff) { @@ -117,12 +121,10 @@ void scheduler_time_pf::dl_sched(ue_pdsch_allocator& pdsch_alloc, dl_alloc_result alloc_result = {alloc_status::invalid_params}; unsigned rem_rbs = slice_candidate.remaining_rbs(); - while (not dl_queue.empty() and rem_rbs > 0) { - ue_ctxt& ue = *dl_queue.top(); - if (alloc_result.status != alloc_status::skip_slot) { - alloc_result = try_dl_alloc(ue, ues, pdsch_alloc, rem_rbs); - } - ue.save_dl_alloc(alloc_result.alloc_bytes, alloc_result.tb_info, ues[ue.ue_index]); + while (not dl_queue.empty() and rem_rbs > 0 and alloc_result.status != alloc_status::skip_slot) { + ue_ctxt& ue = *dl_queue.top(); + alloc_result = try_dl_alloc(ue, ues, pdsch_alloc, rem_rbs); + ue.save_dl_alloc(alloc_result.alloc_bytes, alloc_result.tb_info); dl_queue.pop(); rem_rbs = slice_candidate.remaining_rbs(); } @@ -178,9 +180,6 @@ void scheduler_time_pf::ul_sched(ue_pusch_allocator& pusch_alloc, ul_ran_slice_candidate& slice_candidate, ul_harq_pending_retx_list harq_pending_retx_list) { - // Clear the existing contents of the queue. - ul_queue.clear(); - const slice_ue_repository& ues = slice_candidate.get_slice_ues(); // Remove deleted users from history. for (auto it = ue_history_db.begin(); it != ue_history_db.end();) { @@ -203,6 +202,8 @@ void scheduler_time_pf::ul_sched(ue_pusch_allocator& pusch_alloc, return; } + // Clear the existing contents of the queue. + ul_queue.clear(); for (const auto& u : ues) { ue_ctxt& ctxt = ue_history_db[u.ue_index()]; ctxt.compute_ul_prio( @@ -212,11 +213,9 @@ void scheduler_time_pf::ul_sched(ue_pusch_allocator& pusch_alloc, ul_alloc_result alloc_result = {alloc_status::invalid_params}; unsigned rem_rbs = slice_candidate.remaining_rbs(); - while (not ul_queue.empty() and rem_rbs > 0) { - ue_ctxt& ue = *ul_queue.top(); - if (alloc_result.status != alloc_status::skip_slot) { - alloc_result = try_ul_alloc(ue, ues, pusch_alloc, rem_rbs); - } + while (not ul_queue.empty() and rem_rbs > 0 and alloc_result.status != alloc_status::skip_slot) { + ue_ctxt& ue = *ul_queue.top(); + alloc_result = try_ul_alloc(ue, ues, pusch_alloc, rem_rbs); ue.save_ul_alloc(alloc_result.alloc_bytes); ul_queue.pop(); rem_rbs = slice_candidate.remaining_rbs(); @@ -231,18 +230,14 @@ dl_alloc_result scheduler_time_pf::try_dl_alloc(ue_ctxt& ctxt, dl_alloc_result alloc_result = {alloc_status::invalid_params}; ue_pdsch_grant grant{&ues[ctxt.ue_index], ctxt.cell_index}; - if (ctxt.has_empty_dl_harq) { - grant.h_id = INVALID_HARQ_ID; - grant.recommended_nof_bytes = ues[ctxt.ue_index].pending_dl_newtx_bytes(); - grant.max_nof_rbs = max_rbs; - alloc_result = pdsch_alloc.allocate_dl_grant(grant); - if (alloc_result.status == alloc_status::success) { - ctxt.has_empty_dl_harq = false; - } - return alloc_result; + grant.h_id = INVALID_HARQ_ID; + grant.recommended_nof_bytes = ues[ctxt.ue_index].pending_dl_newtx_bytes(); + grant.max_nof_rbs = max_rbs; + alloc_result = pdsch_alloc.allocate_dl_grant(grant); + if (alloc_result.status == alloc_status::success) { + ctxt.dl_prio = forbid_prio; } - - return {alloc_status::skip_ue}; + return alloc_result; } ul_alloc_result scheduler_time_pf::try_ul_alloc(ue_ctxt& ctxt, @@ -253,18 +248,14 @@ ul_alloc_result scheduler_time_pf::try_ul_alloc(ue_ctxt& ctxt, ul_alloc_result alloc_result = {alloc_status::invalid_params}; ue_pusch_grant grant{&ues[ctxt.ue_index], ctxt.cell_index}; - if (ctxt.has_empty_ul_harq) { - grant.h_id = INVALID_HARQ_ID; - grant.recommended_nof_bytes = ues[ctxt.ue_index].pending_ul_newtx_bytes(); - grant.max_nof_rbs = max_rbs; - alloc_result = pusch_alloc.allocate_ul_grant(grant); - if (alloc_result.status == alloc_status::success) { - ctxt.has_empty_ul_harq = false; - } - return alloc_result; + grant.h_id = INVALID_HARQ_ID; + grant.recommended_nof_bytes = ues[ctxt.ue_index].pending_ul_newtx_bytes(); + grant.max_nof_rbs = max_rbs; + alloc_result = pusch_alloc.allocate_ul_grant(grant); + if (alloc_result.status == alloc_status::success) { + ctxt.ul_prio = forbid_prio; } - - return {alloc_status::skip_ue}; + return alloc_result; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -339,8 +330,11 @@ void scheduler_time_pf::ue_ctxt::compute_dl_prio(const slice_ue& u, slot_point pdcch_slot, slot_point pdsch_slot) { - has_empty_dl_harq = false; - dl_prio = 0; + dl_prio = forbid_prio; + + // Process previous slot allocated bytes and compute average. + compute_dl_avg_rate(u); + const ue_cell* ue_cc = u.find_cell(cell_index); if (ue_cc == nullptr) { return; @@ -352,61 +346,63 @@ void scheduler_time_pf::ue_ctxt::compute_dl_prio(const slice_ue& u, // Cannot allocate PDCCH/PDSCH for this UE in this slot. return; } + if (not ue_cc->harqs.has_empty_dl_harqs() or not u.has_pending_dl_newtx_bytes()) { + // No available HARQs or no pending data. + return; + } - // Calculate DL priority. - has_empty_dl_harq = ue_cc->harqs.has_empty_dl_harqs(); - if (has_empty_dl_harq and u.has_pending_dl_newtx_bytes()) { - // NOTE: It does not matter whether it's a reTx or newTx since DL priority is computed based on estimated - // instantaneous achievable rate to the average throughput of the user. - // [Implementation-defined] We consider only the SearchSpace defined in UE dedicated configuration. - const auto* ss_info = ue_cc->cfg().find_search_space( - ue_cc->cfg().cfg_dedicated().init_dl_bwp.pdcch_cfg->search_spaces.back().get_id()); - if (ss_info == nullptr) { - return; - } - span pdsch_td_res_list = ss_info->pdsch_time_domain_list; - // [Implementation-defined] We pick the first element since PDSCH time domain resource list is sorted in descending - // order of nof. PDSCH symbols. And, we want to calculate estimate of instantaneous achievable rate with maximum - // nof. PDSCH symbols. - const pdsch_time_domain_resource_allocation& pdsch_td_cfg = pdsch_td_res_list.front(); - - pdsch_config_params pdsch_cfg; - switch (ss_info->get_dl_dci_format()) { - case dci_dl_format::f1_0: - pdsch_cfg = get_pdsch_config_f1_0_c_rnti(ue_cc->cfg().cell_cfg_common, &ue_cc->cfg(), pdsch_td_cfg); - break; - case dci_dl_format::f1_1: - pdsch_cfg = get_pdsch_config_f1_1_c_rnti( - ue_cc->cfg(), pdsch_td_cfg, ue_cc->channel_state_manager().get_nof_dl_layers()); - break; - default: - report_fatal_error("Unsupported PDCCH DCI DL format"); - } + // [Implementation-defined] We consider only the SearchSpace defined in UE dedicated configuration. + const auto* ss_info = + ue_cc->cfg().find_search_space(ue_cc->cfg().cfg_dedicated().init_dl_bwp.pdcch_cfg->search_spaces.back().get_id()); + if (ss_info == nullptr) { + return; + } + span pdsch_td_res_list = ss_info->pdsch_time_domain_list; + // [Implementation-defined] We pick the first element since PDSCH time domain resource list is sorted in descending + // order of nof. PDSCH symbols. And, we want to calculate estimate of instantaneous achievable rate with maximum + // nof. PDSCH symbols. + const pdsch_time_domain_resource_allocation& pdsch_td_cfg = pdsch_td_res_list.front(); + + pdsch_config_params pdsch_cfg; + switch (ss_info->get_dl_dci_format()) { + case dci_dl_format::f1_0: + pdsch_cfg = get_pdsch_config_f1_0_c_rnti(ue_cc->cfg().cell_cfg_common, &ue_cc->cfg(), pdsch_td_cfg); + break; + case dci_dl_format::f1_1: + pdsch_cfg = + get_pdsch_config_f1_1_c_rnti(ue_cc->cfg(), pdsch_td_cfg, ue_cc->channel_state_manager().get_nof_dl_layers()); + break; + default: + report_fatal_error("Unsupported PDCCH DCI DL format"); + } - std::optional mcs = ue_cc->link_adaptation_controller().calculate_dl_mcs(pdsch_cfg.mcs_table); - if (not mcs.has_value()) { - // CQI is either 0, or > 15. - has_empty_dl_harq = false; - return; - } + std::optional mcs = ue_cc->link_adaptation_controller().calculate_dl_mcs(pdsch_cfg.mcs_table); + if (not mcs.has_value()) { + // CQI is either 0 or above 15, which means no DL. + return; + } - // Calculate DL PF priority. - // NOTE: Estimated instantaneous DL rate is calculated assuming entire BWP CRBs are allocated to UE. - const double estimated_rate = ue_cc->get_estimated_dl_rate(pdsch_cfg, mcs.value(), ss_info->dl_crb_lims.length()); - const double current_total_avg_rate = total_dl_avg_rate(); - double pf_weight = 0; - if (current_total_avg_rate != 0) { - pf_weight = estimated_rate / pow(current_total_avg_rate, parent->fairness_coeff); + // Calculate DL PF priority. + // NOTE: Estimated instantaneous DL rate is calculated assuming entire BWP CRBs are allocated to UE. + const double estimated_rate = ue_cc->get_estimated_dl_rate(pdsch_cfg, mcs.value(), ss_info->dl_crb_lims.length()); + const double current_total_avg_rate = total_dl_avg_rate(); + double pf_weight = 0; + if (current_total_avg_rate != 0) { + if (parent->fairness_coeff >= MAX_PF_COEFF) { + // For very high coefficients, the pow(.) will be very high, leading to pf_weight of 0 due to lack of precision. + // In such scenarios, we change the way to compute the PF weight. Instead, we completely disregard the estimated + // rate, as its impact is minimal. + pf_weight = 1 / current_total_avg_rate; } else { - pf_weight = estimated_rate == 0 ? 0 : std::numeric_limits::max(); + pf_weight = estimated_rate / pow(current_total_avg_rate, parent->fairness_coeff); } - const double rate_weight = compute_dl_rate_weight( - u, dl_avg_rate_per_lc, ue_cc->cfg().cell_cfg_common.dl_cfg_common.init_dl_bwp.generic_params.scs); - dl_prio = rate_weight * pf_weight; - - return; + } else { + // Give the highest priority to new UE. + pf_weight = estimated_rate == 0 ? 0 : std::numeric_limits::max(); } - has_empty_dl_harq = false; + const double rate_weight = compute_dl_rate_weight( + u, dl_avg_rate_per_lc, ue_cc->cfg().cell_cfg_common.dl_cfg_common.init_dl_bwp.generic_params.scs); + dl_prio = rate_weight * pf_weight; } void scheduler_time_pf::ue_ctxt::compute_ul_prio(const slice_ue& u, @@ -414,9 +410,11 @@ void scheduler_time_pf::ue_ctxt::compute_ul_prio(const slice_ue& u, slot_point pdcch_slot, slot_point pusch_slot) { - has_empty_ul_harq = false; - ul_prio = 0; - sr_ind_received = false; + ul_prio = forbid_prio; + + // Process bytes allocated in previous slot and compute average. + compute_ul_avg_rate(); + const ue_cell* ue_cc = u.find_cell(cell_index); if (ue_cc == nullptr) { return; @@ -428,121 +426,160 @@ void scheduler_time_pf::ue_ctxt::compute_ul_prio(const slice_ue& u, // Cannot allocate PDCCH/PUSCH for this UE in the provided slots. return; } + if (not ue_cc->harqs.has_empty_ul_harqs()) { + // No HARQs for newTxs. + return; + } - // Calculate UL priority. - has_empty_ul_harq = ue_cc->harqs.has_empty_ul_harqs(); - sr_ind_received = u.has_pending_sr(); - if (has_empty_ul_harq and u.pending_ul_newtx_bytes() > 0) { - // NOTE: It does not matter whether it's a reTx or newTx since UL priority is computed based on estimated - // instantaneous achievable rate to the average throughput of the user. - // [Implementation-defined] We consider only the SearchSpace defined in UE dedicated configuration. - const auto* ss_info = ue_cc->cfg().find_search_space( - ue_cc->cfg().cfg_dedicated().init_dl_bwp.pdcch_cfg->search_spaces.back().get_id()); - if (ss_info == nullptr) { - return; - } - span pusch_td_res_list = ss_info->pusch_time_domain_list; - // [Implementation-defined] We pick the first element since PUSCH time domain resource list is sorted in descending - // order of nof. PUSCH symbols. And, we want to calculate estimate of instantaneous achievable rate with maximum - // nof. PUSCH symbols. - const pusch_time_domain_resource_allocation& pusch_td_cfg = pusch_td_res_list.front(); - // [Implementation-defined] We assume nof. HARQ ACK bits is zero at PUSCH slot as a simplification in calculating - // estimated instantaneous achievable rate. - constexpr unsigned nof_harq_ack_bits = 0; - const bool is_csi_report_slot = csi_helper::is_csi_reporting_slot(u.get_pcell().cfg().cfg_dedicated(), pusch_slot); - - pusch_config_params pusch_cfg; - switch (ss_info->get_ul_dci_format()) { - case dci_ul_format::f0_0: - pusch_cfg = get_pusch_config_f0_0_c_rnti(ue_cc->cfg().cell_cfg_common, - &ue_cc->cfg(), - ue_cc->cfg().cell_cfg_common.ul_cfg_common.init_ul_bwp, - pusch_td_cfg, - nof_harq_ack_bits, - is_csi_report_slot); - break; - case dci_ul_format::f0_1: - pusch_cfg = get_pusch_config_f0_1_c_rnti(ue_cc->cfg(), - pusch_td_cfg, - ue_cc->channel_state_manager().get_nof_ul_layers(), - nof_harq_ack_bits, - is_csi_report_slot); - break; - default: - report_fatal_error("Unsupported PDCCH DCI UL format"); - } + if (u.pending_ul_newtx_bytes() == 0) { + // No new bytes to allocate. + return; + } - sch_mcs_index mcs = ue_cc->link_adaptation_controller().calculate_ul_mcs(pusch_cfg.mcs_table); + // [Implementation-defined] We consider only the SearchSpace defined in UE dedicated configuration. + const auto* ss_info = + ue_cc->cfg().find_search_space(ue_cc->cfg().cfg_dedicated().init_dl_bwp.pdcch_cfg->search_spaces.back().get_id()); + if (ss_info == nullptr) { + return; + } - // Calculate UL PF priority. - // NOTE: Estimated instantaneous UL rate is calculated assuming entire BWP CRBs are allocated to UE. - const double estimated_rate = ue_cc->get_estimated_ul_rate(pusch_cfg, mcs.value(), ss_info->ul_crb_lims.length()); - const double current_avg_rate = total_ul_avg_rate(); - double pf_weight = 0; - if (current_avg_rate != 0) { - pf_weight = estimated_rate / pow(current_avg_rate, parent->fairness_coeff); + span pusch_td_res_list = ss_info->pusch_time_domain_list; + // [Implementation-defined] We pick the first element since PUSCH time domain resource list is sorted in descending + // order of nof. PUSCH symbols. And, we want to calculate estimate of instantaneous achievable rate with maximum + // nof. PUSCH symbols. + const pusch_time_domain_resource_allocation& pusch_td_cfg = pusch_td_res_list.front(); + // [Implementation-defined] We assume nof. HARQ ACK bits is zero at PUSCH slot as a simplification in calculating + // estimated instantaneous achievable rate. + constexpr unsigned nof_harq_ack_bits = 0; + const bool is_csi_report_slot = csi_helper::is_csi_reporting_slot(u.get_pcell().cfg().cfg_dedicated(), pusch_slot); + + pusch_config_params pusch_cfg; + switch (ss_info->get_ul_dci_format()) { + case dci_ul_format::f0_0: + pusch_cfg = get_pusch_config_f0_0_c_rnti(ue_cc->cfg().cell_cfg_common, + &ue_cc->cfg(), + ue_cc->cfg().cell_cfg_common.ul_cfg_common.init_ul_bwp, + pusch_td_cfg, + nof_harq_ack_bits, + is_csi_report_slot); + break; + case dci_ul_format::f0_1: + pusch_cfg = get_pusch_config_f0_1_c_rnti(ue_cc->cfg(), + pusch_td_cfg, + ue_cc->channel_state_manager().get_nof_ul_layers(), + nof_harq_ack_bits, + is_csi_report_slot); + break; + default: + report_fatal_error("Unsupported PDCCH DCI UL format"); + } + + sch_mcs_index mcs = ue_cc->link_adaptation_controller().calculate_ul_mcs(pusch_cfg.mcs_table); + + // Calculate UL PF priority. + // NOTE: Estimated instantaneous UL rate is calculated assuming entire BWP CRBs are allocated to UE. + const double estimated_rate = ue_cc->get_estimated_ul_rate(pusch_cfg, mcs.value(), ss_info->ul_crb_lims.length()); + const double current_avg_rate = total_ul_avg_rate(); + double pf_weight = 0; + if (current_avg_rate != 0) { + if (parent->fairness_coeff >= MAX_PF_COEFF) { + // For very high coefficients, the pow(.) will be very high, leading to pf_weight of 0 due to lack of precision. + // In such scenarios, we change the way to compute the PF weight. Instead, we completely disregard the estimated + // rate, as its impact is minimal. + pf_weight = 1 / current_avg_rate; } else { - pf_weight = estimated_rate == 0 ? 0 : std::numeric_limits::max(); + pf_weight = estimated_rate / pow(current_avg_rate, parent->fairness_coeff); } - const double rate_weight = compute_ul_rate_weight( - u, current_avg_rate, ue_cc->cfg().cell_cfg_common.ul_cfg_common.init_ul_bwp.generic_params.scs); - ul_prio = rate_weight * pf_weight; - - return; + } else { + pf_weight = estimated_rate == 0 ? 0 : std::numeric_limits::max(); } - has_empty_ul_harq = false; + const double rate_weight = compute_ul_rate_weight( + u, current_avg_rate, ue_cc->cfg().cell_cfg_common.ul_cfg_common.init_ul_bwp.generic_params.scs); + ul_prio = rate_weight * pf_weight; + sr_ind_received = u.has_pending_sr(); } -void scheduler_time_pf::ue_ctxt::save_dl_alloc(uint32_t total_alloc_bytes, - const dl_msg_tb_info& tb_info, - const slice_ue& u) +void scheduler_time_pf::ue_ctxt::compute_dl_avg_rate(const slice_ue& u) { - span drbs_qos_info = u.get_drbs_qos_info(); - // [Implementation-defined] DL average rate is computed only for DRBs. + // Redimension LCID arrays to the UE configured bearers. + dl_alloc_bytes_per_lc.resize(u.get_bearers().size(), 0); + dl_avg_rate_per_lc.resize(dl_alloc_bytes_per_lc.size(), 0); + // Compute DL average rate on a per-logical channel basis. - for (const sched_drb_info& drb_qos_info : drbs_qos_info) { - lcid_t lcid = drb_qos_info.lcid; - if (not u.contains(lcid)) { - // Skip if LC does not belong to this slice. - continue; - } - const auto* it = std::find_if(tb_info.lc_chs_to_sched.begin(), - tb_info.lc_chs_to_sched.end(), - [lcid](const dl_msg_lc_info& lc_info) { return lc_info.lcid == lcid; }); - // [Implementation-defined] If a DRB is not scheduled then we consider nof. scheduled bytes for that LCID to be 0. - unsigned sched_bytes = 0; - if (it != tb_info.lc_chs_to_sched.end()) { - sched_bytes = it->sched_bytes; + for (unsigned i = 0; i != dl_alloc_bytes_per_lc.size(); ++i) { + if (not u.contains(uint_to_lcid(i))) { + // Skip LCIDs that are not configured. + dl_alloc_bytes_per_lc[i] = 0; + dl_avg_rate_per_lc[i] = 0; } + + unsigned sched_bytes = dl_alloc_bytes_per_lc[i]; + if (dl_nof_samples < 1 / parent->exp_avg_alpha) { // Fast start before transitioning to exponential average. - dl_avg_rate_per_lc[lcid] = - dl_avg_rate_per_lc[lcid] + (sched_bytes - dl_avg_rate_per_lc[lcid]) / (dl_nof_samples + 1); + dl_avg_rate_per_lc[i] += (sched_bytes - dl_avg_rate_per_lc[i]) / (dl_nof_samples + 1); } else { - dl_avg_rate_per_lc[lcid] = - (1 - parent->exp_avg_alpha) * dl_avg_rate_per_lc[lcid] + (parent->exp_avg_alpha) * sched_bytes; + dl_avg_rate_per_lc[i] = + (1 - parent->exp_avg_alpha) * dl_avg_rate_per_lc[i] + (parent->exp_avg_alpha) * sched_bytes; } + + // Flush allocated bytes for the current slot. + dl_alloc_bytes_per_lc[i] = 0; } // Compute DL average rate of the UE. if (dl_nof_samples < 1 / parent->exp_avg_alpha) { // Fast start before transitioning to exponential average. - total_dl_avg_rate_ = total_dl_avg_rate_ + (total_alloc_bytes - total_dl_avg_rate_) / (dl_nof_samples + 1); + total_dl_avg_rate_ = total_dl_avg_rate_ + (dl_sum_alloc_bytes - total_dl_avg_rate_) / (dl_nof_samples + 1); } else { - total_dl_avg_rate_ = (1 - parent->exp_avg_alpha) * total_dl_avg_rate_ + (parent->exp_avg_alpha) * total_alloc_bytes; + total_dl_avg_rate_ = + (1 - parent->exp_avg_alpha) * total_dl_avg_rate_ + (parent->exp_avg_alpha) * dl_sum_alloc_bytes; } + + // Flush allocated bytes for the current slot. + dl_sum_alloc_bytes = 0; + + // Increment number of samples. dl_nof_samples++; } -void scheduler_time_pf::ue_ctxt::save_ul_alloc(uint32_t alloc_bytes) +void scheduler_time_pf::ue_ctxt::compute_ul_avg_rate() { if (ul_nof_samples < 1 / parent->exp_avg_alpha) { // Fast start before transitioning to exponential average. - total_ul_avg_rate_ = total_ul_avg_rate_ + (alloc_bytes - total_ul_avg_rate_) / (ul_nof_samples + 1); + total_ul_avg_rate_ = total_ul_avg_rate_ + (ul_sum_alloc_bytes - total_ul_avg_rate_) / (ul_nof_samples + 1); } else { - total_ul_avg_rate_ = (1 - parent->exp_avg_alpha) * total_ul_avg_rate_ + (parent->exp_avg_alpha) * alloc_bytes; + total_ul_avg_rate_ = + (1 - parent->exp_avg_alpha) * total_ul_avg_rate_ + (parent->exp_avg_alpha) * ul_sum_alloc_bytes; } + + // Increment number of samples. ul_nof_samples++; + + // Flush allocated bytes for the current slot. + ul_sum_alloc_bytes = 0; +} + +void scheduler_time_pf::ue_ctxt::save_dl_alloc(uint32_t total_alloc_bytes, const dl_msg_tb_info& tb_info) +{ + for (const auto& tb : tb_info.lc_chs_to_sched) { + if (not tb.lcid.is_sdu()) { + // Ignore CEs. + continue; + } + const lcid_t lcid = tb.lcid.to_lcid(); + if (lcid >= dl_alloc_bytes_per_lc.size()) { + // It can happen that an LCID of another slice can be added to a given grant. + continue; + } + dl_alloc_bytes_per_lc[lcid] += tb.sched_bytes; + } + dl_sum_alloc_bytes += total_alloc_bytes; +} + +void scheduler_time_pf::ue_ctxt::save_ul_alloc(uint32_t alloc_bytes) +{ + ul_sum_alloc_bytes += alloc_bytes; } bool scheduler_time_pf::ue_dl_prio_compare::operator()(const scheduler_time_pf::ue_ctxt* lhs, diff --git a/lib/scheduler/policy/scheduler_time_pf.h b/lib/scheduler/policy/scheduler_time_pf.h index f28a937140..4d0a15abe4 100644 --- a/lib/scheduler/policy/scheduler_time_pf.h +++ b/lib/scheduler/policy/scheduler_time_pf.h @@ -43,6 +43,9 @@ class scheduler_time_pf : public scheduler_policy ul_harq_pending_retx_list harq_pending_retx_list) override; private: + // Value used to flag that the UE cannot be allocated in a given slot. + static constexpr double forbid_prio = std::numeric_limits::lowest(); + /// Fairness parameters. /// Coefficient used to tweak decision in favor of fairness or throughput. const double fairness_coeff; @@ -67,7 +70,7 @@ class scheduler_time_pf : public scheduler_policy /// Computes the priority of the UE to be scheduled in UL based on the proportional fair metric. void compute_ul_prio(const slice_ue& u, ran_slice_id_t slice_id, slot_point pdcch_slot, slot_point pusch_slot); - void save_dl_alloc(uint32_t total_alloc_bytes, const dl_msg_tb_info& tb_info, const slice_ue& u); + void save_dl_alloc(uint32_t total_alloc_bytes, const dl_msg_tb_info& tb_info); void save_ul_alloc(uint32_t alloc_bytes); const du_ue_index_t ue_index; @@ -75,25 +78,31 @@ class scheduler_time_pf : public scheduler_policy const scheduler_time_pf* parent; /// DL priority value of the UE. - double dl_prio = 0; + double dl_prio = forbid_prio; /// UL priority value of the UE. - double ul_prio = 0; + double ul_prio = forbid_prio; - bool has_empty_dl_harq = false; - bool has_empty_ul_harq = false; /// Flag indicating whether SR indication from the UE is received or not. bool sr_ind_received = false; private: - /// Average DL rate expressed in bytes per slot experienced by UE in each of its logical channel. + void compute_dl_avg_rate(const slice_ue& u); + void compute_ul_avg_rate(); + + // Sum of DL bytes allocated for a given slot, before it is taken into account in the average rate computation. + static_vector dl_alloc_bytes_per_lc; + unsigned dl_sum_alloc_bytes = 0; + // Sum of UL bytes allocated for a given slot, before it is taken into account in the average rate computation. + unsigned ul_sum_alloc_bytes = 0; + // Average DL rate expressed in bytes per slot experienced by UE in each of its logical channel. static_vector dl_avg_rate_per_lc; - /// Average DL rate expressed in bytes per slot experienced by UE. + // Average DL rate expressed in bytes per slot experienced by UE. double total_dl_avg_rate_ = 0; - /// Average UL rate expressed in bytes per slot experienced by UE. + // Average UL rate expressed in bytes per slot experienced by UE. double total_ul_avg_rate_ = 0; - /// Nof. DL samples over which average DL bitrate is computed. + // Nof. DL samples over which average DL bitrate is computed. uint32_t dl_nof_samples = 0; - /// Nof. UL samples over which average DL bitrate is computed. + // Nof. UL samples over which average DL bitrate is computed. uint32_t ul_nof_samples = 0; }; @@ -142,7 +151,7 @@ class scheduler_time_pf : public scheduler_policy // Adapter of the priority_queue push method to avoid adding candidates with skip priority level. void push(ue_ctxt* elem) { - if (not elem->has_empty_dl_harq) { + if (elem->dl_prio == forbid_prio) { return; } base_type::push(elem); @@ -167,7 +176,7 @@ class scheduler_time_pf : public scheduler_policy // Adapter of the priority_queue push method to avoid adding candidates with skip priority level. void push(ue_ctxt* elem) { - if (not elem->has_empty_ul_harq) { + if (elem->ul_prio == forbid_prio) { return; } base_type::push(elem); diff --git a/lib/scheduler/support/dci_builder.cpp b/lib/scheduler/support/dci_builder.cpp index 5f5e1dfd1f..92f647001d 100644 --- a/lib/scheduler/support/dci_builder.cpp +++ b/lib/scheduler/support/dci_builder.cpp @@ -28,7 +28,6 @@ #include "srsran/ran/pusch/pusch_antenna_ports_mapping.h" #include "srsran/ran/pusch/pusch_configuration.h" #include "srsran/scheduler/config/bwp_configuration.h" - #include using namespace srsran; diff --git a/lib/sdap/sdap_session_logger.h b/lib/sdap/sdap_session_logger.h index b8dee79110..7f478775b0 100644 --- a/lib/sdap/sdap_session_logger.h +++ b/lib/sdap/sdap_session_logger.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/ran/cu_types.h" diff --git a/lib/srsvec/accumulate.cpp b/lib/srsvec/accumulate.cpp index fe076a6bb9..1e8e32db95 100644 --- a/lib/srsvec/accumulate.cpp +++ b/lib/srsvec/accumulate.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "srsran/srsvec/accumulate.h" #include "srsran/srsvec/simd.h" #include "srsran/support/srsran_assert.h" diff --git a/lib/support/byte_buffer.cpp b/lib/support/byte_buffer.cpp index 37654c5c66..0941d8333f 100644 --- a/lib/support/byte_buffer.cpp +++ b/lib/support/byte_buffer.cpp @@ -27,9 +27,12 @@ using namespace srsran; +static constexpr size_t default_pool_nof_segments = 16384; +static constexpr size_t default_segment_size = 2048; + size_t srsran::byte_buffer_segment_pool_default_segment_size() { - return 2048; + return default_segment_size; } /// Get default byte buffer segment pool. Initialize pool if not initialized before. @@ -37,9 +40,7 @@ detail::byte_buffer_segment_pool& srsran::detail::get_default_byte_buffer_segmen { // Initialize byte buffer segment pool, if not yet initialized. // Note: In case of unit tests, this function will be called rather than init_byte_buffer_segment_pool(...). - static constexpr size_t default_byte_buffer_segment_pool_size = 16384; - static auto& pool = detail::byte_buffer_segment_pool::get_instance(default_byte_buffer_segment_pool_size, - byte_buffer_segment_pool_default_segment_size()); + static auto& pool = detail::byte_buffer_segment_pool::get_instance(default_pool_nof_segments, default_segment_size); return pool; } @@ -65,17 +66,121 @@ size_t srsran::get_byte_buffer_segment_pool_current_size_approx() return pool.get_central_cache_approx_size() + pool.get_local_cache_size(); } +// ------ memory resource ------- + +namespace { + +/// Warn when the default segment pool is depleted. +void byte_buffer_warn_alloc_failure() +{ + static srslog::basic_logger& logger = srslog::fetch_basic_logger("ALL"); + logger.warning("POOL: Failure to allocate byte buffer segment"); +} + +/// Memory resource wrapper of the default byte buffer segment pool. +class default_segment_pool_memory_resource final : public byte_buffer_memory_resource +{ +public: + default_segment_pool_memory_resource(bool log_on_failure_) : + log_on_failure(log_on_failure_), default_pool(detail::get_default_byte_buffer_segment_pool()) + { + } + + bool owns_segment(void* block) const { return default_pool.owns_segment(block); } + +private: + span do_allocate(size_t /* unused */, size_t /* unused */) override + { + // Fetch default pool. + const size_t block_size = default_pool.memory_block_size(); + + // Allocate new block. + void* mem_block = default_pool.allocate_node(block_size); + if (SRSRAN_LIKELY(mem_block != nullptr)) { + // Allocation from pool was successful. + return {static_cast(mem_block), block_size}; + } + + // Pool is depleted. + if (log_on_failure) { + byte_buffer_warn_alloc_failure(); + } + return {}; + } + + void do_deallocate(void* block) override + { + // Return block back to the pool. + default_pool.deallocate_node(block); + } + + bool do_is_equal(const byte_buffer_memory_resource& other) const noexcept override { return this == &other; } + + const bool log_on_failure; + detail::byte_buffer_segment_pool& default_pool; +}; + +/// \brief Memory resource wrapper of the default byte buffer segment pool, but that on pool depletion, performs as +/// a fallback an allocation on the heap with operator new. +class default_fallback_segment_pool_memory_resource final : public byte_buffer_memory_resource +{ +public: + default_fallback_segment_pool_memory_resource() : pool(false) {} + + span do_allocate(size_t recommended_bytes, size_t alignment) override + { + // Allocate using the default segment pool. + span block = pool.allocate(recommended_bytes, alignment); + + if (block.empty()) { + // Allocation failed. Resort to the heap as fallback. + void* heap_block = new uint8_t[recommended_bytes]; + return {static_cast(heap_block), recommended_bytes}; + } + + return block; + } + + void do_deallocate(void* block) override + { + if (pool.owns_segment(block)) { + // The block comes from the default byte buffer pool. + pool.deallocate(block); + return; + } + + // The block comes from the heap. + delete[] static_cast(block); + } + + bool do_is_equal(const byte_buffer_memory_resource& other) const noexcept override { return this == &other; } + +private: + default_segment_pool_memory_resource pool; +}; + +} // namespace + +byte_buffer_memory_resource& srsran::get_default_byte_buffer_segment_pool() +{ + static default_segment_pool_memory_resource default_mem_resource{true}; + return default_mem_resource; +} + +byte_buffer_memory_resource& srsran::get_default_fallback_byte_buffer_segment_pool() +{ + static default_fallback_segment_pool_memory_resource default_fallback_mem_resource; + return default_fallback_mem_resource; +} + // ------- byte_buffer class ------- void byte_buffer::control_block::destroy_node(node_t* node) const { + void* block = node; node->~node_t(); if (node != segment_in_cb_memory_block) { - if (not this->malloc_fallback or detail::byte_buffer_segment_pool::get_instance().owns_segment(node)) { - detail::byte_buffer_segment_pool::get_instance().deallocate_node(node); - } else { - delete[] reinterpret_cast(node); - } + segment_pool->deallocate(block); } } @@ -90,26 +195,44 @@ byte_buffer::control_block::~control_block() void byte_buffer::control_block::destroy_cb() { - bool pool_used = not this->malloc_fallback or detail::byte_buffer_segment_pool::get_instance().owns_segment(this); + void* block = this; + byte_buffer_memory_resource* pool = this->segment_pool; this->~control_block(); - if (pool_used) { - detail::get_default_byte_buffer_segment_pool().deallocate_node(this); - } else { - delete[] reinterpret_cast(this); - } + pool->deallocate(block); } // ----- byte_buffer ----- -byte_buffer::byte_buffer(fallback_allocation_tag tag, span other) noexcept +expected byte_buffer::create(byte_buffer_memory_resource& segment_pool) { - // Append new head segment to linked list with fallback allocator mode. - node_t* n = add_head_segment(DEFAULT_FIRST_SEGMENT_HEADROOM, true); - srsran_sanity_check(n != nullptr, "Should never fail to append segment if fallback is enabled"); + byte_buffer result; + if (not result.default_construct_unsafe(segment_pool, + default_segment_size - sizeof(control_block) - sizeof(node_t))) { + return make_unexpected(default_error_t{}); + } + return result; +} + +expected byte_buffer::create(span bytes, byte_buffer_memory_resource& segment_pool) +{ + byte_buffer result; + if (not result.append(bytes, segment_pool)) { + return make_unexpected(default_error_t{}); + } + return result; +} + +expected byte_buffer::create(const std::initializer_list& lst, byte_buffer_memory_resource& pool) +{ + return create(span(lst.begin(), lst.size()), pool); +} - bool var = this->append(other); - srsran_sanity_check(var, "Should never fail to append segment if fallback is enabled"); - (void)var; +byte_buffer::byte_buffer(fallback_allocation_tag /* unused */, span other) noexcept +{ + // Create new byte buffer with default_fallback_pool. + // Note: We can retrieve the value() directly as the default fallback pool is supposed to never fail. + bool ret = append(other, get_default_fallback_byte_buffer_segment_pool()); + srsran_sanity_check(ret, "Should never fail to append segment if fallback is enabled"); } byte_buffer::byte_buffer(fallback_allocation_tag tag, const std::initializer_list& other) noexcept : @@ -117,10 +240,12 @@ byte_buffer::byte_buffer(fallback_allocation_tag tag, const std::initializer_lis { } -byte_buffer::byte_buffer(fallback_allocation_tag tag, const byte_buffer& other) noexcept +byte_buffer::byte_buffer(fallback_allocation_tag /* unused */, const byte_buffer& other) noexcept { // Append new head segment to linked list with fallback allocator mode. - node_t* n = add_head_segment(DEFAULT_FIRST_SEGMENT_HEADROOM, true); + node_t* n = add_head_segment(DEFAULT_FIRST_SEGMENT_HEADROOM, + get_default_fallback_byte_buffer_segment_pool(), + other.length() + DEFAULT_FIRST_SEGMENT_HEADROOM); srsran_sanity_check(n != nullptr, "Should never fail to append segment if fallback is enabled"); for (span seg : other.segments()) { @@ -152,27 +277,7 @@ expected byte_buffer::deep_copy(fallback_allocation_tag tag) const bool byte_buffer::append(span bytes) { - if (bytes.empty()) { - // no bytes to append. - return true; - } - if (not has_ctrl_block() and not append_segment(DEFAULT_FIRST_SEGMENT_HEADROOM)) { - // failed to allocate head segment. - return false; - } - - // segment-wise copy. - for (size_t count = 0; count < bytes.size();) { - if (ctrl_blk_ptr->segments.tail->tailroom() == 0 and not append_segment(0)) { - return false; - } - size_t to_write = std::min(ctrl_blk_ptr->segments.tail->tailroom(), bytes.size() - count); - span subspan = bytes.subspan(count, to_write); - ctrl_blk_ptr->segments.tail->append(subspan); - count += to_write; - ctrl_blk_ptr->pkt_len += to_write; - } - return true; + return append(bytes, get_default_byte_buffer_segment_pool()); } bool byte_buffer::append(const std::initializer_list& bytes) @@ -186,13 +291,14 @@ bool byte_buffer::append(const byte_buffer& other) if (other.empty()) { return true; } - if (not has_ctrl_block() and not append_segment(other.ctrl_blk_ptr->segments.head->headroom())) { + if (not has_ctrl_block() and not append_segment(other.ctrl_blk_ptr->segments.head->headroom(), + other.ctrl_blk_ptr->segments.head->headroom() + other.length())) { return false; } for (node_t* seg = other.ctrl_blk_ptr->segments.head; seg != nullptr; seg = seg->next) { auto* other_it = seg->begin(); while (other_it != seg->end()) { - if (ctrl_blk_ptr->segments.tail->tailroom() == 0 and not append_segment(0)) { + if (ctrl_blk_ptr->segments.tail->tailroom() == 0 and not append_segment(0, seg->length())) { return false; } auto to_append = @@ -219,8 +325,13 @@ bool byte_buffer::append(byte_buffer&& other) // Use lvalue append. return append(other); } + if (*other.ctrl_blk_ptr->segment_pool != *ctrl_blk_ptr->segment_pool) { + // The pools are different. Deep copy segments. + return append(other); + } + // This is the last reference to "after". Shallow copy, except control segment. - node_t* node = create_segment(0); + node_t* node = create_segment(0, other.ctrl_blk_ptr->segment_in_cb_memory_block->length()); if (node == nullptr) { return false; } @@ -259,31 +370,67 @@ bool byte_buffer::append(const byte_buffer_view& view) return true; } -byte_buffer::node_t* byte_buffer::add_head_segment(size_t headroom, bool use_fallback) +bool byte_buffer::default_construct_unsafe(byte_buffer_memory_resource& segment_pool, unsigned sz_hint) { - auto& pool = detail::get_default_byte_buffer_segment_pool(); - const size_t block_size = pool.memory_block_size(); + if (&segment_pool == &get_default_byte_buffer_segment_pool()) { + // No need to create a control block yet, if the pool is default one. + return true; + } + // create head segment and assign segment pool to the control block. + node_t* n = add_head_segment(DEFAULT_FIRST_SEGMENT_HEADROOM, segment_pool, sz_hint); + return n != nullptr; +} - // Allocate new node. - void* mem_block = pool.allocate_node(block_size); - if (mem_block == nullptr) { - if (not use_fallback) { - // Pool is depleted. - byte_buffer::warn_alloc_failure(); - return nullptr; +bool byte_buffer::append(span bytes, byte_buffer_memory_resource& segment_pool) +{ + if (bytes.empty()) { + // No bytes are being appended. However, we may still need to create a control block to store the pool. + if (not has_ctrl_block()) { + return default_construct_unsafe(segment_pool, default_segment_size - sizeof(control_block) - sizeof(node_t)); } - // Use heap as fallback. - mem_block = new uint8_t[block_size]; + return true; + } + + if (not has_ctrl_block()) { + // Create control block. + node_t* n = + add_head_segment(DEFAULT_FIRST_SEGMENT_HEADROOM, segment_pool, bytes.size() + DEFAULT_FIRST_SEGMENT_HEADROOM); + if (n == nullptr) { + return false; + } + } + + // segment-wise copy. + for (size_t offset = 0; offset < bytes.size();) { + if (ctrl_blk_ptr->segments.tail->tailroom() == 0 and not append_segment(0, bytes.size() - offset)) { + return false; + } + size_t to_write = std::min(ctrl_blk_ptr->segments.tail->tailroom(), bytes.size() - offset); + span subspan = bytes.subspan(offset, to_write); + ctrl_blk_ptr->segments.tail->append(subspan); + offset += to_write; + ctrl_blk_ptr->pkt_len += to_write; + } + return true; +} + +byte_buffer::node_t* +byte_buffer::add_head_segment(size_t headroom, byte_buffer_memory_resource& segment_pool, size_t sz_hint) +{ + // Allocate new node. + span mem_block = segment_pool.allocate(sz_hint + sizeof(control_block) + sizeof(node_t)); + if (mem_block.empty()) { + return nullptr; } // Construct linear allocator pointing to allocated segment memory block. - linear_memory_allocator arena{mem_block, block_size}; + linear_memory_allocator arena{mem_block.data(), mem_block.size()}; // Create control block using allocator. void* cb_region = arena.allocate(sizeof(control_block), alignof(control_block)); ctrl_blk_ptr = new (cb_region) control_block{}; srsran_sanity_check(ctrl_blk_ptr != nullptr, "Something went wrong with the creation of the control block"); - ctrl_blk_ptr->malloc_fallback = use_fallback; + ctrl_blk_ptr->segment_pool = &segment_pool; // For first segment of byte_buffer, add a headroom. void* segment_header_region = arena.allocate(sizeof(node_t), alignof(node_t)); @@ -302,24 +449,16 @@ byte_buffer::node_t* byte_buffer::add_head_segment(size_t headroom, bool use_fal return node; } -byte_buffer::node_t* byte_buffer::create_segment(size_t headroom) +byte_buffer::node_t* byte_buffer::create_segment(size_t headroom, size_t sz_hint) { - auto& pool = detail::get_default_byte_buffer_segment_pool(); - const size_t block_size = pool.memory_block_size(); - // Allocate memory block. - void* mem_block = pool.allocate_node(block_size); - if (mem_block == nullptr) { - if (not ctrl_blk_ptr->malloc_fallback) { - byte_buffer::warn_alloc_failure(); - return nullptr; - } - // Use malloc as fallback. - mem_block = new uint8_t[block_size]; + span mem_block = ctrl_blk_ptr->segment_pool->allocate(sz_hint + sizeof(node_t)); + if (mem_block.empty()) { + return nullptr; } // Create a linear allocator pointing to the allocated memory block. - linear_memory_allocator arena{mem_block, block_size}; + linear_memory_allocator arena{mem_block.data(), mem_block.size()}; void* segment_start = arena.allocate(sizeof(node_t), alignof(node_t)); size_t segment_size = arena.nof_bytes_left(); @@ -328,12 +467,12 @@ byte_buffer::node_t* byte_buffer::create_segment(size_t headroom) node_t(span{static_cast(payload_start), segment_size}, std::min(headroom, segment_size)); } -bool byte_buffer::append_segment(size_t headroom_suggestion) +bool byte_buffer::append_segment(size_t headroom_suggestion, size_t sz_hint) { if (not has_ctrl_block()) { - return add_head_segment(headroom_suggestion) != nullptr; + return add_head_segment(headroom_suggestion, get_default_byte_buffer_segment_pool(), sz_hint) != nullptr; } - node_t* segment = create_segment(headroom_suggestion); + node_t* segment = create_segment(headroom_suggestion, sz_hint); if (segment == nullptr) { return false; } @@ -342,12 +481,12 @@ bool byte_buffer::append_segment(size_t headroom_suggestion) return true; } -bool byte_buffer::prepend_segment(size_t headroom_suggestion) +bool byte_buffer::prepend_segment(size_t headroom_suggestion, size_t sz_hint) { if (not has_ctrl_block()) { - return add_head_segment(headroom_suggestion) != nullptr; + return add_head_segment(headroom_suggestion, get_default_byte_buffer_segment_pool(), sz_hint) != nullptr; } - node_t* segment = create_segment(headroom_suggestion); + node_t* segment = create_segment(headroom_suggestion, sz_hint); if (segment == nullptr) { return false; } @@ -381,7 +520,7 @@ bool byte_buffer::prepend(span bytes) } for (size_t count = 0; count < bytes.size();) { if (ctrl_blk_ptr->segments.head->headroom() == 0) { - if (not prepend_segment(bytes.size() - count)) { + if (not prepend_segment(bytes.size() - count, bytes.size() - count)) { return false; } } @@ -405,7 +544,7 @@ bool byte_buffer::prepend(const byte_buffer& other) return append(other); } for (span seg : other.segments()) { - node_t* node = create_segment(0); + node_t* node = create_segment(0, seg.size()); if (node == nullptr) { return false; } @@ -428,12 +567,16 @@ bool byte_buffer::prepend(byte_buffer&& other) return append(std::move(other)); } if (not other.ctrl_blk_ptr->ref_count.unique()) { - // Deep copy of segments. + // "other" is not the last reference to the underlying byte buffer control block. Deep copy of segments. + return prepend(other); + } + if (*other.ctrl_blk_ptr->segment_pool != *ctrl_blk_ptr->segment_pool) { + // The pools are different. Deep copy segments. return prepend(other); } // This is the last reference to "other". Shallow copy, except control segment. - node_t* node = create_segment(0); + node_t* node = create_segment(0, other.ctrl_blk_ptr->segment_in_cb_memory_block->length()); if (node == nullptr) { return false; } @@ -464,7 +607,7 @@ byte_buffer_view byte_buffer::reserve_prepend(size_t nof_bytes) size_t rem_bytes = nof_bytes; while (rem_bytes > 0) { if (empty() or ctrl_blk_ptr->segments.head->headroom() == 0) { - if (not prepend_segment(rem_bytes)) { + if (not prepend_segment(rem_bytes, rem_bytes)) { return {}; } } @@ -561,7 +704,7 @@ bool byte_buffer::resize(size_t new_sz) if (new_sz > prev_len) { for (size_t to_add = new_sz - prev_len; to_add > 0;) { if (not has_ctrl_block() or ctrl_blk_ptr->segments.tail->tailroom() == 0) { - if (not append_segment(0)) { + if (not append_segment(0, to_add)) { return false; } } @@ -587,12 +730,6 @@ bool byte_buffer::resize(size_t new_sz) return true; } -void byte_buffer::warn_alloc_failure() -{ - static srslog::basic_logger& logger = srslog::fetch_basic_logger("ALL"); - logger.warning("POOL: Failure to allocate byte buffer segment"); -} - expected srsran::make_byte_buffer(const std::string& hex_str) { if (hex_str.size() % 2 != 0) { diff --git a/lib/support/dynlink_manager.cpp b/lib/support/dynlink_manager.cpp index fe27f22d3e..4c8804d6ae 100644 --- a/lib/support/dynlink_manager.cpp +++ b/lib/support/dynlink_manager.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "srsran/support/dynlink_manager.h" #include #include diff --git a/lib/support/timers.cpp b/lib/support/timers.cpp index 2863429282..d6d1ed1cf9 100644 --- a/lib/support/timers.cpp +++ b/lib/support/timers.cpp @@ -243,16 +243,26 @@ void timer_manager::handle_timer_commands() create_timer_handle(cmd.cmd_id, std::move(std::get(cmd.action).frontend)); continue; } + const auto t_idx = static_cast(cmd.id); + + if (t_idx >= timers.size()) { + // Second command ended up being processed before timer creation due to reordering. + // Grow timers list to avoid bad accesses. The cmd will be added to tmp_skipped_cmds below in this iteration. + if (t_idx > timers.size() + 1024) { + logger.error("Detected corrupted timer_id={}. Current timer list size is {}", t_idx, timers.size()); + } + timers.resize(t_idx + 1); + } // The timer already exists. - timer_handle& timer = timers[static_cast(cmd.id)]; + timer_handle& timer = timers[t_idx]; if (cmd.cmd_id - timer.backend.cmd_id >= std::numeric_limits::max() / 2) { // Note: This should not happen. It means that there was some corruption of the cmd_id. logger.warning( "Discarding cmd_id={} for timer={}. Cause: cmd_id is below the last processed cmd_id={} by the timer", cmd.cmd_id, - timer.frontend->id, + cmd.id, timer.backend.cmd_id); continue; } @@ -263,7 +273,7 @@ void timer_manager::handle_timer_commands() logger.debug("The processing of cmd_id={} for timer={} was postponed. Cause: There are commands in between " "[{},{}) not yet processed", cmd.cmd_id, - timer.frontend->id, + cmd.id, timer.backend.cmd_id + 1, cmd.cmd_id); continue; @@ -273,7 +283,7 @@ void timer_manager::handle_timer_commands() handle_timer_command(timer, cmd); } - constexpr static unsigned max_skip_slot_thres = 4; + constexpr static unsigned max_skip_slot_thres = 16; // Sort skipped cmds by cmd_id. std::sort(tmp_skipped_cmds.begin(), tmp_skipped_cmds.end(), [](const auto& lhs, const auto& rhs) { return lhs.second.cmd_id < rhs.second.cmd_id; @@ -284,12 +294,11 @@ void timer_manager::handle_timer_commands() // already processed. continue; } - timer_handle& timer = timers[static_cast(cmd.id)]; + const auto t_idx = static_cast(cmd.id); - if (timer.frontend == nullptr) { - // Timer was deleted in the meantime. - cmd.id = timer_id_t::invalid; - } else if (cmd.cmd_id == timer.backend.cmd_id + 1) { + timer_handle& timer = timers[t_idx]; + + if (cmd.cmd_id == timer.backend.cmd_id + 1) { // Now the command can be processed in order. handle_timer_command(timer, cmd); cmd.id = timer_id_t::invalid; @@ -298,15 +307,17 @@ void timer_manager::handle_timer_commands() logger.warning( "Discarding cmd_id={} for timer={}. Cause: cmd_id is below the last processed cmd_id={} by the timer", cmd.cmd_id, - timer.frontend->id, + t_idx, timer.backend.cmd_id); cmd.id = timer_id_t::invalid; - } else if (p.first - cur_time > max_skip_slot_thres) { + } else if (cur_time - p.first > max_skip_slot_thres) { logger.warning("Discarding cmd_ids=[{},{}) for timer={}. Cause: The cmd_ids went missing", timer.backend.cmd_id + 1, cmd.cmd_id - 1, - timer.frontend->id); - handle_timer_command(timer, cmd); + t_idx); + if (timer.frontend != nullptr) { + handle_timer_command(timer, cmd); + } cmd.id = timer_id_t::invalid; } } @@ -319,6 +330,7 @@ void timer_manager::handle_timer_commands() void timer_manager::handle_timer_command(timer_handle& timer, const cmd_t& cmd) { srsran_sanity_check(not std::holds_alternative(cmd.action), "Invalid action type"); + srsran_assert(timer.frontend != nullptr, "Invalid timer frontend"); // Update the timer backend cmd_id to match frontend. timer.backend.cmd_id = cmd.cmd_id; diff --git a/tests/e2e/tests/steps/kpis.py b/tests/e2e/tests/steps/kpis.py index 805efad7a6..d07546209b 100644 --- a/tests/e2e/tests/steps/kpis.py +++ b/tests/e2e/tests/steps/kpis.py @@ -29,7 +29,7 @@ from retina.launcher.public import MetricsSummary from retina.protocol import RanStub from retina.protocol.base_pb2 import Metrics -from retina.viavi.client import ViaviFailureManager +from retina.viavi.client import ViaviKPIs @dataclass @@ -58,7 +58,7 @@ class KPIs: def get_kpis( gnb: RanStub, ue_array: Sequence[RanStub] = (), - viavi_failure_manager: Optional[ViaviFailureManager] = None, + viavi_kpis: Optional[ViaviKPIs] = None, metrics_summary: Optional[MetricsSummary] = None, ) -> KPIs: """ @@ -95,8 +95,8 @@ def get_kpis( kpis.nof_handovers += ue_info.nof_handovers # Viavi - if viavi_failure_manager: - nof_failure = viavi_failure_manager.get_nof_failure_by_group_procedure("EMM_PROCEDURE", "attach") + if viavi_kpis: + nof_failure = viavi_kpis.get_nof_procedure_failure_by_group("EMM_PROCEDURE", "attach") if nof_failure: kpis.nof_attach_failures += nof_failure diff --git a/tests/e2e/tests/viavi.py b/tests/e2e/tests/viavi.py index d3d02a7fc4..0b777099d0 100644 --- a/tests/e2e/tests/viavi.py +++ b/tests/e2e/tests/viavi.py @@ -38,7 +38,7 @@ from retina.protocol.base_pb2 import FiveGCDefinition, PLMN, StartInfo from retina.protocol.gnb_pb2 import GNBStartInfo from retina.protocol.gnb_pb2_grpc import GNBStub -from retina.viavi.client import CampaignStatusEnum, Viavi +from retina.viavi.client import CampaignStatusEnum, Viavi, ViaviKPIs from rich.console import Console from rich.table import Table @@ -68,7 +68,7 @@ class _ViaviConfiguration: # test/fail criteria expected_ul_bitrate: float = 0 expected_dl_bitrate: float = 0 - expected_nof_kos: int = 0 + expected_nof_kos: float = 0 # Infinity value is represented in a float warning_as_errors: bool = True enable_dddsu: bool = False ul_heavy_7u2d: bool = False @@ -477,8 +477,8 @@ def check_metrics_criteria( is_ok = True # Check metrics - viavi_failure_manager = viavi.get_test_failures() - kpis: KPIs = get_kpis(gnb, viavi_failure_manager=viavi_failure_manager, metrics_summary=metrics_summary) + viavi_kpis: ViaviKPIs = viavi.get_test_kpis() + kpis: KPIs = get_kpis(gnb, viavi_kpis=viavi_kpis, metrics_summary=metrics_summary) criteria_result: List[_ViaviResult] = [] criteria_dl_brate_aggregate = check_criteria( @@ -499,23 +499,47 @@ def check_metrics_criteria( ) ) - criteria_nof_ko_dl = check_criteria(kpis.nof_ko_dl, test_configuration.expected_nof_kos, operator.lt) + criteria_nof_ko_dl_gnb = check_criteria(kpis.nof_ko_dl, test_configuration.expected_nof_kos + 100, operator.lt) criteria_result.append( _ViaviResult( - "DL KOs", - test_configuration.expected_nof_kos, + "DL KOs (gnb)", + test_configuration.expected_nof_kos + 100, kpis.nof_ko_dl, - criteria_nof_ko_dl, + criteria_nof_ko_dl_gnb, + ) + ) + + criteria_nof_ko_dl_viavi = check_criteria( + viavi_kpis.dl_data.num_tbs_errors, test_configuration.expected_nof_kos, operator.lt + ) + criteria_result.append( + _ViaviResult( + "DL KOs (viavi)", + test_configuration.expected_nof_kos, + viavi_kpis.dl_data.num_tbs_errors, + criteria_nof_ko_dl_viavi, ) ) - criteria_nof_ko_ul = check_criteria(kpis.nof_ko_ul, test_configuration.expected_nof_kos, operator.lt) + criteria_nof_ko_ul_gnb = check_criteria(kpis.nof_ko_ul, test_configuration.expected_nof_kos, operator.lt) criteria_result.append( _ViaviResult( - "UL KOs", + "UL KOs (gnb)", test_configuration.expected_nof_kos, kpis.nof_ko_ul, - criteria_nof_ko_ul, + criteria_nof_ko_ul_gnb, + ) + ) + + criteria_nof_ko_ul_viavi = check_criteria( + viavi_kpis.ul_data.num_tbs_nack, test_configuration.expected_nof_kos, operator.lt + ) + criteria_result.append( + _ViaviResult( + "UL KOs (viavi)", + test_configuration.expected_nof_kos, + viavi_kpis.ul_data.num_tbs_nack, + criteria_nof_ko_ul_viavi, ) ) @@ -525,13 +549,13 @@ def check_metrics_criteria( ) # Check procedure table - viavi_failure_manager.print_failures(_OMIT_VIAVI_FAILURE_LIST) - criteria_procedure_table = viavi_failure_manager.get_number_of_failures(_OMIT_VIAVI_FAILURE_LIST) == 0 + viavi_kpis.print_procedure_failures(_OMIT_VIAVI_FAILURE_LIST) + criteria_procedure_table = viavi_kpis.get_number_of_procedure_failures(_OMIT_VIAVI_FAILURE_LIST) == 0 criteria_result.append( _ViaviResult( "Procedure table", 0, - viavi_failure_manager.get_number_of_failures(_OMIT_VIAVI_FAILURE_LIST), + viavi_kpis.get_number_of_procedure_failures(_OMIT_VIAVI_FAILURE_LIST), criteria_procedure_table, ) ) @@ -539,8 +563,10 @@ def check_metrics_criteria( is_ok = ( criteria_dl_brate_aggregate and criteria_ul_brate_aggregate - and criteria_nof_ko_dl - and criteria_nof_ko_ul + and criteria_nof_ko_dl_gnb + and criteria_nof_ko_dl_viavi + and criteria_nof_ko_ul_gnb + and criteria_nof_ko_ul_viavi and criteria_procedure_table ) @@ -601,6 +627,10 @@ def get_str_number_criteria(number_criteria: float) -> str: """ Get string number criteria """ + if number_criteria == float("inf"): + return "∞" + if number_criteria == float("-inf"): + return "-∞" if number_criteria >= 1_000_000_000: return f"{number_criteria / 1_000_000_000:.1f}G" if number_criteria >= 1_000_000: diff --git a/tests/e2e/tests/viavi/test_declaration.yml b/tests/e2e/tests/viavi/test_declaration.yml index a04b95cf49..ffda740f25 100644 --- a/tests/e2e/tests/viavi/test_declaration.yml +++ b/tests/e2e/tests/viavi/test_declaration.yml @@ -75,7 +75,7 @@ tests: # test/fail criteria expected_dl_bitrate: 14.0e+3 expected_ul_bitrate: 1.0e+3 - expected_nof_kos: 9999999999999 + expected_nof_kos: .inf warning_as_errors: false - campaign_filename: *campaign_filename @@ -89,7 +89,7 @@ tests: # test/fail criteria expected_dl_bitrate: 14.0e+3 expected_ul_bitrate: 1.0e+3 - expected_nof_kos: 9999999999999 + expected_nof_kos: .inf warning_as_errors: false - campaign_filename: *campaign_filename @@ -131,7 +131,7 @@ tests: # test/fail criteria expected_dl_bitrate: 14.0e+3 expected_ul_bitrate: 1.0e+3 - expected_nof_kos: 9999999999999 + expected_nof_kos: .inf warning_as_errors: false - campaign_filename: *campaign_filename @@ -145,7 +145,7 @@ tests: # test/fail criteria expected_dl_bitrate: 14.0e+3 expected_ul_bitrate: 1.0e+3 - expected_nof_kos: 9999999999999 + expected_nof_kos: .inf warning_as_errors: false - campaign_filename: *campaign_filename @@ -218,7 +218,7 @@ tests: # test/fail criteria expected_dl_bitrate: 14.0e+3 expected_ul_bitrate: 1.0e+3 - expected_nof_kos: 9999999999999 + expected_nof_kos: .inf warning_as_errors: true - campaign_filename: *campaign_filename diff --git a/tests/e2e/tests/viavi/test_declaration_schema.json b/tests/e2e/tests/viavi/test_declaration_schema.json index 59afe55215..d82ba9799d 100644 --- a/tests/e2e/tests/viavi/test_declaration_schema.json +++ b/tests/e2e/tests/viavi/test_declaration_schema.json @@ -38,7 +38,7 @@ "type": "integer" }, "expected_nof_kos": { - "type": "integer" + "type": "number" }, "warning_as_errors": { "type": "boolean" diff --git a/tests/test_doubles/ngap/ngap_test_message_validators.h b/tests/test_doubles/ngap/ngap_test_message_validators.h index e2a5cd68ee..a738103b5e 100644 --- a/tests/test_doubles/ngap/ngap_test_message_validators.h +++ b/tests/test_doubles/ngap/ngap_test_message_validators.h @@ -23,6 +23,7 @@ #pragma once #include "srsran/ran/cu_types.h" + namespace srsran { namespace srs_cu_cp { diff --git a/tests/unittests/cu_cp/ue_manager/ue_manager_test_helpers.h b/tests/unittests/cu_cp/ue_manager/ue_manager_test_helpers.h index 335edb4d6e..1322662257 100644 --- a/tests/unittests/cu_cp/ue_manager/ue_manager_test_helpers.h +++ b/tests/unittests/cu_cp/ue_manager/ue_manager_test_helpers.h @@ -27,7 +27,6 @@ #include "tests/unittests/ngap/test_helpers.h" #include "srsran/cu_cp/cu_cp_types.h" #include "srsran/support/executors/manual_task_worker.h" - #include #include diff --git a/tests/unittests/du_manager/procedures/ue_deletion_test.cpp b/tests/unittests/du_manager/procedures/ue_deletion_test.cpp index a18d276f92..6c58123b74 100644 --- a/tests/unittests/du_manager/procedures/ue_deletion_test.cpp +++ b/tests/unittests/du_manager/procedures/ue_deletion_test.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "du_manager_procedure_test_helpers.h" #include "lib/du/du_high/du_manager/procedures/ue_creation_procedure.h" #include "lib/du/du_high/du_manager/procedures/ue_deletion_procedure.h" diff --git a/tests/unittests/e1ap/cu_cp/e1ap_cu_cp_ue_context_test.cpp b/tests/unittests/e1ap/cu_cp/e1ap_cu_cp_ue_context_test.cpp index 0b1c67b0ff..0c058f3dec 100644 --- a/tests/unittests/e1ap/cu_cp/e1ap_cu_cp_ue_context_test.cpp +++ b/tests/unittests/e1ap/cu_cp/e1ap_cu_cp_ue_context_test.cpp @@ -26,7 +26,6 @@ #include "srsran/srslog/logger.h" #include "srsran/support/executors/manual_task_worker.h" #include "srsran/support/test_utils.h" - #include using namespace srsran; diff --git a/tests/unittests/f1ap/cu_cp/f1ap_cu_ue_context_test.cpp b/tests/unittests/f1ap/cu_cp/f1ap_cu_ue_context_test.cpp index bbe4ec8ae8..bbe32aa202 100644 --- a/tests/unittests/f1ap/cu_cp/f1ap_cu_ue_context_test.cpp +++ b/tests/unittests/f1ap/cu_cp/f1ap_cu_ue_context_test.cpp @@ -25,7 +25,6 @@ #include "srsran/f1ap/f1ap_ue_id_types.h" #include "srsran/support/executors/manual_task_worker.h" #include "srsran/support/test_utils.h" - #include #include #include diff --git a/tests/unittests/f1ap/du/f1ap_du_ue_context_setup_procedure_test.cpp b/tests/unittests/f1ap/du/f1ap_du_ue_context_setup_procedure_test.cpp index 1cb6bca1d0..8005676bce 100644 --- a/tests/unittests/f1ap/du/f1ap_du_ue_context_setup_procedure_test.cpp +++ b/tests/unittests/f1ap/du/f1ap_du_ue_context_setup_procedure_test.cpp @@ -22,7 +22,6 @@ #include "f1ap_du_test_helpers.h" #include "tests/test_doubles/f1ap/f1ap_test_messages.h" - #include "srsran/du/du_cell_config_helpers.h" #include "srsran/support/test_utils.h" #include diff --git a/tests/unittests/gateways/baseband/baseband_gateway_buffer_test_doubles.h b/tests/unittests/gateways/baseband/baseband_gateway_buffer_test_doubles.h index 22c1dfca61..160550d9f2 100644 --- a/tests/unittests/gateways/baseband/baseband_gateway_buffer_test_doubles.h +++ b/tests/unittests/gateways/baseband/baseband_gateway_buffer_test_doubles.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/gateways/baseband/buffer/baseband_gateway_buffer_reader.h" #include "srsran/gateways/baseband/buffer/baseband_gateway_buffer_writer.h" #include "srsran/srsvec/copy.h" @@ -109,4 +110,4 @@ class baseband_gateway_buffer_read_only : public baseband_gateway_buffer_reader } }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/tests/unittests/gateways/baseband/baseband_gateway_receiver_test_doubles.h b/tests/unittests/gateways/baseband/baseband_gateway_receiver_test_doubles.h index fa141ec973..a0a9fc77d2 100644 --- a/tests/unittests/gateways/baseband/baseband_gateway_receiver_test_doubles.h +++ b/tests/unittests/gateways/baseband/baseband_gateway_receiver_test_doubles.h @@ -21,6 +21,7 @@ */ #pragma once + #include "baseband_gateway_buffer_test_doubles.h" #include "srsran/gateways/baseband/baseband_gateway_receiver.h" #include @@ -71,4 +72,4 @@ class baseband_gateway_receiver_spy : public baseband_gateway_receiver std::vector entries; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/tests/unittests/gateways/baseband/baseband_gateway_transmitter_test_doubles.h b/tests/unittests/gateways/baseband/baseband_gateway_transmitter_test_doubles.h index f9426ecf1e..6065b0aaca 100644 --- a/tests/unittests/gateways/baseband/baseband_gateway_transmitter_test_doubles.h +++ b/tests/unittests/gateways/baseband/baseband_gateway_transmitter_test_doubles.h @@ -21,6 +21,7 @@ */ #pragma once + #include "baseband_gateway_buffer_test_doubles.h" #include "srsran/gateways/baseband/baseband_gateway_transmitter.h" #include @@ -54,4 +55,4 @@ class baseband_gateway_transmitter_spy : public baseband_gateway_transmitter std::vector entries; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/tests/unittests/gateways/test_helpers.h b/tests/unittests/gateways/test_helpers.h index 64f2074783..dcbf3ad2bf 100644 --- a/tests/unittests/gateways/test_helpers.h +++ b/tests/unittests/gateways/test_helpers.h @@ -22,6 +22,11 @@ #pragma once +#include "srsran/adt/byte_buffer.h" +#include "srsran/gateways/sctp_network_gateway.h" +#include "srsran/srslog/srslog.h" +#include "srsran/support/io/io_broker.h" +#include "srsran/support/io/sctp_socket.h" #include #include #include @@ -31,12 +36,6 @@ #include #include -#include "srsran/adt/byte_buffer.h" -#include "srsran/gateways/sctp_network_gateway.h" -#include "srsran/srslog/srslog.h" -#include "srsran/support/io/io_broker.h" -#include "srsran/support/io/sctp_socket.h" - namespace srsran { inline byte_buffer make_tx_byte_buffer(uint32_t length) diff --git a/tests/unittests/ofh/CMakeLists.txt b/tests/unittests/ofh/CMakeLists.txt index 038580fcfc..bdadbfdf37 100644 --- a/tests/unittests/ofh/CMakeLists.txt +++ b/tests/unittests/ofh/CMakeLists.txt @@ -25,6 +25,7 @@ add_subdirectory(ecpri) add_subdirectory(ethernet) add_subdirectory(receiver) add_subdirectory(serdes) +add_subdirectory(support) add_subdirectory(transmitter) add_executable(slot_symbol_point_test slot_symbol_point_test.cpp) diff --git a/tests/unittests/ofh/support/CMakeLists.txt b/tests/unittests/ofh/support/CMakeLists.txt new file mode 100644 index 0000000000..d9356874df --- /dev/null +++ b/tests/unittests/ofh/support/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# Copyright 2021-2024 Software Radio Systems Limited +# +# This file is part of srsRAN +# +# srsRAN is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsRAN is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +set_directory_properties(PROPERTIES LABELS "support") + +add_executable(context_repository_helpers_test context_repository_helpers_test.cpp) +target_link_libraries(context_repository_helpers_test srsran_support gtest gtest_main) +target_include_directories(context_repository_helpers_test PRIVATE ${CMAKE_SOURCE_DIR}/lib/ofh/support) +gtest_discover_tests(context_repository_helpers_test) diff --git a/tests/unittests/ofh/support/context_repository_helpers_test.cpp b/tests/unittests/ofh/support/context_repository_helpers_test.cpp new file mode 100644 index 0000000000..b732eab16b --- /dev/null +++ b/tests/unittests/ofh/support/context_repository_helpers_test.cpp @@ -0,0 +1,97 @@ +/* + * + * Copyright 2021-2024 Software Radio Systems Limited + * + * This file is part of srsRAN. + * + * srsRAN is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsRAN is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include "context_repository_helpers.h" +#include + +using namespace srsran; +using namespace ofh; + +namespace { +/// Test fixture for tests involving a single array of bytes. +class context_repository_helpers_param_test : public ::testing::TestWithParam> +{ +protected: + subcarrier_spacing scs = std::get<0>(GetParam()); + unsigned min_repo_size = std::get<1>(GetParam()); +}; + +} // namespace + +TEST_P(context_repository_helpers_param_test, first_and_last_repo_size_slot_index_share_same_index) +{ + unsigned repo_size = calculate_repository_size(scs, min_repo_size); + + for (unsigned i = 0, b = repo_size; i != repo_size; i++, --b) { + slot_point initial_wrap = slot_point(scs, 0, 0) + i; + slot_point end_wrap = slot_point(scs, 0, 0) - b; + ASSERT_EQ(calculate_repository_index(initial_wrap, repo_size), calculate_repository_index(end_wrap, repo_size)); + } +} + +TEST_P(context_repository_helpers_param_test, next_repo_size_position_of_the_repo_do_not_share_index) +{ + unsigned repo_size = calculate_repository_size(scs, min_repo_size); + + for (unsigned b = repo_size; b; --b) { + slot_point end_wrap = slot_point(scs, 0, 0) - b; + // Check that in the next repo_size slots, there is no repeated index. + for (unsigned i = 1; i != repo_size; i++) { + slot_point initial_wrap = end_wrap + i; + ASSERT_NE(calculate_repository_index(initial_wrap, repo_size), calculate_repository_index(end_wrap, repo_size)); + } + } +} + +TEST_P(context_repository_helpers_param_test, repositories_sizes_not_being_multiple_of_total_number_of_slots_fails) +{ + unsigned repo_size = min_repo_size; + + bool result = true; + for (unsigned b = repo_size; b; --b) { + slot_point end_wrap = slot_point(scs, 0, 0) - b; + // Check that in the next repo_size slots, there is no repeated index. + for (unsigned i = 1; i != repo_size && result; i++) { + slot_point initial_wrap = end_wrap + i; + result = calculate_repository_index(initial_wrap, repo_size) != calculate_repository_index(end_wrap, repo_size); + if (!result) { + break; + } + } + } + + // If the total number of slots is not multiple of the repository size, result should be false. + if (SFN_MAX_VALUE * get_nof_slots_per_subframe(scs) * NOF_SUBFRAMES_PER_FRAME % min_repo_size) { + ASSERT_FALSE(result); + } else { + ASSERT_TRUE(result); + } +} + +INSTANTIATE_TEST_SUITE_P(context_repository_helpers_param_test_suite, + context_repository_helpers_param_test, + ::testing::Combine(::testing::Values(subcarrier_spacing::kHz15, + subcarrier_spacing::kHz30, + subcarrier_spacing::kHz60, + subcarrier_spacing::kHz120, + subcarrier_spacing::kHz240), + ::testing::Range(4U, 124U, 4U))); diff --git a/tests/unittests/pdcp/pdcp_test_vectors.h b/tests/unittests/pdcp/pdcp_test_vectors.h index 16fcb7ca70..1bcea0f3f5 100644 --- a/tests/unittests/pdcp/pdcp_test_vectors.h +++ b/tests/unittests/pdcp/pdcp_test_vectors.h @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once #include "srsran/adt/byte_buffer.h" diff --git a/tests/unittests/phy/generic_functions/transform_precoding/transform_precoder_vectortest.cpp b/tests/unittests/phy/generic_functions/transform_precoding/transform_precoder_vectortest.cpp index e6be3c9887..6b6d2956a6 100644 --- a/tests/unittests/phy/generic_functions/transform_precoding/transform_precoder_vectortest.cpp +++ b/tests/unittests/phy/generic_functions/transform_precoding/transform_precoder_vectortest.cpp @@ -21,11 +21,11 @@ */ #include "transform_precoder_test_data.h" +#include "srsran/phy/constants.h" #include "srsran/phy/generic_functions/generic_functions_factories.h" #include "srsran/phy/generic_functions/transform_precoding/transform_precoder.h" #include "srsran/phy/generic_functions/transform_precoding/transform_precoding_factories.h" #include -#include using namespace srsran; diff --git a/tests/unittests/phy/lower/amplitude_control/amplitude_controller_test_doubles.h b/tests/unittests/phy/lower/amplitude_control/amplitude_controller_test_doubles.h index 9c796dc0e6..28817cf733 100644 --- a/tests/unittests/phy/lower/amplitude_control/amplitude_controller_test_doubles.h +++ b/tests/unittests/phy/lower/amplitude_control/amplitude_controller_test_doubles.h @@ -19,7 +19,9 @@ * and at http://www.gnu.org/licenses/. * */ + #pragma once + #include "../../phy_test_utils.h" #include "srsran/phy/lower/amplitude_controller/amplitude_controller.h" #include "srsran/phy/lower/amplitude_controller/amplitude_controller_factories.h" @@ -86,4 +88,4 @@ class amplitude_controller_spy : public amplitude_controller PHY_SPY_FACTORY_TEMPLATE(amplitude_controller); -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/tests/unittests/phy/lower/processors/downlink/downlink_processor_test_doubles.h b/tests/unittests/phy/lower/processors/downlink/downlink_processor_test_doubles.h index 7b981fd39f..4a398e76ca 100644 --- a/tests/unittests/phy/lower/processors/downlink/downlink_processor_test_doubles.h +++ b/tests/unittests/phy/lower/processors/downlink/downlink_processor_test_doubles.h @@ -21,6 +21,7 @@ */ #pragma once + #include "../../../../gateways/baseband/baseband_gateway_buffer_test_doubles.h" #include "srsran/phy/lower/processors/downlink/downlink_processor.h" #include "srsran/phy/lower/processors/downlink/downlink_processor_baseband.h" @@ -156,4 +157,4 @@ class lower_phy_downlink_processor_factory_spy : public lower_phy_downlink_proce std::vector entries; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/tests/unittests/phy/support/interpolator_test.cpp b/tests/unittests/phy/support/interpolator_test.cpp index bcce693a54..cb56bbe21a 100644 --- a/tests/unittests/phy/support/interpolator_test.cpp +++ b/tests/unittests/phy/support/interpolator_test.cpp @@ -24,7 +24,6 @@ /// \brief Interpolator unit test. #include "srsran/phy/support/support_factories.h" - #include using namespace srsran; @@ -58,4 +57,4 @@ TEST(InterpolatorTest, FloatLateStart) ASSERT_TRUE(std::equal(output.cbegin(), output.cend(), expected.cbegin(), [](cf_t a, cf_t b) { return (std::abs(a - b) < 1e-5); })) << fmt::format("output: {},\nexpected: {}", span(output), span(expected)); -} \ No newline at end of file +} diff --git a/tests/unittests/phy/support/re_pattern_test.cpp b/tests/unittests/phy/support/re_pattern_test.cpp index b7cbdced3d..53db638ec9 100644 --- a/tests/unittests/phy/support/re_pattern_test.cpp +++ b/tests/unittests/phy/support/re_pattern_test.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #if defined(__GNUC__) && (__GNUC__ > 10) && (__GNUC__ < 14) && defined(__OPTIMIZE__) #pragma GCC diagnostic ignored "-Warray-bounds" #pragma message "GCC versions greater than 10 give a likely false array-bounds alarm." @@ -309,4 +310,4 @@ int main() test_equal(); test_bracket_initializer(); return 0; -} \ No newline at end of file +} diff --git a/tests/unittests/phy/upper/channel_coding/ldpc/ldpc_segmenter_test.cpp b/tests/unittests/phy/upper/channel_coding/ldpc/ldpc_segmenter_test.cpp index 72f00759f7..3da610e20e 100644 --- a/tests/unittests/phy/upper/channel_coding/ldpc/ldpc_segmenter_test.cpp +++ b/tests/unittests/phy/upper/channel_coding/ldpc/ldpc_segmenter_test.cpp @@ -30,7 +30,6 @@ #include "srsran/phy/upper/channel_coding/channel_coding_factories.h" #include "srsran/phy/upper/channel_coding/ldpc/ldpc_segmenter_buffer.h" #include "srsran/srsvec/bit.h" - #include using namespace srsran; diff --git a/tests/unittests/phy/upper/channel_processors/pucch/pucch_detector_test.cpp b/tests/unittests/phy/upper/channel_processors/pucch/pucch_detector_test.cpp index 70ba034c95..e7e130d9ad 100644 --- a/tests/unittests/phy/upper/channel_processors/pucch/pucch_detector_test.cpp +++ b/tests/unittests/phy/upper/channel_processors/pucch/pucch_detector_test.cpp @@ -30,7 +30,6 @@ #include "srsran/phy/upper/channel_processors/channel_processor_factories.h" #include "srsran/phy/upper/channel_processors/pucch/factories.h" #include "srsran/phy/upper/equalization/equalization_factories.h" - #include using namespace srsran; @@ -190,4 +189,4 @@ TEST_P(PUCCHDetectFixture, Format1Variance0Test) INSTANTIATE_TEST_SUITE_P(PUCCHDetectorSuite, PUCCHDetectFixture, ::testing::ValuesIn(pucch_detector_test_data)); } // namespace -/// \endcond \ No newline at end of file +/// \endcond diff --git a/tests/unittests/phy/upper/channel_processors/pusch/pusch_codeword_buffer_test_doubles.h b/tests/unittests/phy/upper/channel_processors/pusch/pusch_codeword_buffer_test_doubles.h index 44fb1998b6..14d232c801 100644 --- a/tests/unittests/phy/upper/channel_processors/pusch/pusch_codeword_buffer_test_doubles.h +++ b/tests/unittests/phy/upper/channel_processors/pusch/pusch_codeword_buffer_test_doubles.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/upper/channel_processors/pusch/pusch_codeword_buffer.h" #include "srsran/srsvec/bit.h" #include "srsran/srsvec/copy.h" diff --git a/tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_buffer_test_doubles.h b/tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_buffer_test_doubles.h index dec5041065..df14d3faf0 100644 --- a/tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_buffer_test_doubles.h +++ b/tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_buffer_test_doubles.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/upper/channel_processors/pusch/pusch_decoder_buffer.h" #include "srsran/srsvec/copy.h" diff --git a/tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_notifier_spy.h b/tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_notifier_spy.h index a18e4c62dc..42fa49fc57 100644 --- a/tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_notifier_spy.h +++ b/tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_notifier_spy.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/upper/channel_processors/pusch/pusch_decoder_notifier.h" #include "srsran/phy/upper/channel_processors/pusch/pusch_decoder_result.h" #include @@ -40,4 +41,4 @@ class pusch_decoder_notifier_spy : public pusch_decoder_notifier std::vector entries; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/tests/unittests/phy/upper/channel_processors/pusch/pusch_demodulator_notifier_test_doubles.h b/tests/unittests/phy/upper/channel_processors/pusch/pusch_demodulator_notifier_test_doubles.h index 8056f9538a..06dbe7dc4e 100644 --- a/tests/unittests/phy/upper/channel_processors/pusch/pusch_demodulator_notifier_test_doubles.h +++ b/tests/unittests/phy/upper/channel_processors/pusch/pusch_demodulator_notifier_test_doubles.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/upper/channel_processors/pusch/pusch_demodulator_notifier.h" namespace srsran { diff --git a/tests/unittests/phy/upper/channel_processors/pusch/pusch_processor_result_test_doubles.h b/tests/unittests/phy/upper/channel_processors/pusch/pusch_processor_result_test_doubles.h index 840f5ad7d8..f4e1f43d6c 100644 --- a/tests/unittests/phy/upper/channel_processors/pusch/pusch_processor_result_test_doubles.h +++ b/tests/unittests/phy/upper/channel_processors/pusch/pusch_processor_result_test_doubles.h @@ -21,6 +21,7 @@ */ #pragma once + #include "srsran/phy/upper/channel_processors/pusch/pusch_processor_result_notifier.h" #include "srsran/phy/upper/channel_state_information.h" @@ -48,4 +49,4 @@ class pusch_processor_result_notifier_spy : public pusch_processor_result_notifi std::vector sch_entries; }; -} // namespace srsran \ No newline at end of file +} // namespace srsran diff --git a/tests/unittests/phy/upper/equalization/channel_equalizer_test.cpp b/tests/unittests/phy/upper/equalization/channel_equalizer_test.cpp index a45ebc3526..e93dad3d7f 100644 --- a/tests/unittests/phy/upper/equalization/channel_equalizer_test.cpp +++ b/tests/unittests/phy/upper/equalization/channel_equalizer_test.cpp @@ -28,7 +28,6 @@ #include "srsran/srsvec/zero.h" #include "fmt/ostream.h" #include -#include using namespace srsran; diff --git a/tests/unittests/phy/upper/log_likelihood_ratio_test.cpp b/tests/unittests/phy/upper/log_likelihood_ratio_test.cpp index 6ca5b2d44c..31aaf6c177 100644 --- a/tests/unittests/phy/upper/log_likelihood_ratio_test.cpp +++ b/tests/unittests/phy/upper/log_likelihood_ratio_test.cpp @@ -25,7 +25,6 @@ /// /// Tests all the operators and functions defined for the type. #include "../../srslog/testing_helpers.h" - #include "srsran/phy/upper/log_likelihood_ratio.h" #include "srsran/support/srsran_test.h" #include diff --git a/tests/unittests/phy/upper/signal_processors/dmrs_pucch_estimator_test_data.h b/tests/unittests/phy/upper/signal_processors/dmrs_pucch_estimator_test_data.h index 47e6942fae..2ea50307d2 100644 --- a/tests/unittests/phy/upper/signal_processors/dmrs_pucch_estimator_test_data.h +++ b/tests/unittests/phy/upper/signal_processors/dmrs_pucch_estimator_test_data.h @@ -22,7 +22,7 @@ #pragma once -// This file was generated using the following MATLAB class on 07-11-2024 (seed 0): +// This file was generated using the following MATLAB class on 13-11-2024 (seed 0): // + "srsPUCCHdmrsUnittest.m" #include "../../support/resource_grid_test_doubles.h" @@ -53,29 +53,29 @@ static const std::vector dmrs_pucch_estimator_test_data = { {dmrs_pucch_estimator::format2_configuration{{{0, 8}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 9, 2, 48, {27}, 98, {7}}, 1, 98}, {"test_data/dmrs_pucch_estimator_test_output6.dat"}}, {dmrs_pucch_estimator::format2_configuration{{{0, 8}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 2, 7, {12}, 745, {7}}, 4, 745}, {"test_data/dmrs_pucch_estimator_test_output7.dat"}}, {dmrs_pucch_estimator::format3_configuration{{{0, 6}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 14, 21, {}, 173, {7}}, 16, true}, {"test_data/dmrs_pucch_estimator_test_output8.dat"}}, - {dmrs_pucch_estimator::format3_configuration{{{0, 7}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 1, 11, 12, {}, 332, {2}}, 4, true}, {"test_data/dmrs_pucch_estimator_test_output9.dat"}}, - {dmrs_pucch_estimator::format3_configuration{{{0, 7}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 7, 4, 30, {43}, 634, {4}}, 8, false}, {"test_data/dmrs_pucch_estimator_test_output10.dat"}}, - {dmrs_pucch_estimator::format3_configuration{{{0, 3}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 2, 5, 21, {35}, 555, {7}}, 3, true}, {"test_data/dmrs_pucch_estimator_test_output11.dat"}}, - {dmrs_pucch_estimator::format4_configuration{{{0, 0}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 3, 4, 40, {}, 970, {6}}, true, 0}, {"test_data/dmrs_pucch_estimator_test_output12.dat"}}, - {dmrs_pucch_estimator::format4_configuration{{{0, 4}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 13, 9, {}, 395, {4}}, false, 0}, {"test_data/dmrs_pucch_estimator_test_output13.dat"}}, - {dmrs_pucch_estimator::format4_configuration{{{0, 4}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 5, 4, 5, {27}, 931, {1}}, false, 0}, {"test_data/dmrs_pucch_estimator_test_output14.dat"}}, - {dmrs_pucch_estimator::format4_configuration{{{0, 9}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 5, 4, 20, {7}, 698, {5}}, true, 1}, {"test_data/dmrs_pucch_estimator_test_output15.dat"}}, - {dmrs_pucch_estimator::format1_configuration{{{1, 7}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 1, 10, 37, {}, 293, {7}}, 11, 4}, {"test_data/dmrs_pucch_estimator_test_output16.dat"}}, - {dmrs_pucch_estimator::format1_configuration{{{1, 2}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 4, 8, 43, {}, 243, {5}}, 7, 3}, {"test_data/dmrs_pucch_estimator_test_output17.dat"}}, - {dmrs_pucch_estimator::format1_configuration{{{1, 6}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 4, 7, 28, {18}, 280, {4}}, 11, 0}, {"test_data/dmrs_pucch_estimator_test_output18.dat"}}, - {dmrs_pucch_estimator::format1_configuration{{{1, 15}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 14, 36, {43}, 691, {3}}, 5, 0}, {"test_data/dmrs_pucch_estimator_test_output19.dat"}}, - {dmrs_pucch_estimator::format2_configuration{{{1, 14}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 2, 1, 18, {}, 31, {7}}, 11, 31}, {"test_data/dmrs_pucch_estimator_test_output20.dat"}}, - {dmrs_pucch_estimator::format2_configuration{{{1, 14}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 5, 1, 34, {}, 642, {4}}, 1, 642}, {"test_data/dmrs_pucch_estimator_test_output21.dat"}}, - {dmrs_pucch_estimator::format2_configuration{{{1, 4}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 10, 2, 14, {26}, 360, {5}}, 12, 360}, {"test_data/dmrs_pucch_estimator_test_output22.dat"}}, - {dmrs_pucch_estimator::format2_configuration{{{1, 11}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 4, 2, 26, {12}, 407, {2}}, 8, 407}, {"test_data/dmrs_pucch_estimator_test_output23.dat"}}, - {dmrs_pucch_estimator::format3_configuration{{{1, 19}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 2, 10, 9, {}, 39, {0}}, 10, true}, {"test_data/dmrs_pucch_estimator_test_output24.dat"}}, - {dmrs_pucch_estimator::format3_configuration{{{1, 16}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 3, 6, 50, {}, 21, {0}}, 2, true}, {"test_data/dmrs_pucch_estimator_test_output25.dat"}}, - {dmrs_pucch_estimator::format3_configuration{{{1, 5}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 13, 18, {22}, 459, {2}}, 2, true}, {"test_data/dmrs_pucch_estimator_test_output26.dat"}}, - {dmrs_pucch_estimator::format3_configuration{{{1, 0}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 2, 11, 41, {1}, 959, {2}}, 8, true}, {"test_data/dmrs_pucch_estimator_test_output27.dat"}}, - {dmrs_pucch_estimator::format4_configuration{{{1, 3}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 10, 45, {}, 859, {5}}, true, 1}, {"test_data/dmrs_pucch_estimator_test_output28.dat"}}, - {dmrs_pucch_estimator::format4_configuration{{{1, 14}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 1, 10, 24, {}, 260, {6}}, false, 2}, {"test_data/dmrs_pucch_estimator_test_output29.dat"}}, - {dmrs_pucch_estimator::format4_configuration{{{1, 9}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 11, 40, {14}, 302, {2}}, true, 0}, {"test_data/dmrs_pucch_estimator_test_output30.dat"}}, - {dmrs_pucch_estimator::format4_configuration{{{1, 16}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 14, 45, {32}, 652, {7}}, true, 1}, {"test_data/dmrs_pucch_estimator_test_output31.dat"}}, + {dmrs_pucch_estimator::format3_configuration{{{0, 9}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 4, 7, 34, {}, 332, {6}}, 3, true}, {"test_data/dmrs_pucch_estimator_test_output9.dat"}}, + {dmrs_pucch_estimator::format3_configuration{{{0, 4}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 2, 10, 30, {20}, 634, {4}}, 8, false}, {"test_data/dmrs_pucch_estimator_test_output10.dat"}}, + {dmrs_pucch_estimator::format3_configuration{{{0, 9}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 2, 9, 18, {0}, 555, {2}}, 15, false}, {"test_data/dmrs_pucch_estimator_test_output11.dat"}}, + {dmrs_pucch_estimator::format4_configuration{{{0, 3}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 8, 4, 36, {}, 970, {5}}, false, 3}, {"test_data/dmrs_pucch_estimator_test_output12.dat"}}, + {dmrs_pucch_estimator::format4_configuration{{{0, 3}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 5, 6, 11, {}, 395, {5}}, false, 1}, {"test_data/dmrs_pucch_estimator_test_output13.dat"}}, + {dmrs_pucch_estimator::format4_configuration{{{0, 1}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 1, 5, 48, {45}, 931, {6}}, false, 0}, {"test_data/dmrs_pucch_estimator_test_output14.dat"}}, + {dmrs_pucch_estimator::format4_configuration{{{0, 0}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 1, 7, 40, {47}, 698, {0}}, true, 0}, {"test_data/dmrs_pucch_estimator_test_output15.dat"}}, + {dmrs_pucch_estimator::format1_configuration{{{1, 12}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 2, 9, 2, {}, 293, {0}}, 4, 3}, {"test_data/dmrs_pucch_estimator_test_output16.dat"}}, + {dmrs_pucch_estimator::format1_configuration{{{1, 16}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 5, 8, 7, {}, 243, {3}}, 10, 3}, {"test_data/dmrs_pucch_estimator_test_output17.dat"}}, + {dmrs_pucch_estimator::format1_configuration{{{1, 14}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 6, 5, 48, {32}, 280, {4}}, 4, 0}, {"test_data/dmrs_pucch_estimator_test_output18.dat"}}, + {dmrs_pucch_estimator::format1_configuration{{{1, 16}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 3, 7, 43, {50}, 691, {3}}, 8, 0}, {"test_data/dmrs_pucch_estimator_test_output19.dat"}}, + {dmrs_pucch_estimator::format2_configuration{{{1, 10}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 6, 1, 18, {}, 31, {2}}, 13, 31}, {"test_data/dmrs_pucch_estimator_test_output20.dat"}}, + {dmrs_pucch_estimator::format2_configuration{{{1, 13}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 2, 43, {}, 642, {7}}, 9, 642}, {"test_data/dmrs_pucch_estimator_test_output21.dat"}}, + {dmrs_pucch_estimator::format2_configuration{{{1, 7}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 7, 2, 11, {34}, 360, {5}}, 12, 360}, {"test_data/dmrs_pucch_estimator_test_output22.dat"}}, + {dmrs_pucch_estimator::format2_configuration{{{1, 0}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 3, 2, 12, {35}, 407, {2}}, 12, 407}, {"test_data/dmrs_pucch_estimator_test_output23.dat"}}, + {dmrs_pucch_estimator::format3_configuration{{{1, 2}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 1, 12, 30, {}, 39, {6}}, 5, false}, {"test_data/dmrs_pucch_estimator_test_output24.dat"}}, + {dmrs_pucch_estimator::format3_configuration{{{1, 17}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 14, 50, {}, 21, {2}}, 1, false}, {"test_data/dmrs_pucch_estimator_test_output25.dat"}}, + {dmrs_pucch_estimator::format3_configuration{{{1, 13}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 12, 18, {42}, 459, {4}}, 9, false}, {"test_data/dmrs_pucch_estimator_test_output26.dat"}}, + {dmrs_pucch_estimator::format3_configuration{{{1, 13}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 2, 6, 6, {21}, 959, {1}}, 4, false}, {"test_data/dmrs_pucch_estimator_test_output27.dat"}}, + {dmrs_pucch_estimator::format4_configuration{{{1, 2}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 8, 48, {}, 859, {7}}, true, 1}, {"test_data/dmrs_pucch_estimator_test_output28.dat"}}, + {dmrs_pucch_estimator::format4_configuration{{{1, 10}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 7, 2, {}, 260, {5}}, true, 1}, {"test_data/dmrs_pucch_estimator_test_output29.dat"}}, + {dmrs_pucch_estimator::format4_configuration{{{1, 17}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 0, 12, 47, {42}, 302, {4}}, true, 3}, {"test_data/dmrs_pucch_estimator_test_output30.dat"}}, + {dmrs_pucch_estimator::format4_configuration{{{1, 8}, cyclic_prefix::NORMAL, pucch_group_hopping::NEITHER, 1, 12, 13, {25}, 652, {3}}, false, 1}, {"test_data/dmrs_pucch_estimator_test_output31.dat"}}, // clang-format on }; diff --git a/tests/unittests/phy/upper/signal_processors/port_channel_estimator_test.cpp b/tests/unittests/phy/upper/signal_processors/port_channel_estimator_test.cpp index afd85f8f22..498819ea16 100644 --- a/tests/unittests/phy/upper/signal_processors/port_channel_estimator_test.cpp +++ b/tests/unittests/phy/upper/signal_processors/port_channel_estimator_test.cpp @@ -30,7 +30,6 @@ #include "srsran/phy/upper/channel_processors/pusch/pusch_processor_phy_capabilities.h" #include "srsran/phy/upper/signal_processors/port_channel_estimator_parameters.h" #include "srsran/phy/upper/signal_processors/signal_processor_factories.h" - #include using namespace srsran; diff --git a/tests/unittests/ran/uci/uci_part2_size_calculator_test.cpp b/tests/unittests/ran/uci/uci_part2_size_calculator_test.cpp index bf03dfb784..436b47a435 100644 --- a/tests/unittests/ran/uci/uci_part2_size_calculator_test.cpp +++ b/tests/unittests/ran/uci/uci_part2_size_calculator_test.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "srsran/ran/uci/uci_part2_size_calculator.h" #include @@ -183,4 +184,4 @@ TEST(uci_part2_size_calculator, basic_four_ports) ASSERT_EQ(csi_part2_size, 3); } -} \ No newline at end of file +} diff --git a/tests/unittests/rlc/rlc_metrics_aggregator_test.cpp b/tests/unittests/rlc/rlc_metrics_aggregator_test.cpp index 580d9ec3ee..fc6a68f581 100644 --- a/tests/unittests/rlc/rlc_metrics_aggregator_test.cpp +++ b/tests/unittests/rlc/rlc_metrics_aggregator_test.cpp @@ -19,6 +19,7 @@ * and at http://www.gnu.org/licenses/. * */ + #include "lib/rlc/rlc_metrics_aggregator.h" #include "srsran/srslog/srslog.h" #include "srsran/support/executors/manual_task_worker.h" diff --git a/tests/unittests/rlc/rlc_pdu_recycler_test.cpp b/tests/unittests/rlc/rlc_pdu_recycler_test.cpp index 18e18df54c..43664dcdbc 100644 --- a/tests/unittests/rlc/rlc_pdu_recycler_test.cpp +++ b/tests/unittests/rlc/rlc_pdu_recycler_test.cpp @@ -65,11 +65,9 @@ class rlc_pdu_recycler_test : public ::testing::Test TEST_F(rlc_pdu_recycler_test, recycler_memory_reserved) { - std::array, 3>& recycle_bins = pdu_recycler->get_recycle_bins(); - for (const std::vector& bin : recycle_bins) { - EXPECT_EQ(bin.size(), 0); - EXPECT_EQ(bin.capacity(), rlc_window_size); - } + auto& recycle_bin = pdu_recycler->get_recycle_queue(); + EXPECT_EQ(recycle_bin.size(), 0); + EXPECT_EQ(recycle_bin.capacity(), rlc_window_size); } TEST_F(rlc_pdu_recycler_test, clear_by_executor) @@ -77,25 +75,16 @@ TEST_F(rlc_pdu_recycler_test, clear_by_executor) byte_buffer pdu = test_helpers::create_pdcp_pdu(pdcp_sn_size::size12bits, /* is_srb = */ false, 0xaa, 3, 0xaa); EXPECT_TRUE(pdu_recycler->add_discarded_pdu(pdu.deep_copy().value())); // Check the PDU is stored in first recycle bin - std::array, 3>& recycle_bins = pdu_recycler->get_recycle_bins(); - EXPECT_EQ(recycle_bins[2].size(), 0); - EXPECT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 1); - EXPECT_EQ(recycle_bins[0][0], pdu); + auto& recycle_bin = pdu_recycler->get_recycle_queue(); + ASSERT_EQ(recycle_bin.size(), 1); // Schedule the cleanup in the other_worker task queue. Nothing will be deleted yet. pdu_recycler->clear_by_executor(other_worker); - EXPECT_EQ(recycle_bins[2].size(), 0); - EXPECT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 1); - EXPECT_EQ(recycle_bins[0][0], pdu); + ASSERT_EQ(recycle_bin.size(), 1); // Perform the cleanup by the other_worker. Everything will be deleted. other_worker.run_pending_tasks(); - for (const std::vector& bin : recycle_bins) { - EXPECT_EQ(bin.size(), 0); - EXPECT_EQ(bin.capacity(), rlc_window_size); - } + EXPECT_EQ(recycle_bin.size(), 0); } TEST_F(rlc_pdu_recycler_test, clear_multiple_times) @@ -104,75 +93,67 @@ TEST_F(rlc_pdu_recycler_test, clear_multiple_times) byte_buffer pdu2 = test_helpers::create_pdcp_pdu(pdcp_sn_size::size12bits, /* is_srb = */ false, 0xbb, 3, 0xbb); byte_buffer pdu3 = test_helpers::create_pdcp_pdu(pdcp_sn_size::size12bits, /* is_srb = */ false, 0xcc, 3, 0xcc); byte_buffer pdu4 = test_helpers::create_pdcp_pdu(pdcp_sn_size::size12bits, /* is_srb = */ false, 0xdd, 3, 0xdd); + + auto& recycle_bin = pdu_recycler->get_recycle_queue(); + EXPECT_TRUE(pdu_recycler->add_discarded_pdu(pdu1.deep_copy().value())); + // Check the PDU is stored in first recycle bin - std::array, 3>& recycle_bins = pdu_recycler->get_recycle_bins(); - EXPECT_EQ(recycle_bins[2].size(), 0); - EXPECT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 1); - EXPECT_EQ(recycle_bins[0][0], pdu1); + ASSERT_EQ(recycle_bin.size(), 1); // Schedule the cleanup in the other_worker task queue. Nothing will be deleted yet. pdu_recycler->clear_by_executor(other_worker); - EXPECT_EQ(recycle_bins[2].size(), 0); - EXPECT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 1); - EXPECT_EQ(recycle_bins[0][0], pdu1); + ASSERT_EQ(recycle_bin.size(), 1); // Discard PDU2, check its stored in second recycle bin EXPECT_TRUE(pdu_recycler->add_discarded_pdu(pdu2.deep_copy().value())); - EXPECT_EQ(recycle_bins[2].size(), 0); - ASSERT_EQ(recycle_bins[1].size(), 1); - ASSERT_EQ(recycle_bins[0].size(), 1); - EXPECT_EQ(recycle_bins[1][0], pdu2); - EXPECT_EQ(recycle_bins[0][0], pdu1); + ASSERT_EQ(recycle_bin.size(), 2); - // Perform the cleanup by the other_worker. The first bin will be deleted + // Perform the cleanup by the other_worker. The PDUs will be deleted other_worker.run_pending_tasks(); - EXPECT_EQ(recycle_bins[2].size(), 0); - ASSERT_EQ(recycle_bins[1].size(), 1); - ASSERT_EQ(recycle_bins[0].size(), 0); - - // Schedule the cleanup in the other_worker task queue. Nothing will be deleted yet. - pdu_recycler->clear_by_executor(other_worker); - EXPECT_EQ(recycle_bins[2].size(), 0); - ASSERT_EQ(recycle_bins[1].size(), 1); - ASSERT_EQ(recycle_bins[0].size(), 0); + ASSERT_EQ(recycle_bin.size(), 0); // Discard PDU3, check its stored in third recycle bin EXPECT_TRUE(pdu_recycler->add_discarded_pdu(pdu3.deep_copy().value())); - ASSERT_EQ(recycle_bins[2].size(), 1); - ASSERT_EQ(recycle_bins[1].size(), 1); - EXPECT_EQ(recycle_bins[0].size(), 0); - EXPECT_EQ(recycle_bins[2][0], pdu3); - EXPECT_EQ(recycle_bins[1][0], pdu2); + + // Schedule the cleanup in the other_worker task queue. Nothing will be deleted yet. + pdu_recycler->clear_by_executor(other_worker); + ASSERT_EQ(recycle_bin.size(), 1); // Perform the cleanup by the other_worker. The second bin will be deleted other_worker.run_pending_tasks(); - EXPECT_EQ(recycle_bins[2].size(), 1); - ASSERT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 0); + ASSERT_EQ(recycle_bin.size(), 0); +} + +TEST_F(rlc_pdu_recycler_test, clear_multiple_times_without_running_task) +{ + byte_buffer pdu1 = test_helpers::create_pdcp_pdu(pdcp_sn_size::size12bits, /* is_srb = */ false, 0xaa, 3, 0xaa); + byte_buffer pdu2 = test_helpers::create_pdcp_pdu(pdcp_sn_size::size12bits, /* is_srb = */ false, 0xbb, 3, 0xbb); + byte_buffer pdu3 = test_helpers::create_pdcp_pdu(pdcp_sn_size::size12bits, /* is_srb = */ false, 0xcc, 3, 0xcc); + byte_buffer pdu4 = test_helpers::create_pdcp_pdu(pdcp_sn_size::size12bits, /* is_srb = */ false, 0xdd, 3, 0xdd); + EXPECT_TRUE(pdu_recycler->add_discarded_pdu(pdu1.deep_copy().value())); + // Check the PDU is stored in first recycle bin + auto& recycle_bin = pdu_recycler->get_recycle_queue(); + ASSERT_EQ(recycle_bin.size(), 1); // Schedule the cleanup in the other_worker task queue. Nothing will be deleted yet. pdu_recycler->clear_by_executor(other_worker); - EXPECT_EQ(recycle_bins[2].size(), 1); - ASSERT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 0); + ASSERT_EQ(recycle_bin.size(), 1); - // Perform the cleanup by the other_worker. Everything will be deleted. - other_worker.run_pending_tasks(); - for (const std::vector& bin : recycle_bins) { - EXPECT_EQ(bin.size(), 0); - EXPECT_EQ(bin.capacity(), rlc_window_size); - } + // Don't perform the cleanup by the other_worker. + // Discard one more PDU and confirm 2 PDUs in the queue. - // We start again at first recycling bin - EXPECT_TRUE(pdu_recycler->add_discarded_pdu(pdu4.deep_copy().value())); - // Check the PDU is stored in first recycle bin - EXPECT_EQ(recycle_bins[2].size(), 0); - EXPECT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 1); - EXPECT_EQ(recycle_bins[0][0], pdu4); + // Discard PDU2, check its stored in the recycle bin + EXPECT_TRUE(pdu_recycler->add_discarded_pdu(pdu2.deep_copy().value())); + ASSERT_EQ(recycle_bin.size(), 2); + + // Schedule the cleanup in the other_worker task queue. Nothing will be deleted yet. + pdu_recycler->clear_by_executor(other_worker); + ASSERT_EQ(recycle_bin.size(), 2); + + // Finally run pending tasks + other_worker.run_pending_tasks(); + ASSERT_EQ(recycle_bin.size(), 0); } TEST_F(rlc_pdu_recycler_test, full_recycle_bin) @@ -187,28 +168,17 @@ TEST_F(rlc_pdu_recycler_test, full_recycle_bin) // Recycle bin is full - any extra PDU will be deleted on the spot and the function returns false EXPECT_FALSE(pdu_recycler->add_discarded_pdu(pdu3.deep_copy().value())); - // Check the PDUs are stored in first recycle bin - std::array, 3>& recycle_bins = pdu_recycler->get_recycle_bins(); - EXPECT_EQ(recycle_bins[2].size(), 0); - EXPECT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 2); - EXPECT_EQ(recycle_bins[0][0], pdu1); - EXPECT_EQ(recycle_bins[0][1], pdu2); + // Check the PDUs are stored in the recycle bin + auto& recycle_bin = pdu_recycler->get_recycle_queue(); + ASSERT_EQ(recycle_bin.size(), 2); // Schedule the cleanup in the other_worker task queue. Nothing will be deleted yet. pdu_recycler->clear_by_executor(other_worker); - EXPECT_EQ(recycle_bins[2].size(), 0); - EXPECT_EQ(recycle_bins[1].size(), 0); - ASSERT_EQ(recycle_bins[0].size(), 2); - EXPECT_EQ(recycle_bins[0][0], pdu1); - EXPECT_EQ(recycle_bins[0][1], pdu2); + ASSERT_EQ(recycle_bin.size(), 2); // Perform the cleanup by the other_worker. Everything will be deleted. other_worker.run_pending_tasks(); - for (const std::vector& bin : recycle_bins) { - EXPECT_EQ(bin.size(), 0); - EXPECT_EQ(bin.capacity(), rlc_window_size); - } + ASSERT_EQ(recycle_bin.size(), 0); } int main(int argc, char** argv) diff --git a/utils/trx_srsran/trx_srsran_test.cpp b/utils/trx_srsran/trx_srsran_test.cpp index e9d07d96b5..8aee0acb64 100644 --- a/utils/trx_srsran/trx_srsran_test.cpp +++ b/utils/trx_srsran/trx_srsran_test.cpp @@ -22,7 +22,6 @@ #include #include - #include extern "C" { @@ -128,4 +127,4 @@ int main(int argc, char** argv) std::cout << "Successful." << std::endl; exit(EXIT_SUCCESS); -} \ No newline at end of file +}