From a0606669e24b6f3753f18f8d1a08d68e1c886c0c Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 19 Jun 2020 19:54:38 +0100 Subject: [PATCH] fix ue nr gw initialization --- lib/test/common/pnf_bridge.cc | 2 +- srsue/src/stack/mac/mac_nr.cc | 2 +- srsue/src/stack/ue_stack_nr.cc | 17 ++++++----------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/test/common/pnf_bridge.cc b/lib/test/common/pnf_bridge.cc index 428ba2636..bfb6dec1c 100644 --- a/lib/test/common/pnf_bridge.cc +++ b/lib/test/common/pnf_bridge.cc @@ -60,7 +60,7 @@ void parse_args(pnf_args_t* args, int argc, char* argv[]) ("vnf.ue_port", bpo::value(&args->ue_vnf_port)->default_value(3334), "UE VNF port") ("sf_interval", bpo::value(&args->sf_interval)->default_value(1000), "Interval between subframes in us") ("num_sf", bpo::value(&args->num_sf)->default_value(-1), "Number of subframes to signal (-1 infinity)") - ("tb_len", bpo::value(&args->tb_len)->default_value(0), "TB lenth (0 for random size)"); + ("tb_len", bpo::value(&args->tb_len)->default_value(1600), "TB lenth (0 for random size)"); // clang-format on // these options are allowed on the command line diff --git a/srsue/src/stack/mac/mac_nr.cc b/srsue/src/stack/mac/mac_nr.cc index df248b6cd..0311d9dcd 100644 --- a/srsue/src/stack/mac/mac_nr.cc +++ b/srsue/src/stack/mac/mac_nr.cc @@ -145,7 +145,7 @@ void mac_nr::tb_decoded(const uint32_t cc_idx, mac_nr_grant_dl_t& grant) } } - stack->defer_task([this]() { process_pdus(); }); + stack_task_dispatch_queue.push([this]() { process_pdus(); }); } } diff --git a/srsue/src/stack/ue_stack_nr.cc b/srsue/src/stack/ue_stack_nr.cc index 9efab2111..422ea7e95 100644 --- a/srsue/src/stack/ue_stack_nr.cc +++ b/srsue/src/stack/ue_stack_nr.cc @@ -30,7 +30,7 @@ ue_stack_nr::ue_stack_nr(srslte::logger* logger_) : logger(logger_), timers(64), thread("STACK"), - pending_tasks(1024), + pending_tasks(64), background_tasks(2), rlc_log("RLC"), pdcp_log("PDCP"), @@ -100,16 +100,6 @@ int ue_stack_nr::init(const stack_args_t& args_) rrc_args.coreless.ip_addr = "192.168.1.3"; rrc->init(phy, mac.get(), rlc.get(), pdcp.get(), gw, &timers, this, rrc_args); - // statically setup TUN (will be done through RRC later) - char* err_str = nullptr; - if (gw->setup_if_addr(rrc_args.coreless.drb_lcid, - LIBLTE_MME_PDN_TYPE_IPV4, - htonl(inet_addr(rrc_args.coreless.ip_addr.c_str())), - nullptr, - err_str)) { - printf("Error configuring TUN interface\n"); - } - running = true; start(STACK_MAIN_THREAD_PRIO); @@ -141,6 +131,11 @@ void ue_stack_nr::stop_impl() bool ue_stack_nr::switch_on() { + // statically setup TUN (will be done through RRC later) + char* err_str = nullptr; + if (gw->setup_if_addr(4, LIBLTE_MME_PDN_TYPE_IPV4, htonl(inet_addr("192.168.1.3")), nullptr, err_str)) { + printf("Error configuring TUN interface\n"); + } return true; }