mirror of https://github.com/PentHertz/srsLTE.git
issue 2170 fix: add extra check that UL harq is empty before allocating it
This commit is contained in:
parent
f45d31d899
commit
02d4dde1f5
|
@ -27,7 +27,16 @@ enum class alloc_type_t { DL_BC, DL_PCCH, DL_RAR, DL_DATA, UL_DATA };
|
||||||
|
|
||||||
//! Result of alloc attempt
|
//! Result of alloc attempt
|
||||||
struct alloc_outcome_t {
|
struct alloc_outcome_t {
|
||||||
enum result_enum { SUCCESS, DCI_COLLISION, RB_COLLISION, ERROR, NOF_RB_INVALID, PUCCH_COLLISION, MEASGAP_COLLISION };
|
enum result_enum {
|
||||||
|
SUCCESS,
|
||||||
|
DCI_COLLISION,
|
||||||
|
RB_COLLISION,
|
||||||
|
ERROR,
|
||||||
|
NOF_RB_INVALID,
|
||||||
|
PUCCH_COLLISION,
|
||||||
|
MEASGAP_COLLISION,
|
||||||
|
ALREADY_ALLOC
|
||||||
|
};
|
||||||
result_enum result = ERROR;
|
result_enum result = ERROR;
|
||||||
alloc_outcome_t() = default;
|
alloc_outcome_t() = default;
|
||||||
alloc_outcome_t(result_enum e) : result(e) {}
|
alloc_outcome_t(result_enum e) : result(e) {}
|
||||||
|
|
|
@ -36,6 +36,8 @@ const char* alloc_outcome_t::to_string() const
|
||||||
return "pucch_collision";
|
return "pucch_collision";
|
||||||
case MEASGAP_COLLISION:
|
case MEASGAP_COLLISION:
|
||||||
return "measgap_collision";
|
return "measgap_collision";
|
||||||
|
case ALREADY_ALLOC:
|
||||||
|
return "already allocated";
|
||||||
}
|
}
|
||||||
return "unknown error";
|
return "unknown error";
|
||||||
}
|
}
|
||||||
|
@ -758,14 +760,16 @@ bool is_periodic_cqi_expected(const sched_interface::ue_cfg_t& ue_cfg, tti_point
|
||||||
|
|
||||||
alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_mask, uint32_t pid)
|
alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_mask, uint32_t pid)
|
||||||
{
|
{
|
||||||
if (is_dl_alloc(user->get_rnti())) {
|
|
||||||
Warning("SCHED: Attempt to assign multiple harq pids to the same user rnti=0x%x\n", user->get_rnti());
|
|
||||||
return alloc_outcome_t::ERROR;
|
|
||||||
}
|
|
||||||
if (data_allocs.size() >= sched_interface::MAX_DATA_LIST) {
|
if (data_allocs.size() >= sched_interface::MAX_DATA_LIST) {
|
||||||
Warning("SCHED: Maximum number of DL allocations reached\n");
|
Warning("SCHED: Maximum number of DL allocations reached\n");
|
||||||
return alloc_outcome_t::ERROR;
|
return alloc_outcome_t::ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_dl_alloc(user->get_rnti())) {
|
||||||
|
Warning("SCHED: Attempt to assign multiple harq pids to the same user rnti=0x%x\n", user->get_rnti());
|
||||||
|
return alloc_outcome_t::ALREADY_ALLOC;
|
||||||
|
}
|
||||||
|
|
||||||
auto* cc = user->find_ue_carrier(cc_cfg->enb_cc_idx);
|
auto* cc = user->find_ue_carrier(cc_cfg->enb_cc_idx);
|
||||||
if (cc == nullptr or cc->cc_state() != cc_st::active) {
|
if (cc == nullptr or cc->cc_state() != cc_st::active) {
|
||||||
return alloc_outcome_t::ERROR;
|
return alloc_outcome_t::ERROR;
|
||||||
|
@ -824,16 +828,17 @@ alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_ma
|
||||||
|
|
||||||
alloc_outcome_t sf_sched::alloc_ul(sched_ue* user, prb_interval alloc, ul_alloc_t::type_t alloc_type, int msg3_mcs)
|
alloc_outcome_t sf_sched::alloc_ul(sched_ue* user, prb_interval alloc, ul_alloc_t::type_t alloc_type, int msg3_mcs)
|
||||||
{
|
{
|
||||||
// Check whether user was already allocated
|
|
||||||
if (is_ul_alloc(user->get_rnti())) {
|
|
||||||
log_h->warning("SCHED: Attempt to assign multiple ul_harq_proc to the same user rnti=0x%x\n", user->get_rnti());
|
|
||||||
return alloc_outcome_t::ERROR;
|
|
||||||
}
|
|
||||||
if (ul_data_allocs.size() >= sched_interface::MAX_DATA_LIST) {
|
if (ul_data_allocs.size() >= sched_interface::MAX_DATA_LIST) {
|
||||||
Warning("SCHED: Maximum number of UL allocations reached\n");
|
Warning("SCHED: Maximum number of UL allocations reached\n");
|
||||||
return alloc_outcome_t::ERROR;
|
return alloc_outcome_t::ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check whether user was already allocated
|
||||||
|
if (is_ul_alloc(user->get_rnti())) {
|
||||||
|
log_h->warning("SCHED: Attempt to assign multiple ul_harq_proc to the same user rnti=0x%x\n", user->get_rnti());
|
||||||
|
return alloc_outcome_t::ALREADY_ALLOC;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if there is no collision with measGap
|
// Check if there is no collision with measGap
|
||||||
bool needs_pdcch = alloc_type == ul_alloc_t::ADAPT_RETX or alloc_type == ul_alloc_t::NEWTX;
|
bool needs_pdcch = alloc_type == ul_alloc_t::ADAPT_RETX or alloc_type == ul_alloc_t::NEWTX;
|
||||||
if (not user->pusch_enabled(srslte::tti_point{get_tti_rx()}, cc_cfg->enb_cc_idx, needs_pdcch)) {
|
if (not user->pusch_enabled(srslte::tti_point{get_tti_rx()}, cc_cfg->enb_cc_idx, needs_pdcch)) {
|
||||||
|
|
|
@ -123,7 +123,8 @@ uint32_t sched_time_pf::try_ul_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* t
|
||||||
alloc_outcome_t code = alloc_outcome_t::ERROR;
|
alloc_outcome_t code = alloc_outcome_t::ERROR;
|
||||||
if (ue_ctxt.ul_h != nullptr and ue_ctxt.ul_h->has_pending_retx()) {
|
if (ue_ctxt.ul_h != nullptr and ue_ctxt.ul_h->has_pending_retx()) {
|
||||||
code = try_ul_retx_alloc(*tti_sched, ue, *ue_ctxt.ul_h);
|
code = try_ul_retx_alloc(*tti_sched, ue, *ue_ctxt.ul_h);
|
||||||
} else if (ue_ctxt.ul_h != nullptr) {
|
} else if (ue_ctxt.ul_h != nullptr and not tti_sched->is_ul_alloc(ue_ctxt.rnti)) {
|
||||||
|
// Note: h->is_empty check is required, in case CA allocated a small UL grant for UCI
|
||||||
uint32_t pending_data = ue.get_pending_ul_new_data(tti_sched->get_tti_tx_ul(), ue_ctxt.ue_cc_idx);
|
uint32_t pending_data = ue.get_pending_ul_new_data(tti_sched->get_tti_tx_ul(), ue_ctxt.ue_cc_idx);
|
||||||
// Check if there is a empty harq, and data to transmit
|
// Check if there is a empty harq, and data to transmit
|
||||||
if (pending_data == 0) {
|
if (pending_data == 0) {
|
||||||
|
|
Loading…
Reference in New Issue