lte,pdcp: silence error message when a reconfiguration of a PDCP entity is no-op

This commit is contained in:
Francisco Paisana 2021-08-18 14:23:33 +02:00
parent 9855450a4a
commit eb4999a18e
4 changed files with 28 additions and 2 deletions

View File

@ -156,6 +156,15 @@ public:
// TODO: Support the following configurations
// bool do_rohc;
bool operator==(const pdcp_config_t& other) const
{
return bearer_id == other.bearer_id and rb_type == other.rb_type and tx_direction == other.tx_direction and
rx_direction == other.rx_direction and sn_len == other.sn_len and hdr_len_bytes == other.hdr_len_bytes and
t_reordering == other.t_reordering and discard_timer == other.discard_timer and rat == other.rat and
status_report_required == other.status_report_required;
}
bool operator!=(const pdcp_config_t& other) const { return not(*this == other); }
};
// Specifies in which direction security (integrity and ciphering) are enabled for PDCP

View File

@ -93,8 +93,7 @@ void pdcp::write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu)
int pdcp::add_bearer(uint32_t lcid, pdcp_config_t cfg)
{
if (valid_lcid(lcid)) {
logger.error("Bearer %s already configured.", rrc->get_rb_name(lcid));
return SRSRAN_ERROR;
return pdcp_array[lcid]->configure(cfg) ? SRSRAN_SUCCESS : SRSRAN_ERROR;
}
std::unique_ptr<pdcp_entity_base> entity;

View File

@ -51,6 +51,15 @@ pdcp_entity_lte::~pdcp_entity_lte()
bool pdcp_entity_lte::configure(const pdcp_config_t& cnfg_)
{
if (active) {
// Already configured
if (cnfg_ != cfg) {
logger.error("Bearer reconfiguration not supported. LCID=%d.", rrc->get_rb_name(lcid));
return false;
}
return true;
}
cfg = cnfg_;
maximum_pdcp_sn = (1u << cfg.sn_len) - 1u;
st.last_submitted_pdcp_rx_sn = maximum_pdcp_sn;

View File

@ -43,6 +43,15 @@ void pdcp_entity_nr::reestablish()
bool pdcp_entity_nr::configure(const pdcp_config_t& cnfg_)
{
if (active) {
// Already configured
if (cnfg_ != cfg) {
logger.error("Bearer reconfiguration not supported. LCID=%d.", rrc->get_rb_name(lcid));
return false;
}
return true;
}
cfg = cnfg_;
window_size = 1 << (cfg.sn_len - 1);