rlc,rrc,nr: fix rlc bearer string diplayed in logs

Signed-off-by: Carlo Galiotto <carlo@srs.io>
master
Carlo Galiotto 3 years ago committed by carlo-gal
parent c02aeee0d8
commit d95c31d2de

@ -134,7 +134,7 @@ bool make_mac_dl_harq_cfg_nr_t(const asn1::rrc_nr::pdsch_ser
/***************************
* RLC Config
**************************/
int make_rlc_config_t(const asn1::rrc_nr::rlc_cfg_c& asn1_type, rlc_config_t* rlc_config_out);
int make_rlc_config_t(const asn1::rrc_nr::rlc_cfg_c& asn1_type, rlc_config_t* rlc_config_out, uint8_t bearer_id = 0);
/***************************
* PDCP Config

@ -111,6 +111,7 @@ struct rlc_um_nr_config_t {
rlc_um_nr_sn_size_t sn_field_length; // Number of bits used for sequence number
int32_t t_reassembly_ms; // Timer used by rx to detect PDU loss (ms)
uint8_t bearer_id; // This is not in the 3GPP TS 38.322
};
#define RLC_TX_QUEUE_LEN (256)

@ -41,6 +41,9 @@ public:
~rlc_um_nr();
bool configure(const rlc_config_t& cnfg);
// logging helpers
std::string get_rb_name() const;
private:
// Transmitter sub-class for NR
class rlc_um_nr_tx : public rlc_um_base_tx

@ -101,7 +101,7 @@ rach_nr_cfg_t make_mac_rach_cfg(const rach_cfg_common_s& asn1_type)
return rach_nr_cfg;
};
int make_rlc_config_t(const rlc_cfg_c& asn1_type, rlc_config_t* cfg_out)
int make_rlc_config_t(const rlc_cfg_c& asn1_type, rlc_config_t* cfg_out, uint8_t bearer_id)
{
rlc_config_t rlc_cfg = rlc_config_t::default_rlc_um_nr_config();
rlc_cfg.rat = srsran_rat_t::nr;
@ -112,7 +112,7 @@ int make_rlc_config_t(const rlc_cfg_c& asn1_type, rlc_config_t* cfg_out)
case rlc_cfg_c::types_opts::um_bi_dir:
rlc_cfg.rlc_mode = rlc_mode_t::um;
rlc_cfg.um_nr.t_reassembly_ms = asn1_type.um_bi_dir().dl_um_rlc.t_reassembly.to_number();
rlc_cfg.um_nr.bearer_id = bearer_id;
if (asn1_type.um_bi_dir().dl_um_rlc.sn_field_len_present &&
asn1_type.um_bi_dir().ul_um_rlc.sn_field_len_present &&
asn1_type.um_bi_dir().dl_um_rlc.sn_field_len != asn1_type.um_bi_dir().ul_um_rlc.sn_field_len) {

@ -33,12 +33,12 @@ rlc_um_nr::~rlc_um_nr()
bool rlc_um_nr::configure(const rlc_config_t& cnfg_)
{
// determine bearer name and configure Rx/Tx objects
rb_name = get_rb_name(rrc, lcid, cnfg_.um.is_mrb);
// store config
cfg = cnfg_;
// determine bearer name and configure Rx/Tx objects
rb_name = get_rb_name();
rx.reset(new rlc_um_nr_rx(this));
if (not rx->configure(cfg, rb_name)) {
return false;
@ -61,6 +61,22 @@ bool rlc_um_nr::configure(const rlc_config_t& cnfg_)
return true;
}
/****************************************************************************
* Logging helpers
***************************************************************************/
std::string rlc_um_nr::get_rb_name() const
{
fmt::memory_buffer fmtbuf;
// currently we only support DRB 1 (hardcoded)
if (cfg.um_nr.bearer_id == 1) {
fmt::format_to(fmtbuf, "DRB{}", cfg.um_nr.bearer_id);
} else {
fmt::format_to(fmtbuf, "DRB N/A");
}
return fmt::to_string(fmtbuf);
}
/****************************************************************************
* Tx Subclass implementation
***************************************************************************/
@ -253,6 +269,8 @@ bool rlc_um_nr::rlc_um_nr_rx::configure(const rlc_config_t& cnfg_, std::string r
[this](uint32_t tid) { timer_expired(tid); });
}
rb_name = rb_name_;
return true;
}

@ -1402,7 +1402,10 @@ int rrc_nr::ue::add_drb()
// add RLC bearer
srsran::rlc_config_t rlc_cfg;
if (srsran::make_rlc_config_t(cell_group_cfg.rlc_bearer_to_add_mod_list[0].rlc_cfg, &rlc_cfg) != SRSRAN_SUCCESS) {
/// NOTE, we need to pass the radio-bearer to the rlc_config
if (srsran::make_rlc_config_t(cell_group_cfg.rlc_bearer_to_add_mod_list[0].rlc_cfg,
&rlc_cfg,
rlc_bearer.served_radio_bearer.drb_id()) != SRSRAN_SUCCESS) {
parent->logger.error("Failed to build RLC config");
return SRSRAN_ERROR;
}

Loading…
Cancel
Save