Remove unused mutex in the SPGW.

master
Pedro Alvarez 6 years ago committed by Andre Puschmann
parent 3933b269d7
commit 9463b95dc1

@ -95,9 +95,6 @@ private:
srslte::byte_buffer_pool* m_pool;
mme_gtpc* m_mme_gtpc;
// data-plane/control-plane mutex
pthread_mutex_t m_mutex;
// GTP-C and GTP-U handlers
gtpc* m_gtpc;
gtpu* m_gtpu;

@ -228,13 +228,11 @@ void spgw::gtpu::handle_sgi_pdu(srslte::byte_buffer_t *msg)
m_gtpu_log->debug("SGi PDU -- IP dst addr %s\n", gtpu_ntoa(iph->daddr).c_str());
// Find user and control tunnel
pthread_mutex_lock(&m_spgw->m_mutex);
gtpu_fteid_it = m_ip_to_usr_teid.find(iph->daddr);
if (gtpu_fteid_it != m_ip_to_usr_teid.end()) {
usr_found = true;
enb_fteid = gtpu_fteid_it->second;
}
pthread_mutex_unlock(&m_spgw->m_mutex);
if (usr_found == false) {
m_gtpu_log->debug("Packet for unknown UE. Discarding packet.\n");
@ -305,22 +303,17 @@ bool spgw::gtpu::modify_gtpu_tunnel(in_addr_t ue_ipv4, srslte::gtpc_f_teid_ie dw
m_gtpu_log->info("UE IP %s\n", gtpu_ntoa(ue_ipv4).c_str());
m_gtpu_log->info("Downlink eNB addr %s, U-TEID 0x%x\n", gtpu_ntoa(dw_user_fteid.ipv4).c_str(), dw_user_fteid.teid);
m_gtpu_log->info("Uplink C-TEID: 0x%x\n", up_ctrl_teid);
pthread_mutex_lock(&m_spgw->m_mutex);
m_ip_to_usr_teid[ue_ipv4] = dw_user_fteid;
pthread_mutex_unlock(&m_spgw->m_mutex);
return true;
}
bool spgw::gtpu::delete_gtpu_tunnel(in_addr_t ue_ipv4)
{
// Remove GTP-U connections, if any.
pthread_mutex_lock(&m_spgw->m_mutex);
if (m_ip_to_usr_teid.count(ue_ipv4)) {
m_ip_to_usr_teid.erase(ue_ipv4);
pthread_mutex_unlock(&m_spgw->m_mutex);
} else {
m_gtpu_log->error("Could not find GTP-U Tunnel to delete.\n");
pthread_mutex_unlock(&m_spgw->m_mutex);
return false;
}
return true;

@ -94,8 +94,6 @@ int spgw::init(spgw_args_t* args,
return -1;
}
// Init mutex
pthread_mutex_init(&m_mutex, NULL);
m_spgw_log->info("SP-GW Initialized.\n");
m_spgw_log->console("SP-GW Initialized.\n");
return 0;

Loading…
Cancel
Save