From 217f16d1377f2845d2ca383b825e48fad918fa4d Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 12 Jun 2020 12:22:42 +0100 Subject: [PATCH] Getting PDCP state on re-establishment. --- srsenb/hdr/stack/rrc/rrc_metrics.h | 1 + srsenb/src/stack/rrc/rrc_ue.cc | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/srsenb/hdr/stack/rrc/rrc_metrics.h b/srsenb/hdr/stack/rrc/rrc_metrics.h index 0d712d3e1..f720c6fe5 100644 --- a/srsenb/hdr/stack/rrc/rrc_metrics.h +++ b/srsenb/hdr/stack/rrc/rrc_metrics.h @@ -33,6 +33,7 @@ typedef enum { RRC_STATE_WAIT_FOR_SECURITY_MODE_COMPLETE, RRC_STATE_WAIT_FOR_UE_CAP_INFO, RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE, + RRC_STATE_REESTABLISHMENT_COMPLETE, RRC_STATE_REGISTERED, RRC_STATE_RELEASE_REQUEST, RRC_STATE_N_ITEMS, diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index 1ae3d34d2..498a09601 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -367,6 +367,13 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg) // Get PDCP entity state (required when using RLC AM) parent->pdcp->get_state(old_rnti, 3, &old_reest_pdcp_state); + parent->rrc_log->debug( + "Got PDCP state: TX COUNT %d, RX_HFN %d, NEXT_PDCP_RX_SN %d, LAST_SUBMITTED_PDCP_RX_SN %d\n", + old_reest_pdcp_state.tx_count, + old_reest_pdcp_state.rx_hfn, + old_reest_pdcp_state.next_pdcp_rx_sn, + old_reest_pdcp_state.last_submitted_pdcp_rx_sn); + old_reest_rnti = old_rnti; state = RRC_STATE_WAIT_FOR_CON_REEST_COMPLETE; set_activity_timeout(UE_RESPONSE_RX_TIMEOUT); @@ -445,7 +452,7 @@ void rrc::ue::handle_rrc_con_reest_complete(rrc_conn_reest_complete_s* msg, srsl // remove old RNTI parent->rem_user_thread(old_reest_rnti); - state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE; + state = RRC_STATE_REESTABLISHMENT_COMPLETE; send_connection_reconf(std::move(pdu)); } @@ -549,6 +556,11 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu) } last_rrc_conn_recfg = dl_dcch_msg.msg.c1().rrc_conn_recfg(); + // If reconf due to reestablishment, recover PDCP state + if (state == RRC_STATE_REESTABLISHMENT_COMPLETE) { + // parent->pdcp->set_state(rnti, 3, old_reest_pdcp_state); + } + // Reuse same PDU pdu->clear();