Improved stability when UE reattaches

master
Ismael Gomez 7 years ago
parent ea0f6f2e2a
commit f0d9b333b2

@ -61,6 +61,7 @@ typedef struct SRSLTE_API {
uint32_t max_re;
uint16_t ue_rnti;
bool is_ue;
/* buffers */

@ -71,6 +71,7 @@ typedef struct SRSLTE_API {
srslte_cell_t cell;
bool is_ue;
uint16_t ue_rnti;
uint32_t max_re;
srslte_dft_precoding_t dft_precoding;

@ -74,6 +74,8 @@ private:
bool if_up;
uint32_t lcid;
uint32_t current_ip_addr;
long ul_tput_bytes;
long dl_tput_bytes;
struct timeval metrics_time[3];

@ -381,6 +381,7 @@ int srslte_pdsch_set_rnti(srslte_pdsch_t *q, uint16_t rnti) {
}
}
}
q->ue_rnti = rnti;
q->users[rnti_idx]->cell_id = q->cell.id;
q->users[rnti_idx]->sequence_generated = true;
} else {
@ -400,6 +401,7 @@ void srslte_pdsch_free_rnti(srslte_pdsch_t* q, uint16_t rnti)
}
free(q->users[rnti_idx]);
q->users[rnti_idx] = NULL;
q->ue_rnti = 0;
}
}
@ -528,6 +530,7 @@ static srslte_sequence_t *get_user_sequence(srslte_pdsch_t *q, uint16_t rnti,
// The scrambling sequence is pregenerated for all RNTIs in the eNodeB but only for C-RNTI in the UE
if (q->users[rnti_idx] && q->users[rnti_idx]->sequence_generated &&
q->users[rnti_idx]->cell_id == q->cell.id &&
q->ue_rnti == rnti &&
((rnti >= SRSLTE_CRNTI_START && rnti < SRSLTE_CRNTI_END) || !q->is_ue))
{
return &q->users[rnti_idx]->seq[codeword_idx][sf_idx];

@ -453,6 +453,7 @@ int srslte_pusch_set_rnti(srslte_pusch_t *q, uint16_t rnti) {
return SRSLTE_ERROR;
}
}
q->ue_rnti = rnti;
q->users[rnti_idx]->cell_id = q->cell.id;
q->users[rnti_idx]->sequence_generated = true;
} else {
@ -471,10 +472,10 @@ void srslte_pusch_free_rnti(srslte_pusch_t *q, uint16_t rnti) {
}
free(q->users[rnti_idx]);
q->users[rnti_idx] = NULL;
q->ue_rnti = 0;
}
}
static srslte_sequence_t *get_user_sequence(srslte_pusch_t *q, uint16_t rnti, uint32_t sf_idx, uint32_t len)
{
uint32_t rnti_idx = q->is_ue?0:rnti;
@ -482,6 +483,7 @@ static srslte_sequence_t *get_user_sequence(srslte_pusch_t *q, uint16_t rnti, ui
// The scrambling sequence is pregenerated for all RNTIs in the eNodeB but only for C-RNTI in the UE
if (q->users[rnti_idx] && q->users[rnti_idx]->sequence_generated &&
q->users[rnti_idx]->cell_id == q->cell.id &&
q->ue_rnti == rnti &&
((rnti >= SRSLTE_CRNTI_START && rnti < SRSLTE_CRNTI_END) || !q->is_ue))
{
return &q->users[rnti_idx]->seq[sf_idx];

@ -42,7 +42,9 @@ namespace srslte {
gw::gw()
:if_up(false)
{}
{
current_ip_addr = 0;
}
void gw::init(srsue::pdcp_interface_gw *pdcp_, srsue::ue_interface *ue_, log *gw_log_, uint32_t lcid_)
{
@ -77,6 +79,8 @@ void gw::stop()
thread_cancel();
}
wait_thread_finish();
current_ip_addr = 0;
}
// TODO: tear down TUN device?
@ -126,6 +130,7 @@ void gw::write_pdu(uint32_t lcid, byte_buffer_t *pdu)
*******************************************************************************/
error_t gw::setup_if_addr(uint32_t ip_addr, char *err_str)
{
if (ip_addr != current_ip_addr) {
if(!if_up)
{
if(init_if(err_str))
@ -156,8 +161,11 @@ error_t gw::setup_if_addr(uint32_t ip_addr, char *err_str)
return(ERROR_CANT_START);
}
current_ip_addr = ip_addr;
// Setup a thread to receive packets from the TUN device
start(GW_THREAD_PRIO);
}
return(ERROR_NONE);
}

@ -369,7 +369,8 @@ private:
current_irv = 0;
is_msg3 = is_msg3_;
Info("UL %d: New TX%s, RV=%d, TBS=%d, RNTI=%d\n",
pid, is_msg3?" for Msg3":"", get_rv(), cur_grant.n_bytes[0], cur_grant.rnti);
pid, is_msg3?" for Msg3":"", get_rv(), cur_grant.n_bytes[0],
is_msg3?harq_entity->rntis->temp_rnti:cur_grant.rnti);
generate_tx(tti_tx, action);
}
}

@ -1075,7 +1075,7 @@ int phch_worker::read_ce_abs(float *ce_abs) {
int phch_worker::read_pdsch_d(cf_t* pdsch_d)
{
memcpy(pdsch_d, ue_dl.pdsch.d, ue_dl.pdsch_cfg.nbits[0].nof_re*sizeof(cf_t));
memcpy(pdsch_d, ue_dl.pdsch.d[0], ue_dl.pdsch_cfg.nbits[0].nof_re*sizeof(cf_t));
return ue_dl.pdsch_cfg.nbits[0].nof_re;
}

Loading…
Cancel
Save