Commit b6d466d7 authored by Robert Schmidt's avatar Robert Schmidt

FlexRAN: reimplement timers without ITTI

The timer code used to trigger periodic statistics message sending used
ITTI. Together with a high frequency reporting (e.g. 1ms), this resulted
in high CPU usage. This commit reimplements this:
* using a thread that is synchronized to the RU (if there is no MAC, we
  assume there is no RU generating a tick so we create the tick source
  ourselves)
* no RB trees but plain arrays
* smaller interface for users
* slight user interface changes
* remove stopped timer state: such timer might be simply removed
* remove one-shot timers
parent 233affc9
dev 1 128-ues 256_QAM_demod 512-dataplane-bug-in-l2nfapi_nos1 FR2_NSA Fix_SA_SIB1 LTE_TRX_on_single_port NCTU_CS_ISIP NCTU_CS_ISIP_CPU NCTU_CS_ISIP_GPU NCTU_OpinConnect_LDPC NR-PHY-MAC-IF-multi-UE NRPRACH_highSpeed_saankhya NRUE_usedlschparallel NR_10MHz NR_2port_CSIRS NR_CSIRS_tomerge NR_CSI_reporting NR_DCI_01 NR_DLUL_PF NR_DLUL_PF_4UL NR_DLUL_PF_rebased NR_DL_MIMO NR_DL_sched_fixes NR_DL_scheduler NR_F1C_F1U_extensions NR_FAPI_beamindex_SSB_RO NR_FAPI_beamindex_SSB_RO_SEMPROJ NR_FDD_FIX NR_FR2_RA NR_FR2_RRC_SSB NR_FR2_initsync_fixes NR_MAC_CE_GlobalEdge NR_MAC_Multi_Rach_GlobalEdge NR_MAC_Multi_Rach_GlobalEdge-old NR_MAC_SSB NR_MAC_SSB_RO_GlobalEdge NR_MAC_SSB_RO_UE_IDCC NR_MAC_SSB_RO_merge NR_MAC_TCI_UCI_GlobalEdge NR_MCS_BLER NR_NGAP NR_PDCP_noS1 NR_PUCCH_MultiUE NR_RA_cleanup NR_RA_updates NR_RRCConfiguration NR_RRCConfiguration_FR2 NR_RRCConfiguration_S1U NR_RRCConfiguration_merge_develop NR_RRCConfiguration_sync_source NR_RRCConfiguration_trx_thread NR_RRCReconfiguration_BWP NR_RRC_CP_bugfix NR_RRC_PDCP NR_RRC_PRACH_procedures NR_RRC_PRACH_procedures_todevelop NR_RRC_TA NR_RRC_X2AP_AMBR_Change_Global_edge NR_RRC_X2AP_RemoveHardcodings_GlobalEdge NR_RRC_config_simplified NR_RRC_harq NR_RRC_harq_b NR_RRC_harq_hacks NR_RRC_harq_newdcipdu NR_SA_F1AP_5GRECORDS NR_SA_F1AP_5GRECORDS-USIM NR_SA_F1AP_5GRECORDS-wf-0623 NR_SA_F1AP_5GRECORDS_lts NR_SA_F1AP_RFSIMULATOR NR_SA_F1AP_RFSIMULATOR2 NR_SA_F1AP_RFSIMULATOR2_SRB NR_SA_F1AP_RFSIMULATOR3 NR_SA_F1AP_RFSIMULATOR3_tmp NR_SA_F1AP_RFSIMULATOR3_wf NR_SA_F1AP_RFSIMULATOR_w5GCN NR_SA_F1AP_dev NR_SA_NGAP_RRC NR_SA_NGAP_RRC_wk42 NR_SA_itti_sim_wk48 NR_SA_itti_sim_wk48_hs NR_SA_itti_sim_wk48_hs1 NR_SA_w5GCN_new_gtpu NR_SCHED NR_SCHED_HARQ NR_SCHED_PDCCH_PUCCH_HARQ NR_SCHED_PDCCH_PUCCH_HARQ_rebased NR_SCHED_fixes NR_SRB_Config NR_TRX_on_single_port NR_TRX_on_single_port2 NR_UE_CONFIG_REQ_FIXES NR_UE_MAC_scheduler NR_UE_PUCCH_bugfixes NR_UE_RA_fixes NR_UE_SA NR_UE_SSB_meas NR_UE_UL_DCI_improvements NR_UE_dlsch_bugfix NR_UE_enable_parallelization NR_UE_rework_test NR_UE_reworking_UCI_procedures NR_UE_stability_fixes NR_UL_FAPI_programming NR_UL_SCFDMA_100MHz NR_UL_scheduler NR_UL_scheduler_rebased NR_UL_scheduling NR_Wireshark NR_beam_simulation NR_cleanup_PUCCH_resources NR_gNB_SCF_Indication NR_gNB_initial_MIB_fix NR_ipaccess_testing NR_mac_uci_functions_rework NR_msg2_phytest NR_multiplexing_HARQ_CSI_PUCCH NR_new_ul_antennaports NR_phytest_bugfixes NR_reworking_UL_antennaports NR_scheduling_CSIRS NR_scheduling_request NR_scheduling_request2 NR_scheduling_request3 NR_test_S1U_RRC_PRACH_procedures NR_ue_dlsch_dmrs_cdm PBCHNRTCFIX PUSCH_TA_update RA_CI_test RFquality Saankhya_NRPRACH_HighSpeed Test_SA_5GREC UE_DL_DCI_hotfix add-dmrs-test add-ru-docker-image avxllr bandwidth-testing bch-fixes-bitmap benetel_5g_prach_fix benetel_config_file_fix benetel_dpdk20 benetel_driver_uldl_pf_merge benetel_driver_update benetel_fixes benetel_phase_rotation benetel_phase_rotation_old bsr-fix bugfix-free-ra-process bugfix-minor-remove-wrong-log bugfix-nr-bands bugfix-nr-ldpc-post-processing bugfix-nr-ldpc-size-typo bugfix-nr-pdcp-sn-size bugfix-nr-rate-matching-assertion bugfix-nr-t-reordering bugfix-x2-SgNBAdditionRequest bugfix_gnb_rt_stats_html bupt-sa-merge cce_indexing_fix cce_indexing_fix2 ci-add-sabox-support ci-deploy-asterix ci-deploy-docker-compose ci-fix-module-ul-iperf ci-new-docker-pipeline ci-rd-july-improvements ci-reduce-nb-vms ci-test ci-ul-iperf-from-trf-container ci_benetel_longrun_limits ci_benetel_test ci_fix_iperf_for_module ci_hotfix_module_ue_ip_address ci_improve_module_ctl ci_nsa_2x2_implem ci_nsa_benetel ci_nsa_fixes ci_nsa_pipes_improve ci_nsa_test_integration_2021_wk19 ci_nsa_traces ci_nsa_uplink ci_phytest ci_quectel_support ci_sa_rfsim_test ci_solve_ul_for_module ci_test_5GREC ci_test_nsa_2x2 ci_test_nsa_fix_quectel_nic ci_test_nsa_on_develop ci_test_ra_fr2 ci_testinfra_as_code ci_update_build_nasmesh ci_vm_resource_fix clean-5G-scope-round2 cleanup_softmodem_main code-cleanup-20210716 constant_power debug-UL-5GRECORDS debug_UL_signal debug_branch_init_sync detached-w16-test develop develop-CBRA-v3 develop-CCE develop-NR_SA_F1AP_5GRECORDS develop-NR_SA_F1AP_5GRECORDS-abs develop-NR_SA_F1AP_5GRECORDS-hs develop-NR_SA_F1AP_5GRECORDS-hs1 develop-NR_SA_F1AP_5GRECORDS-lts develop-NR_SA_F1AP_5GRECORDS-lts-wf develop-NR_SA_F1AP_5GRECORDS-v3 develop-NR_SA_F1AP_5GRECORDS_100M develop-NR_SA_F1AP_5GRECORDS_LDPC_FPGA develop-NR_SA_F1AP_5GRECORDS_lfq_0607 develop-NSA_SA_fixes develop-SA-CBRA develop-SA-CBRA-CUDU develop-SA-CBRA-Msg5 develop-SA-CBRA-lts develop-SA-CBRA-ulsch-lts develop-SA-RA develop-SnT develop-aw2sori develop-oriecpriupdates develop-sib1 develop-sib1-local develop-sib1-lts develop-sib1-update develop-sib1-update-test1 develop-sib1-update-ue develop-wf-du develop_fpga_ldpc develop_inria_ci_deployment develop_inria_ci_deployment_gp develop_integration_2020_w15 develop_integration_2020_w19 develop_integration_w08 develop_stable dfts_alternatives disable_CSI_measrep dlsch-all-dlslots dlsch_encode_mthread dlsch_parallel docker-improvements-2021-april docker-no-cache-option docupdate_tools dongzhanyi-zte-develop dongzhanyi-zte-develop1 dongzhanyi-zte-develop2 dreibh/apt-auth-fix dreibh/device-load-fix dreibh/device-load-fix-develop-branch edrx enhance-rfsim episys-merge episys/nsa_baseline episys/nsa_development extend_sharedlibusage extend_sharedlibusage2 fapi_for_dmrs_and_ptrs feature-4g-sched feature-support-clang-format feature/make-s1-mme-port-configurable feature/make-s1-mme-port-configurable-with-astyle-fixes fedora-gen-kernel-fix fembms-enb-ue fft_bench_hotfix finalize-oaicn-integration firas fix-check fix-ci-tun fix-compile fix-itti-segv fix-l2-sim fix-limeSDR-compile fix-lte-ue-modem-in-docker-container fix-nr-pdcp-timer fix-nr-rlc-range-nack fix-physim-deploy fix-physim-run-script-on-cluster fix-quectel fix-realtime fix-retransmission-rbg fix-softmodem-restart fix-warnings fix-x2-without-gnb fix_NR_DLUL_PF fix_NR_DLUL_PF_benchmark fix_coreset_dmrs_idx fix_do_ra_data fix_nr_ulsim fix_pdsch_low_prb fix_rb_corruption fix_reestablishment fix_rfsim_mimo fix_rrc_x2_ticking fixes-CE-RLC-PDU-size fixes-mac-sched-nfapi fixes-mac-sched-tun fixes-tun fixgtpu flexran-apps flexran-improvements flexran-repair-mme-mgmt flexran-rtc-repo-is-public fujitsu_lte_contribution fujitsu_lte_contribution-128 generate_push_ptrs git-dashboard gnb-freerun-txru gnb-n300-fixes gnb-only-test gnb-realtime-hotfix gnb-realtime-quickfix gnb-threadpool hack-bch-no-sched-sf-0 hack-exit-gnb-when-no-enb-nsa harq-hotfix hotfix-minor-remove-nr-rlc-cppcheck-error hotfix-nr-rlc-tick hotfix-ocp-executable hotfix-ue-musim-compilation improve_nr_modulation improve_ue_stability integ-w13-test-rt-issue integration_2020_wk15 integration_2020_wk40 integration_2020_wk41 integration_2020_wk42_2 integration_2020_wk45 integration_2020_wk45_2 integration_2020_wk46 integration_2020_wk46_2 integration_2020_wk47 integration_2020_wk48 integration_2020_wk48_2 integration_2020_wk49 integration_2020_wk50 integration_2020_wk50_1 integration_2020_wk51 integration_2020_wk51_2 integration_2021_wk02 integration_2021_wk02_wMR988 integration_2021_wk04 integration_2021_wk05 integration_2021_wk06 integration_2021_wk06_MR978 integration_2021_wk06_b integration_2021_wk06_c integration_2021_wk08 integration_2021_wk08_2 integration_2021_wk08_MR963 integration_2021_wk09 integration_2021_wk09_b integration_2021_wk10 integration_2021_wk10_b integration_2021_wk11 integration_2021_wk12 integration_2021_wk12_b integration_2021_wk13_a integration_2021_wk13_b integration_2021_wk13_b_fix_tdas integration_2021_wk13_b_fixed integration_2021_wk13_c integration_2021_wk14_a integration_2021_wk15_a integration_2021_wk16 integration_2021_wk17_a integration_2021_wk17_b integration_2021_wk18_a integration_2021_wk18_b integration_2021_wk19 integration_2021_wk20_a integration_2021_wk22 integration_2021_wk23 integration_2021_wk27 integration_2021_wk28 integration_2021_wk30 integration_2021_wk30_b integration_w5GC_CBRA_test inter-RRU-final inter-RRU-nr inter-RRU-oairu inter-rru-UE itti-enhancement l2-fixes ldpc-decoder-codegen ldpc-decoder-codegen2 ldpc-offload ldpc_offload_t1 ldpc_short_codeword_fixes load_gnb lte-ulsch-bugfix lte_uplink_improvement mac-fixes-wk45_2 migrate-cpp-check-container migrate-vm-pipeline-to-bionic minor-fix-doc-basic-sim mosaic5g-oai-ran mosaic5g-oai-sim msg4_phy_0303_lfq multiple_ssb_sib1_bugfix nasmesh_kernel_5.8 new-gtpu new_rlc_2020 nfapi-bugfix nfapi_nr_arch_mod nfapi_nr_develop nfapi_nr_develop_new ngap-dlul ngap-support ngap-w48-merge2 ngap-wf ngap-wf-1120 ngap-wf-1120-srb ngap-wf-1120-srb-gtp ngap-wf-1120-srb-gtp-hs ngap-wf-1120-srb-gtp-hs1 ngap-wf-1120-srb-gtp-hs2 ngap-wf-1120-srb-gtp-yhz ngap-wf-1203-yunsdr ngap-wf-liuyu ngap_lfq_1120 ngap_merge noCore nr-bsr-fix nr-dl-mimo-2layer nr-dmrs-fixes nr-ip-uplink-noS1 nr-mac-pdu-wireshark nr-mac-remove-ue-list nr-pdcp-benchmarking nr-pdcp-improvements nr-pdcp-nea2-security nr-pdcp-nia2-integrity nr-pdcp-small-bugfixes nr-pdcp-srb-integrity nr-ra-fix nr-rlc-am-bugfix-w44 nr-rlc-bugfix-w44 nr-stats-print nrPBCHTCFix nrPbchTcFix nrUE nrUE-hs nrUE-upper-layer nr_bsr nr_dl_dmrs_type2 nr_dl_pf nr_dl_pf2 nr_dl_ul_ptrs nr_fdd_if_fix nr_improve_chanest nr_polar_decoder_improvement nr_power_measurement_fixes nr_prach_fr2 nr_pucch nr_pucch2 nr_ue_msg3 nr_ue_pdcp_fix nr_ue_remove_high_speed_flag nr_ue_tti_cleanup nr_ul_pf nr_ul_scfdma nrue-multi-thread nrue_msg2_reception nsa-ue nsa_remove_band_hardcodings oai-sim oai-ubuntu-docker oai-ubuntu-docker-for-lmssdr oairu oairu-dockerfile-support oc-docker-october-improvements openxg/develop pdcp-benchmark phy-asan-fixes physim-build-deploy physim-deploy-handle-error-cases polar8 prb_based_dl_channel_estimation ptrs_rrc_config pusch-mthread-scaling-fix pusch-retrans-fix-ue ra-dl-ul recursive-cmake remove_nos1_hack_pdcp remove_x2_gnb_hardcoding repair-TA revert_memcpy rh-ci-add-ue-parallelization rh_ci_add_runtime_stats rh_ci_add_uldlharq_stats rh_ci_fix_autoterminate rh_ci_fr1_update rh_ci_gsheet_rt_monitoring rh_ci_nsa2jenkins rh_ci_nsa_test_n310 rh_ci_oc rh_ci_phy_test_improve rh_ci_py rh_ci_ra_fr2 rh_ci_rfsim_ra rh_ci_test_benetel rh_ci_test_nsa rh_ci_test_nsa_wk16 rh_ci_test_nsa_wk17_b rh_ci_test_nsa_wk17b rh_ci_test_rfsim_sa rh_ci_ue_parallel rh_doc_update_3 rh_fr1_newjenkins rh_fr1_update rh_gnb_compile_fix rh_wk50_debug rlc-v2-bugfix-status-reporting rlc-v2-tick rlc_v2_coverity_fixes rohan_ulsim2RxFix rrc-enb-phy-testmode s1-subnormal_rewrite s1_subnormal s1_subnormal-robert s1ap-bugfix-rab_setup sa-demo sa-demo-hs sa-merge-rrc-srb sa-msg4 sa-msg4-rrc sa-msg4-rrc-yihz sa-msg4-rrc-yihz-hs sa_rrc_yihz sanitize-address sanitize-v1 sanitize-v1-tmp sarma_pvnp_oai scs_60_iisc sim-channels small-bugfixes-w40 small-config-change small_nr_bugfixes smallcleanup softmodem_cleanup split73 t-gnb-tracer test-5GREC test-nsa-benetel test-panos test_nsa_gtpu_fix test_rt-fix_phy-test testing_2symb_pdcch testing_with_external_txdata tools_5Gadapt tp-ota-test trx_thread_param trx_write_thread ue-csi ue-dci-false-detection ue-fixes ue-fixes-ota ue-pdsch-pusch-parallel ue-race-fix ue_beam_selection ue_nfapi_mch ul-freq-iq-samps-to-file ul_dl_dci_same_slot ul_harq ulsch_decode_mthread ulsim_changes usrp_fix_adc_shift_and_pps_sync usrp_stop_cleanly usrp_x400 wf-sa-rrc wf_testc wireshark-T-hack-ueid wireshark-log-scheduling-requests wk11-with-phytest x2-endc-processing x2_handle_sctp_shutdown xiangwab xiangwan xw2 yihongzheng_srb zzs 2021.wk14_a 2021.wk13_d 2021.wk13_c 2021.w30 2021.w29 2021.w28 2021.w27 2021.w26 2021.w25 2021.w24 2021.w23 2021.w22 2021.w20 2021.w19 2021.w18_b 2021.w18_a 2021.w17_b 2021.w16 2021.w15 2021.w14 2021.w13_a 2021.w12 2021.w11 2021.w10 2021.w09 2021.w08 2021.w06 2021.w05 2021.w04 2021.w02 2020.w51_2 2020.w51 2020.w50 2020.w49 2020.w48_2 2020.w48 2020.w47 2020.w46_2 2020.w46 2020.w45_2 2020.w45 2020.w44 2020.w42_2 2020.w42 2020.w41 2020.w39 2020.w38 2020.w37 2020.w36 2020.w34 2020.w33 2020.w31 2020.w30 2020.w29 2020.w28 2020.w26 2020.w25 2020.w24 2020.w23 2020.w22 2020.w19 2020.w17 2020.w16 2020.w15 2020.w11 2020.w09 2020.w06 2020.w05 2020.w04 benetel_phase_rotation benetel_gnb_rel_2.0 benetel_gnb_rel_1.0 benetel_enb_rel_2.0 benetel_enb_rel_1.0
No related merge requests found
......@@ -1562,11 +1562,10 @@ int flexran_agent_register_mac_xface(mid_t mod_id)
return -1;
}
//xface->agent_ctxt = &shared_ctxt[mod_id];
xface->flexran_agent_send_sr_info = flexran_agent_send_sr_info;
xface->flexran_agent_send_sf_trigger = flexran_agent_send_sf_trigger;
//xface->flexran_agent_send_update_mac_stats = flexran_agent_send_update_mac_stats;
xface->flexran_agent_get_pending_dl_mac_config = flexran_agent_get_pending_dl_mac_config;
xface->flexran_agent_notify_tick = flexran_agent_timer_signal;
xface->dl_scheduler_loaded_lib = NULL;
xface->ul_scheduler_loaded_lib = NULL;
......@@ -1689,11 +1688,10 @@ int flexran_agent_unregister_mac_xface(mid_t mod_id)
return -1;
}
AGENT_MAC_xface *xface = agent_mac_xface[mod_id];
//xface->agent_ctxt = NULL;
xface->flexran_agent_send_sr_info = NULL;
xface->flexran_agent_send_sf_trigger = NULL;
//xface->flexran_agent_send_update_mac_stats = NULL;
xface->flexran_agent_get_pending_dl_mac_config = NULL;
xface->flexran_agent_notify_tick = NULL;
xface->dl_scheduler_loaded_lib = NULL;
xface->ul_scheduler_loaded_lib = NULL;
......
......@@ -54,10 +54,9 @@ typedef struct {
void (*flexran_agent_get_pending_dl_mac_config)(mid_t mod_id,
Protocol__FlexranMessage **msg);
/// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
// int (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
// uint8_t state_change);
/// Notify the controller of another (RU) tick, i.e. new subframe. Used to
/// synchronize the eNB and the agent.
void (*flexran_agent_notify_tick)(mid_t mod_id);
void *dl_scheduler_loaded_lib;
......
......@@ -33,27 +33,14 @@
#include <pthread.h>
#include <arpa/inet.h>
void *receive_thread(void *args);
Protocol__FlexranMessage *flexran_agent_timeout(void* args);
int agent_task_created = 0;
/*
* enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller
* and can interact with other itti tasks
*/
void *flexran_agent_task(void *args){
//flexran_agent_info_t *d = (flexran_agent_info_t *) args;
Protocol__FlexranMessage *msg;
void *data;
int size;
err_code_t err_code=0;
int priority = 0;
MessageDef *msg_p = NULL;
int result;
struct flexran_agent_timer_element_s * elem = NULL;
itti_mark_task_ready(TASK_FLEXRAN_AGENT);
......@@ -72,20 +59,6 @@ void *flexran_agent_task(void *args){
LOG_I(FLEXRAN_AGENT, "Received %s\n", ITTI_MSG_NAME(msg_p));
break;
case TIMER_HAS_EXPIRED:
msg = flexran_agent_process_timeout(msg_p->ittiMsg.timer_has_expired.timer_id, msg_p->ittiMsg.timer_has_expired.arg);
if (msg != NULL){
data=flexran_agent_pack_message(msg,&size);
elem = get_timer_entry(msg_p->ittiMsg.timer_has_expired.timer_id);
if (flexran_agent_msg_send(elem->agent_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) {
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error;
}
LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
}
break;
default:
LOG_E(FLEXRAN_AGENT, "Received unexpected message %s\n", ITTI_MSG_NAME (msg_p));
break;
......@@ -93,10 +66,6 @@ void *flexran_agent_task(void *args){
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
continue;
error:
if (err_code != 0)
LOG_E(FLEXRAN_AGENT,"flexran_agent_task: error %d occured\n",err_code);
} while (1);
return NULL;
......@@ -245,7 +214,7 @@ int flexran_agent_start(mid_t mod_id)
* initilize a timer
*/
flexran_agent_init_timer();
flexran_agent_timer_init(mod_id);
/*
* start the enb agent task for tx and interaction with the underlying network function
......@@ -286,16 +255,3 @@ error:
return 1;
}
Protocol__FlexranMessage *flexran_agent_timeout(void* args){
// flexran_agent_timer_args_t *timer_args = calloc(1, sizeof(*timer_args));
//memcpy (timer_args, args, sizeof(*timer_args));
flexran_agent_timer_args_t *timer_args = (flexran_agent_timer_args_t *) args;
LOG_UI(FLEXRAN_AGENT, "flexran_agent %d timeout\n", timer_args->mod_id);
//LOG_I(FLEXRAN_AGENT, "eNB action %d ENB flags %d \n", timer_args->cc_actions,timer_args->cc_report_flags);
//LOG_I(FLEXRAN_AGENT, "UE action %d UE flags %d \n", timer_args->ue_actions,timer_args->ue_report_flags);
return NULL;
}
......@@ -150,10 +150,15 @@ Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id,
uint32_t size);
/* Function to be used to send a message to a dispatcher once the appropriate event is triggered. */
Protocol__FlexranMessage *flexran_agent_handle_timed_task(void *args);
Protocol__FlexranMessage *flexran_agent_handle_timed_task(
mid_t mod_id,
Protocol__FlexranMessage *msg);
/*Top level Statistics hanlder*/
Protocol__FlexranMessage *flexran_agent_send_stats_reply(void *args);
Protocol__FlexranMessage *flexran_agent_send_stats_reply(
mid_t mod_id,
const Protocol__FlexranMessage *msg);
int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
/* Function to be used to handle reply message . */
......
......@@ -107,36 +107,6 @@ typedef uint8_t lcid_t;
typedef int32_t err_code_t;
/*---------Timer Enums --------- */
typedef enum {
/* oneshot timer: */
FLEXRAN_AGENT_TIMER_TYPE_ONESHOT = 0,
/* periodic timer */
FLEXRAN_AGENT_TIMER_TYPE_PERIODIC = 1,
/* Inactive state: initial state for any timer. */
FLEXRAN_AGENT_TIMER_TYPE_EVENT_DRIVEN = 2,
/* Max number of states available */
FLEXRAN_AGENT_TIMER_TYPE_MAX,
} flexran_agent_timer_type_t;
typedef enum {
/* Inactive state: initial state for any timer. */
FLEXRAN_AGENT_TIMER_STATE_INACTIVE = 0x0,
/* Inactive state: initial state for any timer. */
FLEXRAN_AGENT_TIMER_STATE_ACTIVE = 0x1,
/* Inactive state: initial state for any timer. */
FLEXRAN_AGENT_TIMER_STATE_STOPPED = 0x2,
/* Max number of states available */
FLEXRAN_AGENT_TIMER_STATE_MAX,
} flexran_agent_timer_state_t;
#define FLEXRAN_CAP_LOPHY(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__LOPHY)) > 0)
#define FLEXRAN_CAP_HIPHY(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__HIPHY)) > 0)
......
......@@ -154,39 +154,20 @@ void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
return NULL;
}
Protocol__FlexranMessage *flexran_agent_handle_timed_task(void *args) {
Protocol__FlexranMessage *flexran_agent_handle_timed_task(
mid_t mod_id,
Protocol__FlexranMessage *msg) {
err_code_t err_code;
flexran_agent_timer_args_t *timer_args = (flexran_agent_timer_args_t *) args;
Protocol__FlexranMessage *timed_task, *reply_message;
timed_task = timer_args->msg;
err_code = ((*agent_messages_callback[timed_task->msg_case-1][timed_task->msg_dir-1])(timer_args->mod_id, (void *) timed_task, &reply_message));
if ( err_code < 0 ){
goto error;
Protocol__FlexranMessage *reply_message;
err_code = ((*agent_messages_callback[msg->msg_case-1][msg->msg_dir-1])(
mod_id, msg, &reply_message));
if (err_code < 0) {
LOG_E(FLEXRAN_AGENT, "could not handle message: errno %d occured\n", err_code);
return NULL;
}
return reply_message;
error:
LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code);
return NULL;
}
Protocol__FlexranMessage* flexran_agent_process_timeout(long timer_id, void* timer_args){
struct flexran_agent_timer_element_s *found = get_timer_entry(timer_id);
if (found == NULL ) goto error;
LOG_D(FLEXRAN_AGENT, "Found the entry (%p): timer_id is 0x%lx 0x%lx\n", found, timer_id, found->timer_id);
if (timer_args == NULL)
LOG_W(FLEXRAN_AGENT,"null timer args\n");
return found->cb(timer_args);
error:
LOG_E(FLEXRAN_AGENT, "can't get the timer element\n");
return NULL;
}
err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg) {
......@@ -209,24 +190,21 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
return -1;
}
Protocol__FlexCompleteStatsRequest *comp_req = stats_req->complete_stats_request;
flexran_agent_timer_args_t *timer_args = NULL;
switch (comp_req->report_frequency) {
case PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_OFF:
flexran_agent_destroy_timer_by_task_id(xid);
flexran_agent_destroy_timer(mod_id, xid);
return 0;
case PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE:
LOG_E(FLEXRAN_AGENT, "one-shot timer not implemented yet\n");
return -1;
case PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_PERIODICAL:
/* Create a one off flexran message as an argument for the periodical task */
timer_args = calloc(1, sizeof(flexran_agent_timer_args_t));
AssertFatal(timer_args, "cannot allocate memory for timer\n");
timer_args->mod_id = mod_id;
timer_args->msg = input;
LOG_I(FLEXRAN_AGENT, "periodical timer xid %d cell_flags %d ue_flags %d\n",
xid, comp_req->cell_report_flags, comp_req->ue_report_flags);
flexran_agent_create_timer(mod_id, comp_req->sf,
FLEXRAN_AGENT_TIMER_TYPE_PERIODIC, xid,
flexran_agent_send_stats_reply, timer_args);
flexran_agent_send_stats_reply, input);
/* return 1: do not dispose comp_req message we received, we still need it */
return 1;
case PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_CONTINUOUS:
......@@ -241,15 +219,14 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
/*
Top level reply
*/
Protocol__FlexranMessage *flexran_agent_send_stats_reply(void *args) {
const flexran_agent_timer_args_t *timer_args = args;
const mid_t enb_id = timer_args->mod_id;
const Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)timer_args->msg;
const Protocol__FlexStatsRequest *stats_req = input->stats_request_msg;
Protocol__FlexranMessage *flexran_agent_send_stats_reply(
mid_t mod_id,
const Protocol__FlexranMessage *msg) {
const Protocol__FlexStatsRequest *stats_req = msg->stats_request_msg;
const xid_t xid = stats_req->header->xid;
Protocol__FlexranMessage *reply = NULL;
err_code_t rc = flexran_agent_stats_reply(enb_id, xid, stats_req, &reply);
err_code_t rc = flexran_agent_stats_reply(mod_id, xid, stats_req, &reply);
if (rc < 0) {
LOG_E(FLEXRAN_AGENT, "%s(): errno %d occured, cannot send stats_reply\n",
__func__, rc);
......
......@@ -21,175 +21,266 @@
/*! \file flexran_agent_timer.c
* \brief FlexRAN Timer
* \author shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
*/
/*
* timer primitives
* \author Robert Schmidt
* \date 2019
* \version 0.2
*/
#include "flexran_agent_timer.h"
#include "flexran_agent_extern.h"
#include <pthread.h>
#include <sys/timerfd.h>
//struct flexran_agent_map agent_map;
flexran_agent_timer_instance_t timer_instance;
int agent_timer_init = 0;
err_code_t flexran_agent_init_timer(void) {
LOG_I(FLEXRAN_AGENT, "init RB tree\n");
#define MAX_NUM_TIMERS 10
if (!agent_timer_init) {
RB_INIT(&timer_instance.flexran_agent_head);
agent_timer_init = 1;
}
return PROTOCOL__FLEXRAN_ERR__NO_ERR;
}
typedef struct flexran_agent_timer_element_s {
mid_t mod_id;
xid_t xid; /* The id of the task as received by the controller message*/
uint32_t sf;
uint64_t next;
flexran_agent_timer_callback_t cb;
Protocol__FlexranMessage *msg;
} flexran_agent_timer_element_t;
RB_GENERATE(flexran_agent_map, flexran_agent_timer_element_s, entry, flexran_agent_compare_timer);
typedef struct flexran_agent_timer_extern_source_s {
pthread_mutex_t mutex_sync;
pthread_cond_t cond;
int wait;
} flexran_agent_timer_extern_source_t;
/* The timer_id might not be the best choice for the comparison */
int flexran_agent_compare_timer(struct flexran_agent_timer_element_s *a, struct flexran_agent_timer_element_s *b) {
if (a->timer_id < b->timer_id) return -1;
struct timesync {
void *param_sync;
void (*fsync)(void *);
pthread_t thread;
if (a->timer_id > b->timer_id) return 1;
uint64_t current;
uint64_t next;
// equal timers
return 0;
}
int timer_num;
flexran_agent_timer_element_t *timer[MAX_NUM_TIMERS];
pthread_mutex_t mutex_timer;
err_code_t flexran_agent_create_timer(mid_t mod_id,
uint32_t sf,
uint32_t timer_type,
xid_t xid,
flexran_agent_timer_callback_t cb,
void *timer_args) {
int ret=-1;
int exit;
};
struct timesync timesync[NUM_MAX_ENB];
if (sf <= 0)
return TIMER_NULL;
int flexran_agent_timer_signal_init(struct timesync *sync);
int flexran_agent_timer_source_setup(struct timesync *sync);
void *flexran_agent_timer_thread(void *args);
void flexran_agent_timer_remove_internal(struct timesync *sync, int index);
void flexran_agent_timer_process(flexran_agent_timer_element_t *t);
if (timer_type >= FLEXRAN_AGENT_TIMER_TYPE_MAX)
return TIMER_TYPE_INVALIDE;
uint32_t interval_usec = sf * 1000;
uint32_t interval_sec = 0;
if (interval_usec >= 1000 * 1000) {
interval_sec = interval_usec / (1000 * 1000);
interval_usec = interval_usec % (1000 * 1000);
}
struct flexran_agent_timer_element_s *e = calloc(1, sizeof(*e));
DevAssert(e != NULL);
long timer_id = 0;
AssertFatal(e, "cannot allocate memory for FlexRAN timer!\n");
if (timer_type == FLEXRAN_AGENT_TIMER_TYPE_ONESHOT) {
ret = timer_setup(interval_sec,
interval_usec,
TASK_FLEXRAN_AGENT,
mod_id,
TIMER_ONE_SHOT,
timer_args,
&timer_id);
e->type = TIMER_ONE_SHOT;
} else if (timer_type == FLEXRAN_AGENT_TIMER_TYPE_PERIODIC ) {
ret = timer_setup(interval_sec,
interval_usec,
TASK_FLEXRAN_AGENT,
mod_id,
TIMER_PERIODIC,
timer_args,
&timer_id);
e->type = TIMER_PERIODIC;
}
err_code_t flexran_agent_timer_init(mid_t mod_id) {
struct timesync *sync = &timesync[mod_id];
sync->current = 0;
sync->next = 0;
sync->timer_num = 0;
for (int i = 0; i < MAX_NUM_TIMERS; ++i)
sync->timer[i] = NULL;
pthread_mutex_init(&sync->mutex_timer, NULL);
sync->exit = 0;
if (ret < 0 ) {
free(e);
/* if there is a MAC, we assume we can have a tick from the MAC interface
* (external tick source). Otherwise, generate a tick internally via the
* timerfd linux library. The init functions set everything up and the thread
* will use whatever is available. */
int (*init)(struct timesync *) = flexran_agent_get_mac_xface(mod_id) ?
flexran_agent_timer_signal_init : flexran_agent_timer_source_setup;
if (init(timesync) < 0
|| pthread_create(&sync->thread, NULL, flexran_agent_timer_thread, sync) != 0) {
sync->thread = 0;
if (sync->param_sync)
free(sync->param_sync);
LOG_E(FLEXRAN_AGENT, "could not start timer thread\n");
return TIMER_SETUP_FAILED;
}
return PROTOCOL__FLEXRAN_ERR__NO_ERR;
}
e->agent_id = mod_id;
e->instance = mod_id;
e->state = FLEXRAN_AGENT_TIMER_STATE_ACTIVE;
e->timer_id = timer_id;
e->xid = xid;
e->timer_args = timer_args;
e->cb = cb;
/*element should be a real pointer*/
RB_INSERT(flexran_agent_map, &timer_instance.flexran_agent_head, e);
LOG_I(FLEXRAN_AGENT,"Created a new timer with id 0x%lx for agent %d, instance %d \n",
e->timer_id, e->agent_id, e->instance);
return 0;
void flexran_agent_timer_exit(mid_t mod_id) {
timesync[mod_id].exit = 1;
}
err_code_t flexran_agent_destroy_timer(long timer_id) {
struct flexran_agent_timer_element_s *e = get_timer_entry(timer_id);
void flexran_agent_timer_source_sync(void *sync) {
int fd = *(int *)sync;
uint64_t occ;
int rc __attribute__((unused)) = read(fd, &occ, sizeof(occ));
}
if (e != NULL ) {
RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e);
flexran_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
}
int flexran_agent_timer_source_setup(struct timesync *sync) {
sync->param_sync = malloc(sizeof(int));
if (!sync->param_sync)
return -1;
int fd = timerfd_create(CLOCK_MONOTONIC, 0);
if (fd < 0)
return fd;
if (timer_remove(timer_id) < 0 )
goto error;
const uint64_t period_ns = 1000000; // 1ms
struct itimerspec t;
t.it_interval.tv_sec = period_ns / 1000000000;
t.it_interval.tv_nsec = period_ns % 1000000000;
t.it_value.tv_sec = period_ns / 1000000000;
t.it_value.tv_nsec = period_ns % 1000000000;
int rc = timerfd_settime(fd, 0, &t, NULL);
if (rc != 0)
return -1;
*(int *)sync->param_sync = fd;
sync->fsync = flexran_agent_timer_source_sync;
return 0;
}
void flexran_agent_timer_signal_sync(void *param_sync) {
flexran_agent_timer_extern_source_t *sync = param_sync;
pthread_mutex_lock(&sync->mutex_sync);
while (sync->wait) {
pthread_cond_wait(&sync->cond, &sync->mutex_sync);
}
sync->wait = 1;
pthread_mutex_unlock(&sync->mutex_sync);
}
int flexran_agent_timer_signal_init(struct timesync *sync) {
flexran_agent_timer_extern_source_t *s = malloc(sizeof(flexran_agent_timer_extern_source_t));
if (!s)
return TIMER_SETUP_FAILED;
if (pthread_mutex_init(&s->mutex_sync, NULL) < 0)
return TIMER_SETUP_FAILED;
if (pthread_cond_init(&s->cond, NULL) < 0)
return TIMER_SETUP_FAILED;
s->wait = 1;
sync->param_sync = s;
sync->fsync = flexran_agent_timer_signal_sync;
return 0;
error:
LOG_E(FLEXRAN_AGENT, "timer can't be removed\n");
return TIMER_REMOVED_FAILED ;
}
err_code_t flexran_agent_destroy_timer_by_task_id(xid_t xid) {
struct flexran_agent_timer_element_s *e = NULL;
long timer_id;
RB_FOREACH(e, flexran_agent_map, &timer_instance.flexran_agent_head) {
if (e->xid == xid) {
timer_id = e->timer_id;
RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e);
flexran_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
if (timer_remove(timer_id) < 0 ) {
goto error;
void flexran_agent_timer_signal(mid_t mod_id) {
flexran_agent_timer_extern_source_t *sync = timesync[mod_id].param_sync;
pthread_mutex_lock(&sync->mutex_sync);
sync->wait = 0;
pthread_mutex_unlock(&sync->mutex_sync);
pthread_cond_signal(&sync->cond);
}
void *flexran_agent_timer_thread(void *args) {
struct timesync *sync = args;
while (1) {
sync->fsync(sync->param_sync);
if (sync->exit)
break;
pthread_mutex_lock(&sync->mutex_timer);
sync->current++;
if (sync->current < sync->next) {
pthread_mutex_unlock(&sync->mutex_timer);
continue;
}
for (int i = 0; i < sync->timer_num; ++i) {
flexran_agent_timer_element_t *t = sync->timer[i];
if (sync->current == t->next) {
flexran_agent_timer_process(t);
t->next += t->sf;
}
if (sync->next == sync->current || t->next < sync->next)
sync->next = t->next;
}
return 0;
error:
LOG_E(FLEXRAN_AGENT, "timer can't be removed\n");
return TIMER_REMOVED_FAILED ;
pthread_mutex_unlock(&sync->mutex_timer);
}
LOG_W(FLEXRAN_AGENT, "terminated timer thread\n");
return NULL;
}
void flexran_agent_timer_process(flexran_agent_timer_element_t *t) {
Protocol__FlexranMessage *msg = t->cb(t->mod_id, t->msg);
if (!msg)
return;
int size = 0;
void *data = flexran_agent_pack_message(msg, &size);
if (flexran_agent_msg_send(t->mod_id, FLEXRAN_AGENT_DEFAULT, data, size, 0) < 0)
LOG_E(FLEXRAN_AGENT, "error while sending message for timer xid %d\n", t->xid);
}
err_code_t flexran_agent_destroy_timers(void) {
struct flexran_agent_timer_element_s *e = NULL;
RB_FOREACH(e, flexran_agent_map, &timer_instance.flexran_agent_head) {
RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e);
timer_remove(e->timer_id);
flexran_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
err_code_t flexran_agent_create_timer(mid_t mod_id,
uint32_t sf,
flexran_agent_timer_type_t timer_type,
xid_t xid,
flexran_agent_timer_callback_t cb,
Protocol__FlexranMessage *msg) {
if (sf == 0)
return TIMER_NULL;
if (cb == NULL)
return TIMER_SETUP_FAILED;
AssertFatal(timer_type != FLEXRAN_AGENT_TIMER_TYPE_ONESHOT,
"one shot timer not yet implemented\n");
flexran_agent_timer_element_t *t = malloc(sizeof(flexran_agent_timer_element_t));
if (!t) {
LOG_E(FLEXRAN_AGENT, "no memory for new timer %d\n", xid);
return TIMER_SETUP_FAILED;
}
t->mod_id = mod_id;
t->xid = xid;
t->sf = sf;
t->cb = cb;
t->msg = msg;
struct timesync *sync = &timesync[mod_id];
pthread_mutex_lock(&sync->mutex_timer);
if (sync->timer_num >= MAX_NUM_TIMERS) {
pthread_mutex_unlock(&sync->mutex_timer);
LOG_E(FLEXRAN_AGENT, "maximum number of timers (%d) reached while adding timer %d\n",
sync->timer_num, xid);
free(t);
return TIMER_SETUP_FAILED;
}
/* TODO check that xid does not exist? */
t->next = sync->current + 1;
if (sync->next <= sync->current || t->next < sync->next)
sync->next = t->next;
sync->timer[sync->timer_num] = t;
sync->timer_num++;
pthread_mutex_unlock(&sync->mutex_timer);
LOG_D(FLEXRAN_AGENT, "added new timer xid %d for agent %d\n", xid, mod_id);
return 0;
}
err_code_t flexran_agent_stop_timer(long timer_id) {
struct flexran_agent_timer_element_s *e=NULL;
struct flexran_agent_timer_element_s search;
memset(&search, 0, sizeof(struct flexran_agent_timer_element_s));
search.timer_id = timer_id;
e = RB_FIND(flexran_agent_map, &timer_instance.flexran_agent_head, &search);
if (e != NULL ) {
e->state = FLEXRAN_AGENT_TIMER_STATE_STOPPED;
err_code_t flexran_agent_destroy_timers(mid_t mod_id) {
struct timesync *sync = &timesync[mod_id];
pthread_mutex_lock(&sync->mutex_timer);
for (int i = sync->timer_num - 1; i < 0; --i) {
flexran_agent_timer_remove_internal(sync, i);
}
pthread_mutex_unlock(&sync->mutex_timer);
return 0;
}
timer_remove(timer_id);
err_code_t flexran_agent_destroy_timer(mid_t mod_id, xid_t xid) {
struct timesync *sync = &timesync[mod_id];
pthread_mutex_lock(&sync->mutex_timer);
for (int i = 0; i < sync->timer_num; ++i) {
if (sync->timer[i]->xid == xid) {
flexran_agent_timer_remove_internal(sync, i);
pthread_mutex_unlock(&sync->mutex_timer);
return 0;
}
}
pthread_mutex_unlock(&sync->mutex_timer);
LOG_E(FLEXRAN_AGENT, "could not find timer %d\n", xid);
return TIMER_ELEMENT_NOT_FOUND;
}
struct flexran_agent_timer_element_s *get_timer_entry(long timer_id) {
struct flexran_agent_timer_element_s search;
memset(&search, 0, sizeof(struct flexran_agent_timer_element_s));
search.timer_id = timer_id;
return RB_FIND(flexran_agent_map, &timer_instance.flexran_agent_head, &search);
/* this function assumes that the timer lock is held */
void flexran_agent_timer_remove_internal(struct timesync *sync, int index) {
LOG_I(FLEXRAN_AGENT, "remove timer xid %d (index %d) for agent %d\n",
sync->timer[index]->xid, index, sync->timer[index]->mod_id);
flexran_agent_destroy_flexran_message(sync->timer[index]->msg);
free(sync->timer[index]);
for (int i = index + 1; i < sync->timer_num; ++i)
sync->timer[i - 1] = sync->timer[i];
sync->timer_num--;
sync->timer[sync->timer_num] = NULL;
}
......@@ -26,100 +26,45 @@
* \version 0.1
*/
#include <stdio.h>
#include <time.h>
#ifndef _FLEXRAN_AGENT_TIMER_
#define _FLEXRAN_AGENT_TIMER_
#include "flexran_agent_common.h"
#include "flexran_agent_common_internal.h"
#include "flexran_agent_extern.h"
#include "flexran_agent_defs.h"
# include "tree.h"
# include "intertask_interface.h"
/*******************
* timer primitves
*******************/
#define TIMER_NULL -1
#define TIMER_TYPE_INVALIDE -2
#define TIMER_SETUP_FAILED -3
#define TIMER_REMOVED_FAILED -4
#define TIMER_ELEMENT_NOT_FOUND -5
typedef enum {
FLEXRAN_AGENT_TIMER_TYPE_ONESHOT,
FLEXRAN_AGENT_TIMER_TYPE_PERIODIC,
} flexran_agent_timer_type_t;
/* Type of the callback executed when the timer expired */
typedef Protocol__FlexranMessage *(*flexran_agent_timer_callback_t)(void*);
typedef struct flexran_agent_timer_args_s{
mid_t mod_id;
Protocol__FlexranMessage *msg;
} flexran_agent_timer_args_t;
typedef struct flexran_agent_timer_element_s{
RB_ENTRY(flexran_agent_timer_element_s) entry;
agent_id_t agent_id;
instance_t instance;
flexran_agent_timer_type_t type;
flexran_agent_timer_state_t state;
typedef Protocol__FlexranMessage *(*flexran_agent_timer_callback_t)(
mid_t mod_id, const Protocol__FlexranMessage *msg);
uint32_t interval_sec;
uint32_t interval_usec;
err_code_t flexran_agent_timer_init(mid_t mod_id);
void flexran_agent_timer_exit(mid_t mod_id);
long timer_id; /* Timer id returned by the timer API*/
xid_t xid; /*The id of the task as received by the controller
message*/
flexran_agent_timer_callback_t cb;
flexran_agent_timer_args_t *timer_args;
} flexran_agent_timer_element_t;
typedef struct flexran_agent_timer_instance_s{
RB_HEAD(flexran_agent_map, flexran_agent_timer_element_s) flexran_agent_head;
}flexran_agent_timer_instance_t;
err_code_t flexran_agent_init_timer(void);
/* Signals next subframe for FlexRAN timers */
void flexran_agent_timer_signal(mid_t mod_id);
/* Create a timer for some agent related event with id xid. */
err_code_t flexran_agent_create_timer(mid_t mod_id,
uint32_t sf,
uint32_t timer_type,
flexran_agent_timer_type_t timer_type,
xid_t xid,
flexran_agent_timer_callback_t cb,
void *timer_args);
Protocol__FlexranMessage *msg);
/* Destroy all existing timers */
err_code_t flexran_agent_destroy_timers(void);
/* Destroy the timer with the given timer_id */
err_code_t flexran_agent_destroy_timer(long timer_id);
err_code_t flexran_agent_destroy_timers(mid_t mod_id);
/* Destroy the timer for task with id xid */
err_code_t flexran_agent_destroy_timer_by_task_id(xid_t xid);
/* Stop a timer */
err_code_t flexran_agent_stop_timer(long timer_id);
/* Restart the given timer */
err_code_t flexran_agent_restart_timer(long *timer_id);
/* Find the timer with the given timer_id */
struct flexran_agent_timer_element_s * get_timer_entry(long timer_id);
/* Obtain the protocol message stored in the given expired timer */
Protocol__FlexranMessage * flexran_agent_process_timeout(long timer_id, void* timer_args);
/* Comparator function comparing two timers. Decides the ordering of the timers */
int flexran_agent_compare_timer(struct flexran_agent_timer_element_s *a, struct flexran_agent_timer_element_s *b);
err_code_t flexran_agent_destroy_timer(mid_t mod_id, xid_t xid);
/* RB_PROTOTYPE is for .h files */
RB_PROTOTYPE(flexran_agent_map, flexran_agent_timer_element_s, entry, flexran_agent_compare_timer);
#endif /* _FLEXRAN_AGENT_TIMER_ */
......@@ -988,6 +988,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if (flexran_agent_get_mac_xface(module_idP) && subframeP == 9) {
flexran_agent_slice_update(module_idP);
}
if (flexran_agent_get_mac_xface(module_idP))
flexran_agent_get_mac_xface(module_idP)->flexran_agent_notify_tick(module_idP);
stop_meas(&(eNB->eNB_scheduler));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, VCD_FUNCTION_OUT);
......
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