Skip to content

Commit

Permalink
Update main
Browse files Browse the repository at this point in the history
# Conflicts:
#	docker/metrics_server/Dockerfile
#	lib/cu_cp/adapters/mobility_manager_adapters.h
#	tests/unittests/phy/upper/channel_processors/pdcch_modulator_test_data.tar.gz
#	tests/unittests/phy/upper/channel_processors/pucch_processor_format2_test_data.tar.gz
#	tests/unittests/phy/upper/channel_processors/ssb_processor_test_data.tar.gz
#	tests/unittests/phy/upper/signal_processors/dmrs_pbch_processor_test_data.tar.gz
#	tests/unittests/phy/upper/signal_processors/dmrs_pdcch_processor_test_data.tar.gz
#	tests/unittests/phy/upper/signal_processors/dmrs_pdsch_processor_test_data.tar.gz
#	tests/unittests/phy/upper/signal_processors/dmrs_pucch_processor_test_data.tar.gz
#	tests/unittests/phy/upper/signal_processors/dmrs_pusch_estimator_test_data.tar.gz
  • Loading branch information
codebot committed Dec 18, 2023
2 parents 55c984b + bcbc26e commit 60811de
Show file tree
Hide file tree
Showing 253 changed files with 5,230 additions and 3,110 deletions.
6 changes: 3 additions & 3 deletions .gitlab/ci/e2e/.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SRSGNB_REGISTRY_URI=registry.gitlab.com/softwareradiosystems/srsgnb
RETINA_REGISTRY_PREFIX=registry.gitlab.com/softwareradiosystems/ci/retina
RETINA_VERSION=0.37.8
RETINA_VERSION=0.37.13
AMARISOFT_VERSION=2023-03-17
SRSUE_VERSION=23.04.01
SRSUE_VERSION=23.11
OPEN5GS_VERSION=2.5.6
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
METRICS_SERVER_VERSION=1.3.0
METRICS_SERVER_VERSION=1.4.0
8 changes: 5 additions & 3 deletions apps/gnb/gnb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ int main(int argc, char** argv)
json_channel.set_enabled(gnb_cfg.metrics_cfg.enable_json_metrics);

// Create console helper object for commands and metrics printing.
gnb_console_helper console(*epoll_broker, json_channel);
gnb_console_helper console(*epoll_broker, json_channel, gnb_cfg.metrics_cfg.autostart_stdout_metrics);
console.on_app_starting();

std::unique_ptr<metrics_hub> hub = std::make_unique<metrics_hub>(*workers.metrics_hub_exec);
Expand Down Expand Up @@ -466,9 +466,11 @@ int main(int argc, char** argv)

// Create CU-UP config.
srsran::srs_cu_up::cu_up_configuration cu_up_cfg = generate_cu_up_config(gnb_cfg);
cu_up_cfg.cu_up_executor = workers.cu_up_exec;
cu_up_cfg.ctrl_executor = workers.cu_up_ctrl_exec;
cu_up_cfg.cu_up_e2_exec = workers.cu_up_e2_exec;
cu_up_cfg.gtpu_pdu_executor = workers.gtpu_pdu_exec;
cu_up_cfg.dl_executor = workers.cu_up_dl_exec;
cu_up_cfg.ul_executor = workers.cu_up_ul_exec;
cu_up_cfg.io_ul_executor = workers.cu_up_ul_exec; // Optinally select separate exec for UL IO
cu_up_cfg.e1ap.e1ap_conn_client = &e1ap_gw;
cu_up_cfg.f1u_gateway = f1u_conn->get_f1u_cu_up_gateway();
cu_up_cfg.epoll_broker = epoll_broker.get();
Expand Down
12 changes: 10 additions & 2 deletions apps/gnb/gnb_appconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ struct pucch_appconfig {
max_pucch_code_rate max_code_rate = max_pucch_code_rate::dot_35;
/// Minimum k1 value (distance in slots between PDSCH and HARQ-ACK) that the gNB can use. Values: {1, ..., 15}.
unsigned min_k1 = 4;

/// Maximum number of consecutive undecoded PUCCH Format 2 for CSI before an RLF is reported.
unsigned max_consecutive_kos = 100;
};

/// Parameters that are used to initialize or build the \c PhysicalCellGroupConfig, TS 38.331.
Expand Down Expand Up @@ -538,6 +541,10 @@ struct rlc_rx_am_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)
int32_t t_status_prohibit; ///< Timer used by rx to prohibit tx of status PDU (ms)

// Implementation-specific parameters that are not specified by 3GPP
/// Maximum number of visited SNs in the RX window when building a status report. 0 means no limit.
uint32_t max_sn_per_status = 0;
};

/// RLC AM configuration
Expand Down Expand Up @@ -791,8 +798,9 @@ struct metrics_appconfig {
unsigned cu_cp_statistics_report_period = 1; // Statistics report period in seconds
unsigned cu_up_statistics_report_period = 1; // Statistics report period in seconds
/// JSON metrics reporting.
bool enable_json_metrics = false;
std::string json_filename = "/tmp/gnb_metrics.json";
bool enable_json_metrics = false;
std::string json_filename = "/tmp/gnb_metrics.json";
bool autostart_stdout_metrics = false;
};

/// Lower physical layer thread profiles.
Expand Down
11 changes: 11 additions & 0 deletions apps/gnb/gnb_appconfig_cli11_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ static void configure_cli11_metrics_args(CLI::App& app, metrics_appconfig& metri
->always_capture_default();
app.add_option("--json_metrics_filename", metrics_params.json_filename, "JSON metrics output path")
->capture_default_str();
app.add_option(
"--autostart_stdout_metrics", metrics_params.autostart_stdout_metrics, "Autostart stdout metrics reporting")
->capture_default_str();
}

static void configure_cli11_slicing_args(CLI::App& app, s_nssai_t& slice_params)
Expand Down Expand Up @@ -877,6 +880,11 @@ static void configure_cli11_pucch_args(CLI::App& app, pucch_appconfig& pucch_par
"latency, but place a stricter requirement on the UE decode latency.")
->capture_default_str()
->check(CLI::Range(1, 4));

app.add_option("--max_consecutive_kos",
pucch_params.max_consecutive_kos,
"Maximum number of consecutive undecoded PUCCH F2 for CSI before an Radio Link Failure is reported")
->capture_default_str();
}

static void configure_cli11_ul_common_args(CLI::App& app, ul_common_appconfig& ul_common_params)
Expand Down Expand Up @@ -1405,6 +1413,9 @@ static void configure_cli11_rlc_am_args(CLI::App& app, rlc_am_appconfig& rlc_am_
->capture_default_str();
rlc_rx_am_subcmd->add_option("--t-status-prohibit", rlc_am_params.rx.t_status_prohibit, "RLC AM RX t-StatusProhibit")
->capture_default_str();
rlc_rx_am_subcmd->add_option("--max_sn_per_status", rlc_am_params.rx.max_sn_per_status, "RLC AM RX status SN limit")
->capture_default_str();
;
}

static void configure_cli11_rlc_args(CLI::App& app, rlc_appconfig& rlc_params)
Expand Down
30 changes: 15 additions & 15 deletions apps/gnb/gnb_appconfig_translators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,6 @@ std::vector<du_cell_config> srsran::generate_du_cell_config(const gnb_appconfig&
unsigned cset1_start_crb = 0;
if (base_cell.pdcch_cfg.dedicated.coreset1_rb_start.has_value()) {
cset1_start_crb = base_cell.pdcch_cfg.dedicated.coreset1_rb_start.value();
} else if (not base_cell.pdcch_cfg.dedicated.dci_format_0_1_and_1_1) {
// [Implementation-defined] Reason for starting from frequency resource 1 (i.e. CRB6) to remove the ambiguity of
// UE decoding the DCI in CSS rather than USS when using fallback DCI formats (DCI format 1_0 and 0_0).
cset1_start_crb = 6;
}
unsigned cset1_l_crb = nof_crbs - cset1_start_crb;
if (base_cell.pdcch_cfg.dedicated.coreset1_l_crb.has_value()) {
Expand Down Expand Up @@ -716,15 +712,15 @@ std::vector<du_cell_config> srsran::generate_du_cell_config(const gnb_appconfig&
ss_cfg.set_non_ss0_monitored_dci_formats(search_space_configuration::ue_specific_dci_format::f0_0_and_f1_0);
}

// PDSCH-Config - Update PDSCH time domain resource allocations based on partial slot.
if (band_helper::get_duplex_mode(param.band.value()) == duplex_mode::TDD) {
const auto& tdd_cfg = out_cell.tdd_ul_dl_cfg_common.value();
out_cell.dl_cfg_common.init_dl_bwp.pdsch_common.pdsch_td_alloc_list =
config_helpers::make_pdsch_time_domain_resource(param.search_space0_index,
out_cell.dl_cfg_common.init_dl_bwp.pdcch_common,
out_cell.ue_ded_serv_cell_cfg.init_dl_bwp.pdcch_cfg,
tdd_cfg);
}
// PDSCH-Config - Update PDSCH time domain resource allocations based on partial slot and/or dedicated PDCCH
// configuration.
out_cell.dl_cfg_common.init_dl_bwp.pdsch_common.pdsch_td_alloc_list =
config_helpers::make_pdsch_time_domain_resource(
param.search_space0_index,
out_cell.dl_cfg_common.init_dl_bwp.pdcch_common,
out_cell.ue_ded_serv_cell_cfg.init_dl_bwp.pdcch_cfg,
band_helper::get_duplex_mode(param.band.value()) == duplex_mode::TDD ? out_cell.tdd_ul_dl_cfg_common.value()
: optional<tdd_ul_dl_config_common>{});

out_cell.ue_ded_serv_cell_cfg.pdsch_serv_cell_cfg->nof_harq_proc =
(pdsch_serving_cell_config::nof_harq_proc_for_pdsch)config.cells_cfg.front().cell.pdsch_cfg.nof_harqs;
Expand Down Expand Up @@ -1016,6 +1012,9 @@ srsran::rlc_am_config srsran::generate_rlc_am_config(const rlc_am_appconfig& in_
}
out_rlc.rx.t_reassembly = in_cfg.rx.t_reassembly;
out_rlc.rx.t_status_prohibit = in_cfg.rx.t_status_prohibit;
if (in_cfg.rx.max_sn_per_status != 0) {
out_rlc.rx.max_sn_per_status = in_cfg.rx.max_sn_per_status;
}
return out_rlc;
}

Expand Down Expand Up @@ -1594,8 +1593,9 @@ mac_expert_config srsran::generate_mac_expert_config(const gnb_appconfig& config
mac_expert_config out_cfg = {};
const base_cell_appconfig& cell = config.cells_cfg.front().cell;

out_cfg.max_consecutive_dl_kos = cell.pdsch_cfg.max_consecutive_kos;
out_cfg.max_consecutive_ul_kos = cell.pusch_cfg.max_consecutive_kos;
out_cfg.max_consecutive_dl_kos = cell.pdsch_cfg.max_consecutive_kos;
out_cfg.max_consecutive_ul_kos = cell.pusch_cfg.max_consecutive_kos;
out_cfg.max_consecutive_csi_dtx = cell.pucch_cfg.max_consecutive_kos;

return out_cfg;
}
Expand Down
20 changes: 12 additions & 8 deletions apps/gnb/gnb_appconfig_validators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,15 @@ static bool validate_cells_appconfig(const cell_appconfig& config)
/// Validates the given list of cell application configuration. Returns true on success, otherwise false.
static bool validate_cells_appconfig(span<const cell_appconfig> config)
{
unsigned tac = config[0].cell.tac;
for (const auto& cell : config) {
if (!validate_cells_appconfig(cell)) {
return false;
}
if (cell.cell.tac != tac) {
fmt::print("The TAC must be the same for all cells\n");
return false;
}
}

return true;
Expand Down Expand Up @@ -723,6 +728,13 @@ static bool validate_rlc_am_appconfig(id_type id, const rlc_am_appconfig& config
"ms1200, ms1600, ms2000, ms2400\n");
return false;
}
if (config.rx.max_sn_per_status >= window_size(config.rx.sn_field_length)) {
fmt::print("RLC AM RX max_sn_per_status={} exceeds window_size={}. sn_size={}\n",
config.rx.max_sn_per_status,
window_size(config.rx.sn_field_length),
config.rx.sn_field_length);
return false;
}

return true;
}
Expand Down Expand Up @@ -988,14 +1000,6 @@ static bool validate_pdcch_appconfig(const gnb_appconfig& config)
fmt::print("Non-fallback DCI format not allowed in Common SearchSpace\n");
return false;
}
if (not base_cell.pdcch_cfg.dedicated.dci_format_0_1_and_1_1 and
base_cell.pdcch_cfg.dedicated.coreset1_rb_start.has_value() and
base_cell.pdcch_cfg.dedicated.coreset1_rb_start.value() == 0) {
// [Implementation-defined] Reason for starting from frequency resource 1 (i.e. CRB6) to remove the ambiguity of
// UE decoding the DCI in CSS rather than USS when using fallback DCI formats (DCI format 1_0 and 0_0).
fmt::print("Cannot start CORESET#1 from CRB0 in Common SearchSpace\n");
return false;
}
}
return true;
}
Expand Down
7 changes: 4 additions & 3 deletions apps/gnb/gnb_worker_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ void worker_manager::create_du_cu_executors(const gnb_appconfig& appcfg)
if (not exec_mng.add_execution_context(create_execution_context(gnb_ue_worker))) {
report_fatal_error("Failed to instantiate gNB UE execution context");
}
cu_up_exec = exec_mng.executors().at("ue_up_ctrl_exec");
gtpu_pdu_exec = exec_mng.executors().at("ue_dl_exec");
cu_up_e2_exec = exec_mng.executors().at("ue_up_ctrl_exec");
cu_up_ctrl_exec = exec_mng.executors().at("ue_up_ctrl_exec");
cu_up_dl_exec = exec_mng.executors().at("ue_dl_exec");
cu_up_ul_exec = exec_mng.executors().at("ue_ul_exec");
cu_up_e2_exec = exec_mng.executors().at("ue_up_ctrl_exec");

// Worker for handling DU, CU and UE control procedures.
const priority_multiqueue_worker gnb_ctrl_worker{
Expand Down
7 changes: 4 additions & 3 deletions apps/gnb/gnb_worker_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ struct worker_manager {
/// - e1ap_cu_cp::handle_message calls cu-cp ctrl exec
/// - e1ap_cu_up::handle_message calls cu-up ue exec

task_executor* cu_cp_exec = nullptr;
task_executor* cu_up_exec = nullptr;
task_executor* gtpu_pdu_exec = nullptr;
task_executor* cu_cp_exec = nullptr;
task_executor* cu_up_ctrl_exec = nullptr; ///< CU-UP executor for control
task_executor* cu_up_dl_exec = nullptr; ///< CU-UP executor for DL data flow
task_executor* cu_up_ul_exec = nullptr; ///< CU-UP executor for UL data flow
std::vector<task_executor*> lower_phy_tx_exec;
std::vector<task_executor*> lower_phy_rx_exec;
std::vector<task_executor*> lower_phy_dl_exec;
Expand Down
13 changes: 11 additions & 2 deletions apps/gnb/helpers/gnb_console_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@

using namespace srsran;

gnb_console_helper::gnb_console_helper(io_broker& io_broker_, srslog::log_channel& log_chan_) :
logger(srslog::fetch_basic_logger("GNB")), io_broker_handle(io_broker_), metrics_json(log_chan_)
gnb_console_helper::gnb_console_helper(io_broker& io_broker_,
srslog::log_channel& log_chan_,
bool autostart_stdout_metrics_) :
logger(srslog::fetch_basic_logger("GNB")),
io_broker_handle(io_broker_),
metrics_json(log_chan_),
autostart_stdout_metrics(autostart_stdout_metrics_)
{
// set STDIN file descripter into non-blocking mode
int flags = fcntl(STDIN_FILENO, F_GETFL, 0);
Expand Down Expand Up @@ -138,6 +143,10 @@ void gnb_console_helper::on_app_running()

fmt::print("==== gNodeB started ===\n");
fmt::print("Type <t> to view trace\n");

if (autostart_stdout_metrics) {
metrics_plotter.enable_print();
}
}

void gnb_console_helper::on_app_stopping()
Expand Down
3 changes: 2 additions & 1 deletion apps/gnb/helpers/gnb_console_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class app_state_notifier
class gnb_console_helper : public app_state_notifier
{
public:
gnb_console_helper(io_broker& io_broker_, srslog::log_channel& log_chan_);
gnb_console_helper(io_broker& io_broker_, srslog::log_channel& log_chan_, bool autostart_stdout_metrics_ = false);
~gnb_console_helper();

scheduler_ue_metrics_notifier& get_stdout_metrics_notifier() { return metrics_plotter; };
Expand All @@ -70,6 +70,7 @@ class gnb_console_helper : public app_state_notifier
metrics_plotter_stdout metrics_plotter;
metrics_plotter_json metrics_json;
std::vector<du_cell_config> cells;
bool autostart_stdout_metrics = false;
};

} // namespace srsran
5 changes: 5 additions & 0 deletions apps/gnb/helpers/metrics_plotter_stdout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ void metrics_plotter_stdout::report_metrics(span<const scheduler_ue_metrics> ue_
}
}

void metrics_plotter_stdout::enable_print()
{
print_metrics = true;
}

void metrics_plotter_stdout::toggle_print()
{
print_metrics = !print_metrics;
Expand Down
3 changes: 3 additions & 0 deletions apps/gnb/helpers/metrics_plotter_stdout.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class metrics_plotter_stdout : public scheduler_ue_metrics_notifier
/// Notifier called from the scheduler.
void report_metrics(span<const scheduler_ue_metrics> ue_metrics) override;

/// This can be called from another execution context to turn on the actual plotting.
void enable_print();

/// This can be called from another execution context to turn on/off the actual plotting.
void toggle_print();

Expand Down
4 changes: 2 additions & 2 deletions configs/gnb_rf_b200_tdd_n78_20mhz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ ru_sdr:
device_args: type=b200,num_recv_frames=64,num_send_frames=64 # Optionally pass arguments to the selected RF driver.
srate: 23.04 # RF sample rate might need to be adjusted according to selected bandwidth.
otw_format: sc12
tx_gain: 50 # Transmit gain of the RF might need to adjusted to the given situation.
rx_gain: 60 # Receive gain of the RF might need to adjusted to the given situation.
tx_gain: 80 # Transmit gain of the RF might need to adjusted to the given situation.
rx_gain: 40 # Receive gain of the RF might need to adjusted to the given situation.

cell_cfg:
dl_arfcn: 632628 # ARFCN of the downlink carrier (center frequency).
Expand Down
16 changes: 8 additions & 8 deletions configs/gnb_rf_b210_fdd_srsUE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
# `cell_cfg` section. These are set to match the capabilities of srsUE.

amf:
addr: 127.0.1.100 # The address or hostname of the AMF.
bind_addr: 127.0.0.1 # A local IP that the gNB binds to for>
addr: 10.53.1.2 # The address or hostname of the AMF.
bind_addr: 10.53.1.1 # A local IP that the gNB binds to for>

ru_sdr:
device_driver: uhd # The RF driver name.
device_args: type=b200 # Optionally pass arguments to the selected RF driver.
sync: external # Set sync to external. This set-up uses a LEO BODNAR GPDSO providing a 10 MHz ref.
srate: 11.52 # RF sample rate might need to be adjusted according to selected bandwidth.
tx_gain: 70 # Transmit gain of the RF might need to adjusted to the given situation.
rx_gain: 60 # Receive gain of the RF might need to adjusted to the given situation.
srate: 23.04 # RF sample rate might need to be adjusted according to selected bandwidth.
tx_gain: 80 # Transmit gain of the RF might need to adjusted to the given situation.
rx_gain: 40 # Receive gain of the RF might need to adjusted to the given situation.

cell_cfg:
dl_arfcn: 368500 # ARFCN of the downlink carrier (center frequency).
band: 3 # The NR band.
channel_bandwidth_MHz: 10 # Bandwith in MHz. Number of PRBs will be automatically derived.
channel_bandwidth_MHz: 20 # Bandwith in MHz. Number of PRBs will be automatically derived.
common_scs: 15 # Subcarrier spacing in kHz used for data.
plmn: "00101" # PLMN broadcasted by the gNB.
tac: 7 # Tracking area code (needs to match the core configuration).
Expand All @@ -30,9 +30,9 @@ cell_cfg:
dci_format_0_1_and_1_1: false # Use fallback DCI to match srsUE capabilities
common:
ss0_index: 0 # Set search space zero index to match srsUE capabilities
coreset0_index: 6 # Set search CORESET Zero index to match srsUE capabilities
coreset0_index: 12 # Set search CORESET Zero index to match srsUE capabilities
prach:
prach_config_index: 1 # Set PRACH config index to 1
prach_config_index: 1 # Set PRACH config index to match srsUE expectation

log:
filename: /tmp/gnb.log # Path of the log file.
Expand Down
5 changes: 5 additions & 0 deletions docker/metrics_server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
# and at http://www.gnu.org/licenses/.
#

###################
# Package Builder #
###################
FROM python:3.12-alpine as builder

# Add the folder
ADD . /src
WORKDIR /src
Expand Down
2 changes: 1 addition & 1 deletion docker/metrics_server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ description = "srsRAN Metrics Server"
name = "srs_metrics_server"
readme = "README.md"
requires-python = ">=3.7"
version = "1.3.0"
version = "1.4.0"

[project.scripts]
metrics-server = "metrics_server.__main__:main"
Expand Down
8 changes: 8 additions & 0 deletions docker/open5gs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#
# Copyright 2021-2023 Software Radio Systems Limited
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the distribution.
#

ARG OS_VERSION=22.04
FROM ubuntu:$OS_VERSION as base

Expand Down
Loading

0 comments on commit 60811de

Please sign in to comment.