rrc,rlc,nr: fix RB label in RLC-NR for UE logs + ..

add rb_type in rlc_um_config

Signed-off-by: Carlo Galiotto <carlo@srs.io>
This commit is contained in:
Carlo Galiotto 2021-10-29 10:47:34 +02:00 committed by carlo-gal
parent d95c31d2de
commit 9c2099f680
7 changed files with 20 additions and 8 deletions

View File

@ -134,7 +134,10 @@ 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, uint8_t bearer_id = 0);
int make_rlc_config_t(const asn1::rrc_nr::rlc_cfg_c& asn1_type,
uint8_t bearer_id,
rlc_rb_type_t rb_type,
rlc_config_t* rlc_config_out);
/***************************
* PDCP Config

View File

@ -70,6 +70,8 @@ inline uint16_t to_number(const rlc_am_nr_sn_size_t& sn_size)
return enum_to_number(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
typedef enum { RLC_RB_IS_SRB, RLC_RB_IS_DRB } rlc_rb_type_t;
struct rlc_am_config_t {
/****************************************************************************
* Configurable parameters
@ -112,6 +114,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
rlc_rb_type_t rb_type; // This is not in the 3GPP TS 38.322
};
#define RLC_TX_QUEUE_LEN (256)

View File

@ -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, uint8_t bearer_id)
int make_rlc_config_t(const rlc_cfg_c& asn1_type, uint8_t bearer_id, rlc_rb_type_t rb_type, rlc_config_t* cfg_out)
{
rlc_config_t rlc_cfg = rlc_config_t::default_rlc_um_nr_config();
rlc_cfg.rat = srsran_rat_t::nr;
@ -113,6 +113,7 @@ int make_rlc_config_t(const rlc_cfg_c& asn1_type, rlc_config_t* cfg_out, uint8_t
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;
rlc_cfg.um_nr.rb_type = rb_type;
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) {

View File

@ -61,7 +61,6 @@ bool rlc_um_nr::configure(const rlc_config_t& cnfg_)
return true;
}
/****************************************************************************
* Logging helpers
***************************************************************************/
@ -70,7 +69,7 @@ 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);
fmt::format_to(fmtbuf, "{}{}", cfg.um_nr.rb_type == RLC_RB_IS_SRB ? "SRB" : "DRB", cfg.um_nr.bearer_id);
} else {
fmt::format_to(fmtbuf, "DRB N/A");
}

View File

@ -35,7 +35,8 @@ int test_rlc_config()
srslog::fetch_basic_logger("RRC").info("RLC NR Config: \n %s", jw.to_string().c_str());
rlc_config_t rlc_cfg;
TESTASSERT(make_rlc_config_t(rlc_cfg_asn1, &rlc_cfg) == SRSRAN_SUCCESS);
// We hard-code the bearer_id=1 and rb_type=DRB
TESTASSERT(make_rlc_config_t(rlc_cfg_asn1, /* bearer_id */ 1, /*rb_type*/ RLC_RB_IS_DRB, &rlc_cfg) == SRSRAN_SUCCESS);
TESTASSERT(rlc_cfg.rat == srsran_rat_t::nr);
TESTASSERT(rlc_cfg.um_nr.sn_field_length == rlc_um_nr_sn_size_t::size12bits);
return SRSRAN_SUCCESS;

View File

@ -1404,8 +1404,9 @@ int rrc_nr::ue::add_drb()
srsran::rlc_config_t rlc_cfg;
/// 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) {
rlc_bearer.served_radio_bearer.drb_id(),
srsran::RLC_RB_IS_DRB,
&rlc_cfg) != SRSRAN_SUCCESS) {
parent->logger.error("Failed to build RLC config");
return SRSRAN_ERROR;
}

View File

@ -457,12 +457,15 @@ bool rrc_nr::apply_rlc_add_mod(const rlc_bearer_cfg_s& rlc_bearer_cfg)
uint32_t drb_id = 0;
uint32_t srb_id = 0;
rlc_config_t rlc_cfg;
// We change this to RLC_RB_IS_DRB if below we detect it's a DRB
rlc_rb_type_t rb_type = RLC_RB_IS_SRB;
lc_ch_id = rlc_bearer_cfg.lc_ch_id;
if (rlc_bearer_cfg.served_radio_bearer_present == true) {
if (rlc_bearer_cfg.served_radio_bearer.type() == rlc_bearer_cfg_s::served_radio_bearer_c_::types::drb_id) {
drb_id = rlc_bearer_cfg.served_radio_bearer.drb_id();
add_lcid_drb(lc_ch_id, drb_id);
rb_type = RLC_RB_IS_DRB;
}
} else {
logger.error("In RLC bearer cfg does not contain served radio bearer");
@ -470,7 +473,8 @@ bool rrc_nr::apply_rlc_add_mod(const rlc_bearer_cfg_s& rlc_bearer_cfg)
}
if (rlc_bearer_cfg.rlc_cfg_present == true) {
if (srsran::make_rlc_config_t(rlc_bearer_cfg.rlc_cfg, &rlc_cfg) != SRSRAN_SUCCESS) {
uint8_t bearer_id = static_cast<uint8_t>(rb_type == RLC_RB_IS_SRB ? srb_id : drb_id);
if (srsran::make_rlc_config_t(rlc_bearer_cfg.rlc_cfg, bearer_id, rb_type, &rlc_cfg) != SRSRAN_SUCCESS) {
logger.error("Failed to build RLC config");
return false;
}