nr,mac: use SR to send an UL grant after Msg3 and complete ContextResolution of UE NSA NR

master
Francisco Paisana 3 years ago committed by Andre Puschmann
parent e1a4e63ec8
commit 3351e97aa2

@ -47,7 +47,7 @@ public:
void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) override; void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) override;
void ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) override; void ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) override;
void ul_sr_info(slot_point slot_rx, uint16_t rnti) override; void ul_sr_info(uint16_t rnti) override;
void ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) override; void ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) override;
void dl_buffer_state(uint16_t rnti, uint32_t lcid, uint32_t newtx, uint32_t retx); void dl_buffer_state(uint16_t rnti, uint32_t lcid, uint32_t newtx, uint32_t retx);

@ -125,7 +125,7 @@ public:
virtual void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) = 0; virtual void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) = 0;
virtual void ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) = 0; virtual void ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) = 0;
virtual void ul_sr_info(slot_point, uint16_t rnti) = 0; virtual void ul_sr_info(uint16_t rnti) = 0;
virtual void ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) = 0; virtual void ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) = 0;
}; };

@ -92,7 +92,7 @@ public:
void rlc_buffer_state(uint32_t lcid, uint32_t newtx, uint32_t retx) { buffers.dl_buffer_state(lcid, newtx, retx); } void rlc_buffer_state(uint32_t lcid, uint32_t newtx, uint32_t retx) { buffers.dl_buffer_state(lcid, newtx, retx); }
void ul_bsr(uint32_t lcg, uint32_t bsr_val) { buffers.ul_bsr(lcg, bsr_val); } void ul_bsr(uint32_t lcg, uint32_t bsr_val) { buffers.ul_bsr(lcg, bsr_val); }
void ul_sr_info(slot_point slot_rx) { last_sr_slot = slot_rx; } void ul_sr_info() { last_sr_slot = last_pdcch_slot - TX_ENB_DELAY; }
bool has_ca() const bool has_ca() const
{ {
@ -109,6 +109,7 @@ private:
const uint16_t rnti; const uint16_t rnti;
const sched_params& sched_cfg; const sched_params& sched_cfg;
slot_point last_pdcch_slot;
slot_point last_sr_slot; slot_point last_sr_slot;
int ul_pending_bytes = 0, dl_pending_bytes = 0; int ul_pending_bytes = 0, dl_pending_bytes = 0;

@ -342,7 +342,7 @@ bool mac_nr::handle_uci_data(const uint16_t rnti, const srsran_uci_cfg_nr_t& cfg
// Process SR // Process SR
if (value.valid and value.sr > 0) { if (value.valid and value.sr > 0) {
sched.ul_sr_info(pdsch_slot - TX_ENB_DELAY, cfg_.pucch.rnti); sched.ul_sr_info(cfg_.pucch.rnti);
} }
return true; return true;
} }

@ -163,9 +163,9 @@ void sched_nr::ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc)
sched_workers->enqueue_cc_feedback(rnti, cc, [pid, crc](ue_carrier& ue_cc) { ue_cc.harq_ent.ul_crc_info(pid, crc); }); sched_workers->enqueue_cc_feedback(rnti, cc, [pid, crc](ue_carrier& ue_cc) { ue_cc.harq_ent.ul_crc_info(pid, crc); });
} }
void sched_nr::ul_sr_info(slot_point slot_rx, uint16_t rnti) void sched_nr::ul_sr_info(uint16_t rnti)
{ {
sched_workers->enqueue_event(rnti, [this, rnti, slot_rx]() { ue_db[rnti]->ul_sr_info(slot_rx); }); sched_workers->enqueue_event(rnti, [this, rnti]() { ue_db[rnti]->ul_sr_info(); });
} }
void sched_nr::ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) void sched_nr::ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr)

@ -100,6 +100,8 @@ void ue::set_cfg(const ue_cfg_t& cfg)
void ue::new_slot(slot_point pdcch_slot) void ue::new_slot(slot_point pdcch_slot)
{ {
last_pdcch_slot = pdcch_slot;
for (auto& ue_cc_cfg : ue_cfg.carriers) { for (auto& ue_cc_cfg : ue_cfg.carriers) {
auto& cc = carriers[ue_cc_cfg.cc]; auto& cc = carriers[ue_cc_cfg.cc];
if (cc != nullptr) { if (cc != nullptr) {

@ -68,7 +68,7 @@ int ue_nr::process_pdu(srsran::unique_byte_buffer_t pdu)
if (logger.info.enabled()) { if (logger.info.enabled()) {
fmt::memory_buffer str_buffer; fmt::memory_buffer str_buffer;
mac_pdu_ul.to_string(str_buffer); mac_pdu_ul.to_string(str_buffer);
logger.info("0x%x %s", rnti, srsran::to_c_str(str_buffer)); logger.info("Rx PDU: rnti=0x%x, %s", rnti, srsran::to_c_str(str_buffer));
} }
for (uint32_t i = 0; i < mac_pdu_ul.get_num_subpdus(); ++i) { for (uint32_t i = 0; i < mac_pdu_ul.get_num_subpdus(); ++i) {
@ -86,7 +86,7 @@ int ue_nr::process_pdu(srsran::unique_byte_buffer_t pdu)
if (true /*sched->ue_exists(c_crnti)*/) { if (true /*sched->ue_exists(c_crnti)*/) {
rrc->update_user(rnti, c_rnti); rrc->update_user(rnti, c_rnti);
rnti = c_rnti; rnti = c_rnti;
sched->ul_bsr(rnti, 0, 1); // provide UL grant regardless of other BSR content for UE to complete RA sched->ul_sr_info(rnti); // provide UL grant regardless of other BSR content for UE to complete RA
} else { } else {
logger.warning("Updating user C-RNTI: rnti=0x%x already released.", c_rnti); logger.warning("Updating user C-RNTI: rnti=0x%x already released.", c_rnti);
// Disable scheduling for all bearers. The new rnti will be removed on msg3 timer expiry in the RRC // Disable scheduling for all bearers. The new rnti will be removed on msg3 timer expiry in the RRC
@ -99,10 +99,6 @@ int ue_nr::process_pdu(srsran::unique_byte_buffer_t pdu)
case srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::SHORT_TRUNC_BSR: { case srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::SHORT_TRUNC_BSR: {
srsran::mac_sch_subpdu_nr::lcg_bsr_t sbsr = subpdu.get_sbsr(); srsran::mac_sch_subpdu_nr::lcg_bsr_t sbsr = subpdu.get_sbsr();
uint32_t buffer_size_bytes = buff_size_field_to_bytes(sbsr.buffer_size, srsran::SHORT_BSR); uint32_t buffer_size_bytes = buff_size_field_to_bytes(sbsr.buffer_size, srsran::SHORT_BSR);
// FIXME: a UE might send a zero BSR but still needs an UL grant to finish RA procedure
if (buffer_size_bytes == 0) {
buffer_size_bytes++;
}
sched->ul_bsr(rnti, sbsr.lcg_id, buffer_size_bytes); sched->ul_bsr(rnti, sbsr.lcg_id, buffer_size_bytes);
} break; } break;
case srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::LONG_BSR: case srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::LONG_BSR:
@ -172,8 +168,8 @@ void ue_nr::metrics_read(mac_ue_metrics_t* metrics_)
// set PCell sector id // set PCell sector id
std::array<int, SRSRAN_MAX_CARRIERS> cc_list; //= sched->get_enb_ue_cc_map(rnti); std::array<int, SRSRAN_MAX_CARRIERS> cc_list; //= sched->get_enb_ue_cc_map(rnti);
auto it = std::find(cc_list.begin(), cc_list.end(), 0); auto it = std::find(cc_list.begin(), cc_list.end(), 0);
ue_metrics.cc_idx = std::distance(cc_list.begin(), it); ue_metrics.cc_idx = std::distance(cc_list.begin(), it);
*metrics_ = ue_metrics; *metrics_ = ue_metrics;

@ -239,7 +239,6 @@ void rrc::ue::rrc_mobility::handle_ue_meas_report(const meas_report_s& msg, srsr
} }
if (meas_res.meas_result_neigh_cells.type().value != if (meas_res.meas_result_neigh_cells.type().value !=
meas_results_s::meas_result_neigh_cells_c_::types::meas_result_list_eutra) { meas_results_s::meas_result_neigh_cells_c_::types::meas_result_list_eutra) {
Error("MeasReports regarding non-EUTRA are not supported!");
return; return;
} }
const meas_id_list& measid_list = rrc_ue->current_ue_cfg.meas_cfg.meas_id_to_add_mod_list; const meas_id_list& measid_list = rrc_ue->current_ue_cfg.meas_cfg.meas_id_to_add_mod_list;
@ -861,11 +860,11 @@ void rrc::ue::rrc_mobility::handle_ho_requested(idle_st& s, const ho_req_rx_ev&
if (ho_req.transparent_container->erab_info_list_present) { if (ho_req.transparent_container->erab_info_list_present) {
const auto& lst = ho_req.transparent_container->erab_info_list; const auto& lst = ho_req.transparent_container->erab_info_list;
const auto* it = std::find_if( const auto* it = std::find_if(
lst.begin(), lst.begin(),
lst.end(), lst.end(),
[&erab](const asn1::s1ap::protocol_ie_single_container_s<asn1::s1ap::erab_info_list_ies_o>& fwd_erab) { [&erab](const asn1::s1ap::protocol_ie_single_container_s<asn1::s1ap::erab_info_list_ies_o>& fwd_erab) {
return fwd_erab.value.erab_info_list_item().erab_id == erab.second.id; return fwd_erab.value.erab_info_list_item().erab_id == erab.second.id;
}); });
if (it == lst.end()) { if (it == lst.end()) {
continue; continue;
} }
@ -1044,7 +1043,7 @@ void rrc::ue::rrc_mobility::handle_status_transfer(s1_target_ho_st& s, const sta
const auto& drbs = rrc_ue->bearer_list.get_established_drbs(); const auto& drbs = rrc_ue->bearer_list.get_established_drbs();
lte_drb drbid = lte_lcid_to_drb(erab_it->second.lcid); lte_drb drbid = lte_lcid_to_drb(erab_it->second.lcid);
auto drb_it = std::find_if( auto drb_it = std::find_if(
drbs.begin(), drbs.end(), [drbid](const drb_to_add_mod_s& drb) { return (lte_drb)drb.drb_id == drbid; }); drbs.begin(), drbs.end(), [drbid](const drb_to_add_mod_s& drb) { return (lte_drb)drb.drb_id == drbid; });
if (drb_it == drbs.end()) { if (drb_it == drbs.end()) {
logger.warning("The DRB id=%d does not exist", drbid); logger.warning("The DRB id=%d does not exist", drbid);
} }

Loading…
Cancel
Save