Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG-RAN
Commits
4b8f62b0
Commit
4b8f62b0
authored
Sep 23, 2021
by
Melissa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added slot_ind queue and handling slot_inds in VNF
parent
30065ef0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
32 deletions
+51
-32
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+16
-8
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
+2
-1
nfapi/open-nFAPI/vnf/src/vnf_p7.c
nfapi/open-nFAPI/vnf/src/vnf_p7.c
+11
-15
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
+22
-8
No files found.
nfapi/oai_integration/nfapi_vnf.c
View file @
4b8f62b0
...
...
@@ -176,6 +176,7 @@ queue_t gnb_rach_ind_queue;
queue_t
gnb_rx_ind_queue
;
queue_t
gnb_crc_ind_queue
;
queue_t
gnb_uci_ind_queue
;
queue_t
gnb_slot_ind_queue
;
int
vnf_pack_vendor_extension_tlv
(
void
*
ve
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
,
nfapi_p4_p5_codec_config_t
*
codec
)
{
//NFAPI_TRACE(NFAPI_TRACE_INFO, "vnf_pack_vendor_extension_tlv\n");
...
...
@@ -1230,17 +1231,23 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
//NR phy indication
int
phy_nr_slot_indication
(
nfapi_nr_slot_indication_scf_t
*
ind
)
{
uint8_t
vnf_slot_ahead
=
0
;
uint32_t
vnf_sfn_slot
=
sfnslot_add_slot
(
ind
->
sfn
,
ind
->
slot
,
vnf_slot_ahead
);
uint16_t
vnf_sfn
=
NFAPI_SFNSLOT2SFN
(
vnf_sfn_slot
);
uint8_t
vnf_slot
=
NFAPI_SFNSLOT2SLOT
(
vnf_sfn_slot
);
//offsetting the vnf from pnf by vnf_slot_head slots
struct
PHY_VARS_gNB_s
*
gNB
=
RC
.
gNB
[
0
];
pthread_mutex_lock
(
&
gNB
->
UL_INFO_mutex
);
gNB
->
UL_INFO
.
frame
=
vnf_sfn
;
gNB
->
UL_INFO
.
slot
=
vnf_slot
;
pthread_mutex_unlock
(
&
gNB
->
UL_INFO_mutex
);
LOG_D
(
MAC
,
"VNF SFN/Slot %d.%d
\n
"
,
gNB
->
UL_INFO
.
frame
,
gNB
->
UL_INFO
.
slot
);
uint8_t
vnf_slot
=
NFAPI_SFNSLOT2SLOT
(
vnf_sfn_slot
);
LOG_D
(
MAC
,
"VNF SFN/Slot %d.%d
\n
"
,
vnf_sfn
,
vnf_slot
);
nfapi_nr_slot_indication_scf_t
*
nr_slot_ind
=
CALLOC
(
1
,
sizeof
(
*
nr_slot_ind
));
nr_slot_ind
->
header
=
ind
->
header
;
nr_slot_ind
->
sfn
=
vnf_sfn
;
nr_slot_ind
->
slot
=
vnf_slot
;
if
(
!
put_queue
(
&
gnb_slot_ind_queue
,
nr_slot_ind
))
{
LOG_E
(
NR_MAC
,
"Put_queue failed for slot_ind
\n
"
);
free
(
nr_slot_ind
);
nr_slot_ind
=
NULL
;
}
return
1
;
}
...
...
@@ -1424,6 +1431,7 @@ void *vnf_nr_p7_thread_start(void *ptr) {
init_queue
(
&
gnb_rx_ind_queue
);
init_queue
(
&
gnb_crc_ind_queue
);
init_queue
(
&
gnb_uci_ind_queue
);
init_queue
(
&
gnb_slot_ind_queue
);
vnf_p7_info
*
p7_vnf
=
(
vnf_p7_info
*
)
ptr
;
p7_vnf
->
config
->
port
=
p7_vnf
->
local_port
;
...
...
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
View file @
4b8f62b0
...
...
@@ -20,6 +20,7 @@
#include "nfapi_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "nfapi_nr_interface.h"
#include "openair2/PHY_INTERFACE/queue.h"
#include "debug.h"
...
...
@@ -900,7 +901,7 @@ void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config);
* This function is blocking and will not return until the nfapi_vnf_p7_stop
* function is called.
*/
extern
queue_t
gnb_slot_ind_queue
;
int
nfapi_vnf_p7_start
(
nfapi_vnf_p7_config_t
*
config
);
int
nfapi_nr_vnf_p7_start
(
nfapi_vnf_p7_config_t
*
config
);
...
...
nfapi/open-nFAPI/vnf/src/vnf_p7.c
View file @
4b8f62b0
...
...
@@ -2508,26 +2508,22 @@ int vnf_nr_p7_read_dispatch_message(vnf_p7_t* vnf_p7)
}
// read the segment
recvfrom_result
=
recvfrom
(
vnf_p7
->
socket
,
vnf_p7
->
rx_message_buffer
,
header
.
message_length
,
MSG_WAITALL
,
(
struct
sockaddr
*
)
&
remote_addr
,
&
remote_addr_size
);
recvfrom_result
=
recvfrom
(
vnf_p7
->
socket
,
vnf_p7
->
rx_message_buffer
,
header
.
message_length
,
MSG_WAITALL
|
MSG_TRUNC
,
(
struct
sockaddr
*
)
&
remote_addr
,
&
remote_addr_size
);
NFAPI_TRACE
(
NFAPI_TRACE_DEBUG
,
"recvfrom_result = %d from %s():%d
\n
"
,
recvfrom_result
,
__FUNCTION__
,
__LINE__
);
// todo : how to handle incomplete readfroms, need some sort of buffer/select
if
(
recvfrom_result
==
0
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"recvfrom returned 0
\n
"
);
}
else
if
(
recvfrom_result
!=
header
.
message_length
)
{
NFAPI_TRACE
(
NFAPI_TRACE_NOTE
,
"did not receive the entire message %d %d
\n
"
,
recvfrom_result
,
header
.
message_length
);
recvfrom_result
+=
recvfrom
(
vnf_p7
->
socket
,
&
vnf_p7
->
rx_message_buffer
[
recvfrom_result
],
header
.
message_length
-
recvfrom_result
,
MSG_WAITALL
,
(
struct
sockaddr
*
)
&
remote_addr
,
&
remote_addr_size
);
}
if
(
recvfrom_result
>
0
)
if
(
recvfrom_result
>
0
)
{
if
(
recvfrom_result
!=
header
.
message_length
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"(%d) Received unexpected number of bytes. %d != %d"
,
__LINE__
,
recvfrom_result
,
header
.
message_length
);
break
;
}
NFAPI_TRACE
(
NFAPI_TRACE_DEBUG
,
"Calling vnf_nr_handle_p7_message from %d
\n
"
,
__LINE__
);
vnf_nr_handle_p7_message
(
vnf_p7
->
rx_message_buffer
,
recvfrom_result
,
vnf_p7
);
return
0
;
}
else
{
...
...
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
View file @
4b8f62b0
...
...
@@ -168,20 +168,34 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
// Add the p7 socket
FD_SET
(
vnf_p7
->
socket
,
&
rfds
);
maxSock
=
vnf_p7
->
socket
;
struct
timespec
curr_time
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
curr_time
);
setup_time
=
curr_time
.
tv_sec
-
ref_time
.
tv_sec
;
if
(
setup_time
>
3
&&
prev_slot
!=
gNB
->
UL_INFO
.
slot
){
//Give the VNF sufficient time to setup before starting scheduling
//Call the scheduler
nfapi_nr_slot_indication_scf_t
*
slot_ind
=
get_queue
(
&
gnb_slot_ind_queue
);
NFAPI_TRACE
(
NFAPI_TRACE_DEBUG
,
"This is the slot_ind queue size %ld in %s():%d
\n
"
,
gnb_slot_ind_queue
.
num_items
,
__FUNCTION__
,
__LINE__
);
if
(
slot_ind
)
{
pthread_mutex_lock
(
&
gNB
->
UL_INFO_mutex
);
gNB
->
UL_INFO
.
module_id
=
gNB
->
Mod_id
;
gNB
->
UL_INFO
.
CC_id
=
gNB
->
CC_id
;
gNB
->
if_inst
->
NR_UL_indication
(
&
gNB
->
UL_INFO
);
gNB
->
UL_INFO
.
frame
=
slot_ind
->
sfn
;
gNB
->
UL_INFO
.
slot
=
slot_ind
->
slot
;
NFAPI_TRACE
(
NFAPI_TRACE_DEBUG
,
"gNB->UL_INFO.frame = %d and slot %d, prev_slot = %d, setup_time = %d
\n
"
,
gNB
->
UL_INFO
.
frame
,
gNB
->
UL_INFO
.
slot
,
prev_slot
,
setup_time
);
if
(
setup_time
>
3
&&
prev_slot
!=
gNB
->
UL_INFO
.
slot
)
{
//Give the VNF sufficient time to setup before starting scheduling && prev_slot != gNB->UL_INFO.slot
//Call the scheduler
gNB
->
UL_INFO
.
module_id
=
gNB
->
Mod_id
;
gNB
->
UL_INFO
.
CC_id
=
gNB
->
CC_id
;
NFAPI_TRACE
(
NFAPI_TRACE_DEBUG
,
"Calling NR_UL_indication for gNB->UL_INFO.frame = %d and slot %d
\n
"
,
gNB
->
UL_INFO
.
frame
,
gNB
->
UL_INFO
.
slot
);
gNB
->
if_inst
->
NR_UL_indication
(
&
gNB
->
UL_INFO
);
prev_slot
=
gNB
->
UL_INFO
.
slot
;
}
pthread_mutex_unlock
(
&
gNB
->
UL_INFO_mutex
);
prev_slot
=
gNB
->
UL_INFO
.
slot
;
free
(
slot_ind
);
slot_ind
=
NULL
;
}
selectRetval
=
pselect
(
maxSock
+
1
,
&
rfds
,
NULL
,
NULL
,
&
pselect_timeout
,
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment