remove init for all RLC TM/UM/AM

- all RLC entities are now initialized during contruction
- there is no need to check for, e.g., existance of timers, during
  runtime
- there is also no need to call re-init during resume
- timers are freed in dtor
This commit is contained in:
Andre Puschmann 2019-06-06 12:00:48 +02:00 committed by Xavier Arteaga
parent f24c0cef8c
commit e8d6236975
12 changed files with 218 additions and 418 deletions

View File

@ -48,7 +48,7 @@ public:
void init(srsue::pdcp_interface_rlc* pdcp_, void init(srsue::pdcp_interface_rlc* pdcp_,
srsue::rrc_interface_rlc* rrc_, srsue::rrc_interface_rlc* rrc_,
srsue::ue_interface* ue_, srsue::ue_interface* ue_,
log* rlc_log_, srslte::log* log_,
mac_interface_timers* mac_timers_, mac_interface_timers* mac_timers_,
uint32_t lcid_); uint32_t lcid_);
void stop(); void stop();

View File

@ -64,22 +64,21 @@ struct rlc_amd_retx_t{
class rlc_am : public rlc_common class rlc_am : public rlc_common
{ {
public: public:
rlc_am(); rlc_am(srslte::log* log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc* pdcp_,
srsue::rrc_interface_rlc* rrc_,
srslte::mac_interface_timers* mac_timers_);
~rlc_am(); ~rlc_am();
void init(log *log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_,
srsue::rrc_interface_rlc *rrc_,
mac_interface_timers *mac_timers_);
bool resume(); bool resume();
bool configure(srslte_rlc_config_t cfg_); bool configure(srslte_rlc_config_t cfg_);
void reestablish(); void reestablish();
void stop(); void stop();
void empty_queue(); void empty_queue();
rlc_mode_t get_mode(); rlc_mode_t get_mode();
uint32_t get_bearer(); uint32_t get_bearer();
// PDCP interface // PDCP interface
void write_sdu(unique_byte_buffer_t sdu, bool blocking = true); void write_sdu(unique_byte_buffer_t sdu, bool blocking = true);
@ -103,7 +102,6 @@ private:
rlc_am_tx(rlc_am* parent_); rlc_am_tx(rlc_am* parent_);
~rlc_am_tx(); ~rlc_am_tx();
void init();
bool configure(srslte_rlc_config_t cfg_); bool configure(srslte_rlc_config_t cfg_);
void empty_queue(); void empty_queue();
@ -205,7 +203,6 @@ private:
rlc_am_rx(rlc_am* parent_); rlc_am_rx(rlc_am* parent_);
~rlc_am_rx(); ~rlc_am_rx();
void init();
bool configure(srslte_rlc_am_config_t cfg_); bool configure(srslte_rlc_am_config_t cfg_);
void reestablish(); void reestablish();
void stop(); void stop();
@ -280,10 +277,6 @@ private:
uint32_t reordering_timer_id; uint32_t reordering_timer_id;
}; };
// Rx and Tx objects
rlc_am_tx tx;
rlc_am_rx rx;
// Common variables needed/provided by parent class // Common variables needed/provided by parent class
srsue::rrc_interface_rlc *rrc; srsue::rrc_interface_rlc *rrc;
srslte::log *log; srslte::log *log;
@ -295,6 +288,10 @@ private:
std::string rb_name; std::string rb_name;
static const int poll_periodicity = 8; // After how many data PDUs a status PDU shall be requested static const int poll_periodicity = 8; // After how many data PDUs a status PDU shall be requested
// Rx and Tx objects
rlc_am_tx tx;
rlc_am_rx rx;
}; };
/**************************************************************************** /****************************************************************************

View File

@ -143,11 +143,6 @@ public:
const static int RLC_BUFFER_NOF_PDU = 128; const static int RLC_BUFFER_NOF_PDU = 128;
virtual ~rlc_common() {} virtual ~rlc_common() {}
virtual void init(srslte::log *rlc_entity_log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_,
srsue::rrc_interface_rlc *rrc_,
srslte::mac_interface_timers *mac_timers_) = 0;
virtual bool configure(srslte_rlc_config_t cnfg) = 0; virtual bool configure(srslte_rlc_config_t cnfg) = 0;
virtual bool resume() = 0; virtual bool resume() = 0;
virtual void stop() = 0; virtual void stop() = 0;

View File

@ -34,13 +34,13 @@ namespace srslte {
class rlc_tm : public rlc_common class rlc_tm : public rlc_common
{ {
public: public:
rlc_tm(uint32_t queue_len = 16); rlc_tm(srslte::log* log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc* pdcp_,
srsue::rrc_interface_rlc* rrc_,
srslte::mac_interface_timers* mac_timers_,
uint32_t queue_len = 16);
~rlc_tm(); ~rlc_tm();
void init(log *rlc_entity_log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_,
srsue::rrc_interface_rlc *rrc_,
mac_interface_timers *mac_timers);
bool configure(srslte_rlc_config_t cnfg); bool configure(srslte_rlc_config_t cnfg);
bool resume(); bool resume();
void stop(); void stop();

View File

@ -43,13 +43,12 @@ class rlc_um
:public rlc_common :public rlc_common
{ {
public: public:
rlc_um(); rlc_um(srslte::log* log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc* pdcp_,
srsue::rrc_interface_rlc* rrc_,
mac_interface_timers* mac_timers_);
~rlc_um(); ~rlc_um();
void init(log *rlc_entity_log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_,
srsue::rrc_interface_rlc *rrc_,
mac_interface_timers *mac_timers_);
bool configure(srslte_rlc_config_t cnfg); bool configure(srslte_rlc_config_t cnfg);
bool resume(); bool resume();
void reestablish(); void reestablish();
@ -80,9 +79,8 @@ private:
class rlc_um_tx class rlc_um_tx
{ {
public: public:
rlc_um_tx(); rlc_um_tx(srslte::log* log_);
~rlc_um_tx(); ~rlc_um_tx();
void init(srslte::log *log_);
bool configure(srslte_rlc_config_t cfg, std::string rb_name); bool configure(srslte_rlc_config_t cfg, std::string rb_name);
int build_data_pdu(uint8_t *payload, uint32_t nof_bytes); int build_data_pdu(uint8_t *payload, uint32_t nof_bytes);
void stop(); void stop();
@ -131,13 +129,12 @@ private:
// Receiver sub-class // Receiver sub-class
class rlc_um_rx : public timer_callback { class rlc_um_rx : public timer_callback {
public: public:
rlc_um_rx(); rlc_um_rx(srslte::log* log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc* pdcp_,
srsue::rrc_interface_rlc* rrc_,
srslte::mac_interface_timers* mac_timers_);
~rlc_um_rx(); ~rlc_um_rx();
void init(srslte::log *log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_,
srsue::rrc_interface_rlc *rrc_,
srslte::mac_interface_timers *mac_timers_);
void stop(); void stop();
void reestablish(); void reestablish();
bool configure(srslte_rlc_config_t cfg, std::string rb_name); bool configure(srslte_rlc_config_t cfg, std::string rb_name);
@ -202,10 +199,6 @@ private:
const char* get_rb_name(); const char* get_rb_name();
}; };
// Rx and Tx objects
rlc_um_tx tx;
rlc_um_rx rx;
// Common variables needed by parent class // Common variables needed by parent class
srsue::rrc_interface_rlc *rrc; srsue::rrc_interface_rlc *rrc;
srslte::log *log; srslte::log *log;
@ -216,6 +209,10 @@ private:
byte_buffer_pool *pool; byte_buffer_pool *pool;
std::string get_rb_name(srsue::rrc_interface_rlc *rrc, uint32_t lcid, bool is_mrb); std::string get_rb_name(srsue::rrc_interface_rlc *rrc, uint32_t lcid, bool is_mrb);
// Rx and Tx objects
rlc_um_tx tx;
rlc_um_rx rx;
}; };
/**************************************************************************** /****************************************************************************

View File

@ -423,13 +423,13 @@ void rlc::add_bearer(uint32_t lcid, srslte_rlc_config_t cnfg)
switch(cnfg.rlc_mode) switch(cnfg.rlc_mode)
{ {
case RLC_MODE_TM: case RLC_MODE_TM:
rlc_entity = new rlc_tm(); rlc_entity = new rlc_tm(rlc_log, lcid, pdcp, rrc, mac_timers);
break; break;
case RLC_MODE_AM: case RLC_MODE_AM:
rlc_entity = new rlc_am(); rlc_entity = new rlc_am(rlc_log, lcid, pdcp, rrc, mac_timers);
break; break;
case RLC_MODE_UM: case RLC_MODE_UM:
rlc_entity = new rlc_um(); rlc_entity = new rlc_um(rlc_log, lcid, pdcp, rrc, mac_timers);
break; break;
default: default:
rlc_log->error("Cannot add RLC entity - invalid mode\n"); rlc_log->error("Cannot add RLC entity - invalid mode\n");
@ -437,8 +437,6 @@ void rlc::add_bearer(uint32_t lcid, srslte_rlc_config_t cnfg)
} }
// configure and add to array // configure and add to array
rlc_entity->init(rlc_log, lcid, pdcp, rrc, mac_timers);
if (cnfg.rlc_mode != RLC_MODE_TM) { if (cnfg.rlc_mode != RLC_MODE_TM) {
if (rlc_entity->configure(cnfg) == false) { if (rlc_entity->configure(cnfg) == false) {
rlc_log->error("Error configuring RLC entity\n."); rlc_log->error("Error configuring RLC entity\n.");
@ -472,9 +470,8 @@ void rlc::add_bearer_mrb(uint32_t lcid)
rlc_common *rlc_entity = NULL; rlc_common *rlc_entity = NULL;
if (not valid_lcid_mrb(lcid)) { if (not valid_lcid_mrb(lcid)) {
rlc_entity = new rlc_um(); rlc_entity = new rlc_um(rlc_log, lcid, pdcp, rrc, mac_timers);
// configure and add to array // configure and add to array
rlc_entity->init(rlc_log, lcid, pdcp, rrc, mac_timers);
if (not rlc_entity->configure(srslte_rlc_config_t::mch_config())) { if (not rlc_entity->configure(srslte_rlc_config_t::mch_config())) {
rlc_log->error("Error configuring RLC entity\n."); rlc_log->error("Error configuring RLC entity\n.");
goto delete_and_exit; goto delete_and_exit;
@ -568,10 +565,6 @@ void rlc::resume_bearer(uint32_t lcid)
pthread_rwlock_wrlock(&rwlock); pthread_rwlock_wrlock(&rwlock);
if (valid_lcid(lcid)) { if (valid_lcid(lcid)) {
// Need to call init again because timers have been destroyed
rlc_array.at(lcid)->init(rlc_log, lcid, pdcp, rrc, mac_timers);
if (rlc_array.at(lcid)->resume()) { if (rlc_array.at(lcid)->resume()) {
rlc_log->info("Resumed radio bearer %s\n", rrc->get_rb_name(lcid).c_str()); rlc_log->info("Resumed radio bearer %s\n", rrc->get_rb_name(lcid).c_str());
} else { } else {

View File

@ -32,17 +32,20 @@
namespace srslte { namespace srslte {
rlc_am::rlc_am() : rlc_am::rlc_am(srslte::log* log_,
tx(this), uint32_t lcid_,
rx(this), srsue::pdcp_interface_rlc* pdcp_,
log(NULL), srsue::rrc_interface_rlc* rrc_,
rrc(NULL), srslte::mac_interface_timers* mac_timers_) :
pdcp(NULL), log(log_),
mac_timers(NULL), rrc(rrc_),
lcid(0), pdcp(pdcp_),
rb_name(""), mac_timers(mac_timers_),
lcid(lcid_),
cfg(), cfg(),
has_configuration(false) has_configuration(false),
tx(this),
rx(this)
{ {
} }
@ -50,22 +53,6 @@ rlc_am::~rlc_am()
{ {
} }
void rlc_am::init(srslte::log *log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_,
srsue::rrc_interface_rlc *rrc_,
srslte::mac_interface_timers *mac_timers_)
{
log = log_;
lcid = lcid_;
pdcp = pdcp_;
rrc = rrc_;
mac_timers = mac_timers_;
rx.init();
tx.init();
}
bool rlc_am::resume() bool rlc_am::resume()
{ {
if (not has_configuration) { if (not has_configuration) {
@ -196,9 +183,9 @@ void rlc_am::write_pdu(uint8_t *payload, uint32_t nof_bytes)
rlc_am::rlc_am_tx::rlc_am_tx(rlc_am* parent_) : rlc_am::rlc_am_tx::rlc_am_tx(rlc_am* parent_) :
parent(parent_), parent(parent_),
poll_retx_timer(NULL), poll_retx_timer(nullptr),
poll_retx_timer_id(0), poll_retx_timer_id(0),
status_prohibit_timer(NULL), status_prohibit_timer(nullptr),
status_prohibit_timer_id(0), status_prohibit_timer_id(0),
vt_a(0), vt_a(0),
vt_ms(RLC_AM_WINDOW_SIZE), vt_ms(RLC_AM_WINDOW_SIZE),
@ -207,33 +194,32 @@ rlc_am::rlc_am_tx::rlc_am_tx(rlc_am* parent_) :
num_tx_bytes(0), num_tx_bytes(0),
pdu_without_poll(0), pdu_without_poll(0),
byte_without_poll(0), byte_without_poll(0),
log(NULL), log(parent_->log),
cfg(), cfg(),
tx_status(), tx_status(),
pool(byte_buffer_pool::get_instance()), pool(byte_buffer_pool::get_instance()),
tx_enabled(false) tx_enabled(false)
{ {
poll_retx_timer_id = parent->mac_timers->timer_get_unique_id();
poll_retx_timer = parent->mac_timers->timer_get(poll_retx_timer_id);
status_prohibit_timer_id = parent->mac_timers->timer_get_unique_id();
status_prohibit_timer = parent->mac_timers->timer_get(status_prohibit_timer_id);
pthread_mutex_init(&mutex, NULL); pthread_mutex_init(&mutex, NULL);
} }
rlc_am::rlc_am_tx::~rlc_am_tx() rlc_am::rlc_am_tx::~rlc_am_tx()
{ {
poll_retx_timer->stop();
parent->mac_timers->timer_release_id(poll_retx_timer_id);
status_prohibit_timer->stop();
parent->mac_timers->timer_release_id(status_prohibit_timer_id);
pthread_mutex_destroy(&mutex); pthread_mutex_destroy(&mutex);
} }
void rlc_am::rlc_am_tx::init()
{
log = parent->log;
if (parent->mac_timers != NULL) {
poll_retx_timer_id = parent->mac_timers->timer_get_unique_id();
poll_retx_timer = parent->mac_timers->timer_get(poll_retx_timer_id);
status_prohibit_timer_id = parent->mac_timers->timer_get_unique_id();
status_prohibit_timer = parent->mac_timers->timer_get(status_prohibit_timer_id);
}
}
bool rlc_am::rlc_am_tx::configure(srslte_rlc_config_t cfg_) bool rlc_am::rlc_am_tx::configure(srslte_rlc_config_t cfg_)
{ {
// TODO: add config checks // TODO: add config checks
@ -271,14 +257,10 @@ void rlc_am::rlc_am_tx::stop()
if (parent->mac_timers != NULL && poll_retx_timer != NULL) { if (parent->mac_timers != NULL && poll_retx_timer != NULL) {
poll_retx_timer->stop(); poll_retx_timer->stop();
parent->mac_timers->timer_release_id(poll_retx_timer_id);
poll_retx_timer = NULL;
} }
if (parent->mac_timers != NULL && status_prohibit_timer != NULL) { if (parent->mac_timers != NULL && status_prohibit_timer != NULL) {
status_prohibit_timer->stop(); status_prohibit_timer->stop();
parent->mac_timers->timer_release_id(status_prohibit_timer_id);
status_prohibit_timer = NULL;
} }
vt_a = 0; vt_a = 0;
@ -1170,37 +1152,34 @@ bool rlc_am::rlc_am_tx::retx_queue_has_sn(uint32_t sn)
* Rx subclass implementation * Rx subclass implementation
***************************************************************************/ ***************************************************************************/
rlc_am::rlc_am_rx::rlc_am_rx(rlc_am* parent_) rlc_am::rlc_am_rx::rlc_am_rx(rlc_am* parent_) :
:parent(parent_) parent(parent_),
,pool(byte_buffer_pool::get_instance()) pool(byte_buffer_pool::get_instance()),
,log(NULL) log(parent_->log),
,cfg() cfg(),
,reordering_timer(NULL) reordering_timer(nullptr),
,reordering_timer_id(0) reordering_timer_id(0),
,vr_r(0) vr_r(0),
,vr_mr(RLC_AM_WINDOW_SIZE) vr_mr(RLC_AM_WINDOW_SIZE),
,vr_x(0) vr_x(0),
,vr_ms(0) vr_ms(0),
,vr_h(0) vr_h(0),
,num_rx_bytes(0) num_rx_bytes(0),
,poll_received(false) poll_received(false),
,do_status(false) do_status(false)
{ {
reordering_timer_id = parent->mac_timers->timer_get_unique_id();
reordering_timer = parent->mac_timers->timer_get(reordering_timer_id);
pthread_mutex_init(&mutex, NULL); pthread_mutex_init(&mutex, NULL);
} }
rlc_am::rlc_am_rx::~rlc_am_rx() rlc_am::rlc_am_rx::~rlc_am_rx()
{ {
pthread_mutex_destroy(&mutex); reordering_timer->stop();
} parent->mac_timers->timer_release_id(reordering_timer_id);
void rlc_am::rlc_am_rx::init() pthread_mutex_destroy(&mutex);
{
log = parent->log;
if (parent->mac_timers != NULL) {
reordering_timer_id = parent->mac_timers->timer_get_unique_id();
reordering_timer = parent->mac_timers->timer_get(reordering_timer_id);
}
} }
bool rlc_am::rlc_am_rx::configure(srslte_rlc_am_config_t cfg_) bool rlc_am::rlc_am_rx::configure(srslte_rlc_am_config_t cfg_)
@ -1233,8 +1212,6 @@ void rlc_am::rlc_am_rx::stop()
if (parent->mac_timers != NULL && reordering_timer != NULL) { if (parent->mac_timers != NULL && reordering_timer != NULL) {
reordering_timer->stop(); reordering_timer->stop();
parent->mac_timers->timer_release_id(reordering_timer_id);
reordering_timer = NULL;
} }
rx_sdu.reset(); rx_sdu.reset();

View File

@ -23,13 +23,18 @@
namespace srslte { namespace srslte {
rlc_tm::rlc_tm(uint32_t queue_len) : rlc_tm::rlc_tm(srslte::log* log_,
ul_queue(queue_len), uint32_t lcid_,
tx_enabled(false), srsue::pdcp_interface_rlc* pdcp_,
log(NULL), srsue::rrc_interface_rlc* rrc_,
pdcp(NULL), srslte::mac_interface_timers* mac_timers_,
rrc(NULL), uint32_t queue_len_) :
lcid(0), ul_queue(queue_len_),
tx_enabled(true),
log(log_),
pdcp(pdcp_),
rrc(rrc_),
lcid(lcid_),
num_tx_bytes(0), num_tx_bytes(0),
num_rx_bytes(0) num_rx_bytes(0)
{ {
@ -41,19 +46,6 @@ rlc_tm::~rlc_tm() {
pool = NULL; pool = NULL;
} }
void rlc_tm::init(srslte::log *log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_,
srsue::rrc_interface_rlc *rrc_,
mac_interface_timers *mac_timers)
{
log = log_;
lcid = lcid_;
pdcp = pdcp_;
rrc = rrc_;
tx_enabled = true;
}
bool rlc_tm::configure(srslte_rlc_config_t cnfg) bool rlc_tm::configure(srslte_rlc_config_t cnfg)
{ {
log->error("Attempted to configure TM RLC entity\n"); log->error("Attempted to configure TM RLC entity\n");

View File

@ -22,7 +22,6 @@
#include "srslte/upper/rlc_um.h" #include "srslte/upper/rlc_um.h"
#include <sstream> #include <sstream>
#include <srslte/upper/rlc_interface.h> #include <srslte/upper/rlc_interface.h>
#include <srslte/upper/rlc_common.h>
#define RX_MOD_BASE(x) (((x)-vr_uh-cfg.rx_window_size)%cfg.rx_mod) #define RX_MOD_BASE(x) (((x)-vr_uh-cfg.rx_window_size)%cfg.rx_mod)
@ -30,7 +29,17 @@ using namespace asn1::rrc;
namespace srslte { namespace srslte {
rlc_um::rlc_um() : lcid(0), tx(), pool(byte_buffer_pool::get_instance()), rrc(NULL), log(NULL) rlc_um::rlc_um(srslte::log* log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc* pdcp_,
srsue::rrc_interface_rlc* rrc_,
mac_interface_timers* mac_timers_) :
lcid(lcid_),
pool(byte_buffer_pool::get_instance()),
rrc(rrc_),
log(log_),
tx(log_),
rx(log_, lcid_, pdcp_, rrc_, mac_timers_)
{ {
bzero(&cfg, sizeof(srslte_rlc_um_config_t)); bzero(&cfg, sizeof(srslte_rlc_um_config_t));
} }
@ -41,19 +50,6 @@ rlc_um::~rlc_um()
stop(); stop();
} }
void rlc_um::init(srslte::log *log_,
uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_,
srsue::rrc_interface_rlc *rrc_,
srslte::mac_interface_timers *mac_timers_)
{
tx.init(log_);
rx.init(log_, lcid_, pdcp_, rrc_, mac_timers_);
lcid = lcid_;
rrc = rrc_; // needed to determine bearer name during configuration
log = log_;
}
bool rlc_um::resume() bool rlc_um::resume()
{ {
if (not has_configuration) { if (not has_configuration) {
@ -226,9 +222,9 @@ std::string rlc_um::get_rb_name(srsue::rrc_interface_rlc *rrc, uint32_t lcid, bo
* Tx subclass implementation * Tx subclass implementation
***************************************************************************/ ***************************************************************************/
rlc_um::rlc_um_tx::rlc_um_tx() : rlc_um::rlc_um_tx::rlc_um_tx(srslte::log* log_) :
pool(byte_buffer_pool::get_instance()), pool(byte_buffer_pool::get_instance()),
log(NULL), log(log_),
vt_us(0), vt_us(0),
tx_enabled(false), tx_enabled(false),
num_tx_bytes(0) num_tx_bytes(0)
@ -243,12 +239,6 @@ rlc_um::rlc_um_tx::~rlc_um_tx()
} }
void rlc_um::rlc_um_tx::init(srslte::log *log_)
{
log = log_;
}
bool rlc_um::rlc_um_tx::configure(srslte_rlc_config_t cnfg_, std::string rb_name_) bool rlc_um::rlc_um_tx::configure(srslte_rlc_config_t cnfg_, std::string rb_name_)
{ {
cfg = cnfg_.um; cfg = cnfg_.um;
@ -513,45 +503,43 @@ void rlc_um::rlc_um_tx::debug_state()
* Rx subclass implementation * Rx subclass implementation
***************************************************************************/ ***************************************************************************/
rlc_um::rlc_um_rx::rlc_um_rx() rlc_um::rlc_um_rx::rlc_um_rx(srslte::log* log_,
:reordering_timer(NULL) uint32_t lcid_,
,reordering_timer_id(0) srsue::pdcp_interface_rlc* pdcp_,
,pool(byte_buffer_pool::get_instance()) srsue::rrc_interface_rlc* rrc_,
,log(NULL) srslte::mac_interface_timers* mac_timers_) :
,pdcp(NULL) reordering_timer(nullptr),
,rrc(NULL) reordering_timer_id(0),
,vr_ur(0) pool(byte_buffer_pool::get_instance()),
,vr_ux (0) log(log_),
,vr_uh(0) pdcp(pdcp_),
,vr_ur_in_rx_sdu(0) rrc(rrc_),
,pdu_lost(false) vr_ur(0),
,mac_timers(NULL) vr_ux(0),
,lcid(0) vr_uh(0),
,num_rx_bytes(0) vr_ur_in_rx_sdu(0),
,rx_enabled(false) pdu_lost(false),
mac_timers(mac_timers_),
lcid(lcid_),
num_rx_bytes(0),
rx_enabled(false)
{ {
reordering_timer_id = mac_timers->timer_get_unique_id();
reordering_timer = mac_timers->timer_get(reordering_timer_id);
pthread_mutex_init(&mutex, NULL); pthread_mutex_init(&mutex, NULL);
} }
rlc_um::rlc_um_rx::~rlc_um_rx() rlc_um::rlc_um_rx::~rlc_um_rx()
{ {
reordering_timer->stop();
mac_timers->timer_release_id(reordering_timer_id);
pthread_mutex_destroy(&mutex); pthread_mutex_destroy(&mutex);
} }
void rlc_um::rlc_um_rx::init(srslte::log *log_, uint32_t lcid_, srsue::pdcp_interface_rlc *pdcp_, srsue::rrc_interface_rlc *rrc_, srslte::mac_interface_timers *mac_timers_)
{
log = log_;
lcid = lcid_;
pdcp = pdcp_;
rrc = rrc_;
mac_timers = mac_timers_;
reordering_timer_id = mac_timers->timer_get_unique_id();
reordering_timer = mac_timers->timer_get(reordering_timer_id);
}
void rlc_um::rlc_um_rx::reestablish() void rlc_um::rlc_um_rx::reestablish()
{ {
// try to reassemble any SDUs if possible // try to reassemble any SDUs if possible
@ -575,11 +563,7 @@ void rlc_um::rlc_um_rx::stop()
reset(); reset();
if (mac_timers != NULL && reordering_timer != NULL) { reordering_timer->stop();
reordering_timer->stop();
mac_timers->timer_release_id(reordering_timer_id);
reordering_timer = NULL;
}
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }

View File

@ -161,20 +161,13 @@ bool basic_test()
log2.set_level(srslte::LOG_LEVEL_DEBUG); log2.set_level(srslte::LOG_LEVEL_DEBUG);
log1.set_hex_limit(-1); log1.set_hex_limit(-1);
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
byte_buffer_t pdu_bufs[NBUFS]; byte_buffer_t pdu_bufs[NBUFS];
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -205,7 +198,7 @@ bool basic_test()
// Read status PDU from RLC2 // Read status PDU from RLC2
byte_buffer_t status_buf; byte_buffer_t status_buf;
len = rlc2.read_pdu(status_buf.msg, 2); int len = rlc2.read_pdu(status_buf.msg, 2);
status_buf.N_bytes = len; status_buf.N_bytes = len;
assert(0 == rlc2.get_buffer_state()); assert(0 == rlc2.get_buffer_state());
@ -241,16 +234,8 @@ bool concat_test()
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -284,7 +269,7 @@ bool concat_test()
// Read 1 PDUs from RLC1 containing all 5 SDUs // Read 1 PDUs from RLC1 containing all 5 SDUs
byte_buffer_t pdu_buf; byte_buffer_t pdu_buf;
len = rlc1.read_pdu(pdu_buf.msg, 13); // 8 bytes for header + payload int len = rlc1.read_pdu(pdu_buf.msg, 13); // 8 bytes for header + payload
pdu_buf.N_bytes = len; pdu_buf.N_bytes = len;
assert(0 == rlc1.get_buffer_state()); assert(0 == rlc1.get_buffer_state());
@ -322,17 +307,10 @@ bool segment_test(bool in_seq_rx)
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -432,17 +410,10 @@ bool retx_test()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -541,17 +512,10 @@ bool resegment_test_1()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -663,17 +627,10 @@ bool resegment_test_2()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -783,16 +740,8 @@ bool resegment_test_3()
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -897,16 +846,8 @@ bool resegment_test_4()
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -1013,14 +954,8 @@ bool resegment_test_5()
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -1126,17 +1061,10 @@ bool resegment_test_6()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -1280,14 +1208,8 @@ bool resegment_test_7()
#endif #endif
mac_dummy_timers timers; mac_dummy_timers timers;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -1468,15 +1390,8 @@ bool resegment_test_8()
#endif #endif
mac_dummy_timers timers; mac_dummy_timers timers;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
rlc_am rlc2; rlc_am rlc2(&log2, 1, &tester, &tester, &timers);
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc2.init(&log2, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -1623,20 +1538,13 @@ bool resegment_test_8()
bool reset_test() bool reset_test()
{ {
srslte::log_filter log1("RLC_AM_1"); srslte::log_filter log1("RLC_AM_1");
srslte::log_filter log2("RLC_AM_2");
log1.set_level(srslte::LOG_LEVEL_DEBUG); log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
log1.set_hex_limit(-1); log1.set_hex_limit(-1);
log2.set_hex_limit(-1);
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -1684,20 +1592,13 @@ bool reset_test()
bool resume_test() bool resume_test()
{ {
srslte::log_filter log1("RLC_AM_1"); srslte::log_filter log1("RLC_AM_1");
srslte::log_filter log2("RLC_AM_2");
log1.set_level(srslte::LOG_LEVEL_DEBUG); log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
log1.set_hex_limit(-1); log1.set_hex_limit(-1);
log2.set_hex_limit(-1);
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);
@ -1750,11 +1651,7 @@ bool stop_test()
rlc_am_tester tester; rlc_am_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
rlc_am rlc1; rlc_am rlc1(&log1, 1, &tester, &tester, &timers);
log1.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 1, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::am); cnfg.set(rlc_cfg_c::types::am);

View File

@ -104,23 +104,37 @@ void parse_args(stress_test_args_t *args, int argc, char *argv[]) {
} }
} }
class mac_dummy // To provide timer services to RLC
:public srslte::mac_interface_timers class stack_dummy : public srslte::mac_interface_timers
,public thread {
public:
stack_dummy() : timers(8) {}
srslte::timers::timer* timer_get(uint32_t timer_id) { return timers.get(timer_id); }
uint32_t timer_get_unique_id() { return timers.get_unique_id(); }
void timer_release_id(uint32_t timer_id) { timers.release_id(timer_id); }
void step_timer() { timers.step_all(); }
private:
srslte::timers timers;
};
class mac_dummy : public thread
{ {
public: public:
mac_dummy(rlc_interface_mac* rlc1_, mac_dummy(rlc_interface_mac* rlc1_,
rlc_interface_mac* rlc2_, rlc_interface_mac* rlc2_,
stress_test_args_t args_, stress_test_args_t args_,
uint32_t lcid_, uint32_t lcid_,
stack_dummy* stack_,
rlc_pcap* pcap_ = NULL) : rlc_pcap* pcap_ = NULL) :
timers(8),
run_enable(true), run_enable(true),
rlc1(rlc1_), rlc1(rlc1_),
rlc2(rlc2_), rlc2(rlc2_),
args(args_), args(args_),
pcap(pcap_), pcap(pcap_),
lcid(lcid_), lcid(lcid_),
stack(stack_),
log("MAC "), log("MAC "),
thread("MAC_DUMMY") thread("MAC_DUMMY")
{ {
@ -134,20 +148,6 @@ public:
wait_thread_finish(); wait_thread_finish();
} }
srslte::timers::timer* timer_get(uint32_t timer_id)
{
return timers.get(timer_id);
}
uint32_t timer_get_unique_id() {
return timers.get_unique_id();
}
void timer_release_id(uint32_t timer_id) {
timers.release_id(timer_id);
}
void step_timer() {
timers.step_all();
}
private: private:
void run_tti(rlc_interface_mac *tx_rlc, rlc_interface_mac *rx_rlc, bool is_dl) void run_tti(rlc_interface_mac *tx_rlc, rlc_interface_mac *rx_rlc, bool is_dl)
{ {
@ -193,18 +193,19 @@ private:
run_tti(rlc2, rlc1, false); run_tti(rlc2, rlc1, false);
// step timer // step timer
step_timer(); stack->step_timer();
} }
} }
rlc_interface_mac *rlc1; rlc_interface_mac *rlc1;
rlc_interface_mac *rlc2; rlc_interface_mac *rlc2;
srslte::timers timers;
bool run_enable; bool run_enable;
stress_test_args_t args; stress_test_args_t args;
rlc_pcap *pcap; rlc_pcap *pcap;
uint32_t lcid; uint32_t lcid;
srslte::log_filter log; srslte::log_filter log;
stack_dummy* stack = nullptr;
}; };
@ -334,16 +335,18 @@ void stress_test(stress_test_args_t args)
exit(-1); exit(-1);
} }
stack_dummy stack;
rlc rlc1; rlc rlc1;
rlc rlc2; rlc rlc2;
rlc_tester tester1(&rlc1, "tester1", args, lcid); rlc_tester tester1(&rlc1, "tester1", args, lcid);
rlc_tester tester2(&rlc2, "tester2", args, lcid); rlc_tester tester2(&rlc2, "tester2", args, lcid);
mac_dummy mac(&rlc1, &rlc2, args, lcid, &pcap); mac_dummy mac(&rlc1, &rlc2, args, lcid, &stack, &pcap);
ue_interface ue; ue_interface ue;
rlc1.init(&tester1, &tester1, &ue, &log1, &mac, 0); rlc1.init(&tester1, &tester1, &ue, &log1, &stack, 0);
rlc2.init(&tester2, &tester2, &ue, &log2, &mac, 0); rlc2.init(&tester2, &tester2, &ue, &log2, &stack, 0);
// only add AM and UM bearers // only add AM and UM bearers
if (args.mode != "TM") { if (args.mode != "TM") {

View File

@ -104,17 +104,10 @@ int basic_test()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_um_tester tester; rlc_um_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_um rlc1; rlc_um rlc1(&log1, 3, &tester, &tester, &timers);
rlc_um rlc2; rlc_um rlc2(&log2, 3, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 3, &tester, &tester, &timers);
rlc2.init(&log2, 3, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::um_bi_dir); cnfg.set(rlc_cfg_c::types::um_bi_dir);
@ -178,17 +171,10 @@ int loss_test()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_um_tester tester; rlc_um_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_um rlc1; rlc_um rlc1(&log1, 3, &tester, &tester, &timers);
rlc_um rlc2; rlc_um rlc2(&log2, 3, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 3, &tester, &tester, &timers);
rlc2.init(&log2, 3, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::um_bi_dir); cnfg.set(rlc_cfg_c::types::um_bi_dir);
@ -250,17 +236,10 @@ int basic_mbsfn_test()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_um_tester tester; rlc_um_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_um rlc1; rlc_um rlc1(&log1, 3, &tester, &tester, &timers);
rlc_um rlc2; rlc_um rlc2(&log2, 3, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 3, &tester, &tester, &timers);
rlc2.init(&log2, 3, &tester, &tester, &timers);
rlc1.configure(srslte_rlc_config_t::mch_config()); rlc1.configure(srslte_rlc_config_t::mch_config());
rlc2.configure(srslte_rlc_config_t::mch_config()); rlc2.configure(srslte_rlc_config_t::mch_config());
@ -329,17 +308,10 @@ int reassmble_test()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_um_tester tester; rlc_um_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_um rlc1; rlc_um rlc1(&log1, 3, &tester, &tester, &timers);
rlc_um rlc2; rlc_um rlc2(&log2, 3, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 3, &tester, &tester, &timers);
rlc2.init(&log2, 3, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::um_bi_dir); cnfg.set(rlc_cfg_c::types::um_bi_dir);
@ -449,17 +421,10 @@ int reassmble_test2()
log2.set_hex_limit(-1); log2.set_hex_limit(-1);
rlc_um_tester tester; rlc_um_tester tester;
mac_dummy_timers timers; mac_dummy_timers timers;
int len = 0;
rlc_um rlc1; rlc_um rlc1(&log1, 3, &tester, &tester, &timers);
rlc_um rlc2; rlc_um rlc2(&log2, 3, &tester, &tester, &timers);
int len;
log1.set_level(srslte::LOG_LEVEL_DEBUG);
log2.set_level(srslte::LOG_LEVEL_DEBUG);
rlc1.init(&log1, 3, &tester, &tester, &timers);
rlc2.init(&log2, 3, &tester, &tester, &timers);
rlc_cfg_c cnfg; rlc_cfg_c cnfg;
cnfg.set(rlc_cfg_c::types::um_bi_dir); cnfg.set(rlc_cfg_c::types::um_bi_dir);