changed the supported cc list to a vector of structs

master
Francisco Paisana 5 years ago
parent 42b15c7bed
commit c8fc0d91b3

@ -31,7 +31,7 @@ namespace srsenb {
class sched_interface
{
public:
virtual ~sched_interface() {}
virtual ~sched_interface() = default;
const static uint32_t max_cce = 128;
const static uint32_t max_prb = 100;
@ -127,6 +127,10 @@ public:
};
struct ue_cfg_t {
struct cc_cfg_t {
uint32_t enb_cc_idx = 0; ///< eNB CC index
uint32_t periodic_cqi_i = 0; ///< Periodic CQI configuration for this Scell
};
/* ue capabilities, etc */
uint32_t maxharq_tx = 5;
bool continuous_pusch;
@ -135,7 +139,7 @@ public:
uint32_t aperiodic_cqi_period = 0; // if 0 is periodic CQI
srslte_dl_cfg_t dl_cfg;
std::array<ue_bearer_cfg_t, MAX_LC> ue_bearers = {};
std::vector<uint32_t> supported_cc_idxs;
std::vector<cc_cfg_t> supported_cc_list; ///< list of UE supported CCs. First index for PCell
ant_info_ded_t dl_ant_info;
};

@ -277,8 +277,7 @@ private:
bool phy_config_dedicated_enabled = false;
sched_interface::ant_info_ded_t dl_ant_info;
std::vector<sched_ue_carrier> carriers; ///< map of UE CellIndex to carrier configuration
std::map<uint32_t, uint32_t> enb_ue_cellindex_map; ///< map cc idx eNB -> UE
std::vector<sched_ue_carrier> carriers; ///< map of UE CellIndex to carrier configuration
};
} // namespace srsenb

@ -470,9 +470,11 @@ int mac::rach_detected(uint32_t tti, uint32_t enb_cc_idx, uint32_t preamble_idx,
// Add new user to the scheduler so that it can RX/TX SRB0
sched_interface::ue_cfg_t ue_cfg = {};
ue_cfg.supported_cc_idxs.push_back(enb_cc_idx);
ue_cfg.ue_bearers[0].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
ue_cfg.dl_cfg.tm = SRSLTE_TM1;
ue_cfg.supported_cc_list.emplace_back();
ue_cfg.supported_cc_list.back().enb_cc_idx = enb_cc_idx;
ue_cfg.supported_cc_list.back().periodic_cqi_i = 0;
ue_cfg.ue_bearers[0].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
ue_cfg.dl_cfg.tm = SRSLTE_TM1;
if (scheduler.ue_cfg(rnti, ue_cfg) != SRSLTE_SUCCESS) {
Error("Registering new user rnti=0x%x to SCHED\n", rnti);
return -1;

@ -70,10 +70,10 @@ void sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_)
std::unique_lock<std::mutex> lock(mutex);
// for the first configured cc, set it as primary cc
if (cfg.supported_cc_idxs.empty()) {
if (cfg.supported_cc_list.empty()) {
uint32_t primary_cc_idx = 0;
if (not cfg_.supported_cc_idxs.empty()) {
primary_cc_idx = cfg_.supported_cc_idxs[0];
if (not cfg_.supported_cc_list.empty()) {
primary_cc_idx = cfg_.supported_cc_list[0].enb_cc_idx;
} else {
Warning("Primary cc idx not provided in scheduler ue_cfg. Defaulting to cc_idx=0\n");
}
@ -93,16 +93,15 @@ void sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_)
}
// either add a new carrier, or reconfigure existing one
for (uint32_t enb_cc_idx : cfg.supported_cc_idxs) {
auto it = enb_ue_cellindex_map.find(enb_cc_idx);
if (it == enb_ue_cellindex_map.end()) {
for (auto& cc_cfg : cfg.supported_cc_list) {
sched_ue_carrier* c = get_ue_carrier(cc_cfg.enb_cc_idx);
if (c == nullptr) {
// add new carrier to sched_ue
carriers.emplace_back(cfg, (*cell_params_list)[enb_cc_idx], rnti);
enb_ue_cellindex_map[enb_cc_idx] = carriers.size() - 1; // maps enb_cc_idx to ue_cc_idx
carriers.emplace_back(cfg, (*cell_params_list)[cc_cfg.enb_cc_idx], rnti);
} else {
// reconfiguration of carrier might be needed
if (maxharq_tx_changed) {
carriers[it->second].set_cfg(cfg);
c->set_cfg(cfg);
}
}
}
@ -123,7 +122,6 @@ void sched_ue::reset()
cqi_request_tti = 0;
conres_ce_pending = true;
carriers.clear();
enb_ue_cellindex_map.clear();
// erase all bearers
for (uint32_t i = 0; i < cfg.ue_bearers.size(); ++i) {
@ -926,26 +924,30 @@ dl_harq_proc* sched_ue::get_dl_harq(uint32_t idx, uint32_t cc_idx)
std::pair<bool, uint32_t> sched_ue::get_cell_index(uint32_t enb_cc_idx) const
{
auto it = enb_ue_cellindex_map.find(enb_cc_idx);
if (it == enb_ue_cellindex_map.end()) {
auto it =
std::find_if(cfg.supported_cc_list.begin(),
cfg.supported_cc_list.end(),
[enb_cc_idx](const sched_interface::ue_cfg_t::cc_cfg_t& u) { return u.enb_cc_idx == enb_cc_idx; });
if (it == cfg.supported_cc_list.end()) {
log_h->error("The carrier with eNB_cc_idx=%d does not exist\n", enb_cc_idx);
return std::make_pair(false, 0);
}
return std::make_pair(true, it->second);
return std::make_pair(true, it->enb_cc_idx);
}
void sched_ue::finish_tti(const tti_params_t& tti_params, uint32_t enb_cc_idx)
{
auto it = enb_ue_cellindex_map.find(enb_cc_idx);
if (it == enb_ue_cellindex_map.end()) {
auto p = get_cell_index(enb_cc_idx);
if (not p.first) {
return;
}
uint32_t ue_cc_idx = p.second;
/* Clean-up all the UL Harqs with maxretx == 0 */
get_ul_harq(tti_params.tti_tx_ul, it->second)->reset_pending_data();
get_ul_harq(tti_params.tti_tx_ul, ue_cc_idx)->reset_pending_data();
/* reset PIDs with pending data or blocked */
reset_pending_pids(tti_params.tti_rx, it->second);
reset_pending_pids(tti_params.tti_rx, ue_cc_idx);
}
srslte_dci_format_t sched_ue::get_dci_format()
@ -989,7 +991,11 @@ sched_dci_cce_t* sched_ue::get_locations(uint32_t enb_cc_idx, uint32_t cfi, uint
sched_ue_carrier* sched_ue::get_ue_carrier(uint32_t enb_cc_idx)
{
return &carriers[enb_ue_cellindex_map[enb_cc_idx]];
auto p = get_cell_index(enb_cc_idx);
if (not p.first) {
return nullptr;
}
return &carriers[p.second];
}
/* Allocates first available RLC PDU */

@ -1241,14 +1241,17 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsl
void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srslte::unique_byte_buffer_t pdu)
{
using cc_cfg_t = sched_interface::ue_cfg_t::cc_cfg_t;
if (last_rrc_conn_recfg.rrc_transaction_id == msg->rrc_transaction_id) {
// Finally, add secondary carriers
// TODO: For now the ue supports all cc
auto& list = current_sched_ue_cfg.supported_cc_idxs;
auto& list = current_sched_ue_cfg.supported_cc_list;
for (uint32_t i = 0; i < parent->cfg.cell_list.size(); ++i) {
auto it = std::find(list.begin(), list.end(), i);
auto it = std::find_if(list.begin(), list.end(), [i](const cc_cfg_t& u) { return u.enb_cc_idx == i; });
if (it == list.end()) {
list.push_back(i);
list.emplace_back();
list.back().enb_cc_idx = i;
list.back().periodic_cqi_i = 0;
}
}
parent->mac->ue_cfg(rnti, &current_sched_ue_cfg);

@ -108,8 +108,9 @@ int main(int argc, char* argv[])
srsenb::sched_interface::ul_sched_res_t sched_result_ul;
srsenb::sched_interface::ue_cfg_t ue_cfg = {};
ue_cfg.supported_cc_idxs = {0};
uint16_t rnti = 30;
ue_cfg.supported_cc_list.emplace_back();
ue_cfg.supported_cc_list.back().enb_cc_idx = 0;
uint16_t rnti = 30;
ue_cfg.aperiodic_cqi_period = 40;
ue_cfg.maxharq_tx = 5;

@ -985,8 +985,9 @@ sched_sim_args rand_sim_params(const srsenb::sched_interface::cell_cfg_t& cell_c
sim_args.ue_cfg.aperiodic_cqi_period = 40;
sim_args.ue_cfg.maxharq_tx = 5;
sim_args.ue_cfg.dl_cfg.tm = SRSLTE_TM1;
sim_args.ue_cfg.supported_cc_idxs.push_back(0);
sim_args.ue_cfg.ue_bearers[0].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
sim_args.ue_cfg.supported_cc_list.emplace_back();
sim_args.ue_cfg.supported_cc_list.back().enb_cc_idx = 0;
sim_args.ue_cfg.ue_bearers[0].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
bzero(&sim_args.bearer_cfg, sizeof(srsenb::sched_interface::ue_bearer_cfg_t));
sim_args.bearer_cfg.direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;

Loading…
Cancel
Save