Merge remote-tracking branch 'origin/fapi-stop-exchange' into integration_2025_w48 (!3561)

Implementation of STOP exchange

This implements the STOP.request/indication for all 3 transport mechanisms, the
VNF will send the STOP.request to the PNF, indicating it will disconnect, and
await a STOP.indication from the PNF

The WLS VNF is reworked to be able to start before the PNF, by calling call
rte_eal_init and rte_dev_probe to determine if dpdk has been initialized
properly, before calling rte_eal_init in the intended process when it is
appropriate to do so
This commit is contained in:
Jaroslava Fiedlerova
2025-11-27 15:01:39 +01:00
29 changed files with 525 additions and 136 deletions
+8
View File
@@ -1254,6 +1254,10 @@ uint8_t pack_nr_p5_message_body(nfapi_nr_p4_p5_message_header_t *header,
result = pack_stop_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION:
result = pack_nr_stop_indication(header, ppWritePackedMsg, end, config);
break;
case NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE:
result = pack_stop_response(header, ppWritePackedMsg, end, config);
break;
@@ -2447,6 +2451,10 @@ bool nfapi_nr_p5_message_unpack(void *pMessageBuf,
result = unpack_stop_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION:
result = unpack_nr_stop_indication(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE:
result = unpack_stop_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
@@ -497,6 +497,14 @@ int nfapi_nr_pnf_start_resp(nfapi_pnf_config_t* config, nfapi_nr_start_response_
*/
int nfapi_pnf_stop_resp(nfapi_pnf_config_t* config, nfapi_stop_response_t* resp);
/*! Send the STOP.indication
* \param config A pointer to a pnf configuration
* \param resp A pointer to the message structure
* \return 0 for success, -1 for failure
*
*/
int nfapi_nr_stop_indication(nfapi_pnf_config_t* config, nfapi_nr_stop_indication_scf_t* resp);
/*! Send the MEASUREMENT.response
* \param config A pointer to a pnf configuraiton
* \param resp A pointer to the message structure
+12
View File
@@ -387,6 +387,18 @@ int nfapi_pnf_stop_resp(nfapi_pnf_config_t* config, nfapi_stop_response_t* resp)
return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_stop_response_t));
}
int nfapi_nr_stop_indication(nfapi_pnf_config_t* config, nfapi_nr_stop_indication_scf_t* resp)
{
if (config == NULL || resp == NULL) {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
return -1;
}
pnf_t* _this = (pnf_t*)(config);
AssertFatal(config->send_p5_msg, "Function pointer must be configured|");
return config->send_p5_msg(_this, &(resp->header), sizeof(nfapi_nr_stop_indication_scf_t));
}
int nfapi_pnf_measurement_resp(nfapi_pnf_config_t* config, nfapi_measurement_response_t* resp)
{
if (config == NULL || resp == NULL)
@@ -210,6 +210,24 @@ typedef struct nfapi_vnf_config
int (*pnf_start_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_start_response_t* resp);
int (*pnf_nr_start_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_pnf_start_response_t* resp);
/*! A callback for the STOP.indication
* \param config A pointer to the vnf configuration
* \param p5_idx The p5 index used to indicate a particular pnf p5 connection
* \param ind A data structure for the decoded STOP.indication This will
* have been allocated on the stack.
* \return not currently used.
*
* The STOP.indication contains the result of the STOP.request
*
*
* ind may contain pointers to dynamically allocated sub structures
* such as the vendor_extention. The dynamically allocated structure will
* be deallocated on return. If the client wishes to 'keep' the structures
* then the substructure pointers should be set to 0 and then the client should
* use the codec_config.deallocate function to release it at a future point
*/
int (*nr_stop_ind)(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_stop_indication_scf_t* ind);
/*! A callback for the PNF_STOP.resp
* \param config A pointer to the vnf configuration
* \param p5_idx The p5 index used to indicate a particular pnf p5 connection
@@ -640,6 +658,7 @@ int nfapi_nr_vnf_start_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_star
* \return 0 means success, -1 failure
*/
int nfapi_vnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_stop_request_t* req);
int nfapi_nr_vnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_stop_request_scf_t* req);
/*! Send the MEASUREMENT.request
* \param config A pointer to a vnf config
+28
View File
@@ -665,6 +665,30 @@ void vnf_nr_handle_error_indication(void *pRecvMsg, int recvMsgLen, nfapi_vnf_co
}
}
void vnf_nr_handle_stop_indication(void* pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
{
// ensure it's valid
if (pRecvMsg == NULL || config == NULL) {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
} else {
NFAPI_TRACE(NFAPI_TRACE_INFO, "Received STOP.indication\n");
nfapi_nr_stop_indication_scf_t msg;
// unpack the message
if (config->unpack_func(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config)) {
if (config->nr_stop_ind) {
(config->nr_stop_ind)(config, p5_idx, &msg);
}
} else {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
// make sure to release any dynamic part of the message
if (msg.vendor_extension)
config->codec_config.deallocate(msg.vendor_extension);
}
}
void vnf_handle_stop_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
{
@@ -1172,6 +1196,10 @@ void vnf_nr_handle_p4_p5_message(void *pRecvMsg, int recvMsgLen, int p5_idx, nfa
vnf_handle_stop_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION:
vnf_nr_handle_stop_indication(pRecvMsg, recvMsgLen, config, p5_idx);
break;
default:
{
if(messageHeader.message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
+12
View File
@@ -665,6 +665,18 @@ int nfapi_vnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_stop_reques
return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_stop_request_t));
}
int nfapi_nr_vnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_stop_request_scf_t* req)
{
if (config == 0 || req == 0)
return -1;
vnf_t* _this = (vnf_t*)(config);
AssertFatal(config->send_p5_msg, "Function pointer must be configured\n");
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Sending NFAPI STOP.request\n");
return config->send_p5_msg(_this, p5_idx, &req->header, sizeof(nfapi_nr_stop_request_scf_t));
}
int nfapi_vnf_measurement_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_measurement_request_t* req)
{
if(config == 0 || req == 0)