Commit 139576b9 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'tentative_fix_smf_upf' into 'develop'

Tentative fix for heartbeat issue for CI/CD

See merge request oai/cn5g/oai-cn5g-smf!107
parents 3335e710 10639778
...@@ -239,7 +239,7 @@ smf_n4::smf_n4() ...@@ -239,7 +239,7 @@ smf_n4::smf_n4()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void smf_n4::handle_receive_pfcp_msg( void smf_n4::handle_receive_pfcp_msg(
pfcp_msg& msg, const endpoint& remote_endpoint) { pfcp_msg& msg, const endpoint& remote_endpoint) {
Logger::smf_n4().trace( Logger::smf_n4().debug(
"handle_receive_pfcp_msg msg type %d length %d", msg.get_message_type(), "handle_receive_pfcp_msg msg type %d length %d", msg.get_message_type(),
msg.get_message_length()); msg.get_message_length());
switch (msg.get_message_type()) { switch (msg.get_message_type()) {
...@@ -346,6 +346,8 @@ void smf_n4::handle_receive_association_setup_request( ...@@ -346,6 +346,8 @@ void smf_n4::handle_receive_association_setup_request(
bool error = true; bool error = true;
uint64_t trxn_id = 0; uint64_t trxn_id = 0;
pfcp_association_setup_request msg_ies_container = {}; pfcp_association_setup_request msg_ies_container = {};
Logger::smf_n4().debug("Received N4 ASSOCIATION SETUP REQUEST");
msg.to_core_type(msg_ies_container); msg.to_core_type(msg_ies_container);
handle_receive_message_cb(msg, remote_endpoint, TASK_SMF_N4, error, trxn_id); handle_receive_message_cb(msg, remote_endpoint, TASK_SMF_N4, error, trxn_id);
...@@ -353,8 +355,8 @@ void smf_n4::handle_receive_association_setup_request( ...@@ -353,8 +355,8 @@ void smf_n4::handle_receive_association_setup_request(
if (not msg_ies_container.node_id.first) { if (not msg_ies_container.node_id.first) {
// Should be detected by lower layers // Should be detected by lower layers
Logger::smf_n4().warn( Logger::smf_n4().warn(
"Received N4 ASSOCIATION SETUP REQUEST without node id IE!, ignore " "Received N4 ASSOCIATION SETUP REQUEST without node id IE, ignore "
"message"); "message!");
return; return;
} }
if (not msg_ies_container.recovery_time_stamp.first) { if (not msg_ies_container.recovery_time_stamp.first) {
...@@ -395,12 +397,13 @@ void smf_n4::handle_receive_association_setup_request( ...@@ -395,12 +397,13 @@ void smf_n4::handle_receive_association_setup_request(
(uint32_t) recovery_time_stamp}; (uint32_t) recovery_time_stamp};
a.pfcp_ies.set(r); a.pfcp_ies.set(r);
a.pfcp_ies.set(cp_function_features); a.pfcp_ies.set(cp_function_features);
if (node_id.node_id_type == pfcp::NODE_ID_TYPE_IPV4_ADDRESS) { if ((node_id.node_id_type != pfcp::NODE_ID_TYPE_IPV6_ADDRESS) and
(node_id.node_id_type != pfcp::NODE_ID_TYPE_UNKNOWN)) {
a.r_endpoint = remote_endpoint; a.r_endpoint = remote_endpoint;
send_n4_msg(a); send_n4_msg(a);
} else { } else {
Logger::smf_n4().warn( Logger::smf_n4().warn(
"Received N4 ASSOCIATION SETUP REQUEST node_id IPV6, FQDN!, " "Received N4 ASSOCIATION SETUP REQUEST node_id IPV6!"
"ignore message"); "ignore message");
return; return;
} }
...@@ -732,7 +735,8 @@ void smf_n4::send_heartbeat_request(std::shared_ptr<pfcp_association>& a) { ...@@ -732,7 +735,8 @@ void smf_n4::send_heartbeat_request(std::shared_ptr<pfcp_association>& a) {
h.set(r); h.set(r);
pfcp::node_id_t& node_id = a->node_id; pfcp::node_id_t& node_id = a->node_id;
if (node_id.node_id_type == pfcp::NODE_ID_TYPE_IPV4_ADDRESS) { if ((node_id.node_id_type == pfcp::NODE_ID_TYPE_IPV4_ADDRESS) or
(node_id.node_id_type == pfcp::NODE_ID_TYPE_FQDN)) {
a->timer_heartbeat = itti_inst->timer_setup( a->timer_heartbeat = itti_inst->timer_setup(
5, 0, TASK_SMF_N4, TASK_SMF_N4_TIMEOUT_HEARTBEAT_REQUEST, 5, 0, TASK_SMF_N4, TASK_SMF_N4_TIMEOUT_HEARTBEAT_REQUEST,
a->hash_node_id); a->hash_node_id);
...@@ -742,7 +746,7 @@ void smf_n4::send_heartbeat_request(std::shared_ptr<pfcp_association>& a) { ...@@ -742,7 +746,7 @@ void smf_n4::send_heartbeat_request(std::shared_ptr<pfcp_association>& a) {
send_request(r_endpoint, h, TASK_SMF_N4, a->trxn_id_heartbeat); send_request(r_endpoint, h, TASK_SMF_N4, a->trxn_id_heartbeat);
} else { } else {
Logger::smf_n4().warn("TODO send_heartbeat_request() node_id IPV6, FQDN!"); Logger::smf_n4().warn("TODO send_heartbeat_request() node_id IPV6!");
} }
} }
......
...@@ -94,6 +94,7 @@ bool pfcp_associations::add_association( ...@@ -94,6 +94,7 @@ bool pfcp_associations::add_association(
} }
sa->recovery_time_stamp = recovery_time_stamp; sa->recovery_time_stamp = recovery_time_stamp;
sa->function_features = {}; sa->function_features = {};
trigger_heartbeat_request_procedure(sa);
} else { } else {
// Resolve FQDN to get UPF IP address if necessary // Resolve FQDN to get UPF IP address if necessary
if (node_id.node_id_type == pfcp::NODE_ID_TYPE_FQDN) { if (node_id.node_id_type == pfcp::NODE_ID_TYPE_FQDN) {
...@@ -162,6 +163,7 @@ bool pfcp_associations::add_association( ...@@ -162,6 +163,7 @@ bool pfcp_associations::add_association(
sa->recovery_time_stamp = recovery_time_stamp; sa->recovery_time_stamp = recovery_time_stamp;
sa->function_features.first = true; sa->function_features.first = true;
sa->function_features.second = function_features; sa->function_features.second = function_features;
trigger_heartbeat_request_procedure(sa);
} else { } else {
if (node_id.node_id_type == pfcp::NODE_ID_TYPE_FQDN) { if (node_id.node_id_type == pfcp::NODE_ID_TYPE_FQDN) {
Logger::smf_app().info("Node ID Type FQDN: %s", node_id.fqdn.c_str()); Logger::smf_app().info("Node ID Type FQDN: %s", node_id.fqdn.c_str());
...@@ -233,6 +235,7 @@ bool pfcp_associations::add_association( ...@@ -233,6 +235,7 @@ bool pfcp_associations::add_association(
sa->recovery_time_stamp = recovery_time_stamp; sa->recovery_time_stamp = recovery_time_stamp;
sa->function_features.first = true; sa->function_features.first = true;
sa->function_features.second = function_features; sa->function_features.second = function_features;
trigger_heartbeat_request_procedure(sa);
} else { } else {
restore_n4_sessions = false; restore_n4_sessions = false;
sa = std::make_shared<pfcp_association>( sa = std::make_shared<pfcp_association>(
......
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