Skip to content

Commit

Permalink
Update main
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/codeql.yml
  • Loading branch information
codebot committed Oct 20, 2023
2 parents 99d51c7 + 549661c commit e38e418
Show file tree
Hide file tree
Showing 54 changed files with 406 additions and 198 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '38 10 * * 2'

jobs:
analyze:
Expand Down
4 changes: 4 additions & 0 deletions .gitlab/ci/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,21 @@ rf:
variables:
KEYWORDS: "not iperf"
E2E_LOG_LEVEL: "info"
allow_failure: true

rf-iperf-udp:
extends: .rf
variables:
KEYWORDS: "iperf and udp"
E2E_LOG_LEVEL: "info"
allow_failure: true

rf-iperf-tcp:
extends: .rf
variables:
KEYWORDS: "iperf and tcp"
E2E_LOG_LEVEL: "info"
allow_failure: true

rf-tsan:
extends: .rf
Expand All @@ -301,6 +304,7 @@ rf-tsan:
- job: "smoke tsan update cache"
artifacts: true
- *retina-needs
retry: 2

rf-asan:
extends: .rf
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Change Log for Releases
=======================

## 23.10
* Added downlink MIMO (up to 4 layers)
* Added Open Fronthaul (OFH) interface for split 7.2 ORAN radio units (optionally using DPDK)
* Added E2 interface including KPM and RAN control (RC) service model
* Added Timing Advance support
* Added Docker files
* Expose many more config parameters
* Other bug-fixes and improved stability and performance in all parts

## 23.5
* Updated ASN.1 of RRC/NGAP/F1AP/E1AP to 3GPP Release 17.4
* Add UE capability transfer procedure
Expand Down
3 changes: 3 additions & 0 deletions apps/gnb/gnb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ int main(int argc, char** argv)
// Stop CU-UP activity.
cu_up_obj->stop();

// Stop CU-CP activity.
cu_cp_obj->stop();

if (not gnb_cfg.amf_cfg.no_core) {
gnb_logger.info("Closing network connections...");
ngap_adapter->disconnect_gateway();
Expand Down
57 changes: 46 additions & 11 deletions apps/gnb/gnb_appconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ struct cell_appconfig {
/// RLC UM TX configuration
struct rlc_tx_um_appconfig {
uint16_t sn_field_length; ///< Number of bits used for sequence number
int32_t t_reassembly; ///< Timer used by rx to detect PDU loss (ms)
uint32_t queue_size; ///< RLC SDU queue size
};

/// RLC UM RX configuration
Expand All @@ -519,6 +519,7 @@ struct rlc_tx_am_appconfig {
int32_t poll_pdu; ///< Insert poll bit after this many PDUs
int32_t poll_byte; ///< Insert poll bit after this much data (bytes)
uint32_t max_window = 0; ///< Custom parameter to limit the maximum window size for memory reasons. 0 means no limit.
uint32_t queue_size = 4096; ///< RLC SDU queue size
};

/// RLC UM RX configuration
Expand Down Expand Up @@ -668,6 +669,10 @@ struct cu_cp_appconfig {
security_appconfig security_config;
};

struct cu_up_appconfig {
unsigned gtpu_queue_size = 2048;
};

struct log_appconfig {
std::string filename = "/tmp/gnb.log"; // Path to write log file or "stdout" to print to console.
std::string all_level = "warning"; // Default log level for all layers.
Expand Down Expand Up @@ -753,7 +758,7 @@ struct expert_upper_phy_appconfig {
/// Higher values increase the downlink processing pipeline length, which improves performance and stability for
/// demanding cell configurations, such as using large bandwidths or higher order MIMO. Higher values also increase
/// the round trip latency of the radio link.
unsigned max_processing_delay_slots = 2U;
unsigned max_processing_delay_slots = 5U;
/// Number of PUSCH LDPC decoder iterations.
unsigned pusch_decoder_max_iterations = 6;
/// Set to true to enable the PUSCH LDPC decoder early stop.
Expand Down Expand Up @@ -899,6 +904,8 @@ struct ru_ofh_cell_appconfig {
ru_ofh_base_cell_appconfig cell;
/// Ethernet network interface name.
std::string network_interface = "enp1s0f0";
/// Promiscuous mode flag.
bool enable_promiscuous_mode = true;
/// Radio Unit MAC address.
std::string ru_mac_address = "70:b3:d5:e1:5b:06";
/// Distributed Unit MAC address.
Expand Down Expand Up @@ -974,15 +981,6 @@ struct upper_phy_threads_appconfig {

/// Lower PHY thread configuration fo the gNB.
struct lower_phy_threads_appconfig {
lower_phy_threads_appconfig()
{
// Set the lower PHY thread profile according to the number of CPU cores.
if (srsran::compute_host_nof_hardware_threads() >= 8U) {
execution_profile = lower_phy_thread_profile::quad;
} else {
execution_profile = lower_phy_thread_profile::dual;
}
}
/// \brief Lower physical layer thread profile.
///
/// If not configured, a default value is selected based on the number of available CPU cores.
Expand All @@ -996,6 +994,41 @@ struct ofh_threads_appconfig {

/// Expert threads configuration of the gNB app.
struct expert_threads_appconfig {
expert_threads_appconfig()
{
unsigned nof_threads = compute_host_nof_hardware_threads();

if (nof_threads < 4) {
upper_threads.nof_ul_threads = 1;
upper_threads.nof_pusch_decoder_threads = 0;
upper_threads.nof_pdsch_threads = 1;
upper_threads.nof_dl_threads = 1;
lower_threads.execution_profile = lower_phy_thread_profile::single;
ofh_threads.is_downlink_parallelized = false;
} else if (nof_threads < 8) {
upper_threads.nof_ul_threads = 1;
upper_threads.nof_pusch_decoder_threads = 1;
upper_threads.nof_pdsch_threads = 2;
upper_threads.nof_dl_threads = 2;
lower_threads.execution_profile = lower_phy_thread_profile::dual;
ofh_threads.is_downlink_parallelized = true;
} else if (nof_threads < 16) {
upper_threads.nof_ul_threads = 1;
upper_threads.nof_pusch_decoder_threads = 1;
upper_threads.nof_pdsch_threads = 4;
upper_threads.nof_dl_threads = 2;
lower_threads.execution_profile = lower_phy_thread_profile::quad;
ofh_threads.is_downlink_parallelized = true;
} else {
upper_threads.nof_ul_threads = 2;
upper_threads.nof_pusch_decoder_threads = 2;
upper_threads.nof_pdsch_threads = 8;
upper_threads.nof_dl_threads = 4;
lower_threads.execution_profile = lower_phy_thread_profile::quad;
ofh_threads.is_downlink_parallelized = true;
}
}

/// Upper PHY thread configuration of the gNB app.
upper_phy_threads_appconfig upper_threads;
/// Lower PHY thread configuration of the gNB app.
Expand Down Expand Up @@ -1036,6 +1069,8 @@ struct gnb_appconfig {
amf_appconfig amf_cfg;
/// CU-CP configuration.
cu_cp_appconfig cu_cp_cfg;
/// CU-CP configuration.
cu_up_appconfig cu_up_cfg;
/// \brief E2 configuration.
e2_appconfig e2_cfg;
/// Radio Unit configuration.
Expand Down
68 changes: 63 additions & 5 deletions apps/gnb/gnb_appconfig_cli11_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "gnb_appconfig_cli11_schema.h"
#include "gnb_appconfig.h"
#include "srsran/ran/duplex_mode.h"
#include "srsran/ran/pdsch/pdsch_mcs.h"
#include "srsran/support/cli11_utils.h"
#include "srsran/support/config_parsers.h"
Expand Down Expand Up @@ -388,6 +389,11 @@ static void configure_cli11_cu_cp_args(CLI::App& app, cu_cp_appconfig& cu_cp_par
configure_cli11_security_args(*security_subcmd, cu_cp_params.security_config);
}

static void configure_cli11_cu_up_args(CLI::App& app, cu_up_appconfig& cu_up_params)
{
app.add_option("--gtpu_queue_size", cu_up_params.gtpu_queue_size, "GTP-U queue size, in PDUs")->capture_default_str();
}

static void configure_cli11_expert_phy_args(CLI::App& app, expert_upper_phy_appconfig& expert_phy_params)
{
auto pusch_sinr_method_check = [](const std::string& value) -> std::string {
Expand Down Expand Up @@ -1288,6 +1294,8 @@ static void configure_cli11_rlc_um_args(CLI::App& app, rlc_um_appconfig& rlc_um_
{
CLI::App* rlc_tx_um_subcmd = app.add_subcommand("tx", "UM TX parameters");
rlc_tx_um_subcmd->add_option("--sn", rlc_um_params.tx.sn_field_length, "RLC UM TX SN")->capture_default_str();
rlc_tx_um_subcmd->add_option("--queue-size", rlc_um_params.tx.queue_size, "RLC UM TX SDU queue size")
->capture_default_str();
CLI::App* rlc_rx_um_subcmd = app.add_subcommand("rx", "UM TX parameters");
rlc_rx_um_subcmd->add_option("--sn", rlc_um_params.rx.sn_field_length, "RLC UM RX SN")->capture_default_str();
rlc_rx_um_subcmd->add_option("--t-reassembly", rlc_um_params.rx.t_reassembly, "RLC UM t-Reassembly")
Expand All @@ -1304,11 +1312,12 @@ static void configure_cli11_rlc_am_args(CLI::App& app, rlc_am_appconfig& rlc_am_
->capture_default_str();
rlc_tx_am_subcmd->add_option("--poll-pdu", rlc_am_params.tx.poll_pdu, "RLC AM TX PollPdu")->capture_default_str();
rlc_tx_am_subcmd->add_option("--poll-byte", rlc_am_params.tx.poll_byte, "RLC AM TX PollByte")->capture_default_str();
rlc_tx_am_subcmd
->add_option("--max_window",
rlc_am_params.tx.max_window,
"Non-standard parameter that limits the tx window size. Can be used for limiting memory usage with "
"large windows. 0 means no limits other than the SN size (i.e. 2^[sn_size-1]).")
rlc_tx_am_subcmd->add_option(
"--max_window",
rlc_am_params.tx.max_window,
"Non-standard parameter that limits the tx window size. Can be used for limiting memory usage with "
"large windows. 0 means no limits other than the SN size (i.e. 2^[sn_size-1]).");
rlc_tx_am_subcmd->add_option("--queue-size", rlc_am_params.tx.queue_size, "RLC AM TX SDU queue size")
->capture_default_str();
CLI::App* rlc_rx_am_subcmd = app.add_subcommand("rx", "AM RX parameters");
rlc_rx_am_subcmd->add_option("--sn", rlc_am_params.rx.sn_field_length, "RLC AM RX SN")->capture_default_str();
Expand Down Expand Up @@ -1656,6 +1665,8 @@ static void configure_cli11_ru_ofh_cells_args(CLI::App& app, ru_ofh_cell_appconf
{
configure_cli11_ru_ofh_base_cell_args(app, config.cell);
app.add_option("--network_interface", config.network_interface, "Network interface")->capture_default_str();
app.add_option("--enable_promiscuous", config.enable_promiscuous_mode, "Promiscuous mode flag")
->capture_default_str();
app.add_option("--ru_mac_addr", config.ru_mac_address, "Radio Unit MAC address")->capture_default_str();
app.add_option("--du_mac_addr", config.du_mac_address, "Distributed Unit MAC address")->capture_default_str();
app.add_option("--vlan_tag", config.vlan_tag, "V-LAN identifier")->capture_default_str()->check(CLI::Range(1, 4094));
Expand Down Expand Up @@ -1986,6 +1997,47 @@ static void manage_hal_optional(CLI::App& app, gnb_appconfig& gnb_cfg)
}
}

static void manage_expert_execution_threads(CLI::App& app, gnb_appconfig& gnb_cfg)
{
if (!variant_holds_alternative<ru_sdr_appconfig>(gnb_cfg.ru_cfg)) {
return;
}

// Ignore the default settings based in the number of CPU cores for ZMQ.
if (variant_get<ru_sdr_appconfig>(gnb_cfg.ru_cfg).device_driver == "zmq") {
upper_phy_threads_appconfig& upper = gnb_cfg.expert_execution_cfg.threads.upper_threads;
upper.nof_pdsch_threads = 1;
upper.nof_pusch_decoder_threads = 0;
upper.nof_ul_threads = 1;
upper.nof_dl_threads = 1;
gnb_cfg.expert_execution_cfg.threads.lower_threads.execution_profile = lower_phy_thread_profile::blocking;
}
}

static void manage_processing_delay(CLI::App& app, gnb_appconfig& gnb_cfg)
{
// If max proc delay property is present in the config, do nothing.
CLI::App* expert_cmd = app.get_subcommand("expert_phy");
if (expert_cmd->count_all() >= 1 && expert_cmd->count("--max_proc_delay") >= 1) {
return;
}

// As processing delay is not cell related, use the first cell to update the value.
const auto& cell = gnb_cfg.cells_cfg.front().cell;
nr_band band = cell.band ? cell.band.value() : band_helper::get_band_from_dl_arfcn(cell.dl_arfcn);

switch (band_helper::get_duplex_mode(band)) {
case duplex_mode::TDD:
gnb_cfg.expert_phy_cfg.max_processing_delay_slots = 5;
break;
case duplex_mode::FDD:
gnb_cfg.expert_phy_cfg.max_processing_delay_slots = 2;
break;
default:
break;
}
}

void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appconfig& gnb_cfg)
{
app.add_option("--gnb_id", gnb_cfg.gnb_id, "gNodeB identifier")->capture_default_str();
Expand Down Expand Up @@ -2018,6 +2070,10 @@ void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appcon
CLI::App* cu_cp_subcmd = app.add_subcommand("cu_cp", "CU-CP parameters")->configurable();
configure_cli11_cu_cp_args(*cu_cp_subcmd, gnb_cfg.cu_cp_cfg);

// CU-UP section
CLI::App* cu_up_subcmd = app.add_subcommand("cu_up", "CU-CP parameters")->configurable();
configure_cli11_cu_up_args(*cu_up_subcmd, gnb_cfg.cu_up_cfg);

// NOTE: CLI11 needs that the life of the variable lasts longer than the call of this function. As both options need
// to be added and a variant is used to store the Radio Unit configuration, the configuration is parsed in a helper
// variable, but as it is requested later, the variable needs to be static.
Expand Down Expand Up @@ -2121,5 +2177,7 @@ void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appcon
app.callback([&]() {
manage_ru_variant(app, gnb_cfg, sdr_cfg, ofh_cfg);
manage_hal_optional(app, gnb_cfg);
manage_expert_execution_threads(app, gnb_cfg);
manage_processing_delay(app, gnb_cfg);
});
}
28 changes: 17 additions & 11 deletions apps/gnb/gnb_appconfig_translators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ std::map<five_qi_t, du_qos_config> srsran::generate_du_qos_config(const gnb_appc
if (!from_number(out_rlc.um.tx.sn_field_length, qos.rlc.um.tx.sn_field_length)) {
report_error("Invalid RLC UM TX SN: 5QI={}, SN={}\n", qos.five_qi, qos.rlc.um.tx.sn_field_length);
}
out_rlc.um.tx.queue_size = qos.rlc.um.tx.queue_size;
} else if (out_rlc.mode == rlc_mode::am) {
// AM Config
//< TX SN
Expand All @@ -888,6 +889,7 @@ std::map<five_qi_t, du_qos_config> srsran::generate_du_qos_config(const gnb_appc
out_rlc.am.tx.poll_pdu = qos.rlc.am.tx.poll_pdu;
out_rlc.am.tx.poll_byte = qos.rlc.am.tx.poll_byte;
out_rlc.am.tx.max_window = qos.rlc.am.tx.max_window;
out_rlc.am.tx.queue_size = qos.rlc.am.tx.queue_size;
//< RX SN
if (!from_number(out_rlc.am.rx.sn_field_length, qos.rlc.am.rx.sn_field_length)) {
report_error("Invalid RLC AM RX SN: 5QI={}, SN={}\n", qos.five_qi, qos.rlc.am.rx.sn_field_length);
Expand Down Expand Up @@ -1169,7 +1171,8 @@ generate_ru_ofh_config(ru_ofh_configuration& out_cfg, const gnb_appconfig& confi
out_cfg.sector_configs.emplace_back();
ru_ofh_sector_configuration& sector_cfg = out_cfg.sector_configs.back();

sector_cfg.interface = cell_cfg.network_interface;
sector_cfg.interface = cell_cfg.network_interface;
sector_cfg.is_promiscuous_mode_enabled = cell_cfg.enable_promiscuous_mode;
if (!parse_mac_address(cell_cfg.du_mac_address, sector_cfg.mac_src_address)) {
srsran_terminate("Invalid Distributed Unit MAC address");
}
Expand Down Expand Up @@ -1284,6 +1287,14 @@ std::vector<upper_phy_config> srsran::generate_du_low_config(const gnb_appconfig
// Maximum number of HARQ processes for a PUSCH HARQ process.
static constexpr unsigned max_nof_pusch_harq = 16;

// Maximum concurrent PUSCH processing. If there are no dedicated threads for PUSCH decoding, set the maximum
// concurrency to one. Otherwise, assume every possible PUSCH transmission for the maximum number of HARQ could be
// enqueued.
unsigned max_pusch_concurrency = config.common_cell_cfg.pusch_cfg.max_puschs_per_slot * max_nof_pusch_harq;
if (config.expert_execution_cfg.threads.upper_threads.nof_pusch_decoder_threads == 0) {
max_pusch_concurrency = 1;
}

cfg.log_level = srslog::str_to_basic_level(config.log_cfg.phy_level);
cfg.enable_logging_broadcast = config.log_cfg.broadcast_enabled;
cfg.rx_symbol_printer_filename = config.log_cfg.phy_rx_symbols_filename;
Expand All @@ -1298,7 +1309,7 @@ std::vector<upper_phy_config> srsran::generate_du_low_config(const gnb_appconfig
cfg.nof_slots_ul_rg = ul_pipeline_depth;
cfg.nof_ul_processors = ul_pipeline_depth;
cfg.max_ul_thread_concurrency = config.expert_execution_cfg.threads.upper_threads.nof_ul_threads + 1;
cfg.max_pusch_concurrency = MAX_UE_PDUS_PER_SLOT * max_nof_pusch_harq;
cfg.max_pusch_concurrency = max_pusch_concurrency;
cfg.nof_pusch_decoder_threads = config.expert_execution_cfg.threads.upper_threads.nof_pusch_decoder_threads +
config.expert_execution_cfg.threads.upper_threads.nof_ul_threads;
cfg.nof_prach_buffer = prach_pipeline_depth * nof_slots_per_subframe;
Expand Down Expand Up @@ -1446,18 +1457,13 @@ static void derive_cell_auto_params(base_cell_appconfig& cell_cfg)
cell_cfg.tdd_ul_dl_cfg->pattern1.nof_ul_symbols = 0;
}

// If PRACH configuration Index not set, derive a valid one.
// If PRACH configuration Index not set, a default one is assigned.
if (not cell_cfg.prach_cfg.prach_config_index.has_value()) {
if (band_helper::get_duplex_mode(cell_cfg.band.value()) == duplex_mode::FDD) {
cell_cfg.prach_cfg.prach_config_index = 1;
cell_cfg.prach_cfg.prach_config_index = 16;
} else {
// TDD case. Ensure the PRACH falls in UL slots.
optional<uint8_t> index_found = prach_helper::find_valid_prach_config_index(
cell_cfg.common_scs, generate_tdd_pattern(cell_cfg.common_scs, cell_cfg.tdd_ul_dl_cfg.value()));
if (not index_found.has_value()) {
report_error("Failed to auto-derive PRACH configuration index");
}
cell_cfg.prach_cfg.prach_config_index = *index_found;
// Valid for TDD period of 5 ms. And, PRACH index 159 is well tested.
cell_cfg.prach_cfg.prach_config_index = 159;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/gnb/gnb_appconfig_validators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static bool validate_pucch_cell_app_config(const base_cell_appconfig& config)
/// Validates the given PRACH cell application configuration. Returns true on success, otherwise false.
static bool validate_prach_cell_app_config(const prach_appconfig& config, nr_band band)
{
srsran_assert(config.prach_config_index.has_value(), "The PRACH configuration index must be set or auto-derived.");
srsran_assert(config.prach_config_index.has_value(), "The PRACH configuration index must be set.");

auto code =
prach_helper::prach_config_index_is_valid(config.prach_config_index.value(), band_helper::get_duplex_mode(band));
Expand Down
2 changes: 1 addition & 1 deletion apps/gnb/gnb_worker_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void worker_manager::create_du_cu_executors(const gnb_appconfig& appcfg)
{{concurrent_queue_policy::lockfree_mpmc, task_worker_queue_size},
{concurrent_queue_policy::lockfree_mpmc, task_worker_queue_size},
// The IO-broker is currently single threaded, so we can use a SPSC.
{concurrent_queue_policy::lockfree_spsc, task_worker_queue_size}},
{concurrent_queue_policy::lockfree_spsc, appcfg.cu_up_cfg.gtpu_queue_size}},
std::chrono::microseconds{200},
{{"ue_up_ctrl_exec", task_priority::max},
{"ue_ul_exec", task_priority::max - 1, false},
Expand Down
Loading

0 comments on commit e38e418

Please sign in to comment.