adding mbsfn conditional to gtpu to create mch thread only if mbsfn is enabled

master
yagoda 7 years ago
parent 16b2172e36
commit cca8362a69

@ -71,7 +71,7 @@ class gtpu
{ {
public: public:
bool init(std::string gtp_bind_addr_, std::string mme_addr_, pdcp_interface_gtpu *pdcp_, srslte::log *gtpu_log_); bool init(std::string gtp_bind_addr_, std::string mme_addr_, pdcp_interface_gtpu *pdcp_, srslte::log *gtpu_log_, bool enable_mbsfn = false);
void stop(); void stop();
// gtpu_interface_rrc // gtpu_interface_rrc
@ -92,7 +92,7 @@ private:
bool mch_running; bool mch_running;
bool mch_run_enable; bool mch_run_enable;
bool _enable_mbsfn;
std::string gtp_bind_addr; std::string gtp_bind_addr;
std::string mme_addr; std::string mme_addr;
srsenb::pdcp_interface_gtpu *pdcp; srsenb::pdcp_interface_gtpu *pdcp;

@ -219,7 +219,7 @@ bool enb::init(all_args_t *args_)
pdcp.init(&rlc, &rrc, &gtpu, &pdcp_log); pdcp.init(&rlc, &rrc, &gtpu, &pdcp_log);
rrc.init(&rrc_cfg, &phy, &mac, &rlc, &pdcp, &s1ap, &gtpu, &rrc_log); rrc.init(&rrc_cfg, &phy, &mac, &rlc, &pdcp, &s1ap, &gtpu, &rrc_log);
s1ap.init(args->enb.s1ap, &rrc, &s1ap_log); s1ap.init(args->enb.s1ap, &rrc, &s1ap_log);
gtpu.init(args->enb.s1ap.gtp_bind_addr, args->enb.s1ap.mme_addr, &pdcp, &gtpu_log); gtpu.init(args->enb.s1ap.gtp_bind_addr, args->enb.s1ap.mme_addr, &pdcp, &gtpu_log, args->expert.enable_mbsfn);
started = true; started = true;
return true; return true;

@ -34,7 +34,7 @@ using namespace srslte;
namespace srsenb { namespace srsenb {
bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, srsenb::pdcp_interface_gtpu* pdcp_, srslte::log* gtpu_log_) bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, srsenb::pdcp_interface_gtpu* pdcp_, srslte::log* gtpu_log_, bool enable_mbsfn)
{ {
pdcp = pdcp_; pdcp = pdcp_;
gtpu_log = gtpu_log_; gtpu_log = gtpu_log_;
@ -95,11 +95,13 @@ bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, srsenb::pdcp_
//Setup M1-u //Setup M1-u
init_m1u(gtpu_log_); init_m1u(gtpu_log_);
mch_lcid_counter = 1; _enable_mbsfn = enable_mbsfn;
// Setup a thread to receive packets from the src socket // Setup a thread to receive packets from the src socket
start(THREAD_PRIO); start(THREAD_PRIO);
if(_enable_mbsfn){
mch_lcid_counter = 1;
pthread_create(&mch_thread ,NULL ,mch_thread_routine , this); pthread_create(&mch_thread ,NULL ,mch_thread_routine , this);
}
return true; return true;
} }
@ -224,8 +226,9 @@ void gtpu::stop()
} }
} }
wait_thread_finish(); wait_thread_finish();
if(_enable_mbsfn) {
pthread_join(mch_thread, NULL); pthread_join(mch_thread, NULL);
}
} }
if (snk_fd) { if (snk_fd) {

Loading…
Cancel
Save