Commit 047abd75 authored by gauthier's avatar gauthier
Browse files

Clean SPGWU hashtables on Sx delete session request

parent a69056a0
......@@ -443,6 +443,12 @@ void pfcp_switch::add_pfcp_ul_pdr_by_up_teid(const teid_t teid, std::shared_ptr<
}
}
}
//------------------------------------------------------------------------------
void pfcp_switch::remove_pfcp_ul_pdrs_by_up_teid(const teid_t teid)
{
ul_s1u_teid2pfcp_pdr.erase(teid);
}
//------------------------------------------------------------------------------
void pfcp_switch::add_pfcp_dl_pdr_by_ue_ip(const uint32_t ue_ip, std::shared_ptr<pfcp::pfcp_pdr>& pdr)
{
......@@ -466,6 +472,11 @@ void pfcp_switch::add_pfcp_dl_pdr_by_ue_ip(const uint32_t ue_ip, std::shared_ptr
}
}
//------------------------------------------------------------------------------
void pfcp_switch::remove_pfcp_dl_pdrs_by_ue_ip(const uint32_t ue_ip)
{
ue_ipv4_hbo2pfcp_pdr.erase(ue_ip);
}
//------------------------------------------------------------------------------
std::string pfcp_switch::to_string() const
{
std::string s = {};
......@@ -789,16 +800,24 @@ void pfcp_switch::pfcp_session_look_up_pack_in_core(const char *buffer, const st
pfcp::far_id_t far_id = {};
if ((*it)->get(far_id)) {
std::shared_ptr<pfcp::pfcp_far> sfar = {};
//Logger::pfcp_switch().trace( "pfcp_session_look_up_pack_in_core %d bytes, far id %08X", num_bytes, far_id);
#if TRACE_IS_ON
Logger::pfcp_switch().trace( "pfcp_session_look_up_pack_in_core %d bytes, far id %08X", num_bytes, far_id);
#endif
if (ssession->get(far_id.far_id, sfar)) {
//Logger::pfcp_switch().trace( "pfcp_session_look_up_pack_in_core %d bytes, got far, far id %08X", num_bytes, far_id);
#if TRACE_IS_ON
Logger::pfcp_switch().trace( "pfcp_session_look_up_pack_in_core %d bytes, got far, far id %08X", num_bytes, far_id);
#endif
sfar->apply_forwarding_rules(iph, num_bytes, nocp, buff);
if (buff) {
//Logger::pfcp_switch().trace( "Buffering %d bytes, far id %08X", num_bytes, far_id);
#if TRACE_IS_ON
Logger::pfcp_switch().trace( "Buffering %d bytes, far id %08X", num_bytes, far_id);
#endif
(*it)->buffering_requested(buffer, num_bytes);
}
if (nocp) {
//Logger::pfcp_switch().trace( "Notify CP %d bytes, far id %08X", num_bytes, far_id);
#if TRACE_IS_ON
Logger::pfcp_switch().trace( "Notify CP %d bytes, far id %08X", num_bytes, far_id);
#endif
(*it)->notify_cp_requested(ssession);
}
}
......
......@@ -102,7 +102,7 @@ private:
//switching_data_per_cpu_socket switching_data[];
struct iovec msg_iov_; /* scatter/gather array */
std::unordered_map<pfcp::fseid_t, std::shared_ptr<pfcp::pfcp_session>> cp_fseid2pfcp_sessions;
std::unordered_map<pfcp::fseid_t, std::shared_ptr<pfcp::pfcp_session>> cp_fseid2pfcp_sessions;
folly::AtomicHashMap<uint64_t, std::shared_ptr<pfcp::pfcp_session>> up_seid2pfcp_sessions;
folly::AtomicHashMap<teid_t, std::shared_ptr<std::vector<std::shared_ptr<pfcp::pfcp_pdr>>>> ul_s1u_teid2pfcp_pdr;
folly::AtomicHashMap<uint32_t, std::shared_ptr<std::vector<std::shared_ptr<pfcp::pfcp_pdr>>>> ue_ipv4_hbo2pfcp_pdr;
......@@ -170,8 +170,8 @@ public:
void time_out_max_commit_interval(const uint32_t timer_id);
void remove_pfcp_session(const pfcp::fseid_t& cp_fseid);
void remove_pfcp_ul_pdrs_by_up_teid(const teid_t) {};
void remove_pfcp_dl_pdrs_by_ue_ip(const uint32_t) {};
void remove_pfcp_ul_pdrs_by_up_teid(const teid_t);
void remove_pfcp_dl_pdrs_by_ue_ip(const uint32_t);
std::string to_string() const;
};
......
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