Commit 3b301948 authored by Jerome Peraldi's avatar Jerome Peraldi

bug #127412 [L3 SIMU] 3GPP 36523 6.1.2.17 is now FAILED

parent 5dab1d32
......@@ -516,6 +516,8 @@ typedef struct RrcConfigurationReq_s {
uint8_t neighCellConfig[MAX_NUM_CCs];
long *sib3_q_QualMin[MAX_NUM_CCs];
long *sib3_threshServingLowQ[MAX_NUM_CCs];
long *sib3_s_NonIntraSearchP[MAX_NUM_CCs];
long *sib3_s_NonIntraSearchQ[MAX_NUM_CCs];
//SIB4
bool sib4_Present[MAX_NUM_CCs];
......
......@@ -1964,11 +1964,11 @@ uint8_t do_SIB23(uint8_t Mod_id,
if(configuration->sib3_q_QualMin[CC_id] || configuration->sib3_threshServingLowQ[CC_id]){
(*sib3)->ext1 = CALLOC(1, sizeof(struct LTE_SystemInformationBlockType3__ext1));
}
/*
(*sib3)->ext1->s_IntraSearch_v920 = CALLOC(1, sizeof(struct LTE_SystemInformationBlockType3__ext1__s_IntraSearch_v920));
(*sib3)->ext1->s_IntraSearch_v920->s_IntraSearchP_r9 = 31; // FIXME
(*sib3)->ext1->s_IntraSearch_v920->s_IntraSearchQ_r9 = 4;
*/
/*(*sib3)->ext1->s_IntraSearch_v920 = CALLOC(1, sizeof(struct LTE_SystemInformationBlockType3__ext1__s_IntraSearch_v920));
(*sib3)->ext1->s_IntraSearch_v920->s_IntraSearchP_r9 = 0; // FIXME
(*sib3)->ext1->s_IntraSearch_v920->s_IntraSearchQ_r9 = 2;*/
if(configuration->sib3_q_QualMin[CC_id]){
(*sib3)->ext1->q_QualMin_r9 = CALLOC(1,sizeof(LTE_Q_QualMin_r9_t));
*((*sib3)->ext1->q_QualMin_r9) = *(configuration->sib3_q_QualMin[CC_id]);
......@@ -1977,6 +1977,13 @@ uint8_t do_SIB23(uint8_t Mod_id,
(*sib3)->ext1->threshServingLowQ_r9 = CALLOC(1,sizeof(LTE_ReselectionThresholdQ_r9_t));
*((*sib3)->ext1->threshServingLowQ_r9) = *(configuration->sib3_threshServingLowQ[CC_id]);
}
if (configuration->sib3_s_NonIntraSearchP[CC_id]){
(*sib3)->ext1->s_NonIntraSearch_v920 = CALLOC(1,sizeof(LTE_ReselectionThreshold_t)+sizeof(LTE_ReselectionThresholdQ_r9_t));
(*sib3)->ext1->s_NonIntraSearch_v920->s_NonIntraSearchP_r9=*(configuration->sib3_s_NonIntraSearchP[CC_id]);
(*sib3)->ext1->s_NonIntraSearch_v920->s_NonIntraSearchQ_r9=*(configuration->sib3_s_NonIntraSearchQ[CC_id]);
}
(*sib3)->ext4 = CALLOC(1, sizeof(struct LTE_SystemInformationBlockType3__ext4));
(*sib3)->ext4->cellSelectionInfoCE_r13 = CALLOC(1, sizeof(LTE_CellSelectionInfoCE_r13_t));
(*sib3)->ext4->cellSelectionInfoCE_r13->q_RxLevMinCE_r13 = -70;
......@@ -2334,7 +2341,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
NULL,
(void *)bcch_message,
buffer,
900);
1500);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_D(RRC,"[eNB] SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
......
......@@ -123,7 +123,6 @@ extern RAN_CONTEXT_t RC;
extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst;
mui_t rrc_eNB_mui = 0;
extern uint32_t to_earfcn_DL(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw);
......@@ -134,9 +133,12 @@ extern int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *c
OCTET_STRING_t *scg_RB_config);
extern struct rrc_eNB_ue_context_s *get_first_ue_context(eNB_RRC_INST *rrc_instance_pP);
//there are batches of mutex in rrc eNB module which shall be reduced.
pthread_mutex_t rrc_release_freelist;
RRC_release_list_t rrc_release_info;
pthread_mutex_t lock_ue_freelist;
pthread_mutex_t lock_rrc_ttcn;
uint8_t ul_sqn,dl_sqn;
......@@ -6524,12 +6526,20 @@ char openair_rrc_eNB_configuration(
}
}
bool is_update_needed = false;
for (CC_id = 0; CC_id < RC.nb_CC[0]; CC_id++) {
if (RC.ss.CC_update_flag[CC_id]) {
init_SI(&ctxt, CC_id, configuration);
RC.ss.CC_update_flag[CC_id] = 0;
is_update_needed = true;
if (RC.ss.rrc_sysinfo_value_tag_transition == false){
init_SI(&ctxt, CC_id, configuration);
RC.ss.CC_update_flag[CC_id] = 0;
}
}
}
if (RC.ss.mode >= SS_SOFTMODEM && is_update_needed == true){
//the mutex is there to notify TTCN SYS port that SIBxx have been processed
pthread_mutex_unlock(&lock_rrc_ttcn);
}
if(need_init) {
rrc_init_global_param();
......@@ -8515,6 +8525,7 @@ void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t *const ctxt_pP,
void rrc_enb_init(void) {
pthread_mutex_init(&lock_ue_freelist, NULL);
pthread_mutex_init(&rrc_release_freelist, NULL);
pthread_mutex_init(&lock_rrc_ttcn, NULL);
memset(&rrc_release_info,0,sizeof(RRC_release_list_t));
}
......
......@@ -83,6 +83,7 @@ void init_ss_context(SS_Cell_Context_t SSCell_list[]){
memset(SSCell_list, 0, (sizeof(SS_Cell_Context_t) * 8));
memset(RC.ss.l1macind,0,sizeof(RC.ss.l1macind));
memset(RC.ss.CC_update_flag,0, (sizeof(RC.ss.CC_update_flag)));
RC.ss.rrc_sysinfo_value_tag_transition = false;
memset(RC.ss.CC_conf_flag,0, (sizeof(RC.ss.CC_conf_flag)));
for(int Cell_idx = 0; Cell_idx < 8; Cell_idx++){
SSCell_list[Cell_idx].eutra_cellId = -1;
......
......@@ -65,6 +65,7 @@ extern pthread_mutex_t sys_confirm_done_mutex;
extern int sys_confirm_done;
extern RAN_CONTEXT_t RC;
extern uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn);
extern pthread_mutex_t lock_rrc_ttcn;
#ifndef NR_RRC_VERSION
extern pthread_cond_t cell_config_done_cond;
......@@ -92,6 +93,11 @@ int proxy_send_port = 7776;
int proxy_recv_port = 7770;
bool reqCnfFlag_g = false;
static int cell_active_update_prohibition = 0;
// This is counting per cell, if 3 cells count can be in fact done 3 times
#define CELL_ACTIVE_UPDATE_PROHIBITION_COUNT 0
void sys_handle_pdcch_order(struct RA_PDCCH_Order_Type *pdcchOrder);
......@@ -504,9 +510,15 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
count ++;
}
}
RRC_CONFIGURATION_REQ(msg_p).schedulingInfo_count[cell_index] = count;
RRC_CONFIGURATION_REQ(msg_p).num_plmn[cell_index] = SIB1_CELL_ACCESS_REL_INFO.plmn_IdentityList.d;
if (RRC_CONFIGURATION_REQ(msg_p).systemInfoValueTag[cell_index] != SIDL_SIB1_VAL.c1.v.systemInformationBlockType1.systemInfoValueTag){
RC.ss.CC_update_flag[cell_index] = 1;
RC.ss.rrc_sysinfo_value_tag_transition = true;
LOG_I (ENB_SS_SYS_TASK,"SystemInfo value tag has been updated old value: %d, new value: %d\n",
RRC_CONFIGURATION_REQ(msg_p).systemInfoValueTag[cell_index],
SIDL_SIB1_VAL.c1.v.systemInformationBlockType1.systemInfoValueTag);
}
RRC_CONFIGURATION_REQ(msg_p).systemInfoValueTag[cell_index] = SIDL_SIB1_VAL.c1.v.systemInformationBlockType1.systemInfoValueTag;
RRC_CONFIGURATION_REQ(msg_p).num_plmn[cell_index] = SIB1_CELL_ACCESS_REL_INFO.plmn_IdentityList.d;
......@@ -582,6 +594,13 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
RRC_CONFIGURATION_REQ(msg_p).sib3_threshServingLowQ[cell_index] = calloc(1, sizeof(long));
*(RRC_CONFIGURATION_REQ(msg_p).sib3_threshServingLowQ[cell_index]) = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib3.threshServingLowQ_r9.v;
}
if (AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib3.s_NonIntraSearch_v920.d){
RRC_CONFIGURATION_REQ(msg_p).sib3_s_NonIntraSearchP[cell_index] = calloc(1, sizeof(long));
*(RRC_CONFIGURATION_REQ(msg_p).sib3_s_NonIntraSearchP[cell_index]) = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib3.s_NonIntraSearch_v920.v.s_NonIntraSearchP_r9;
RRC_CONFIGURATION_REQ(msg_p).sib3_s_NonIntraSearchQ[cell_index] = calloc(1, sizeof(long));
*(RRC_CONFIGURATION_REQ(msg_p).sib3_s_NonIntraSearchQ[cell_index]) = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib3.s_NonIntraSearch_v920.v.s_NonIntraSearchQ_r9;
}
}
/* SIB4: Received SIB4 from TTCN */
if (SQN_SystemInformation_r8_IEs_sib_TypeAndInfo_s_sib4 == AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].d)
......@@ -818,6 +837,10 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
LOG_A(ENB_SS_SYS_TASK, "Sending Cell configuration to RRC from SYSTEM_CTRL_REQ \n");
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
if (RC.ss.CC_update_flag[cell_index] == 1){
pthread_mutex_lock(&lock_rrc_ttcn);
//RC.ss.CC_update_flag[cell_index] = 0;
}
/* Active Config for ULGrant Params */
bool destTaskMAC = false;
for (int enb_id = 0; enb_id < RC.nb_inst; enb_id++)
......@@ -1033,6 +1056,9 @@ int sys_handle_cell_config_req(struct SYSTEM_CTRL_REQ *req)
assert(req);
struct CellConfigRequest_Type *Cell=&(req->Request.v.Cell);
assert(Cell);
struct CellConfigInfo_Type *AddOrReconfigure = &(Cell->v.AddOrReconfigure);
assert(AddOrReconfigure);
switch (Cell->d)
{
case CellConfigRequest_Type_AddOrReconfigure:
......@@ -1050,7 +1076,11 @@ int sys_handle_cell_config_req(struct SYSTEM_CTRL_REQ *req)
{
//The flag is used to initilize the cell in the RRC layer during init_SI funciton
RC.ss.CC_conf_flag[cell_index] = 1;
RC.ss.CC_update_flag[cell_index] = 1;
if (AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIB1.v.message.v.c1.v.systemInformationBlockType1.systemInfoValueTag == 0){
RC.ss.CC_update_flag[cell_index] = 1;
LOG_I (ENB_SS_SYS_TASK,"SYS task requests to update RRC configuration current cell:%d\n",cell_index);
}
returnState = SS_STATE_CELL_CONFIGURED;
//Increment nb_cc only from 2nd cell as the initilization is done for 1 CC
if (cell_index)
......@@ -1070,12 +1100,20 @@ int sys_handle_cell_config_req(struct SYSTEM_CTRL_REQ *req)
}
else
{
RC.ss.CC_update_flag[cell_index] = 1;
LOG_I (ENB_SS_SYS_TASK,"[SYS] CC-MGMT configured RC.nb_CC %d current updated CC_index %d RC.nb_mac_CC %d\n",
RC.nb_CC[0],cell_index,*RC.nb_mac_CC);
if (RC.ss.rrc_sysinfo_value_tag_transition == false){
RC.ss.CC_update_flag[cell_index] = 1;
} else{
LOG_D (ENB_SS_SYS_TASK,"[SYS] CC-MGMT Updating SI processing... , count: %d\n", cell_active_update_prohibition);
if (cell_active_update_prohibition >= CELL_ACTIVE_UPDATE_PROHIBITION_COUNT) {
RC.ss.rrc_sysinfo_value_tag_transition = false;
cell_active_update_prohibition = 0;
} else{
cell_active_update_prohibition ++;
}
}
}
break;
case CellConfigRequest_Type_Release: /**TODO: NOT IMPLEMNTED */
LOG_A(ENB_SS_SYS_TASK, "CellConfigRequest_Type_Release receivied\n");
......
......@@ -105,6 +105,10 @@ typedef struct ss_config_s {
ss_crnti_config_t ss_crnti[MAX_NUM_CCs];
RrcHOAsSecurityConfig_t HOASSecurityCOnfig;
uint8_t CC_update_flag[MAX_NUM_CCs];
//We have a race when SIB needs to be updated from TTCN with system_info_value_tag updated. We need to wait that update operated at TTCN/SS level before updating SIB
//there is clearly better to do Memory access@SS level (RRC configuration) is not protected at all causing bad behaviour sometimes
//SS code and interactions with RRC will be updated in better manner
bool rrc_sysinfo_value_tag_transition;
} ss_config_t;
/**
typedef enum {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment