From 5ae7d6685aefff897eec8c98a4e7af9241c7e902 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 23 Apr 2024 08:57:12 +0200 Subject: [PATCH] Aerial: use threadCreate() to create P7 thread Use common threadCreate() function to create P7 thread with high(er) priority. Remove old calls to set_priority(), as this is already done with threadCreate(). --- nfapi/oai_integration/aerial/fapi_vnf_p5.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nfapi/oai_integration/aerial/fapi_vnf_p5.c b/nfapi/oai_integration/aerial/fapi_vnf_p5.c index e3af58537f..472487ae2f 100644 --- a/nfapi/oai_integration/aerial/fapi_vnf_p5.c +++ b/nfapi/oai_integration/aerial/fapi_vnf_p5.c @@ -54,7 +54,6 @@ void *aerial_vnf_nr_aerial_p7_start_thread(void *ptr) void *aerial_vnf_nr_p7_thread_start(void *ptr) { - // set_thread_priority(79); int s; cpu_set_t cpuset; @@ -63,8 +62,6 @@ void *aerial_vnf_nr_p7_thread_start(void *ptr) if (s != 0) printf("failed to set afinity\n"); - set_priority(79); - pthread_attr_t ptAttr; if (pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0) { printf("Failed to set pthread sched policy SCHED_RR\n"); @@ -115,7 +112,7 @@ void *aerial_vnf_nr_p7_thread_start(void *ptr) p7_vnf->config->allocate_p7_vendor_ext = &aerial_phy_allocate_p7_vendor_ext; p7_vnf->config->deallocate_p7_vendor_ext = &aerial_phy_deallocate_p7_vendor_ext; NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI P7 start thread %s\n", __FUNCTION__); - pthread_create(&vnf_aerial_p7_start_pthread, NULL, &aerial_vnf_nr_aerial_p7_start_thread, p7_vnf->config); + threadCreate(&vnf_aerial_p7_start_pthread, &aerial_vnf_nr_aerial_p7_start_thread, p7_vnf->config, "aerial_p7_start", -1, OAI_PRIORITY_RT); return 0; } @@ -227,7 +224,7 @@ int aerial_pnf_nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr if (p7_vnf->thread_started == 0) { pthread_t vnf_p7_thread; - pthread_create(&vnf_p7_thread, NULL, &aerial_vnf_nr_p7_thread_start, p7_vnf); + threadCreate(&vnf_p7_thread, &aerial_vnf_nr_p7_thread_start, p7_vnf, "aerial_p7_thread", -1, OAI_PRIORITY_RT); p7_vnf->thread_started = 1; } else { // P7 thread already running. @@ -570,7 +567,7 @@ void aerial_configure_nr_fapi_vnf() if (p7_vnf->thread_started == 0) { pthread_t vnf_p7_thread; - pthread_create(&vnf_p7_thread, NULL, &aerial_vnf_nr_p7_thread_start, p7_vnf); + threadCreate(&vnf_p7_thread, &aerial_vnf_nr_p7_thread_start, p7_vnf, "aerial_p7_thread", -1, OAI_PRIORITY_RT); p7_vnf->thread_started = 1; } else { // P7 thread already running.