|
|
|
@ -254,9 +254,14 @@ uint32_t sched::get_ul_buffer(uint16_t rnti)
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* \Warning: This function is not mutexed because it can produce late changes on the buffer state while
|
|
|
|
|
* the scheduler is already allocating data, resulting in empty grants.
|
|
|
|
|
* Ideally we would like the scheduler to query the RLC for buffer states in order to get the most updated
|
|
|
|
|
* buffer state with the minimum overhead. However, the current architecture is designed to be compliant
|
|
|
|
|
* with the FAPI interface
|
|
|
|
|
*/
|
|
|
|
|
int sched::dl_rlc_buffer_state(uint16_t rnti, uint32_t lc_id, uint32_t tx_queue, uint32_t retx_queue)
|
|
|
|
|
{
|
|
|
|
|
pthread_mutex_lock(&mutex);
|
|
|
|
|
int ret = 0;
|
|
|
|
|
if (ue_db.count(rnti)) {
|
|
|
|
|
ue_db[rnti].dl_buffer_state(lc_id, tx_queue, retx_queue);
|
|
|
|
@ -264,7 +269,6 @@ int sched::dl_rlc_buffer_state(uint16_t rnti, uint32_t lc_id, uint32_t tx_queue,
|
|
|
|
|
Error("User rnti=0x%x not found\n", rnti);
|
|
|
|
|
ret = -1;
|
|
|
|
|
}
|
|
|
|
|
pthread_mutex_unlock(&mutex);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -676,9 +680,10 @@ int sched::dl_sched_data(dl_sched_data_t data[MAX_DATA_LIST])
|
|
|
|
|
|
|
|
|
|
int nof_data_elems = 0;
|
|
|
|
|
for(std::map<uint16_t, sched_ue>::iterator iter=ue_db.begin(); iter!=ue_db.end(); ++iter) {
|
|
|
|
|
sched_ue *user = (sched_ue*) &iter->second;
|
|
|
|
|
uint16_t rnti = (uint16_t) iter->first;
|
|
|
|
|
sched_ue *user = (sched_ue*) &iter->second;
|
|
|
|
|
uint16_t rnti = (uint16_t) iter->first;
|
|
|
|
|
|
|
|
|
|
uint32_t data_before = user->get_pending_dl_new_data(current_tti);
|
|
|
|
|
dl_harq_proc *h = dl_metric->get_user_allocation(user);
|
|
|
|
|
srslte_dci_format_t dci_format = user->get_dci_format();
|
|
|
|
|
data[nof_data_elems].dci_format = dci_format;
|
|
|
|
@ -706,10 +711,12 @@ int sched::dl_sched_data(dl_sched_data_t data[MAX_DATA_LIST])
|
|
|
|
|
Error("DCI format (%d) not implemented\n", dci_format);
|
|
|
|
|
}
|
|
|
|
|
if (tbs > 0) {
|
|
|
|
|
log_h->info("SCHED: DL %s rnti=0x%x, pid=%d, mask=0x%x, dci=%d,%d, n_rtx=%d, tbs=%d, buffer=%d, tb_en={%s,%s}\n",
|
|
|
|
|
log_h->info("SCHED: DL %s rnti=0x%x, pid=%d, mask=0x%x, dci=%d,%d, n_rtx=%d, tbs=%d, buffer=%d/%d, tb_en={%s,%s}\n",
|
|
|
|
|
!is_newtx?"retx":"tx", rnti, h->get_id(), h->get_rbgmask(),
|
|
|
|
|
data[nof_data_elems].dci_location.L, data[nof_data_elems].dci_location.ncce, h->nof_retx(0) + h->nof_retx(1),
|
|
|
|
|
tbs, user->get_pending_dl_new_data(current_tti), data[nof_data_elems].dci.tb_en[0]?"y":"n",
|
|
|
|
|
tbs,
|
|
|
|
|
data_before, user->get_pending_dl_new_data(current_tti),
|
|
|
|
|
data[nof_data_elems].dci.tb_en[0]?"y":"n",
|
|
|
|
|
data[nof_data_elems].dci.tb_en[1]?"y":"n");
|
|
|
|
|
nof_data_elems++;
|
|
|
|
|
} else {
|
|
|
|
|