From 2f8fd7a4835547d4cc2194cfc58e4f6427212742 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 28 Apr 2022 14:12:40 +0100 Subject: [PATCH 1/7] lib,rlc_am_nr: add stop() method to TX entity --- lib/include/srsran/rlc/rlc_am_nr.h | 1 + lib/src/rlc/rlc_am_nr.cc | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/include/srsran/rlc/rlc_am_nr.h b/lib/include/srsran/rlc/rlc_am_nr.h index 425c71455..2ce60bff2 100644 --- a/lib/include/srsran/rlc/rlc_am_nr.h +++ b/lib/include/srsran/rlc/rlc_am_nr.h @@ -98,6 +98,7 @@ public: void reestablish() final; void stop() final; + void stop_no_lock(); int write_sdu(unique_byte_buffer_t sdu); void empty_queue() final; diff --git a/lib/src/rlc/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc index 204d4f2c2..95bd7f82f 100644 --- a/lib/src/rlc/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -1167,7 +1167,33 @@ void rlc_am_nr_tx::empty_queue_no_lock() unique_byte_buffer_t buf = tx_sdu_queue.read(); } } -void rlc_am_nr_tx::stop() {} + +void rlc_am_nr_tx::stop() +{ + std::lock_guard lock(mutex); + stop_no_lock(); +} + +void rlc_am_nr_tx::stop_no_lock() +{ + empty_queue_no_lock(); + + if (parent->timers != nullptr && poll_retransmit_timer.is_valid()) { + poll_retransmit_timer.stop(); + } + + st = {}; + + sdu_under_segmentation_sn = INVALID_RLC_SN; + + // Drop all messages in TX window + tx_window->clear(); + + // Drop all messages in RETX queue + retx_queue->clear(); + + tx_enabled = false; +} void rlc_am_nr_tx::timer_expired(uint32_t timeout_id) { From ea532cbf41801ecda9a05e817547c55a13d90961 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 28 Apr 2022 16:03:49 +0100 Subject: [PATCH 2/7] lib,rlc_am_nr: added stop() method to RX entity --- lib/include/srsran/rlc/rlc_am_nr.h | 5 +++-- lib/src/rlc/rlc_am_nr.cc | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/lib/include/srsran/rlc/rlc_am_nr.h b/lib/include/srsran/rlc/rlc_am_nr.h index 2ce60bff2..f95c98fa8 100644 --- a/lib/include/srsran/rlc/rlc_am_nr.h +++ b/lib/include/srsran/rlc/rlc_am_nr.h @@ -227,8 +227,9 @@ public: void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) final; - void stop(); - void reestablish(); + void reestablish() final; + void stop() final; + void stop_no_lock(); // Status PDU bool get_do_status(); diff --git a/lib/src/rlc/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc index 95bd7f82f..bfae6c2a8 100644 --- a/lib/src/rlc/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -1353,7 +1353,29 @@ bool rlc_am_nr_rx::configure(const rlc_config_t& cfg_) return true; } -void rlc_am_nr_rx::stop() {} +void rlc_am_nr_rx::stop() +{ + std::lock_guard lock(mutex); + stop_no_lock(); +} + +void rlc_am_nr_rx::stop_no_lock() +{ + if (parent->timers != nullptr && reassembly_timer.is_valid()) { + reassembly_timer.stop(); + } + + if (parent->timers != nullptr && status_prohibit_timer.is_valid()) { + status_prohibit_timer.stop(); + } + + st = {}; + + do_status = false; + + // Drop all messages in RX window + rx_window->clear(); +} void rlc_am_nr_rx::reestablish() { From 840aac7fda0082340973fc29e7d4aadc6d9b85b7 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 28 Apr 2022 16:11:30 +0100 Subject: [PATCH 3/7] lic,rlc_am_nr: removed stop_no_lock(), it is not necessasry --- lib/include/srsran/rlc/rlc_am_nr.h | 2 -- lib/src/rlc/rlc_am_nr.cc | 9 --------- 2 files changed, 11 deletions(-) diff --git a/lib/include/srsran/rlc/rlc_am_nr.h b/lib/include/srsran/rlc/rlc_am_nr.h index f95c98fa8..619a3978e 100644 --- a/lib/include/srsran/rlc/rlc_am_nr.h +++ b/lib/include/srsran/rlc/rlc_am_nr.h @@ -98,7 +98,6 @@ public: void reestablish() final; void stop() final; - void stop_no_lock(); int write_sdu(unique_byte_buffer_t sdu); void empty_queue() final; @@ -229,7 +228,6 @@ public: void reestablish() final; void stop() final; - void stop_no_lock(); // Status PDU bool get_do_status(); diff --git a/lib/src/rlc/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc index bfae6c2a8..a05c8a8e3 100644 --- a/lib/src/rlc/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -1171,11 +1171,6 @@ void rlc_am_nr_tx::empty_queue_no_lock() void rlc_am_nr_tx::stop() { std::lock_guard lock(mutex); - stop_no_lock(); -} - -void rlc_am_nr_tx::stop_no_lock() -{ empty_queue_no_lock(); if (parent->timers != nullptr && poll_retransmit_timer.is_valid()) { @@ -1356,11 +1351,7 @@ bool rlc_am_nr_rx::configure(const rlc_config_t& cfg_) void rlc_am_nr_rx::stop() { std::lock_guard lock(mutex); - stop_no_lock(); -} -void rlc_am_nr_rx::stop_no_lock() -{ if (parent->timers != nullptr && reassembly_timer.is_valid()) { reassembly_timer.stop(); } From 02ba06d8cf3b3e6555403520451d0a1e73c9302e Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 29 Apr 2022 15:58:49 +0200 Subject: [PATCH 4/7] gnb,ngap: reduce loglevel for unhandled NGAP message avoid test failure with core sending 2022-04-29T13:44:00.579989 [NGAP ] [I] Rx - PDUSessionResourceReleaseCommand (53 B) 0000: 00 1c 00 31 00 00 04 00 0a 00 02 00 01 00 55 00 0010: 02 00 01 00 26 40 15 14 7e 02 31 3f 3a c9 04 7e 2022-04-29T13:44:00.579990 [NGAP ] [E] Unhandled initiating message: PDUSessionResourceReleaseCommand --- srsgnb/src/stack/ngap/ngap.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srsgnb/src/stack/ngap/ngap.cc b/srsgnb/src/stack/ngap/ngap.cc index 423af12ab..16a44188b 100644 --- a/srsgnb/src/stack/ngap/ngap.cc +++ b/srsgnb/src/stack/ngap/ngap.cc @@ -417,7 +417,7 @@ bool ngap::handle_ngap_rx_pdu(srsran::byte_buffer_t* pdu) case ngap_pdu_c::types_opts::unsuccessful_outcome: return handle_unsuccessful_outcome(rx_pdu.unsuccessful_outcome()); default: - logger.error("Unhandled PDU type %d", rx_pdu.type().value); + logger.warning("Unhandled PDU type %d", rx_pdu.type().value); return false; } @@ -438,7 +438,7 @@ bool ngap::handle_initiating_message(const asn1::ngap::init_msg_s& msg) case ngap_elem_procs_o::init_msg_c::types_opts::paging: return handle_paging(msg.value.paging()); default: - logger.error("Unhandled initiating message: %s", msg.value.type().to_string()); + logger.warning("Unhandled initiating message: %s", msg.value.type().to_string()); } return true; } From 407c44617c89abc3d403d8929ae17f426e5319b6 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Mon, 2 May 2022 13:31:57 +0100 Subject: [PATCH 5/7] lib,rlc_am_nr: fix typo --- lib/src/rlc/rlc_am_base.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/rlc/rlc_am_base.cc b/lib/src/rlc/rlc_am_base.cc index 3d0bf841a..4f4db569b 100644 --- a/lib/src/rlc/rlc_am_base.cc +++ b/lib/src/rlc/rlc_am_base.cc @@ -90,7 +90,7 @@ bool rlc_am::configure(const rlc_config_t& cfg_) } else if (cfg.rat == srsran_rat_t::nr) { RlcInfo("AM NR configured - tx_sn_field_length=%d, rx_sn_field_length=%d, " "t_poll_retx=%d, poll_pdu=%d, poll_byte=%d, " - "max_retx_thresh=%d, t_reassembly=%d, t_status_prohibit=%di, tx_queue_length=%d", + "max_retx_thresh=%d, t_reassembly=%d, t_status_prohibit=%d, tx_queue_length=%d", to_number(cfg.am_nr.tx_sn_field_length), to_number(cfg.am_nr.rx_sn_field_length), cfg.am_nr.t_poll_retx, From ae05ec95b9ef9fa936b4e73e2a460edcaf26e195 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Mon, 2 May 2022 13:39:51 +0100 Subject: [PATCH 6/7] enb,config: revert print to console. When a full section was missing the print did not look good. --- srsenb/src/parser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsenb/src/parser.cc b/srsenb/src/parser.cc index d72dd3043..ab593c564 100644 --- a/srsenb/src/parser.cc +++ b/srsenb/src/parser.cc @@ -109,7 +109,7 @@ int parser::section::parse(Setting& root) *enabled_value = false; return 0; } else { - std::cerr << "Error in section " << name.c_str() << ". " << ex.getPath() << " not found." << std::endl; + std::cerr << "Error section " << name.c_str() << " not found." << std::endl; return -1; } } From 31665aa4ec3990bb5bd9f0f00c662fe1908e2e77 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 3 May 2022 08:29:03 +0200 Subject: [PATCH 7/7] enb,cfg_parser: remove strict arfcn check for SA and replace with list of supported configs the coreset0 index and various related parameters in the scheduler might lead to unsupported and/or overlapping resource allocation patterns. this patch adds a table of supported arfcns for three popular bands (all FDD). --- srsenb/src/enb_cfg_parser.cc | 37 ++++++++++++++++++++++++++++++++++-- srsenb/src/enb_cfg_parser.h | 2 ++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index edbf187e5..8fd77c89d 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -1805,8 +1805,9 @@ int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t* return SRSRAN_ERROR; } if (rrc_nr_cfg_->is_standalone) { - if (cfg.phy_cell.carrier.dl_center_frequency_hz != 1842.5e6) { - ERROR("Only DL-ARFCN 368500 supported."); + if (is_valid_arfcn(cfg.band, cfg.dl_arfcn) == false) { + ERROR("DL-ARFCN %d in band n%d not supported with coreset0 config.", cfg.dl_arfcn, cfg.band); + ERROR("Valid ARFCNs for band n%d are: %s", cfg.band, valid_arfcns_to_string(cfg.band).c_str()); return SRSRAN_ERROR; } if (cfg.duplex_mode == SRSRAN_DUPLEX_MODE_TDD) { @@ -1819,6 +1820,38 @@ int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t* return SRSRAN_SUCCESS; } +// List of selected ARFCNs in band n3, n7 and n20 that match the coreset0 config +using arfcn_list_t = std::list; +std::map valid_arfcn = {{3, {363500, 368500, 369500, 374500, 375000}}, + {7, {525000, 526200, 531000}}, + {20, {159000, 160200}}}; + +std::string valid_arfcns_to_string(uint32_t band) +{ + std::string band_string; + if (valid_arfcn.find(band) != valid_arfcn.end()) { + for (const auto& arfcn : valid_arfcn.at(band)) { + band_string += std::to_string(arfcn); + band_string += ", "; + } + } + return band_string; +} + +bool is_valid_arfcn(uint32_t band, uint32_t dl_arfcn) +{ + if (valid_arfcn.find(band) == valid_arfcn.end()) { + return false; + } + const auto& arfcn_list = valid_arfcn.at(band); + for (const auto& arfcn : arfcn_list) { + if (arfcn == dl_arfcn) { + return true; + } + } + return false; +} + } // namespace enb_conf_sections namespace sib_sections { diff --git a/srsenb/src/enb_cfg_parser.h b/srsenb/src/enb_cfg_parser.h index 574cf115b..10b19ed6f 100644 --- a/srsenb/src/enb_cfg_parser.h +++ b/srsenb/src/enb_cfg_parser.h @@ -42,6 +42,8 @@ int parse_cell_cfg(all_args_t* args_, srsran_cell_t* cell); int parse_cfg_files(all_args_t* args_, rrc_cfg_t* rrc_cfg_, rrc_nr_cfg_t* rrc_cfg_nr_, phy_cfg_t* phy_cfg_); int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_, const srsran_cell_t& cell_cfg_); int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t* phy_cfg_); +bool is_valid_arfcn(uint32_t band, uint32_t dl_arfcn); +std::string valid_arfcns_to_string(uint32_t band); } // namespace enb_conf_sections