From 6d3af2d2bde39d36dbc4d21f3a22ee5b3a2f6b3d Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 23 Nov 2020 14:16:43 +0100 Subject: [PATCH] rlc_um: fix bearer name in logging after re-configuration the RLC bearer name was empty after reestablishing a UM bearer. we need to pass the RLF config and RB name to the internal configure() call of the Rx entity, like we already do for the Tx side --- lib/include/srslte/upper/rlc_um_base.h | 2 +- lib/include/srslte/upper/rlc_um_lte.h | 2 +- lib/include/srslte/upper/rlc_um_nr.h | 2 +- lib/src/upper/rlc.cc | 2 +- lib/src/upper/rlc_um_lte.cc | 10 +++++++--- lib/src/upper/rlc_um_nr.cc | 4 ++-- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/include/srslte/upper/rlc_um_base.h b/lib/include/srslte/upper/rlc_um_base.h index f69c77024..8a2b13a43 100644 --- a/lib/include/srslte/upper/rlc_um_base.h +++ b/lib/include/srslte/upper/rlc_um_base.h @@ -117,7 +117,7 @@ protected: public: rlc_um_base_rx(rlc_um_base* parent_); virtual ~rlc_um_base_rx(); - virtual bool configure() = 0; + virtual bool configure(const rlc_config_t& cnfg_, std::string rb_name_) = 0; virtual void stop() = 0; virtual void reestablish() = 0; diff --git a/lib/include/srslte/upper/rlc_um_lte.h b/lib/include/srslte/upper/rlc_um_lte.h index 7c836adf1..6b7792aee 100644 --- a/lib/include/srslte/upper/rlc_um_lte.h +++ b/lib/include/srslte/upper/rlc_um_lte.h @@ -83,7 +83,7 @@ private: ~rlc_um_lte_rx(); void stop(); void reestablish(); - bool configure(); + bool configure(const rlc_config_t& cnfg_, std::string rb_name_); void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes); void reassemble_rx_sdus(); bool pdu_belongs_to_rx_sdu(); diff --git a/lib/include/srslte/upper/rlc_um_nr.h b/lib/include/srslte/upper/rlc_um_nr.h index 003361762..64aee190d 100644 --- a/lib/include/srslte/upper/rlc_um_nr.h +++ b/lib/include/srslte/upper/rlc_um_nr.h @@ -81,7 +81,7 @@ private: public: rlc_um_nr_rx(rlc_um_base* parent_); - bool configure(); + bool configure(const rlc_config_t& cnfg_, std::string rb_name_); void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes); void reestablish(); diff --git a/lib/src/upper/rlc.cc b/lib/src/upper/rlc.cc index e9cee00e9..e52ca641e 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/upper/rlc.cc @@ -147,7 +147,7 @@ void rlc::reestablish() void rlc::reestablish(uint32_t lcid) { if (valid_lcid(lcid)) { - rlc_log->info("Reestablishing LCID %d\n", lcid); + rlc_log->info("Reestablishing %s\n", rrc->get_rb_name(lcid).c_str()); rlc_array.at(lcid)->reestablish(); } else { rlc_log->warning("RLC LCID %d doesn't exist.\n", lcid); diff --git a/lib/src/upper/rlc_um_lte.cc b/lib/src/upper/rlc_um_lte.cc index 693ce3396..27b7446d7 100644 --- a/lib/src/upper/rlc_um_lte.cc +++ b/lib/src/upper/rlc_um_lte.cc @@ -50,7 +50,7 @@ bool rlc_um_lte::configure(const rlc_config_t& cnfg_) cfg = cnfg_; rx.reset(new rlc_um_lte_rx(this)); - if (not rx->configure()) { + if (not rx->configure(cfg, rb_name)) { return false; } @@ -236,8 +236,10 @@ rlc_um_lte::rlc_um_lte_rx::rlc_um_lte_rx(rlc_um_base* parent_) : rlc_um_lte::rlc_um_lte_rx::~rlc_um_lte_rx() {} -bool rlc_um_lte::rlc_um_lte_rx::configure() +bool rlc_um_lte::rlc_um_lte_rx::configure(const rlc_config_t& cnfg_, std::string rb_name_) { + cfg = cnfg_; + if (cfg.um.rx_mod == 0) { log->error("Error configuring %s RLC UM: rx_mod==0\n", rb_name.c_str()); return false; @@ -254,6 +256,8 @@ bool rlc_um_lte::rlc_um_lte_rx::configure() reordering_timer.set(static_cast(cfg.um.t_reordering), [this](uint32_t tid) { timer_expired(tid); }); } + rb_name = rb_name_; + return true; } @@ -292,7 +296,7 @@ void rlc_um_lte::rlc_um_lte_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_b { rlc_umd_pdu_header_t header; rlc_um_read_data_pdu_header(payload, nof_bytes, cfg.um.rx_sn_field_length, &header); - log->info_hex(payload, nof_bytes, "RX %s Rx data PDU SN=%d (%d B)", rb_name.c_str(), header.sn, nof_bytes); + log->info_hex(payload, nof_bytes, "%s Rx data PDU SN=%d (%d B)", rb_name.c_str(), header.sn, nof_bytes); if (RX_MOD_BASE(header.sn) >= RX_MOD_BASE(vr_uh - cfg.um.rx_window_size) && RX_MOD_BASE(header.sn) < RX_MOD_BASE(vr_ur)) { diff --git a/lib/src/upper/rlc_um_nr.cc b/lib/src/upper/rlc_um_nr.cc index 0349c02f4..de8197a11 100644 --- a/lib/src/upper/rlc_um_nr.cc +++ b/lib/src/upper/rlc_um_nr.cc @@ -48,7 +48,7 @@ bool rlc_um_nr::configure(const rlc_config_t& cnfg_) cfg = cnfg_; rx.reset(new rlc_um_nr_rx(this)); - if (not rx->configure()) { + if (not rx->configure(cfg, rb_name)) { return false; } @@ -223,7 +223,7 @@ rlc_um_nr::rlc_um_nr_rx::rlc_um_nr_rx(rlc_um_base* parent_) : reassembly_timer(timers->get_unique_timer()) {} -bool rlc_um_nr::rlc_um_nr_rx::configure() +bool rlc_um_nr::rlc_um_nr_rx::configure(const rlc_config_t& cnfg_, std::string rb_name_) { if (cfg.um_nr.mod == 0) { log->error("Error configuring %s RLC UM: rx_mod==0\n", rb_name.c_str());