From 89a23cec7e79740b69137fab759182408eb2c644 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 12 Feb 2021 14:18:16 +0000 Subject: [PATCH] Added statusReportRequired to the PDCP entity config. --- .../srslte/interfaces/pdcp_interface_types.h | 8 +++++-- lib/include/srslte/upper/pdcp_entity_base.h | 3 ++- lib/src/asn1/rrc_nr_utils.cc | 7 ++++--- lib/src/asn1/rrc_utils.cc | 21 +++++++------------ lib/src/upper/pdcp_entity_lte.cc | 15 ++++++------- lib/test/upper/pdcp_lte_test.h | 3 ++- lib/test/upper/pdcp_lte_test_discard_sdu.cc | 6 ++++-- lib/test/upper/pdcp_lte_test_rx.cc | 3 ++- lib/test/upper/pdcp_lte_test_status_report.cc | 6 ++++-- lib/test/upper/pdcp_nr_test.h | 3 ++- lib/test/upper/pdcp_nr_test_discard_sdu.cc | 3 ++- lib/test/upper/pdcp_nr_test_rx.cc | 3 ++- lib/test/upper/pdcp_nr_test_tx.cc | 3 ++- srsenb/src/stack/rrc/rrc_nr.cc | 3 ++- srsue/src/stack/rrc/rrc_nr.cc | 8 +++---- 15 files changed, 53 insertions(+), 42 deletions(-) diff --git a/lib/include/srslte/interfaces/pdcp_interface_types.h b/lib/include/srslte/interfaces/pdcp_interface_types.h index 85b558817..25b7b4572 100644 --- a/lib/include/srslte/interfaces/pdcp_interface_types.h +++ b/lib/include/srslte/interfaces/pdcp_interface_types.h @@ -123,14 +123,16 @@ public: security_direction_t rx_direction_, uint8_t sn_len_, pdcp_t_reordering_t t_reordering_, - pdcp_discard_timer_t discard_timer_) : + pdcp_discard_timer_t discard_timer_, + bool status_report_required_) : bearer_id(bearer_id_), rb_type(rb_type_), tx_direction(tx_direction_), rx_direction(rx_direction_), sn_len(sn_len_), t_reordering(t_reordering_), - discard_timer(discard_timer_) + discard_timer(discard_timer_), + status_report_required(status_report_required_) { hdr_len_bytes = ceilf((float)sn_len / 8); } @@ -145,6 +147,8 @@ public: pdcp_t_reordering_t t_reordering = pdcp_t_reordering_t::ms500; pdcp_discard_timer_t discard_timer = pdcp_discard_timer_t::infinity; + bool status_report_required = false; + // TODO: Support the following configurations // bool do_rohc; }; diff --git a/lib/include/srslte/upper/pdcp_entity_base.h b/lib/include/srslte/upper/pdcp_entity_base.h index 3aa3bbfba..bd71b5046 100644 --- a/lib/include/srslte/upper/pdcp_entity_base.h +++ b/lib/include/srslte/upper/pdcp_entity_base.h @@ -141,7 +141,8 @@ protected: SECURITY_DIRECTION_UPLINK, PDCP_SN_LEN_12, pdcp_t_reordering_t::ms500, - pdcp_discard_timer_t::infinity}; + pdcp_discard_timer_t::infinity, + false}; srslte::as_security_config_t sec_cfg = {}; diff --git a/lib/src/asn1/rrc_nr_utils.cc b/lib/src/asn1/rrc_nr_utils.cc index 7d68795b7..71d89b0bb 100644 --- a/lib/src/asn1/rrc_nr_utils.cc +++ b/lib/src/asn1/rrc_nr_utils.cc @@ -69,7 +69,7 @@ logical_channel_config_t make_mac_logical_channel_cfg_t(uint8_t lcid, const lc_c rlc_config_t make_rlc_config_t(const rlc_cfg_c& asn1_type) { rlc_config_t rlc_cfg = rlc_config_t::default_rlc_um_nr_config(); - rlc_cfg.rat = srslte_rat_t::nr; + rlc_cfg.rat = srslte_rat_t::nr; switch (asn1_type.type().value) { case rlc_cfg_c::types_opts::am: break; @@ -138,7 +138,8 @@ srslte::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue is_ue ? SECURITY_DIRECTION_DOWNLINK : SECURITY_DIRECTION_UPLINK, sn_len, t_reordering, - discard_timer); + discard_timer, + false); return cfg; } @@ -171,4 +172,4 @@ int set_sched_cell_cfg_sib1(srsenb::sched_interface::cell_cfg_t* sched_cfg, cons return SRSLTE_SUCCESS; } -} // namespace srsenb \ No newline at end of file +} // namespace srsenb diff --git a/lib/src/asn1/rrc_utils.cc b/lib/src/asn1/rrc_utils.cc index 0c5b03614..d51dd6c6e 100644 --- a/lib/src/asn1/rrc_utils.cc +++ b/lib/src/asn1/rrc_utils.cc @@ -206,7 +206,8 @@ srslte::pdcp_config_t make_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue is_ue ? SECURITY_DIRECTION_DOWNLINK : SECURITY_DIRECTION_UPLINK, PDCP_SN_LEN_5, pdcp_t_reordering_t::ms500, - pdcp_discard_timer_t::infinity); + pdcp_discard_timer_t::infinity, + false); return cfg; } @@ -218,7 +219,8 @@ srslte::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue is_ue ? SECURITY_DIRECTION_DOWNLINK : SECURITY_DIRECTION_UPLINK, PDCP_SN_LEN_12, pdcp_t_reordering_t::ms500, - pdcp_discard_timer_t::infinity); + pdcp_discard_timer_t::infinity, + false); return cfg; } @@ -255,8 +257,9 @@ srslte::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue } } + bool status_report_required = false; if (pdcp_cfg.rlc_am_present) { - // TODO: handle RLC AM config for PDCP + status_report_required = pdcp_cfg.rlc_am.status_report_required; } pdcp_config_t cfg(bearer_id, @@ -265,7 +268,8 @@ srslte::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue is_ue ? SECURITY_DIRECTION_DOWNLINK : SECURITY_DIRECTION_UPLINK, sn_len, t_reordering, - discard_timer); + discard_timer, + status_report_required); return cfg; } @@ -310,7 +314,6 @@ void set_mac_cfg_t_main_cfg(mac_cfg_t* cfg, const asn1::rrc::mac_main_cfg_s& asn // RACH-Common section is always present void set_mac_cfg_t_rach_cfg_common(mac_cfg_t* cfg, const asn1::rrc::rach_cfg_common_s& asn1_type) { - // Preamble info cfg->rach_cfg.nof_preambles = asn1_type.preamb_info.nof_ra_preambs.to_number(); if (asn1_type.preamb_info.preambs_group_a_cfg_present) { @@ -392,7 +395,6 @@ srsenb::sched_interface::ant_info_ded_t make_ant_info_ded(const asn1::rrc::ant_i void set_phy_cfg_t_dedicated_cfg(phy_cfg_t* cfg, const asn1::rrc::phys_cfg_ded_s& asn1_type) { if (asn1_type.pucch_cfg_ded_present) { - if (asn1_type.pucch_cfg_ded.tdd_ack_nack_feedback_mode_present) { cfg->ul_cfg.pucch.tdd_ack_multiplex = asn1_type.pucch_cfg_ded.tdd_ack_nack_feedback_mode == asn1::rrc::pucch_cfg_ded_s::tdd_ack_nack_feedback_mode_e_::mux; @@ -405,7 +407,6 @@ void set_phy_cfg_t_dedicated_cfg(phy_cfg_t* cfg, const asn1::rrc::phys_cfg_ded_s auto* pucch_cfg_ded = asn1_type.pucch_cfg_ded_v1020.get(); if (pucch_cfg_ded->pucch_format_r10_present) { - typedef asn1::rrc::pucch_cfg_ded_v1020_s::pucch_format_r10_c_ pucch_format_r10_t; auto* pucch_format_r10 = &pucch_cfg_ded->pucch_format_r10; @@ -425,7 +426,6 @@ void set_phy_cfg_t_dedicated_cfg(phy_cfg_t* cfg, const asn1::rrc::phys_cfg_ded_s } } } else if (pucch_format_r10->type() == asn1::rrc::pucch_cfg_ded_v1020_s::pucch_format_r10_c_::types::ch_sel_r10) { - typedef pucch_format_r10_t::ch_sel_r10_s_ ch_sel_r10_t; auto* ch_sel_r10 = &pucch_format_r10->ch_sel_r10(); @@ -484,9 +484,7 @@ void set_phy_cfg_t_dedicated_cfg(phy_cfg_t* cfg, const asn1::rrc::phys_cfg_ded_s } if (asn1_type.cqi_report_cfg_present) { - if (asn1_type.cqi_report_cfg.cqi_report_periodic_present) { - cfg->dl_cfg.cqi_report.periodic_configured = asn1_type.cqi_report_cfg.cqi_report_periodic.type() == asn1::rrc::setup_e::setup; if (cfg->dl_cfg.cqi_report.periodic_configured) { @@ -514,7 +512,6 @@ void set_phy_cfg_t_dedicated_cfg(phy_cfg_t* cfg, const asn1::rrc::phys_cfg_ded_s } if (asn1_type.cqi_report_cfg.cqi_report_mode_aperiodic_present) { - cfg->dl_cfg.cqi_report.aperiodic_configured = true; cfg->dl_cfg.cqi_report.aperiodic_mode = make_aperiodic_mode(asn1_type.cqi_report_cfg.cqi_report_mode_aperiodic); } @@ -668,7 +665,6 @@ void set_phy_cfg_t_common_pwr_ctrl(phy_cfg_t* cfg, const asn1::rrc::ul_pwr_ctrl_ void set_phy_cfg_t_scell_config(phy_cfg_t* cfg, const asn1::rrc::scell_to_add_mod_r10_s& asn1_type) { if (asn1_type.rr_cfg_common_scell_r10_present) { - // Enable always CSI request extra bit cfg->dl_cfg.dci.multiple_csi_request_enabled = true; @@ -713,7 +709,6 @@ void set_phy_cfg_t_scell_config(phy_cfg_t* cfg, const asn1::rrc::scell_to_add_mo // Parse nonUL Configuration if (phys_cfg_ded_scell_r10->non_ul_cfg_r10_present) { - auto* non_ul_cfg = &phys_cfg_ded_scell_r10->non_ul_cfg_r10; // Parse Transmission mode diff --git a/lib/src/upper/pdcp_entity_lte.cc b/lib/src/upper/pdcp_entity_lte.cc index 8b209ce52..e8475899f 100644 --- a/lib/src/upper/pdcp_entity_lte.cc +++ b/lib/src/upper/pdcp_entity_lte.cc @@ -52,6 +52,7 @@ pdcp_entity_lte::pdcp_entity_lte(srsue::rlc_interface_pdcp* rlc_, reordering_window, maximum_pdcp_sn, static_cast(cfg.discard_timer)); + logger.info("Status Report Required: %s", cfg.status_report_required ? "True" : "False"); // Check supported config if (!check_valid_config()) { @@ -74,14 +75,14 @@ void pdcp_entity_lte::reestablish() st.tx_hfn = 0; st.rx_hfn = 0; st.next_pdcp_rx_sn = 0; - } else { + } else if (rlc->rb_is_um(lcid)) { // Only reset counter in RLC-UM - if (rlc->rb_is_um(lcid)) { - st.next_pdcp_tx_sn = 0; - st.tx_hfn = 0; - st.rx_hfn = 0; - st.next_pdcp_rx_sn = 0; - } + st.next_pdcp_tx_sn = 0; + st.tx_hfn = 0; + st.rx_hfn = 0; + st.next_pdcp_rx_sn = 0; + } else { + // TODO Send status report if required on reestablishment in RLC AM } } diff --git a/lib/test/upper/pdcp_lte_test.h b/lib/test/upper/pdcp_lte_test.h index 430f2faf8..9f44b0831 100644 --- a/lib/test/upper/pdcp_lte_test.h +++ b/lib/test/upper/pdcp_lte_test.h @@ -90,7 +90,8 @@ srslte::unique_byte_buffer_t gen_expected_pdu(const srslte::unique_byte_buffer_t srslte::SECURITY_DIRECTION_DOWNLINK, pdcp_sn_len, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t::infinity}; + srslte::pdcp_discard_timer_t::infinity, + false}; pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); srslte::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; diff --git a/lib/test/upper/pdcp_lte_test_discard_sdu.cc b/lib/test/upper/pdcp_lte_test_discard_sdu.cc index 57b00b722..d5582e307 100644 --- a/lib/test/upper/pdcp_lte_test_discard_sdu.cc +++ b/lib/test/upper/pdcp_lte_test_discard_sdu.cc @@ -25,7 +25,8 @@ int test_tx_sdu_notify(const srslte::pdcp_lte_state_t& init_state, srslte::SECURITY_DIRECTION_DOWNLINK, srslte::PDCP_SN_LEN_12, srslte::pdcp_t_reordering_t::ms500, - discard_timeout}; + discard_timeout, + false}; pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); srslte::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; @@ -70,7 +71,8 @@ int test_tx_sdu_discard(const srslte::pdcp_lte_state_t& init_state, srslte::SECURITY_DIRECTION_DOWNLINK, srslte::PDCP_SN_LEN_12, srslte::pdcp_t_reordering_t::ms500, - discard_timeout}; + discard_timeout, + false}; pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); srslte::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; diff --git a/lib/test/upper/pdcp_lte_test_rx.cc b/lib/test/upper/pdcp_lte_test_rx.cc index cb3f14f89..271a72e4d 100644 --- a/lib/test/upper/pdcp_lte_test_rx.cc +++ b/lib/test/upper/pdcp_lte_test_rx.cc @@ -30,7 +30,8 @@ int test_rx(std::vector events, srslte::SECURITY_DIRECTION_UPLINK, pdcp_sn_len, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t::infinity}; + srslte::pdcp_discard_timer_t::infinity, + false}; pdcp_lte_test_helper pdcp_hlp_rx(cfg_rx, sec_cfg, logger); srslte::pdcp_entity_lte* pdcp_rx = &pdcp_hlp_rx.pdcp; diff --git a/lib/test/upper/pdcp_lte_test_status_report.cc b/lib/test/upper/pdcp_lte_test_status_report.cc index 7b7ba87eb..1cf9159da 100644 --- a/lib/test/upper/pdcp_lte_test_status_report.cc +++ b/lib/test/upper/pdcp_lte_test_status_report.cc @@ -23,7 +23,8 @@ int test_tx_status_report(const srslte::pdcp_lte_state_t& init_state, srslog::ba srslte::SECURITY_DIRECTION_DOWNLINK, srslte::PDCP_SN_LEN_12, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t::ms500}; + srslte::pdcp_discard_timer_t::ms500, + false}; pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); srslte::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; @@ -102,7 +103,8 @@ int test_rx_status_report(const srslte::pdcp_lte_state_t& init_state, srslog::ba srslte::SECURITY_DIRECTION_DOWNLINK, srslte::PDCP_SN_LEN_12, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t::ms500}; + srslte::pdcp_discard_timer_t::ms500, + false}; pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); srslte::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; diff --git a/lib/test/upper/pdcp_nr_test.h b/lib/test/upper/pdcp_nr_test.h index cd7910378..4d50221c7 100644 --- a/lib/test/upper/pdcp_nr_test.h +++ b/lib/test/upper/pdcp_nr_test.h @@ -123,7 +123,8 @@ srslte::unique_byte_buffer_t gen_expected_pdu(const srslte::unique_byte_buffer_t srslte::SECURITY_DIRECTION_DOWNLINK, pdcp_sn_len, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t::infinity}; + srslte::pdcp_discard_timer_t::infinity, + false}; pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger); srslte::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp; diff --git a/lib/test/upper/pdcp_nr_test_discard_sdu.cc b/lib/test/upper/pdcp_nr_test_discard_sdu.cc index 9b45d7973..54ffeb63e 100644 --- a/lib/test/upper/pdcp_nr_test_discard_sdu.cc +++ b/lib/test/upper/pdcp_nr_test_discard_sdu.cc @@ -26,7 +26,8 @@ int test_tx_sdu_discard(const pdcp_initial_state& init_state, srslte::SECURITY_DIRECTION_DOWNLINK, srslte::PDCP_SN_LEN_12, srslte::pdcp_t_reordering_t::ms500, - discard_timeout}; + discard_timeout, + false}; pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger); srslte::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp; diff --git a/lib/test/upper/pdcp_nr_test_rx.cc b/lib/test/upper/pdcp_nr_test_rx.cc index e06b892e7..5c5bc2226 100644 --- a/lib/test/upper/pdcp_nr_test_rx.cc +++ b/lib/test/upper/pdcp_nr_test_rx.cc @@ -29,7 +29,8 @@ int test_rx(std::vector events, srslte::SECURITY_DIRECTION_UPLINK, pdcp_sn_len, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t::infinity}; + srslte::pdcp_discard_timer_t::infinity, + false}; pdcp_nr_test_helper pdcp_hlp_rx(cfg_rx, sec_cfg, logger); srslte::pdcp_entity_nr* pdcp_rx = &pdcp_hlp_rx.pdcp; diff --git a/lib/test/upper/pdcp_nr_test_tx.cc b/lib/test/upper/pdcp_nr_test_tx.cc index 7f167dfd5..0aca92524 100644 --- a/lib/test/upper/pdcp_nr_test_tx.cc +++ b/lib/test/upper/pdcp_nr_test_tx.cc @@ -28,7 +28,8 @@ int test_tx(uint32_t n_packets, srslte::SECURITY_DIRECTION_DOWNLINK, pdcp_sn_len, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t::infinity}; + srslte::pdcp_discard_timer_t::infinity, + false}; pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger); srslte::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp; diff --git a/srsenb/src/stack/rrc/rrc_nr.cc b/srsenb/src/stack/rrc/rrc_nr.cc index dbe313cd1..f764ddfc5 100644 --- a/srsenb/src/stack/rrc/rrc_nr.cc +++ b/srsenb/src/stack/rrc/rrc_nr.cc @@ -60,7 +60,8 @@ void rrc_nr::init(const rrc_nr_cfg_t& cfg_, srslte::SECURITY_DIRECTION_UPLINK, srslte::PDCP_SN_LEN_18, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t::infinity}; + srslte::pdcp_discard_timer_t::infinity, + false}; pdcp->add_bearer(cfg.coreless.rnti, cfg.coreless.drb_lcid, pdcp_cnfg); m_log->info("Started\n"); diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index a8ec15fea..b674f66a3 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -73,7 +73,8 @@ void rrc_nr::init_core_less() srslte::SECURITY_DIRECTION_UPLINK, srslte::PDCP_SN_LEN_18, srslte::pdcp_t_reordering_t::ms500, - srslte::pdcp_discard_timer_t ::ms100}; + srslte::pdcp_discard_timer_t::ms100, + false}; pdcp->add_bearer(args.coreless.drb_lcid, pdcp_cnfg); return; @@ -322,7 +323,6 @@ bool rrc_nr::rrc_reconfiguration(bool endc_release_and_add_r15, bool nr_radio_bearer_cfg1_r15_present, asn1::dyn_octstring nr_radio_bearer_cfg1_r15) { - // sanity check only for now if (nr_secondary_cell_group_cfg_r15_present == false || sk_counter_r15_present == false || nr_radio_bearer_cfg1_r15_present == false) { @@ -514,7 +514,6 @@ bool rrc_nr::apply_rlc_add_mod(const rlc_bearer_cfg_s& rlc_bearer_cfg) } bool rrc_nr::apply_mac_cell_group(const mac_cell_group_cfg_s& mac_cell_group_cfg) { - if (mac_cell_group_cfg.sched_request_cfg_present) { sr_cfg_t sr_cfg; if (mac_cell_group_cfg.sched_request_cfg.sched_request_to_add_mod_list_present) { @@ -623,7 +622,6 @@ bool rrc_nr::apply_drb_add_mod(const drb_to_add_mod_s& drb_cfg) bool rrc_nr::apply_security_cfg(const security_cfg_s& security_cfg) { - // TODO derive correct keys if (security_cfg.key_to_use_present) { if (security_cfg.key_to_use.value != security_cfg_s::key_to_use_opts::options::secondary) { @@ -753,4 +751,4 @@ void rrc_nr::connection_reconf_no_ho_proc::then(const srslte::proc_state_t& resu // rrc_ptr->con_reconfig_failed(); } -} // namespace srsue \ No newline at end of file +} // namespace srsue