removed gtpu mutex

master
Francisco Paisana 5 years ago
parent 73e06a0858
commit 77f63f7bcd

@ -101,7 +101,7 @@ public:
void add_gtpu_m1u_socket_handler(int fd) override;
/* Stack-MAC interface */
void process_pdus();
void process_pdus() override;
private:
static const int STACK_MAIN_THREAD_PRIO = -1; // Use default high-priority below UHD

@ -111,8 +111,6 @@ private:
void echo_response(in_addr_t addr, in_port_t port, uint16_t seq);
pthread_mutex_t mutex;
/****************************************************************************
* TEID to RNIT/LCID helper functions
***************************************************************************/

@ -177,13 +177,10 @@ void enb_stack_lte::stop_impl()
s1ap.stop();
gtpu.stop();
mac.stop();
usleep(50000);
rlc.stop();
pdcp.stop();
rrc.stop();
usleep(10000);
if (args.pcap.enable) {
mac_pcap.close();
}

@ -235,7 +235,6 @@ void rrc::add_user(uint16_t rnti)
/* Function called by MAC after the reception of a C-RNTI CE indicating that the UE still has a
* valid RNTI.
* Called by MAC reader thread (can wait to process)
*/
void rrc::upd_user(uint16_t new_rnti, uint16_t old_rnti)
{

@ -30,10 +30,7 @@
using namespace srslte;
namespace srsenb {
gtpu::gtpu() : m1u(this)
{
pthread_mutex_init(&mutex, nullptr);
}
gtpu::gtpu() : m1u(this) {}
bool gtpu::init(std::string gtp_bind_addr_,
std::string mme_addr_,
@ -166,7 +163,6 @@ void gtpu::add_bearer(uint16_t rnti, uint32_t lcid, uint32_t addr, uint32_t teid
void gtpu::rem_bearer(uint16_t rnti, uint32_t lcid)
{
pthread_mutex_lock(&mutex);
gtpu_log->info("Removing bearer for rnti: 0x%x, lcid: %d\n", rnti, lcid);
rnti_bearers[rnti].teids_in[lcid] = 0;
@ -179,17 +175,14 @@ void gtpu::rem_bearer(uint16_t rnti, uint32_t lcid)
rem = false;
}
}
if(rem) {
if (rem) {
rnti_bearers.erase(rnti);
}
pthread_mutex_unlock(&mutex);
}
void gtpu::rem_user(uint16_t rnti)
{
pthread_mutex_lock(&mutex);
rnti_bearers.erase(rnti);
pthread_mutex_unlock(&mutex);
}
void gtpu::handle_gtpu_s1u_rx_packet(srslte::unique_byte_buffer_t pdu, const sockaddr_in& addr)
@ -211,9 +204,7 @@ void gtpu::handle_gtpu_s1u_rx_packet(srslte::unique_byte_buffer_t pdu, const soc
uint16_t lcid = 0;
teidin_to_rntilcid(header.teid, &rnti, &lcid);
pthread_mutex_lock(&mutex);
bool user_exists = (rnti_bearers.count(rnti) > 0);
pthread_mutex_unlock(&mutex);
if (not user_exists) {
gtpu_log->error("Unrecognized RNTI for DL PDU: 0x%x - dropping packet\n", rnti);

Loading…
Cancel
Save