mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-16 14:10:28 +00:00
Compare commits
1 Commits
Aerial_xml
...
multipleam
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
909f925541 |
@@ -715,11 +715,6 @@ add_library(NFAPI_LIB ${NFAPI_SRC})
|
||||
target_link_libraries(NFAPI_LIB PUBLIC nfapi_common)
|
||||
target_link_libraries(NFAPI_LIB PUBLIC nr_fapi_p5 nr_fapi_p7)
|
||||
|
||||
if(OAI_WLS)
|
||||
target_compile_definitions(NFAPI_LIB PRIVATE ENABLE_WLS)
|
||||
else()
|
||||
target_compile_definitions(NFAPI_LIB PRIVATE ENABLE_SOCKET)
|
||||
endif()
|
||||
include_directories(${NFAPI_DIR}/nfapi/public_inc)
|
||||
include_directories(${NFAPI_DIR}/nfapi/inc)
|
||||
|
||||
@@ -733,9 +728,6 @@ add_library(NFAPI_PNF_LIB ${NFAPI_PNF_SRC})
|
||||
target_link_libraries(NFAPI_PNF_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
|
||||
target_link_libraries(NFAPI_PNF_LIB PUBLIC nr_fapi_p7)
|
||||
|
||||
if(OAI_WLS)
|
||||
target_compile_definitions(NFAPI_PNF_LIB PRIVATE ENABLE_WLS)
|
||||
endif()
|
||||
include_directories(${NFAPI_DIR}/pnf/public_inc)
|
||||
include_directories(${NFAPI_DIR}/pnf/inc)
|
||||
|
||||
@@ -754,9 +746,6 @@ endif()
|
||||
include_directories(${NFAPI_DIR}/vnf/public_inc)
|
||||
include_directories(${NFAPI_DIR}/vnf/inc)
|
||||
|
||||
if(OAI_WLS)
|
||||
target_compile_definitions(NFAPI_VNF_LIB PRIVATE ENABLE_WLS)
|
||||
endif()
|
||||
# nFAPI user defined code
|
||||
#############################
|
||||
set(NFAPI_USER_SRC
|
||||
@@ -766,15 +755,11 @@ set(NFAPI_USER_SRC
|
||||
${NFAPI_USER_DIR}/gnb_ind_vars.c
|
||||
)
|
||||
add_library(NFAPI_USER_LIB ${NFAPI_USER_SRC})
|
||||
if(OAI_WLS)
|
||||
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_WLS)
|
||||
elseif (OAI_AERIAL)
|
||||
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_AERIAL)
|
||||
else()
|
||||
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_SOCKET)
|
||||
endif()
|
||||
target_link_libraries(NFAPI_USER_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs UTIL)
|
||||
target_link_libraries(NFAPI_USER_LIB PRIVATE nr_fapi_p7)
|
||||
if(OAI_AERIAL)
|
||||
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_AERIAL)
|
||||
endif()
|
||||
include_directories(${NFAPI_USER_DIR})
|
||||
|
||||
# Layer 1
|
||||
@@ -1062,7 +1047,7 @@ add_library(PHY_NR_COMMON ${PHY_NR_SRC_COMMON})
|
||||
target_link_libraries(PHY_NR_COMMON PUBLIC UTIL)
|
||||
|
||||
add_library(PHY_NR ${PHY_NR_SRC})
|
||||
target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5)
|
||||
target_link_libraries(PHY_NR nr_phy_common nr_common)
|
||||
|
||||
add_library(PHY_NR_NO_AVX_256 ${PHY_NR_SRC})
|
||||
target_link_libraries(PHY_NR_NO_AVX_256 nr_phy_common nr_common)
|
||||
@@ -1854,12 +1839,6 @@ target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt sctp)
|
||||
target_link_libraries(nr-softmodem PRIVATE ${T_LIB})
|
||||
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
add_boolean_option(OAI_WLS OFF "Activate OAI's WLS driver" OFF)
|
||||
if (OAI_WLS)
|
||||
target_link_libraries(nr-softmodem PUBLIC wls_integration_lib)
|
||||
else()
|
||||
target_link_libraries(nr-softmodem PUBLIC nfapi_socket_lib)
|
||||
endif()
|
||||
add_boolean_option(OAI_AERIAL OFF "Activate OAI's AERIAL driver" OFF)
|
||||
if (OAI_AERIAL)
|
||||
target_compile_definitions(nr-softmodem PUBLIC ENABLE_AERIAL)
|
||||
|
||||
@@ -65,9 +65,9 @@ oc-cn5g:
|
||||
Host: avra
|
||||
NetworkScript: echo "inet 172.21.6.102"
|
||||
RunIperf3Server: False
|
||||
Deploy: "! scripts/oc-cn5g-deploy.sh /opt/oai-cn5g-fed-develop-2025-jun oaicicd-core-for-ci-ran"
|
||||
Undeploy: "! scripts/oc-cn5g-undeploy.sh /opt/oai-cn5g-fed-develop-2025-jun oaicicd-core-for-ci-ran"
|
||||
LogCollect: "! scripts/oc-cn5g-logcollect.sh /opt/oai-cn5g-fed-develop-2025-jun oaicicd-core-for-ci-ran %%log_dir%%"
|
||||
Deploy: "! scripts/oc-cn5g-deploy.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-ci-ran"
|
||||
Undeploy: "! scripts/oc-cn5g-undeploy.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-ci-ran"
|
||||
LogCollect: "! scripts/oc-cn5g-logcollect.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-ci-ran %%log_dir%%"
|
||||
|
||||
oc-cn5g-20897:
|
||||
Host: cacofonix
|
||||
@@ -89,8 +89,8 @@ matix-cn5g:
|
||||
Host: matix
|
||||
NetworkScript: docker exec prod-trf-gen ip a show dev eth0
|
||||
RunIperf3Server: False
|
||||
Deploy: "cd /opt/oai-cn5g-fed-v2-jun-2025/docker-compose && python3 ./core-network.py --type start-basic"
|
||||
Undeploy: "cd /opt/oai-cn5g-fed-v2-jun-2025/docker-compose && python3 ./core-network.py --type stop-basic"
|
||||
Deploy: "cd /opt/oai-cn5g-fed-v2/docker-compose && python3 ./core-network.py --type start-basic"
|
||||
Undeploy: "cd /opt/oai-cn5g-fed-v2/docker-compose && python3 ./core-network.py --type stop-basic"
|
||||
LogCollect:
|
||||
- "docker logs oai-smf > %%log_dir%%/oai-smf.log"
|
||||
- "docker logs oai-amf > %%log_dir%%/oai-amf.log"
|
||||
|
||||
@@ -152,6 +152,19 @@ def GetImageName(ssh, svcName, file):
|
||||
else:
|
||||
return ret.stdout.strip()
|
||||
|
||||
def GetServiceHealth(ssh, svcName, file):
|
||||
if svcName is None:
|
||||
return False, f"Service {svcName} not found in {file}"
|
||||
image = GetImageName(ssh, svcName, file)
|
||||
if 'db_init' in svcName or 'db-init' in svcName: # exits with 0, there cannot be healthy
|
||||
return True, f"Service {svcName} healthy, image {image}"
|
||||
for _ in range(8):
|
||||
result = ssh.run(f"docker compose -f {file} ps --format json {svcName} | jq -r 'if type==\"array\" then .[0].Health else .Health end'", silent=True)
|
||||
if result.stdout == 'healthy':
|
||||
return True, f"Service {svcName} healthy, image {image}"
|
||||
time.sleep(5)
|
||||
return False, f"Failed to deploy: service {svcName}"
|
||||
|
||||
def ExistEnvFilePrint(ssh, wd, prompt='env vars in existing'):
|
||||
ret = ssh.run(f'cat {wd}/.env', silent=True, reportNonZero=False)
|
||||
if ret.returncode != 0:
|
||||
@@ -298,6 +311,7 @@ class Containerize():
|
||||
self.yamlPath = ['', '', '']
|
||||
self.services = ['', '', '']
|
||||
self.deploymentTag = ''
|
||||
self.eNB_logFile = ['', '', '']
|
||||
|
||||
self.testCase_id = ''
|
||||
|
||||
@@ -306,6 +320,17 @@ class Containerize():
|
||||
self.dockerfileprefix = ''
|
||||
self.host = ''
|
||||
|
||||
self.deployedContainers = []
|
||||
self.tsharkStarted = False
|
||||
self.pingContName = ''
|
||||
self.pingOptions = ''
|
||||
self.pingLossThreshold = ''
|
||||
self.svrContName = ''
|
||||
self.svrOptions = ''
|
||||
self.cliContName = ''
|
||||
self.cliOptions = ''
|
||||
|
||||
self.imageToCopy = ''
|
||||
#checkers from xml
|
||||
self.ran_checkers={}
|
||||
self.num_attempts = 1
|
||||
@@ -687,7 +712,7 @@ class Containerize():
|
||||
HTML.CreateHtmlTestRowQueue("Build unit tests", 'OK', [dockerfile])
|
||||
|
||||
# it worked, build and execute tests, and close connection
|
||||
ret = cmd.run(f'docker run -a STDOUT --workdir /oai-ran/build/ --env LD_LIBRARY_PATH=/oai-ran/build/ --rm ran-unittests:{baseTag} ctest --no-label-summary -j$(nproc)')
|
||||
ret = cmd.run(f'docker run -a STDOUT --workdir /oai-ran/build/ --env LD_LIBRARY_PATH=/oai-ran/build/ --rm ran-unittests:{baseTag} ctest --output-on-failure --no-label-summary -j$(nproc)')
|
||||
cmd.run(f'docker rmi ran-unittests:{baseTag}')
|
||||
build_log_name = f'build_log_{self.testCase_id}'
|
||||
CopyLogsToExecutor(cmd, lSourcePath, build_log_name)
|
||||
@@ -847,24 +872,31 @@ class Containerize():
|
||||
if num_attempts <= 0:
|
||||
raise ValueError(f'Invalid value for num_attempts: {num_attempts}, must be greater than 0')
|
||||
for attempt in range(num_attempts):
|
||||
imagesInfo = []
|
||||
healthInfo = []
|
||||
logging.info(f'will start services {services}')
|
||||
status = ssh.run(f'docker compose -f {wd_yaml} up -d --wait --wait-timeout 60 -- {services}')
|
||||
info = ssh.run(f"docker compose -f {wd_yaml} ps --all --format=\'table {{{{.Service}}}} [{{{{.Image}}}}] {{{{.Status}}}}\' -- {services} | column -t")
|
||||
deployed = status.returncode == 0
|
||||
if not deployed:
|
||||
status = ssh.run(f'docker compose -f {wd_yaml} up -d -- {services}')
|
||||
if status.returncode != 0:
|
||||
msg = f'cannot deploy services {services}: {status.stdout}'
|
||||
logging.error(msg)
|
||||
else:
|
||||
HTML.CreateHtmlTestRowQueue('N/A', 'NOK', [msg])
|
||||
return False
|
||||
for svc in services.split():
|
||||
health, msg = GetServiceHealth(ssh, svc, f'{wd_yaml}')
|
||||
logging.info(msg)
|
||||
imagesInfo.append(msg)
|
||||
healthInfo.append(health)
|
||||
deployed = all(healthInfo)
|
||||
if deployed:
|
||||
break
|
||||
if (attempt < num_attempts - 1):
|
||||
warning_msg = (f'Failed to deploy on attempt {attempt}, restart services {services}')
|
||||
elif (attempt < num_attempts - 1):
|
||||
warning_msg = f'Restart services {services}'
|
||||
logging.warning(warning_msg)
|
||||
HTML.CreateHtmlTestRowQueue('N/A', 'NOK', [warning_msg])
|
||||
imagesInfo.append(warning_msg)
|
||||
HTML.CreateHtmlTestRowQueue('N/A', 'NOK', ['\n'.join(imagesInfo)])
|
||||
for svc in services.split():
|
||||
CopyinServiceLog(ssh, lSourcePath, yaml_dir, svc, wd_yaml, f'{svc}-{HTML.testCase_id}-attempt{attempt}.log')
|
||||
ssh.run(f'docker compose -f {wd_yaml} down -- {services}')
|
||||
imagesInfo = info.stdout.splitlines()[1:]
|
||||
logging.debug(f'{info.stdout.splitlines()[1:]}')
|
||||
if deployed:
|
||||
HTML.CreateHtmlTestRowQueue('N/A', 'OK', ['\n'.join(imagesInfo)])
|
||||
else:
|
||||
|
||||
@@ -43,12 +43,19 @@ gNBs =
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# center frequency = 3350.01 MHz
|
||||
# selected SSB frequency = 3349.92 MHz
|
||||
absoluteFrequencySSB = 623328;
|
||||
# this is 3300.24 + 134*12*30e3 = 3348.48 MHz (5G NR GSCN: 7741)
|
||||
absoluteFrequencySSB = 649920;
|
||||
#652860; #should be 649920
|
||||
#647520;
|
||||
#647540;
|
||||
#649920;
|
||||
#650208;
|
||||
#647540;
|
||||
dl_frequencyBand = 78;
|
||||
# frequency point A = 3300.87 MHz
|
||||
dl_absoluteFrequencyPointA = 620058;
|
||||
# this is 3300.24 MHz
|
||||
dl_absoluteFrequencyPointA = 646724;
|
||||
#649104;
|
||||
#646724;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
|
||||
@@ -195,15 +195,6 @@ gNBs =
|
||||
}
|
||||
);
|
||||
|
||||
rlc = {
|
||||
srb = {
|
||||
t_poll_retransmit = "ms2000"
|
||||
}
|
||||
drb_am = {
|
||||
t_poll_retransmit = "ms2000"
|
||||
}
|
||||
}
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
|
||||
@@ -213,7 +213,7 @@ security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea2", "nea0" );
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
@@ -223,7 +223,7 @@ security = {
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
|
||||
@@ -212,7 +212,7 @@ security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea2", "nea0" );
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
@@ -222,7 +222,7 @@ security = {
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
|
||||
@@ -185,7 +185,6 @@ L1s = (
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
prach_dtx_threshold = 120;
|
||||
tx_amp_backoff_dB = 30;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -19,9 +19,6 @@ Ref :
|
||||
DL & UL scheduling timing : 17.0
|
||||
UL Indication : 1.0
|
||||
Slot Indication : 13.0
|
||||
feprx : 151.0
|
||||
feptx_ofdm (per port, half_slot) : 57
|
||||
feptx_total : 148
|
||||
DeviationThreshold :
|
||||
feprx : 0.25
|
||||
feptx_prec : 0.25
|
||||
@@ -35,6 +32,3 @@ DeviationThreshold :
|
||||
DL & UL scheduling timing : 0.25
|
||||
UL Indication : 1.00
|
||||
Slot Indication : 0.50
|
||||
feprx : 0.25
|
||||
feptx_ofdm (per port, half_slot) : 0.25
|
||||
feptx_total : 0.25
|
||||
|
||||
@@ -19,9 +19,6 @@ Ref :
|
||||
DL & UL scheduling timing : 5.0
|
||||
UL Indication : 1.0
|
||||
Slot Indication : 6.0
|
||||
feprx : 44.0
|
||||
feptx_ofdm (per port, half_slot) : 31
|
||||
feptx_total : 58
|
||||
DeviationThreshold :
|
||||
feprx : 0.25
|
||||
feptx_prec : 0.25
|
||||
@@ -35,6 +32,3 @@ DeviationThreshold :
|
||||
DL & UL scheduling timing : 0.50
|
||||
UL Indication : 1.00
|
||||
Slot Indication : 0.50
|
||||
feprx : 0.25
|
||||
feptx_ofdm (per port, half_slot) : 0.25
|
||||
feptx_total : 0.25
|
||||
|
||||
@@ -19,9 +19,6 @@ Ref :
|
||||
DL & UL scheduling timing : 8.0
|
||||
UL Indication : 3.0
|
||||
Slot Indication : 9.0
|
||||
feprx : 85.0
|
||||
feptx_ofdm (per port, half_slot) : 31
|
||||
feptx_total : 92
|
||||
DeviationThreshold :
|
||||
feprx : 0.25
|
||||
feptx_prec : 0.25
|
||||
@@ -35,6 +32,3 @@ DeviationThreshold :
|
||||
DL & UL scheduling timing : 0.35
|
||||
UL Indication : 1.00
|
||||
Slot Indication : 0.35
|
||||
feprx : 0.25
|
||||
feptx_ofdm (per port, half_slot) : 0.25
|
||||
feptx_total : 0.25
|
||||
|
||||
@@ -19,9 +19,6 @@ Ref :
|
||||
DL & UL scheduling timing : 4.0
|
||||
UL Indication : 2.0
|
||||
Slot Indication : 5.0
|
||||
feprx : 43.0
|
||||
feptx_ofdm (per port, half_slot) : 30
|
||||
feptx_total : 57
|
||||
DeviationThreshold :
|
||||
feprx : 0.25
|
||||
feptx_prec : 0.25
|
||||
@@ -35,6 +32,3 @@ DeviationThreshold :
|
||||
DL & UL scheduling timing : 0.50
|
||||
UL Indication : 1.00
|
||||
Slot Indication : 0.50
|
||||
feprx : 0.25
|
||||
feptx_ofdm (per port, half_slot) : 0.25
|
||||
feptx_total : 0.25
|
||||
|
||||
@@ -80,16 +80,16 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3</id>
|
||||
<nodes>acamas acamas acamas</nodes>
|
||||
<nodes>cacofonix cacofonix cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020021">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from all NR-UEs</desc>
|
||||
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3</id>
|
||||
<nodes>acamas acamas acamas</nodes>
|
||||
<nodes>cacofonix cacofonix cacofonix</nodes>
|
||||
<svr_id>rfsim5g_5gc_fixed_ip</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<testCase id="000030">
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>15</idle_sleep_time_in_sec>
|
||||
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000031">
|
||||
@@ -106,7 +106,7 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000024">
|
||||
@@ -122,9 +122,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from all NR-UEs</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -132,8 +132,8 @@
|
||||
<testCase id="030020">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Simulate a DL radio channel with noise (3 dB)</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo channelmod modify 0 noise_power_dB 3 | ncat --send-only 192.168.71.181 8091</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo channelmod modify 0 noise_power_dB 3 | nc --send-only 192.168.71.181 8091</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030021">
|
||||
@@ -141,9 +141,9 @@
|
||||
<desc>Iperf (DL/5Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 5M -t 20 -R</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -153,9 +153,9 @@
|
||||
<desc>Iperf (UL/3Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 3M -t 20</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -163,17 +163,17 @@
|
||||
<testCase id="040001">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Trigger Reestablishment</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ci force_reestab | ncat 192.168.71.171 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ci force_reestab | nc 192.168.71.171 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020022">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i0.5 -w25</ping_args>
|
||||
<ping_packetloss_threshold>80</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -181,57 +181,57 @@
|
||||
<testCase id="040002">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Verify Reestablishment</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ci get_reestab_count | ncat 192.168.71.150 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ci get_reestab_count | nc 192.168.71.150 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040021">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Simulate a disruption of DL radio channel (ploss 55)</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo channelmod modify 0 ploss 55 | ncat 192.168.71.181 8091</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo channelmod modify 0 ploss 55 | nc 192.168.71.181 8091</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040022">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Get UE sync state (UE ID 0)</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ciUE sync_state 0 | ncat 192.168.71.181 8091 | grep -E UE_NOT_SYNC</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ciUE sync_state 0 | nc 192.168.71.181 8091 | grep -E UE_NOT_SYNC</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040023">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Restoration of the original DL channel conditions (ploss 20)</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo channelmod modify 0 ploss 20 | ncat 192.168.71.181 8091</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo channelmod modify 0 ploss 20 | nc 192.168.71.181 8091</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040024">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Get UE sync state (UE ID 0)</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ciUE sync_state 0 | ncat 192.168.71.181 8091 | grep -E UE_CONNECTED</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ciUE sync_state 0 | nc 192.168.71.181 8091 | grep -E UE_CONNECTED</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040025">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Trigger Handover</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ci trigger_f1_ho | ncat 192.168.71.150 9090</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ci trigger_f1_ho | nc 192.168.71.150 9090</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040026">
|
||||
<class>Custom_Command</class>
|
||||
<desc>UE (1) connected to DU-PCI 0?</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.150 9090 | grep "3584"</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ci fetch_du_by_ue_id 1 | nc 192.168.71.150 9090 | grep "3584"</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040027">
|
||||
<class>Custom_Command</class>
|
||||
<desc>UE (1) connected to DU-PCI 1?</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.150 9090 | grep "3585"</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ci fetch_du_by_ue_id 1 | nc 192.168.71.150 9090 | grep "3585"</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100021">
|
||||
|
||||
@@ -73,16 +73,16 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020011">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -91,9 +91,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -103,9 +103,9 @@
|
||||
<desc>Iperf (DL/3Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 3M -t 30 -R</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -115,9 +115,9 @@
|
||||
<desc>Iperf (UL/3Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 3M -t 30</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
@@ -133,16 +133,16 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3 rfsim5g_ue4 rfsim5g_ue5 rfsim5g_ue6 rfsim5g_ue7 rfsim5g_ue8 rfsim5g_ue9 rfsim5g_ue10</id>
|
||||
<nodes>acamas acamas acamas acamas acamas acamas acamas acamas acamas acamas</nodes>
|
||||
<nodes>cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -151,9 +151,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -162,9 +162,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from Second NR-UE</desc>
|
||||
<id>rfsim5g_ue2</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -173,9 +173,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping Second NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue2</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -184,9 +184,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from both UEs</desc>
|
||||
<id>rfsim5g_ue rfsim5g_ue2</id>
|
||||
<nodes>acamas acamas</nodes>
|
||||
<nodes>cacofonix cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -195,9 +195,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from all UEs</desc>
|
||||
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3 rfsim5g_ue4 rfsim5g_ue5 rfsim5g_ue6 rfsim5g_ue7 rfsim5g_ue8 rfsim5g_ue9 rfsim5g_ue10</id>
|
||||
<nodes>acamas acamas acamas acamas acamas acamas acamas acamas acamas acamas</nodes>
|
||||
<nodes>cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25 -s 1016</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -207,9 +207,9 @@
|
||||
<desc>Iperf (DL/3Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 3M -t 20 -R</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -219,9 +219,9 @@
|
||||
<desc>Iperf (UL/1Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 1M -t 20</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -230,21 +230,21 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE 1 and 2</desc>
|
||||
<id>rfsim5g_ue rfsim5g_ue2</id>
|
||||
<nodes>acamas acamas</nodes>
|
||||
<nodes>cacofonix cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="444444">
|
||||
<class>Detach_UE</class>
|
||||
<desc>Detach OAI UE 1 and 2</desc>
|
||||
<id>rfsim5g_ue rfsim5g_ue2</id>
|
||||
<nodes>acamas acamas</nodes>
|
||||
<nodes>cacofonix cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="444445">
|
||||
<class>Detach_UE</class>
|
||||
<desc>Detach OAI UE 3 to 10</desc>
|
||||
<id>rfsim5g_ue3 rfsim5g_ue4 rfsim5g_ue5 rfsim5g_ue6 rfsim5g_ue7 rfsim5g_ue8 rfsim5g_ue9 rfsim5g_ue10</id>
|
||||
<nodes>acamas acamas acamas acamas acamas acamas acamas acamas</nodes>
|
||||
<nodes>cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100001">
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000004">
|
||||
@@ -104,9 +104,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args> -c 20 -i0.5</ping_args>
|
||||
<ping_packetloss_threshold>80</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -115,9 +115,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i0.2</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -127,9 +127,9 @@
|
||||
<desc>Iperf (DL/3Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 3M -t 20 -R</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -139,9 +139,9 @@
|
||||
<desc>Iperf (UL/1Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 1M -t 20</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -149,15 +149,15 @@
|
||||
<testCase id="040001">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Force Msg3 C-RNTI RA</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ciUE force_crnti_ra | ncat 192.168.71.150 8091</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ciUE force_crnti_ra | nc 192.168.71.150 8091</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040002">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Force RRC_IDLE (UE ID 0)</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ciUE force_RRC_IDLE | ncat 192.168.71.150 8091</command>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ciUE force_RRC_IDLE | nc 192.168.71.150 8091</command>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100001">
|
||||
|
||||
@@ -73,16 +73,16 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -91,9 +91,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -103,21 +103,21 @@
|
||||
<desc>Iperf (DL/10Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 10M -t 20 -R</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030002">
|
||||
<class>Iperf</class>
|
||||
<desc>Iperf (UL/3Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 3M -t 20</iperf_args>
|
||||
<desc>Iperf (UL/4Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 4M -t 20</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<testCase id="004000">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Clean-Up any residual volume</desc>
|
||||
<node>acamas</node>
|
||||
<node>cacofonix</node>
|
||||
<command>docker volume rm 5g_rfsimulator_fdd_phytest_rrc.config -f</command>
|
||||
</testCase>
|
||||
<testCase id="800813">
|
||||
@@ -80,9 +80,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping gNB from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_gnb_nos1</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c20 -i0.2</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -91,9 +91,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from gNB</desc>
|
||||
<id>rfsim5g_gnb_nos1</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c20 -i0.2</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -103,9 +103,9 @@
|
||||
<desc>Iperf (DL/30kbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 0.03M -t 20 -R -c 10.0.1.1</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_gnb_nos1</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -115,9 +115,9 @@
|
||||
<desc>Iperf (UL/30kbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 0.03M -t 20 -c 10.0.1.1</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_gnb_nos1</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
800813
|
||||
000000
|
||||
000001
|
||||
000013
|
||||
020001
|
||||
020002
|
||||
100001
|
||||
@@ -69,20 +68,13 @@
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000013">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i0.2</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -91,9 +83,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i0.2</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
@@ -33,11 +33,6 @@
|
||||
000003
|
||||
020001
|
||||
020002
|
||||
040001
|
||||
020022
|
||||
040002
|
||||
020001
|
||||
020002
|
||||
100001
|
||||
222222
|
||||
</TestCaseRequestedList>
|
||||
@@ -78,16 +73,16 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -96,40 +91,13 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040001">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Trigger Reestablishment</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ci force_reestab | ncat 192.168.71.140 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
|
||||
<command_fail>yes</command_fail>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020022">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<ping_args>-c 20 -i0.5 -w25</ping_args>
|
||||
<ping_packetloss_threshold>80</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040002">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Verify Reestablishment</desc>
|
||||
<node>acamas</node>
|
||||
<command>echo ci get_reestab_count | ncat 192.168.71.140 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
|
||||
<command_fail>yes</command_fail>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100001">
|
||||
<class>Undeploy_Object</class>
|
||||
<always_exec>true</always_exec>
|
||||
|
||||
@@ -73,16 +73,16 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -91,9 +91,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<testCase id="000005">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Check that UE synched</desc>
|
||||
<node>acamas</node>
|
||||
<node>cacofonix</node>
|
||||
<command>docker logs rfsim5g-oai-nr-ue-2 | grep -m 1 "PSBCH RX:OK"</command>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
004000
|
||||
000000
|
||||
000001
|
||||
000030
|
||||
020001
|
||||
020002
|
||||
100001
|
||||
@@ -49,7 +48,7 @@
|
||||
<testCase id="004000">
|
||||
<class>Custom_Command</class>
|
||||
<desc>Clean-Up any residual volume</desc>
|
||||
<node>acamas</node>
|
||||
<node>cacofonix</node>
|
||||
<command>docker volume rm 5g_rfsimulator_tdd_dora_rrc.config -f</command>
|
||||
</testCase>
|
||||
<testCase id="800813">
|
||||
@@ -76,19 +75,13 @@
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000030">
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping gNB from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_gnb_nos1</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c20 -i0.2</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -97,9 +90,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from gNB</desc>
|
||||
<id>rfsim5g_gnb_nos1</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c20 -i0.2</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
@@ -73,16 +73,16 @@
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach OAI UE (Wait for IP)</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -91,9 +91,9 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
@@ -103,9 +103,9 @@
|
||||
<desc>Iperf (DL/3Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 3M -t 20 -R</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
@@ -115,9 +115,9 @@
|
||||
<desc>Iperf (UL/1Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 1M -t 20</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<nodes>acamas</nodes>
|
||||
<nodes>cacofonix</nodes>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>acamas</svr_node>
|
||||
<svr_node>cacofonix</svr_node>
|
||||
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
000111
|
||||
000011
|
||||
000022
|
||||
200022
|
||||
000033
|
||||
000222
|
||||
222222
|
||||
@@ -106,17 +105,6 @@
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="200022">
|
||||
<class>Iperf</class>
|
||||
<desc>Optional iperf (DL/UDP/1000M)(30 sec)(single-ue profile)</desc>
|
||||
<may_fail>true</may_fail>
|
||||
<iperf_args>-u -b 1000M -t 30 -R</iperf_args>
|
||||
<svr_id>oc-cn5g-20897-aerial</svr_id>
|
||||
<id>up2-aerial</id>
|
||||
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000033">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/UDP/40M)(30 sec)(single-ue profile)</desc>
|
||||
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch
|
||||
healthcheck:
|
||||
test: /bin/bash -c "nodetool status"
|
||||
interval: 20s
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -14,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,16 +61,13 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
@@ -85,8 +78,6 @@ services:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -96,8 +87,6 @@ services:
|
||||
container_name: rfsim5g-oai-cu
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time
|
||||
--rfsimulator.options chanmod
|
||||
@@ -114,8 +103,6 @@ services:
|
||||
- ../../conf_files/gnb-cu.sa.band78.106prb.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -125,8 +112,6 @@ services:
|
||||
container_name: rfsim5g-oai-du-pci0
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim
|
||||
--log_config.global_log_options level,nocolor,time
|
||||
@@ -145,8 +130,6 @@ services:
|
||||
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -156,8 +139,6 @@ services:
|
||||
container_name: rfsim5g-oai-du-pci1
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim
|
||||
--log_config.global_log_options level,nocolor,time
|
||||
@@ -180,8 +161,6 @@ services:
|
||||
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -194,13 +173,13 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
|
||||
-r 106 --numerology 1 -C 3619200000
|
||||
--uicc0.imsi 208990100001100
|
||||
--rfsimulator.options chanmod
|
||||
--rfsimulator.serveraddr server
|
||||
--rfsimulator.hanging-workaround 1
|
||||
--telnetsrv --telnetsrv.shrmod ciUE --telnetsrv.listenaddr 192.168.71.181 --telnetsrv.listenport 8091
|
||||
--channelmod.modellist_rfsimu_1.[0].model_name rfsimu_channel_ue0
|
||||
--channelmod.modellist_rfsimu_1.[1].model_name rfsimu_channel_ue1
|
||||
@@ -214,8 +193,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -16,8 +15,6 @@ services:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
retries: 30
|
||||
networks:
|
||||
public_net:
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,15 +61,12 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
@@ -87,8 +80,6 @@ services:
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
oai-gnb:
|
||||
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
|
||||
container_name: rfsim5g-oai-gnb
|
||||
@@ -108,8 +99,6 @@ services:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
retries: 5
|
||||
ipc: host
|
||||
oai-nr-ue:
|
||||
@@ -137,8 +126,6 @@ services:
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
ipc: host
|
||||
|
||||
networks:
|
||||
|
||||
@@ -67,18 +67,6 @@ All the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_r
|
||||
For a deployment with the gNB split in CU and DU components, please refer to the `../5g_f1_rfsimulator` folder.
|
||||
For a deployment with the gNB split in CU-CP, CU-UP, and DU components, please refer to the `../5g_rfsimulator_e1` folder.
|
||||
|
||||
Note: **These instructions require `docker compose` v2.36.0 or later** due to the
|
||||
use of the `interface_name` property, which is necessary for ensuring consistent
|
||||
IP address assignment to the container interface.
|
||||
|
||||
If you're using an older version of `docker compose`, you may encounter the following
|
||||
error:
|
||||
```
|
||||
validating docker-compose.yaml: services.oai-upf.networks.public_net Additional property interface_name is not allowed
|
||||
```
|
||||
To update to the required version, you can follow the official Docker documentation:
|
||||
https://docs.docker.com/compose/install/linux/
|
||||
|
||||
## 2.1. Deploy OAI 5G Core Network ##
|
||||
|
||||
```bash
|
||||
@@ -558,7 +546,8 @@ section in the file for details. This includes an image build service as well as
|
||||
code compilation service. This is necessary as the executable has to be linked
|
||||
against the same libraries that are present in the executing image. This might
|
||||
take a while the first time but other that that is very fast. Here is a list of
|
||||
commands (wait between each command). Tested with `docker compose` v2.36.2.
|
||||
commands (wait between each command). Tested with `docker compose` v2.27.0
|
||||
|
||||
|
||||
This command deploys OAI 5G Core Network
|
||||
```bash
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ./mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -14,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,15 +61,12 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
@@ -84,16 +77,12 @@ services:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-gnb:
|
||||
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
|
||||
container_name: rfsim5g-oai-gnb
|
||||
cap_add:
|
||||
- SYS_NICE
|
||||
cap_drop:
|
||||
- ALL
|
||||
environment:
|
||||
@@ -108,8 +97,6 @@ services:
|
||||
- ../../conf_files/gnb.sa.band78.106prb.rfsim.yaml:/opt/oai-gnb/etc/gnb.yaml
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -121,7 +108,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -135,8 +121,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.yaml:/opt/oai-nr-ue/etc/nr-ue.yaml
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -148,7 +132,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -162,8 +145,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -175,7 +156,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -189,8 +169,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -202,7 +180,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001103 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -216,8 +193,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -229,7 +204,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001104 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -243,8 +217,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -256,7 +228,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001105 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -270,8 +241,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -283,7 +252,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001106 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -297,8 +265,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -310,7 +276,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001107 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -324,8 +289,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -337,7 +300,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001108 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -351,8 +313,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -364,7 +324,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001109 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -378,8 +337,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -14,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,15 +61,12 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
@@ -84,8 +77,6 @@ services:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -106,8 +97,6 @@ services:
|
||||
- ../../conf_files/gnb.sa.band78.24prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -135,8 +124,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -14,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,15 +61,12 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
@@ -84,8 +77,6 @@ services:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -94,8 +85,6 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
@@ -108,8 +97,6 @@ services:
|
||||
- ../../conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -122,7 +109,6 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
- SYS_NICE
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim -r 273 --numerology 1 --band 78 -C 3450720000 --ssb 1518 --ue-nb-ant-tx 2 --uicc0.imsi 208990100001100 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
@@ -137,8 +123,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -14,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,10 +61,8 @@ services:
|
||||
networks:
|
||||
core_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
|
||||
oai-cucp:
|
||||
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
|
||||
@@ -93,8 +87,6 @@ services:
|
||||
- ../../conf_files/gnb-cucp.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -124,8 +116,6 @@ services:
|
||||
- ../../conf_files/gnb-cuup.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-cuup"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -158,8 +148,6 @@ services:
|
||||
- ../../conf_files/gnb-cuup.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-cuup"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -192,8 +180,6 @@ services:
|
||||
- ../../conf_files/gnb-cuup.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-cuup"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -223,8 +209,6 @@ services:
|
||||
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -257,8 +241,6 @@ services:
|
||||
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -291,8 +273,6 @@ services:
|
||||
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -321,8 +301,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -351,8 +329,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -382,8 +358,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -14,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,15 +61,12 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
@@ -84,8 +77,6 @@ services:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -105,8 +96,6 @@ services:
|
||||
- ../../conf_files/gnb.sa.band261.u3.32prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -135,8 +124,6 @@ services:
|
||||
ipv4_address: 192.168.71.150
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -14,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,15 +61,12 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
@@ -84,8 +77,6 @@ services:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -96,9 +87,7 @@ services:
|
||||
- ALL
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
|
||||
--telnetsrv --telnetsrv.listenaddr 192.168.71.140
|
||||
--telnetsrv.shrmod ci
|
||||
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
@@ -108,8 +97,6 @@ services:
|
||||
- ../../conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -135,8 +122,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -13,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -63,10 +61,8 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
@@ -81,8 +77,6 @@ services:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -103,8 +97,6 @@ services:
|
||||
- ../../conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -137,8 +129,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.ntn-leo.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -18,8 +18,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -45,8 +43,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -60,3 +56,11 @@ networks:
|
||||
- subnet: 192.168.71.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-public"
|
||||
traffic_net:
|
||||
driver: bridge
|
||||
name: rfsim5g-oai-traffic-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.72.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-traffic"
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -14,8 +13,6 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -49,7 +46,6 @@ services:
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -65,15 +61,12 @@ services:
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
interface_name: eth0
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
interface_name: eth1
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
@@ -84,8 +77,6 @@ services:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -108,8 +99,6 @@ services:
|
||||
- ../../conf_files/gnb-vnf.sa.band66.u0.25prb.nfapi.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -132,8 +121,6 @@ services:
|
||||
- ../../conf_files/gnb-pnf.band66.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -159,8 +146,6 @@ services:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
start_period: 10s
|
||||
start_interval: 500ms
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -14,9 +14,7 @@ services:
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band77.273prb.usrpn310.2x2.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 15s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -14,9 +14,7 @@ services:
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band77.162prb.usrpn310.2x2.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 15s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
- ../../conf_files/gnb-vnf.sa.band77.162prb.nfapi.4x4.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 5s
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-pnf:
|
||||
@@ -35,9 +35,7 @@ services:
|
||||
volumes:
|
||||
- ../../conf_files/gnb-pnf.band77.usrpn310.4x4.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 15s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -16,9 +16,7 @@ services:
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band78.106prb.n310.7ds2u.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 15s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 5
|
||||
|
||||
@@ -22,12 +22,10 @@ services:
|
||||
oai-net:
|
||||
ipv4_address: 172.21.18.20
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 15s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 5
|
||||
networks:
|
||||
oai-net:
|
||||
driver: macvlan
|
||||
|
||||
@@ -21,12 +21,10 @@ services:
|
||||
oai-net:
|
||||
ipv4_address: 172.21.18.20
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 15s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 5
|
||||
networks:
|
||||
oai-net:
|
||||
driver: macvlan
|
||||
|
||||
@@ -21,13 +21,10 @@ services:
|
||||
oai-net:
|
||||
ipv4_address: 172.21.18.20
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 15s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
retries: 5
|
||||
networks:
|
||||
oai-net:
|
||||
driver: macvlan
|
||||
|
||||
@@ -99,7 +99,7 @@ Options:
|
||||
USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, AERIAL, None (Default)
|
||||
Adds this RF board support (in external packages installation and in compilation)
|
||||
-t | --transport
|
||||
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g, oran_fhlib_5g, oran_fhlib_5g_mplane, WLS
|
||||
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g, oran_fhlib_5g, oran_fhlib_5g_mplane
|
||||
-P | --phy_simulators
|
||||
Makes the unitary tests Layer 1 simulators
|
||||
-s | --check
|
||||
@@ -308,9 +308,6 @@ function main() {
|
||||
TARGET_LIST="$TARGET_LIST $2"
|
||||
CMAKE_CMD="$CMAKE_CMD -DOAI_FHI72=ON -DOAI_FHI72_MPLANE=ON"
|
||||
;;
|
||||
"WLS"|"Wls"|"wls")
|
||||
CMAKE_CMD="$CMAKE_CMD -DOAI_WLS=ON"
|
||||
;;
|
||||
"None")
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -126,9 +126,12 @@ find_package_handle_standard_args(xran
|
||||
VERSION_VAR xran_VERSION
|
||||
)
|
||||
|
||||
# in proper usage of cmake, include directory should only contain "api", but not header files under "src" directory;
|
||||
# however, we use xran_dev_get_ctx() and xran_dev_get_ctx_by_id() functions which are defined in xran_common.h;
|
||||
# since xran_common.h is under "src" directory, we have to include it in ${xran_INCLUDE_DIRS}
|
||||
if(xran_FOUND)
|
||||
set(xran_LIBRARIES ${xran_LIBRARY})
|
||||
set(xran_INCLUDE_DIRS ${xran_INCLUDE_DIR})
|
||||
set(xran_INCLUDE_DIRS ${xran_INCLUDE_DIR} ${xran_INCLUDE_DIR}/../src)
|
||||
endif()
|
||||
|
||||
if(xran_FOUND AND NOT TARGET xran::xran)
|
||||
|
||||
@@ -1,209 +0,0 @@
|
||||
diff --git a/wls_lib/Makefile b/wls_lib/Makefile
|
||||
index 2f8e4b2..e657488 100644
|
||||
--- a/wls_lib/Makefile
|
||||
+++ b/wls_lib/Makefile
|
||||
@@ -1,20 +1,6 @@
|
||||
-###############################################################################
|
||||
-#
|
||||
-# Copyright (c) 2021 Intel.
|
||||
-#
|
||||
-# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-# you may not use this file except in compliance with the License.
|
||||
-# You may obtain a copy of the License at
|
||||
-#
|
||||
-# http://www.apache.org/licenses/LICENSE-2.0
|
||||
-#
|
||||
-# Unless required by applicable law or agreed to in writing, software
|
||||
-# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-# See the License for the specific language governing permissions and
|
||||
-# limitations under the License.
|
||||
-#
|
||||
-###############################################################################
|
||||
+################################################################
|
||||
+# <COPYRIGHT_TAG>
|
||||
+################################################################
|
||||
|
||||
MYCUSTOMTAB=' '
|
||||
MYCUSTOMSPACE='============================================================================================'
|
||||
@@ -24,11 +10,17 @@ MYCUSTOMSPACE1='------------------------------------------------------------'
|
||||
# Tools configuration
|
||||
##############################################################
|
||||
ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
|
||||
-CC := icc
|
||||
+ CC := icc
|
||||
CPP := icpc
|
||||
-AS := as
|
||||
-AR := ar
|
||||
-LD := icc
|
||||
+ AS := as
|
||||
+ AR := ar
|
||||
+ LD := icc
|
||||
+else ifeq ($(WIRELESS_SDK_TOOLCHAIN),gcc)
|
||||
+ CC := gcc
|
||||
+ CPP := g++
|
||||
+ AS := as
|
||||
+ AR := ar
|
||||
+ LD := gcc
|
||||
else ifeq ($(WIRELESS_SDK_TOOLCHAIN),icx)
|
||||
CC := icx
|
||||
CPP := icx
|
||||
@@ -44,9 +36,9 @@ ifeq ($(WIRELESS_SDK_TARGET_ISA),sse)
|
||||
else ifeq ($(WIRELESS_SDK_TARGET_ISA),avx2)
|
||||
TARGET_PROCESSOR := -xCORE-AVX2
|
||||
else ifeq ($(WIRELESS_SDK_TARGET_ISA),avx512)
|
||||
- TARGET_PROCESSOR := -xCORE-AVX512
|
||||
+ TARGET_PROCESSOR := -march=skylake-avx512
|
||||
else ifeq ($(WIRELESS_SDK_TARGET_ISA),snc)
|
||||
- TARGET_PROCESSOR := -xicelake-server
|
||||
+ TARGET_PROCESSOR := -march=icelake-server
|
||||
else ifeq ($(WIRELESS_SDK_TARGET_ISA),spr)
|
||||
TARGET_PROCESSOR := -march=sapphirerapids
|
||||
endif
|
||||
@@ -66,15 +58,38 @@ PROJECT_DIR := ./
|
||||
BUILDDIR := make
|
||||
PROJECT_BINARY := $(PROJECT_NAME).so
|
||||
|
||||
+PKGCONF ?= pkg-config
|
||||
+LIBDPDK_VERSION=20.11.3
|
||||
+
|
||||
+ifeq ($(shell $(PKGCONF) --modversion "libdpdk = '$(LIBDPDK_VERSION)'"),$(LIBDPDK_VERSION))
|
||||
+ DPDK_INSTALLED=1
|
||||
+else
|
||||
+ DPDK_INSTALLED=0
|
||||
+endif
|
||||
+
|
||||
ifeq ($(RTE_SDK),)
|
||||
-$(error "Please define RTE_SDK environment variable")
|
||||
+ifeq ($(DPDK_INSTALLED),0)
|
||||
+$(error "Please define RTE_SDK environment variable OR install DPDK version $(LIBDPDK_VERSION)")
|
||||
+endif
|
||||
endif
|
||||
|
||||
-RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
|
||||
+# At least one of the options is defined
|
||||
+
|
||||
+ifneq ($(RTE_SDK),)
|
||||
+ RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
|
||||
+else ifeq ($(DPDK_INSTALLED),1)
|
||||
+ RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig $(PKGCONF) --cflags-only-I libdpdk)
|
||||
+endif
|
||||
|
||||
CC_SRC = wls_lib_dpdk.c \
|
||||
syslib.c
|
||||
|
||||
+CC_HDR = syslib.h \
|
||||
+ ttypes.h \
|
||||
+ wls.h \
|
||||
+ wls_debug.h \
|
||||
+ wls_lib.h
|
||||
+
|
||||
CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
@@ -84,18 +99,19 @@ CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
|
||||
-Wimplicit-function-declaration \
|
||||
-g -O3 -mcmodel=large $(TARGET_PROCESSOR)
|
||||
|
||||
-INC := -I$(RTE_INC)
|
||||
+INC := -I$(RTE_INC) -I../intel_fapi/
|
||||
DEF :=
|
||||
|
||||
AS_FLAGS :=
|
||||
AR_FLAGS := rc
|
||||
|
||||
PROJECT_OBJ_DIR := $(BUILDDIR)/obj
|
||||
+PROJECT_DEP_DIR := $(PROJECT_OBJ_DIR)/$(PROJECT_NAME).dep.d
|
||||
|
||||
CC_OBJS := $(patsubst %.c,%.o,$(CC_SRC))
|
||||
AS_OBJS := $(patsubst %.s,%.o,$(AS_SRC))
|
||||
OBJS := $(CC_OBJS) $(AS_OBJS) $(LIBS)
|
||||
-DIRLIST := $(addprefix $(PROJECT_OBJ_DIR)/,$(sort $(dir $(OBJS))))
|
||||
+DIRLIST := $(addprefix $(PROJECT_OBJ_DIR)/,$(sort $(dir $(OBJS)))) $(PROJECT_DEP_DIR)
|
||||
|
||||
CC_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(CC_OBJS))
|
||||
|
||||
@@ -104,9 +120,7 @@ CC_FLAGS_FULL := $(CC_FLAGS) $(INC) $(DEF)
|
||||
|
||||
AS_FLAGS := $(AS_FLAGS) $(INC)
|
||||
|
||||
-PROJECT_DEP_FILE := $(PROJECT_OBJ_DIR)/$(PROJECT_NAME).dep
|
||||
-
|
||||
-ifeq ($(wildcard $(PROJECT_DEP_FILE)),$(PROJECT_DEP_FILE))
|
||||
+ifeq ($(wildcard $(PROJECT_DEP_DIR)),$(PROJECT_DEP_DIR))
|
||||
GENERATE_DEPS :=
|
||||
else
|
||||
|
||||
@@ -119,11 +133,11 @@ all : welcome_line $(PROJECT_BINARY)
|
||||
|
||||
.PHONY : clear_dep
|
||||
clear_dep:
|
||||
- @$(RM) $(PROJECT_DEP_FILE)
|
||||
- @echo [DEP] $(subst $(PROJECT_OBJ_DIR)/,,$(PROJECT_DEP_FILE))
|
||||
+ @echo [DEP] rm $(PROJECT_DEP_DIR)/$(@F).dep
|
||||
+ @$(RM) $(PROJECT_DEP_DIR)/$(@F).dep
|
||||
|
||||
-$(CC_DEPS) :
|
||||
- @$(CC) -MM $(subst __up__,../,$(subst __dep__,,$@)) -MT $(PROJECT_OBJ_DIR)/$(patsubst %.c,%.o,$(subst __up__,../,$(subst __dep__,,$@))) $(CC_FLAGS_FULL) >> $(PROJECT_DEP_FILE)
|
||||
+$(CC_DEPS) : $(PROJECT_DEP_DIR)
|
||||
+ @$(CC) $(CC_FLAGS_FULL) -MM $(subst __up__,../,$(subst __dep__,,$@)) -MT $(PROJECT_OBJ_DIR)/$(patsubst %.c,%.o,$(subst __up__,../,$(subst __dep__,,$@))) >> $(PROJECT_DEP_DIR)/$(@F).dep
|
||||
|
||||
.PHONY : generate_deps
|
||||
generate_deps : clear_dep $(CC_DEPS)
|
||||
@@ -136,17 +150,17 @@ echo_start_build :
|
||||
$(DIRLIST) :
|
||||
-@$(MD) $@
|
||||
|
||||
-$(CC_OBJTARGETS) :
|
||||
+$(CC_OBJTARGETS) : $(GENERATE_DEPS)
|
||||
@echo [CC] $(subst $(PROJECT_OBJ_DIR)/,,$@)
|
||||
@$(CC) -c $(CC_FLAGS_FULL) -o"$@" $(patsubst %.o,%.c,$(subst $(PROJECT_OBJ_DIR)/,,$@))
|
||||
|
||||
-$(AS_OBJTARGETS) :
|
||||
+$(AS_OBJTARGETS) : $(CC_OBJTARGETS) $(CPP_OBJTARGETS)
|
||||
@echo [AS] $(subst $(PROJECT_OBJ_DIR)/,,$@)
|
||||
@$(AS) $(AS_FLAGS) -o"$@" $(patsubst %.o,%.s,$(subst $(PROJECT_OBJ_DIR)/,,$@))
|
||||
|
||||
-ifeq ($(wildcard $(PROJECT_DEP_FILE)),$(PROJECT_DEP_FILE))
|
||||
+ifeq ($(wildcard $(PROJECT_DEP_DIR)),$(PROJECT_DEP_DIR))
|
||||
|
||||
-include $(PROJECT_DEP_FILE)
|
||||
+include $(PROJECT_DEP_DIR)/*
|
||||
|
||||
endif
|
||||
|
||||
@@ -156,7 +170,7 @@ clean:
|
||||
@$(RM) $(CC_OBJTARGETS) $(AS_OBJTARGETS)
|
||||
ifneq ($(wildcard $(PROJECT_DIR)/$(PROJECT_MAKE)),)
|
||||
@echo [CLEAN] : $(PROJECT_NAME)
|
||||
- @$(RM) $(PROJECT_BINARY) $(PROJECT_BINARY_LIB) $(PROJECT_DEP_FILE)
|
||||
+ @$(RM) -rf $(PROJECT_BINARY) $(PROJECT_BINARY_LIB) $(PROJECT_DEP_DIR)
|
||||
endif
|
||||
|
||||
xclean: clean
|
||||
@@ -172,7 +186,24 @@ welcome_line :
|
||||
debug : all
|
||||
release : all
|
||||
|
||||
-$(PROJECT_BINARY) : $(DIRLIST) echo_start_build $(GENERATE_DEPS) $(PRE_BUILD) $(CC_OBJTARGETS) $(AS_OBJTARGETS)
|
||||
+$(PROJECT_BINARY) : $(DIRLIST) echo_start_build $(GENERATE_DEPS) $(CC_OBJTARGETS) $(AS_OBJTARGETS)
|
||||
@echo [AR] $(subst $(BUILDDIR)/,,$@)
|
||||
@$(CC) $(CC_OBJTARGETS) $(AS_OBJTARGETS) -shared -fPIC -o $@
|
||||
|
||||
+##############################################################
|
||||
+# Install configuration
|
||||
+##############################################################
|
||||
+
|
||||
+INSTALL_DIR := /usr/local
|
||||
+INCLUDE_DIR := $(INSTALL_DIR)/include/
|
||||
+
|
||||
+.PHONY : install
|
||||
+install: $(PROJECT_BINARY) install_headers
|
||||
+ @echo [INSTALL] : $(PROJECT_BINARY)
|
||||
+ @$(CP) $(PROJECT_BINARY) $(INSTALL_DIR)/lib
|
||||
+
|
||||
+.PHONY : install_headers
|
||||
+install_headers: $(CC_SRC)
|
||||
+ @echo [INSTALL] : $(PROJECT_NAME) headers
|
||||
+ @$(MD) $(INCLUDE_DIR)
|
||||
+ @$(CP) $(CC_HDR) $(INCLUDE_DIR)
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h
|
||||
index 7508117..318508b 100644
|
||||
index 7508117..ce17ebd 100644
|
||||
--- a/fhi_lib/app/src/common.h
|
||||
+++ b/fhi_lib/app/src/common.h
|
||||
@@ -28,7 +28,7 @@
|
||||
@@ -7,12 +7,12 @@ index 7508117..318508b 100644
|
||||
#include <rte_mbuf.h>
|
||||
|
||||
-#define VERSIONX "oran_e_maintenance_release_v1.0"
|
||||
+#define VERSIONX "oran_e_maintenance_release_v1.6"
|
||||
+#define VERSIONX "oran_e_maintenance_release_v1.5"
|
||||
|
||||
#define APP_O_DU 0
|
||||
#define APP_O_RU 1
|
||||
diff --git a/fhi_lib/lib/Makefile b/fhi_lib/lib/Makefile
|
||||
index de141bf..c2a448d 100644
|
||||
index de141bf..fa2923f 100644
|
||||
--- a/fhi_lib/lib/Makefile
|
||||
+++ b/fhi_lib/lib/Makefile
|
||||
@@ -23,12 +23,25 @@ MYCUSTOMSPACE1='------------------------------------------------------------'
|
||||
@@ -50,9 +50,9 @@ index de141bf..c2a448d 100644
|
||||
|
||||
-RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
|
||||
+ifeq ($(TARGET), x86)
|
||||
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkg-config --cflags-only-I libdpdk)
|
||||
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
|
||||
+else ifeq ($(TARGET), armv8)
|
||||
+RTE_INC := $(shell pkg-config --cflags-only-I libdpdk)
|
||||
+RTE_INC := $(pkgconf --cflags-only-I libdpdk)
|
||||
+endif
|
||||
API_DIR := $(PROJECT_DIR)/api
|
||||
SRC_DIR := $(PROJECT_DIR)/src
|
||||
@@ -85,7 +85,7 @@ index de141bf..c2a448d 100644
|
||||
|
||||
CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
|
||||
-fdata-sections \
|
||||
@@ -112,14 +132,23 @@ CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
|
||||
@@ -112,12 +132,21 @@ CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
|
||||
-fPIC \
|
||||
-Wall \
|
||||
-Wimplicit-function-declaration \
|
||||
@@ -110,11 +110,8 @@ index de141bf..c2a448d 100644
|
||||
+ -Werror -Wno-unused-variable -std=c++14
|
||||
+endif
|
||||
|
||||
-INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) -I$(RTE_INC)
|
||||
+INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) $(RTE_INC)
|
||||
INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) -I$(RTE_INC)
|
||||
DEF :=
|
||||
ifeq ($(MLOG),1)
|
||||
INC += -I$(MLOG_DIR)/source
|
||||
@@ -150,8 +179,13 @@ CPP_SNC_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(CPP_OBJS_SNC))
|
||||
|
||||
AS_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(AS_OBJS))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h
|
||||
index ac5f471..5efcce3 100644
|
||||
index ac5f471..9ebbcab 100644
|
||||
--- a/fhi_lib/app/src/common.h
|
||||
+++ b/fhi_lib/app/src/common.h
|
||||
@@ -28,7 +28,7 @@
|
||||
@@ -7,12 +7,12 @@ index ac5f471..5efcce3 100644
|
||||
#include <rte_mbuf.h>
|
||||
|
||||
-#define VERSIONX "oran_f_release_v1.0"
|
||||
+#define VERSIONX "oran_f_release_v1.4"
|
||||
+#define VERSIONX "oran_f_release_v1.3"
|
||||
|
||||
#define APP_O_DU 0
|
||||
#define APP_O_RU 1
|
||||
diff --git a/fhi_lib/lib/Makefile b/fhi_lib/lib/Makefile
|
||||
index eccc4ae..a97fdc6 100644
|
||||
index eccc4ae..b1b8f4b 100644
|
||||
--- a/fhi_lib/lib/Makefile
|
||||
+++ b/fhi_lib/lib/Makefile
|
||||
@@ -23,24 +23,46 @@ MYCUSTOMSPACE1='------------------------------------------------------------'
|
||||
@@ -83,9 +83,9 @@ index eccc4ae..a97fdc6 100644
|
||||
RTE_TARGET ?= x86_64-native-linux-icc
|
||||
-RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
|
||||
+ifeq ($(TARGET), x86)
|
||||
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkg-config --cflags-only-I libdpdk)
|
||||
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
|
||||
+else ifeq ($(TARGET), armv8)
|
||||
+RTE_INC := $(shell pkg-config --cflags-only-I libdpdk)
|
||||
+RTE_INC := $(pkgconf --cflags-only-I libdpdk)
|
||||
+endif
|
||||
|
||||
API_DIR := $(PROJECT_DIR)/api
|
||||
@@ -147,15 +147,6 @@ index eccc4ae..a97fdc6 100644
|
||||
|
||||
ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
|
||||
CPP_FLAGS += -fp-model fast=2 -no-prec-div -no-prec-sqrt -fast-transcendentals -restrict
|
||||
@@ -150,7 +187,7 @@ CPP_FLAGS += -fp-model fast -march=icelake-server -mintrinsic-promote -Wno-unus
|
||||
endif
|
||||
|
||||
|
||||
-INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) -I$(RTE_INC)
|
||||
+INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) $(RTE_INC)
|
||||
DEF :=
|
||||
ifeq ($(MLOG),1)
|
||||
INC += -I$(MLOG_DIR)/source
|
||||
@@ -186,8 +223,13 @@ CPP_SNC_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(CPP_OBJS_SNC))
|
||||
|
||||
AS_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(AS_OBJS))
|
||||
@@ -173,7 +164,7 @@ index eccc4ae..a97fdc6 100644
|
||||
CPP_FLAGS_FULL := $(CPP_FLAGS) $(CPP_COMP) $(INC) $(DEF)
|
||||
CPP_FLAGS_FULL_SNC := $(CPP_FLAGS) $(CPP_COMP_SNC) $(INC) $(DEF)
|
||||
diff --git a/fhi_lib/lib/api/xran_fh_o_du.h b/fhi_lib/lib/api/xran_fh_o_du.h
|
||||
index bacf597..1dd6d66 100644
|
||||
index bacf597..8bd7c66 100644
|
||||
--- a/fhi_lib/lib/api/xran_fh_o_du.h
|
||||
+++ b/fhi_lib/lib/api/xran_fh_o_du.h
|
||||
@@ -141,7 +141,7 @@ extern "C" {
|
||||
@@ -185,15 +176,7 @@ index bacf597..1dd6d66 100644
|
||||
#define XRAN_MAX_SET_BFWS (64) /**< Assumed 64Ant, BFP 9bit with 9K jumbo frame */
|
||||
|
||||
#define XRAN_MAX_PKT_BURST (448+4) /**< 4x14x8 symbols per ms */
|
||||
@@ -419,6 +419,7 @@ struct xran_io_cfg {
|
||||
uint16_t num_rxq; /**< number of RX queues per VF */
|
||||
char *dpdk_dev[XRAN_VF_MAX]; /**< VFs devices */
|
||||
char *bbdev_dev[1]; /**< BBDev dev name */
|
||||
+ char *bbdev_vfio_vf_token[1]; /**< BBDev dev token */
|
||||
int32_t bbdev_mode; /**< DPDK for BBDev */
|
||||
uint32_t dpdkIoVaMode; /**< IOVA Mode */
|
||||
uint32_t dpdkMemorySize; /**< DPDK max memory allocation */
|
||||
@@ -1193,6 +1194,31 @@ int32_t xran_reg_physide_cb_by_dev_id(void *pHandle, xran_fh_tti_callback_fn Cb,
|
||||
@@ -1193,6 +1193,31 @@ int32_t xran_reg_physide_cb_by_dev_id(void *pHandle, xran_fh_tti_callback_fn Cb,
|
||||
*/
|
||||
int32_t xran_get_slot_idx (uint32_t PortId, uint32_t *nFrameIdx, uint32_t *nSubframeIdx, uint32_t *nSlotIdx, uint64_t *nSecond);
|
||||
|
||||
@@ -276,7 +259,7 @@ index 46e0e1d..409ef4b 100644
|
||||
int xran_prepare_iq_symbol_portion(
|
||||
struct rte_mbuf *mbuf,
|
||||
diff --git a/fhi_lib/lib/ethernet/ethdi.c b/fhi_lib/lib/ethernet/ethdi.c
|
||||
index f5b2fd6..8fb0ec2 100644
|
||||
index f5b2fd6..144a65e 100644
|
||||
--- a/fhi_lib/lib/ethernet/ethdi.c
|
||||
+++ b/fhi_lib/lib/ethernet/ethdi.c
|
||||
@@ -37,7 +37,10 @@
|
||||
@@ -290,37 +273,8 @@ index f5b2fd6..8fb0ec2 100644
|
||||
#include <numa.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_common.h>
|
||||
@@ -185,14 +188,24 @@ static void check_port_link_status(uint8_t portid)
|
||||
printf("Port %d Link Up - speed %u "
|
||||
"Mbps - %s\n", (uint8_t)portid,
|
||||
(unsigned)link.link_speed,
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ (link.link_duplex == RTE_ETH_LINK_FULL_DUPLEX) ?
|
||||
+ ("full-duplex") : ("half-duplex\n")
|
||||
+#else
|
||||
(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
|
||||
- ("full-duplex") : ("half-duplex\n"));
|
||||
+ ("full-duplex") : ("half-duplex\n")
|
||||
+#endif
|
||||
+ );
|
||||
else
|
||||
printf("Port %d Link Down\n",
|
||||
(uint8_t)portid);
|
||||
}
|
||||
/* clear all_ports_up flag if any link down */
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ if (link.link_status == RTE_ETH_LINK_DOWN) {
|
||||
+#else
|
||||
if (link.link_status == ETH_LINK_DOWN) {
|
||||
+#endif
|
||||
all_ports_up = 0;
|
||||
break;
|
||||
}
|
||||
@@ -323,10 +336,11 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
uint64_t nWorkerCore = 1;
|
||||
uint32_t coreNum = sysconf(_SC_NPROCESSORS_CONF);
|
||||
@@ -325,8 +328,8 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
char bbdev_wdev[32] = "";
|
||||
+ char bbdev_vfio_vf_token[64] = "";
|
||||
char bbdev_vdev[32] = "";
|
||||
char iova_mode[32] = "--iova-mode=pa";
|
||||
- char socket_mem[32] = "--socket-mem=8192";
|
||||
@@ -330,36 +284,16 @@ index f5b2fd6..8fb0ec2 100644
|
||||
char ring_name[32] = "";
|
||||
int32_t xran_port = -1;
|
||||
queueid_t qi = 0;
|
||||
@@ -336,8 +350,8 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
@@ -336,7 +339,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
cpu = sched_getcpu();
|
||||
node = numa_node_of_cpu(cpu);
|
||||
|
||||
- char *argv[] = { name, core_mask, "-n2", iova_mode, socket_mem, socket_limit, "--proc-type=auto",
|
||||
- "--file-prefix", name, "-a0000:00:00.0", bbdev_wdev, bbdev_vdev};
|
||||
+ char *argv[] = { name, core_mask, "-n2", iova_mode, socket_mem, socket_limit, "--proc-type=auto", "--no-telemetry",
|
||||
+ "--file-prefix", name, "-a0000:00:00.0", bbdev_wdev, bbdev_vdev, bbdev_vfio_vf_token};
|
||||
"--file-prefix", name, "-a0000:00:00.0", bbdev_wdev, bbdev_vdev};
|
||||
|
||||
if (io_cfg == NULL)
|
||||
return 0;
|
||||
@@ -347,11 +361,17 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
// hw-accelerated bbdev
|
||||
printf("hw-accelerated bbdev %s\n", io_cfg->bbdev_dev[0]);
|
||||
snprintf(bbdev_wdev, RTE_DIM(bbdev_wdev), "-a%s", io_cfg->bbdev_dev[0]);
|
||||
+ if (io_cfg->bbdev_vfio_vf_token[0] != NULL) {
|
||||
+ snprintf(bbdev_vfio_vf_token, RTE_DIM(bbdev_vfio_vf_token), "--vfio-vf-token=%s", io_cfg->bbdev_vfio_vf_token[0]);
|
||||
+ }
|
||||
} else if (io_cfg->bbdev_mode == XRAN_BBDEV_MODE_HW_OFF){
|
||||
snprintf(bbdev_wdev, RTE_DIM(bbdev_wdev), "%s", "--vdev=baseband_turbo_sw");
|
||||
} else if (io_cfg->bbdev_mode == XRAN_BBDEV_MODE_HW_SW){
|
||||
printf("software and hw-accelerated bbdev %s\n", io_cfg->bbdev_dev[0]);
|
||||
snprintf(bbdev_wdev, RTE_DIM(bbdev_wdev), "-a%s", io_cfg->bbdev_dev[0]);
|
||||
+ if (io_cfg->bbdev_vfio_vf_token[0] != NULL) {
|
||||
+ snprintf(bbdev_vfio_vf_token, RTE_DIM(bbdev_vfio_vf_token), "--vfio-vf-token=%s", io_cfg->bbdev_vfio_vf_token[0]);
|
||||
+ }
|
||||
snprintf(bbdev_vdev, RTE_DIM(bbdev_vdev), "%s", "--vdev=baseband_turbo_sw");
|
||||
} else {
|
||||
rte_panic("Cannot init DPDK incorrect [bbdev_mode %d]\n", io_cfg->bbdev_mode);
|
||||
@@ -481,11 +501,13 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
@@ -481,11 +484,13 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
ctx->tx_ring[i] = rte_ring_create(ring_name, NUM_MBUFS_RING_TRX,
|
||||
rte_lcore_to_socket_id(*lcore_id), RING_F_SC_DEQ);
|
||||
PANIC_ON(ctx->tx_ring[i] == NULL, "failed to allocate rx ring");
|
||||
@@ -373,7 +307,7 @@ index f5b2fd6..8fb0ec2 100644
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -555,7 +577,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
@@ -555,7 +560,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
ctx->up_dl_pkt_gen_ring[i] = rte_ring_create(ring_name, NUM_MBUFS_RING,
|
||||
rte_lcore_to_socket_id(*lcore_id), /*RING_F_SC_DEQ*/0);
|
||||
PANIC_ON(ctx->up_dl_pkt_gen_ring[i] == NULL, "failed to allocate dl gen ring");
|
||||
@@ -383,7 +317,7 @@ index f5b2fd6..8fb0ec2 100644
|
||||
|
||||
return 1;
|
||||
diff --git a/fhi_lib/lib/ethernet/ethernet.c b/fhi_lib/lib/ethernet/ethernet.c
|
||||
index edda598..77e5ca7 100644
|
||||
index edda598..791256c 100644
|
||||
--- a/fhi_lib/lib/ethernet/ethernet.c
|
||||
+++ b/fhi_lib/lib/ethernet/ethernet.c
|
||||
@@ -37,7 +37,10 @@
|
||||
@@ -397,78 +331,6 @@ index edda598..77e5ca7 100644
|
||||
#include <rte_config.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_log.h>
|
||||
@@ -149,13 +152,22 @@ void xran_init_port(int p_id, uint16_t num_rxq, uint32_t mtu)
|
||||
static uint16_t nb_txd = BURST_SIZE;
|
||||
struct rte_ether_addr addr;
|
||||
struct rte_eth_rxmode rxmode = {
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ .mtu = MAX_RX_LEN,
|
||||
+#else
|
||||
.split_hdr_size = 0,
|
||||
.max_rx_pkt_len = MAX_RX_LEN,
|
||||
.offloads = DEV_RX_OFFLOAD_JUMBO_FRAME
|
||||
+#endif
|
||||
};
|
||||
struct rte_eth_txmode txmode = {
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ .mq_mode = RTE_ETH_MQ_TX_NONE,
|
||||
+ .offloads = RTE_ETH_TX_OFFLOAD_MULTI_SEGS
|
||||
+#else
|
||||
.mq_mode = ETH_MQ_TX_NONE,
|
||||
.offloads = DEV_TX_OFFLOAD_MULTI_SEGS
|
||||
+#endif
|
||||
};
|
||||
struct rte_eth_conf port_conf = {
|
||||
.rxmode = rxmode,
|
||||
@@ -174,8 +186,13 @@ void xran_init_port(int p_id, uint16_t num_rxq, uint32_t mtu)
|
||||
uint32_t num_mbufs = 0;
|
||||
|
||||
if (mtu <= 1500) {
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rxmode.offloads &= ~RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO;
|
||||
+ rxmode.mtu = RTE_ETHER_MAX_LEN;
|
||||
+#else
|
||||
rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
|
||||
rxmode.max_rx_pkt_len = RTE_ETHER_MAX_LEN;
|
||||
+#endif
|
||||
data_room_size = MBUF_POOL_ELM_SMALL;
|
||||
}
|
||||
|
||||
@@ -184,10 +201,19 @@ void xran_init_port(int p_id, uint16_t num_rxq, uint32_t mtu)
|
||||
drv_name = dev_info.driver_name;
|
||||
printf("initializing port %d for TX, drv=%s\n", p_id, drv_name);
|
||||
|
||||
- if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE){
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
|
||||
+#else
|
||||
+ if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
|
||||
+#endif
|
||||
+ {
|
||||
printf("set DEV_TX_OFFLOAD_MBUF_FAST_FREE\n");
|
||||
port_conf.txmode.offloads |=
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
|
||||
+#else
|
||||
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
|
||||
+#endif
|
||||
}
|
||||
|
||||
rte_eth_macaddr_get(p_id, &addr);
|
||||
@@ -293,8 +319,13 @@ void xran_add_eth_hdr_vlan(struct rte_ether_addr *dst, uint16_t ethertype, struc
|
||||
PANIC_ON(h == NULL, "mbuf prepend of ether_hdr failed");
|
||||
|
||||
/* Fill in the ethernet header. */
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_eth_macaddr_get(mb->port, &h->src_addr); /* set source addr */
|
||||
+ h->dst_addr = *dst; /* set dst addr */
|
||||
+#else
|
||||
rte_eth_macaddr_get(mb->port, &h->s_addr); /* set source addr */
|
||||
h->d_addr = *dst; /* set dst addr */
|
||||
+#endif
|
||||
h->ether_type = rte_cpu_to_be_16(ethertype); /* ethertype too */
|
||||
#if 0
|
||||
struct rte_ether_addr *s = &h->s_addr;
|
||||
diff --git a/fhi_lib/lib/src/xran_bfp_ref.cpp b/fhi_lib/lib/src/xran_bfp_ref.cpp
|
||||
index e6d3067..8e0abee 100644
|
||||
--- a/fhi_lib/lib/src/xran_bfp_ref.cpp
|
||||
@@ -703,7 +565,7 @@ index 789c6fd..a768efb 100644
|
||||
#include <rte_common.h>
|
||||
#include <rte_eal.h>
|
||||
diff --git a/fhi_lib/lib/src/xran_delay_measurement.c b/fhi_lib/lib/src/xran_delay_measurement.c
|
||||
index 4c943c8..7db51a8 100644
|
||||
index 4c943c8..d9e7983 100644
|
||||
--- a/fhi_lib/lib/src/xran_delay_measurement.c
|
||||
+++ b/fhi_lib/lib/src/xran_delay_measurement.c
|
||||
@@ -23,7 +23,10 @@
|
||||
@@ -717,155 +579,6 @@ index 4c943c8..7db51a8 100644
|
||||
#include <assert.h>
|
||||
#include <err.h>
|
||||
#include <arpa/inet.h>
|
||||
@@ -572,16 +575,28 @@ int xran_generate_delay_meas(uint16_t port_id, void* handle, uint8_t actionType,
|
||||
PANIC_ON(h == NULL, "mbuf prepend of ether_hdr failed");
|
||||
|
||||
/* Fill in the ethernet header. */
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_eth_macaddr_get(port_id, &h->src_addr); /* set source addr */
|
||||
+#else
|
||||
rte_eth_macaddr_get(port_id, &h->s_addr); /* set source addr */
|
||||
+#endif
|
||||
|
||||
if (p_xran_dev_ctx->fh_init.io_cfg.id)
|
||||
{
|
||||
// rte_ether_addr_copy( (struct rte_ether_addr *)p_xran_dev_ctx->fh_init.p_o_du_addr[port_id],&h->d_addr);
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ h->dst_addr = ctx->entities[port_id][ID_O_DU]; /* set dst addr */
|
||||
+#else
|
||||
h->d_addr = ctx->entities[port_id][ID_O_DU]; /* set dst addr */
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ h->dst_addr = ctx->entities[port_id][ID_O_RU]; /* set dst addr */
|
||||
+#else
|
||||
h->d_addr = ctx->entities[port_id][ID_O_RU]; /* set dst addr */
|
||||
+#endif
|
||||
// rte_ether_addr_copy( (struct rte_ether_addr *)p_xran_dev_ctx->fh_init.p_o_ru_addr[port_id],&h->d_addr);
|
||||
}
|
||||
|
||||
@@ -752,7 +767,11 @@ int xran_generate_delay_meas(uint16_t port_id, void* handle, uint8_t actionType,
|
||||
int8_t *pa = &p_xran_dev_ctx->fh_init.p_o_du_addr[0];
|
||||
printf("DST_MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pa[0],pa[1],pa[2],pa[3],pa[4],pa[5]);
|
||||
#endif
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_ether_addr_copy((struct rte_ether_addr *)&p_xran_dev_ctx->fh_init.p_o_du_addr[0], (struct rte_ether_addr *)&h->dst_addr.addr_bytes[0]);
|
||||
+#else
|
||||
rte_ether_addr_copy((struct rte_ether_addr *)&p_xran_dev_ctx->fh_init.p_o_du_addr[0], (struct rte_ether_addr *)&h->d_addr.addr_bytes[0]);
|
||||
+#endif
|
||||
|
||||
}
|
||||
else
|
||||
@@ -761,13 +780,25 @@ int xran_generate_delay_meas(uint16_t port_id, void* handle, uint8_t actionType,
|
||||
int8_t *pb = &p_xran_dev_ctx->fh_init.p_o_ru_addr[0];
|
||||
printf("DST_MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pb[0],pb[1],pb[2],pb[3],pb[4],pb[5]);
|
||||
#endif
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_ether_addr_copy((struct rte_ether_addr *)&p_xran_dev_ctx->fh_init.p_o_ru_addr[0], (struct rte_ether_addr *)&h->dst_addr.addr_bytes[0]);
|
||||
+#else
|
||||
rte_ether_addr_copy((struct rte_ether_addr *)&p_xran_dev_ctx->fh_init.p_o_ru_addr[0], (struct rte_ether_addr *)&h->d_addr.addr_bytes[0]);
|
||||
+#endif
|
||||
|
||||
}
|
||||
#ifdef XRAN_OWD_DEBUG_PKTS
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ uint8_t *pc = &h->src_addr.addr_bytes[0];
|
||||
+#else
|
||||
uint8_t *pc = &h->s_addr.addr_bytes[0];
|
||||
+#endif
|
||||
printf(" Src MAC from packet: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pc[0],pc[1],pc[2],pc[3],pc[4],pc[5]);
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ uint8_t *pd = &h->dst_addr.addr_bytes[0];
|
||||
+#else
|
||||
uint8_t *pd = &h->d_addr.addr_bytes[0];
|
||||
+#endif
|
||||
printf(" Dst MAC from packet: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pd[0],pd[1],pd[2],pd[3],pd[4],pd[5]);
|
||||
#endif
|
||||
// Copy dest address from above
|
||||
@@ -862,9 +893,15 @@ int xran_process_delmeas_request(struct rte_mbuf *pkt, void* handle, struct xran
|
||||
// 11) Fill the ethernet header properly by swapping src and dest addressed from the copied frame
|
||||
eth_hdr = rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr *);
|
||||
/* Swap dest and src mac addresses. */
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_ether_addr_copy(ð_hdr->dst_addr, &addr);
|
||||
+ rte_ether_addr_copy(ð_hdr->src_addr, ð_hdr->dst_addr);
|
||||
+ rte_ether_addr_copy(&addr, ð_hdr->src_addr);
|
||||
+#else
|
||||
rte_ether_addr_copy(ð_hdr->d_addr, &addr);
|
||||
rte_ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr);
|
||||
rte_ether_addr_copy(&addr, ð_hdr->s_addr);
|
||||
+#endif
|
||||
// Still need to check ol_flags state and update if necessary
|
||||
// Compute the delay td12 and save
|
||||
// Still need to define the DB to save the info and run averages
|
||||
@@ -872,9 +909,17 @@ int xran_process_delmeas_request(struct rte_mbuf *pkt, void* handle, struct xran
|
||||
// 12) Send the response right away
|
||||
#ifdef XRAN_OWD_DEBUG_PKTS
|
||||
struct rte_ether_hdr *h = (struct rte_ether_hdr *)rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr*);
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ uint8_t *pc = &h->src_addr.addr_bytes[0];
|
||||
+#else
|
||||
uint8_t *pc = &h->s_addr.addr_bytes[0];
|
||||
+#endif
|
||||
printf(" Src MAC from packet: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pc[0],pc[1],pc[2],pc[3],pc[4],pc[5]);
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ uint8_t *pd = &h->dst_addr.addr_bytes[0];
|
||||
+#else
|
||||
uint8_t *pd = &h->d_addr.addr_bytes[0];
|
||||
+#endif
|
||||
printf(" Dst MAC from packet: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pd[0],pd[1],pd[2],pd[3],pd[4],pd[5]);
|
||||
// printf("EtherType: %04"PRIx16" \n",&h->ether_type);
|
||||
#endif
|
||||
@@ -1100,9 +1145,15 @@ int xran_process_delmeas_rem_request(struct rte_mbuf *pkt, void* handle, struct
|
||||
// 9) Fill the ethernet header properly by swapping src and dest addressed from the copied frame
|
||||
eth_hdr = rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr *);
|
||||
/* Swap dest and src mac addresses. */
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_ether_addr_copy(ð_hdr->dst_addr, &addr);
|
||||
+ rte_ether_addr_copy(ð_hdr->src_addr, ð_hdr->dst_addr);
|
||||
+ rte_ether_addr_copy(&addr, ð_hdr->src_addr);
|
||||
+#else
|
||||
rte_ether_addr_copy(ð_hdr->d_addr, &addr);
|
||||
rte_ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr);
|
||||
rte_ether_addr_copy(&addr, ð_hdr->s_addr);
|
||||
+#endif
|
||||
// 10) Send the response right away
|
||||
pdm = (struct xran_ecpri_del_meas_pkt*)rte_pktmbuf_mtod_offset(pkt1, struct xran_ecpri_del_meas_pkt *, sizeof(struct rte_ether_hdr) );
|
||||
pdm->cmnhdr.bits.ecpri_payl_size = 10 + powdc->owdm_PlLength; // 10 correponds to the xran_ecpri_delay_meas_pl minus the dummy_bytes field which now allows the user to select the length for this field to be sent
|
||||
@@ -1177,9 +1228,15 @@ int xran_process_delmeas_rem_request_w_fup(struct rte_mbuf* pkt, void* handle, s
|
||||
// 7) Fill the ethernet header properly by swapping src and dest addressed from the copied frame
|
||||
eth_hdr = rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr *);
|
||||
/* Swap dest and src mac addresses. */
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_ether_addr_copy(ð_hdr->dst_addr, &addr);
|
||||
+ rte_ether_addr_copy(ð_hdr->src_addr, ð_hdr->dst_addr);
|
||||
+ rte_ether_addr_copy(&addr, ð_hdr->src_addr);
|
||||
+#else
|
||||
rte_ether_addr_copy(ð_hdr->d_addr, &addr);
|
||||
rte_ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr);
|
||||
rte_ether_addr_copy(&addr, ð_hdr->s_addr);
|
||||
+#endif
|
||||
// 8) Duplicate packet to be used for the follow up packet
|
||||
pkt2 = rte_pktmbuf_copy(pkt1, _eth_mbuf_pool, 0, UINT32_MAX);
|
||||
// 9) Record the current timestamp when the request with follow up is being sent
|
||||
@@ -1283,9 +1340,15 @@ int xran_process_delmeas_follow_up(struct rte_mbuf *pkt, void* handle, struct xr
|
||||
// 9) Fill the ethernet header properly by swapping src and dest addressed from the copied frame
|
||||
eth_hdr = rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr *);
|
||||
/* Swap dest and src mac addresses. */
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_ether_addr_copy(ð_hdr->dst_addr, &addr);
|
||||
+ rte_ether_addr_copy(ð_hdr->src_addr, ð_hdr->dst_addr);
|
||||
+ rte_ether_addr_copy(&addr, ð_hdr->src_addr);
|
||||
+#else
|
||||
rte_ether_addr_copy(ð_hdr->d_addr, &addr);
|
||||
rte_ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr);
|
||||
rte_ether_addr_copy(&addr, ð_hdr->s_addr);
|
||||
+#endif
|
||||
pdm = (struct xran_ecpri_del_meas_pkt*)rte_pktmbuf_mtod_offset(pkt1, struct xran_ecpri_del_meas_pkt *, sizeof(struct rte_ether_hdr) );
|
||||
pdm->cmnhdr.bits.ecpri_payl_size = 10 + powdc->owdm_PlLength; // 10 correponds to the xran_ecpri_delay_meas_pl minus the dummy_bytes field which now allows the user to select the length for this field to be sent
|
||||
pdm->cmnhdr.bits.ecpri_payl_size = rte_cpu_to_be_16(pdm->cmnhdr.bits.ecpri_payl_size);
|
||||
diff --git a/fhi_lib/lib/src/xran_dev.c b/fhi_lib/lib/src/xran_dev.c
|
||||
index 4acade1..c939edc 100644
|
||||
--- a/fhi_lib/lib/src/xran_dev.c
|
||||
@@ -1664,7 +1377,7 @@ index 72249bc..6b30084 100644
|
||||
#include <rte_config.h>
|
||||
|
||||
diff --git a/fhi_lib/lib/src/xran_tx_proc.c b/fhi_lib/lib/src/xran_tx_proc.c
|
||||
index 45a17a8..85ce6fa 100644
|
||||
index 45a17a8..28c5568 100644
|
||||
--- a/fhi_lib/lib/src/xran_tx_proc.c
|
||||
+++ b/fhi_lib/lib/src/xran_tx_proc.c
|
||||
@@ -35,7 +35,11 @@
|
||||
@@ -1679,58 +1392,6 @@ index 45a17a8..85ce6fa 100644
|
||||
|
||||
#include <rte_common.h>
|
||||
#include <rte_eal.h>
|
||||
@@ -1514,7 +1518,11 @@ xran_process_tx_sym_cp_on_opt(void* pHandle, uint8_t ctx_id, uint32_t tti, int32
|
||||
mb_oran_hdr_ext->buf_addr = ext_buff;
|
||||
mb_oran_hdr_ext->buf_iova = ((struct rte_mempool_objhdr*)RTE_PTR_SUB(mb_base, rte_mempool_objhdr_size))->iova + RTE_PTR_DIFF(ext_buff, mb_base);
|
||||
mb_oran_hdr_ext->buf_len = ext_buff_len;
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ mb_oran_hdr_ext->ol_flags |= RTE_MBUF_F_EXTERNAL;
|
||||
+#else
|
||||
mb_oran_hdr_ext->ol_flags |= EXT_ATTACHED_MBUF;
|
||||
+#endif
|
||||
mb_oran_hdr_ext->shinfo = p_share_data;
|
||||
mb_oran_hdr_ext->data_off = (uint16_t)RTE_MIN((uint16_t)RTE_PKTMBUF_HEADROOM, (uint16_t)mb_oran_hdr_ext->buf_len) - rte_ether_hdr_size;
|
||||
mb_oran_hdr_ext->data_len = (uint16_t)(mb_oran_hdr_ext->data_len + rte_ether_hdr_size);
|
||||
@@ -1532,8 +1540,13 @@ xran_process_tx_sym_cp_on_opt(void* pHandle, uint8_t ctx_id, uint32_t tti, int32
|
||||
|
||||
/* Fill in the ethernet header. */
|
||||
#ifndef TRANSMIT_BURST
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_eth_macaddr_get(mb_oran_hdr_ext->port, &((struct rte_ether_hdr*)pStart)->src_addr); /* set source addr */
|
||||
+ ((struct rte_ether_hdr*)pStart)->dst_addr = eth_ctx->entities[vf_id][ID_O_RU]; /* set dst addr */
|
||||
+#else
|
||||
rte_eth_macaddr_get(mb_oran_hdr_ext->port, &((struct rte_ether_hdr*)pStart)->s_addr); /* set source addr */
|
||||
((struct rte_ether_hdr*)pStart)->d_addr = eth_ctx->entities[vf_id][ID_O_RU]; /* set dst addr */
|
||||
+#endif
|
||||
((struct rte_ether_hdr*)pStart)->ether_type = ETHER_TYPE_ECPRI_BE; /* ethertype */
|
||||
#endif
|
||||
nPktSize = sizeof(struct rte_ether_hdr)
|
||||
@@ -1878,7 +1891,11 @@ xran_process_tx_srs_cp_on(void* pHandle, uint8_t ctx_id, uint32_t tti, int32_t s
|
||||
mb_oran_hdr_ext->buf_addr = ext_buff;
|
||||
mb_oran_hdr_ext->buf_iova = ((struct rte_mempool_objhdr*)RTE_PTR_SUB(mb_base, rte_mempool_objhdr_size))->iova + RTE_PTR_DIFF(ext_buff, mb_base);
|
||||
mb_oran_hdr_ext->buf_len = ext_buff_len;
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ mb_oran_hdr_ext->ol_flags |= RTE_MBUF_F_EXTERNAL;
|
||||
+#else
|
||||
mb_oran_hdr_ext->ol_flags |= EXT_ATTACHED_MBUF;
|
||||
+#endif
|
||||
mb_oran_hdr_ext->shinfo = p_share_data;
|
||||
mb_oran_hdr_ext->data_off = (uint16_t)RTE_MIN((uint16_t)RTE_PKTMBUF_HEADROOM, (uint16_t)mb_oran_hdr_ext->buf_len) - rte_ether_hdr_size;
|
||||
mb_oran_hdr_ext->data_len = (uint16_t)(mb_oran_hdr_ext->data_len + rte_ether_hdr_size);
|
||||
@@ -1887,8 +1904,13 @@ xran_process_tx_srs_cp_on(void* pHandle, uint8_t ctx_id, uint32_t tti, int32_t s
|
||||
pStart = (char*)((char*)mb_oran_hdr_ext->buf_addr + mb_oran_hdr_ext->data_off);
|
||||
|
||||
/* Fill in the ethernet header. */
|
||||
+#if (RTE_VER_YEAR >= 21)
|
||||
+ rte_eth_macaddr_get(mb_oran_hdr_ext->port, &((struct rte_ether_hdr*)pStart)->src_addr); /* set source addr */
|
||||
+ ((struct rte_ether_hdr*)pStart)->dst_addr = eth_ctx->entities[vf_id][ID_O_RU]; /* set dst addr */
|
||||
+#else
|
||||
rte_eth_macaddr_get(mb_oran_hdr_ext->port, &((struct rte_ether_hdr*)pStart)->s_addr); /* set source addr */
|
||||
((struct rte_ether_hdr*)pStart)->d_addr = eth_ctx->entities[vf_id][ID_O_RU]; /* set dst addr */
|
||||
+#endif
|
||||
((struct rte_ether_hdr*)pStart)->ether_type = ETHER_TYPE_ECPRI_BE; /* ethertype */
|
||||
|
||||
nPktSize = sizeof(struct rte_ether_hdr)
|
||||
diff --git a/fhi_lib/lib/src/xran_up_api.c b/fhi_lib/lib/src/xran_up_api.c
|
||||
index fe22a1f..3fd369b 100644
|
||||
--- a/fhi_lib/lib/src/xran_up_api.c
|
||||
|
||||
@@ -1415,11 +1415,6 @@ uint32_t nr_timer_elapsed_time(const NR_timer_t *timer)
|
||||
return timer->counter;
|
||||
}
|
||||
|
||||
uint32_t nr_timer_remaining_time(const NR_timer_t *timer)
|
||||
{
|
||||
return timer->target - timer->counter;
|
||||
}
|
||||
|
||||
void nr_timer_setup(NR_timer_t *timer, const uint32_t target, const uint32_t step)
|
||||
{
|
||||
timer->target = target;
|
||||
|
||||
@@ -222,12 +222,6 @@ bool nr_timer_is_active(const NR_timer_t *timer);
|
||||
* @return Time passed since start of timer
|
||||
*/
|
||||
uint32_t nr_timer_elapsed_time(const NR_timer_t *timer);
|
||||
/**
|
||||
* @brief To return how much time is left until the timer expires
|
||||
* @param timer Timer to be checked
|
||||
* @return Time left until the timer expires
|
||||
*/
|
||||
uint32_t nr_timer_remaining_time(const NR_timer_t *timer);
|
||||
|
||||
int set_default_nta_offset(frequency_range_t freq_range, uint32_t samples_per_subframe);
|
||||
|
||||
|
||||
@@ -692,8 +692,8 @@ void run_telnetsrv(void) {
|
||||
break;
|
||||
}
|
||||
|
||||
//if (telnetparams.telnetdbg > 0)
|
||||
TELNET_LOG("Command received: readc %i filled %i \"%s\"\n", readc, filled, buf);
|
||||
if (telnetparams.telnetdbg > 0)
|
||||
TELNET_LOG("Command received: readc %i filled %i \"%s\"\n", readc, filled, buf);
|
||||
|
||||
if (buf[0] == '!') {
|
||||
if (buf[1] == '!') {
|
||||
|
||||
@@ -41,12 +41,12 @@ PTP enabled switches and grandmaster clock we have tested with:
|
||||
|
||||
These are the radio units we've used for testing:
|
||||
|
||||
| Vendor | Software Version |
|
||||
|-----------------------|-----------------------------|
|
||||
| Foxconn RPQN-7801E RU | 2.6.9r254 |
|
||||
| Foxconn RPQN-7801E RU | 3.1.15_0p4 |
|
||||
| Foxconn RPQN-7801E RU | 3.2.0q.551.12.E.rc2.srs-AIO |
|
||||
| WNC R1220-078LE | 1.9.0 |
|
||||
| Vendor | Software Version |
|
||||
|-------------|------------------|
|
||||
| Foxconn RPQN-7801E RU | 2.6.9r254 |
|
||||
| Foxconn RPQN-7801E RU | 3.1.15_0p4 |
|
||||
| Foxconn RPQN-7801E RU | v3.2.0q.551.12.E.rc2.srs-AIO |
|
||||
|
||||
|
||||
The UEs that have been tested and confirmed working with Aerial are the following:
|
||||
|
||||
@@ -80,7 +80,7 @@ To set up the L1 and install the components manually refer to this [instructions
|
||||
| Applicative Threads | Allocated CPUs |
|
||||
|------------------------|----------------|
|
||||
| PTP & PHC2SYS Services | 41 |
|
||||
| OAI `nr-softmodem` | 13-14 |
|
||||
| OAI `nr-softmodem` | 13-20 |
|
||||
|
||||
## PTP configuration
|
||||
|
||||
@@ -230,10 +230,10 @@ After preparing the L1 software, the container needs to be committed to create a
|
||||
In this file the RU MAC address needs to be specified before commiting the image.
|
||||
|
||||
```bash
|
||||
~$ docker commit nv-cubb cubb-build:25-1
|
||||
~$ docker commit nv-cubb cubb-build:24-3
|
||||
~$ docker image ls
|
||||
..
|
||||
cubb-build 25-1 824156e0334c 2 weeks ago 23.9GB
|
||||
cubb-build 24-3 824156e0334c 2 weeks ago 23.9GB
|
||||
-..
|
||||
```
|
||||
|
||||
|
||||
@@ -139,10 +139,6 @@ These modes of operation are supported:
|
||||
- evaluation of CQI report
|
||||
- MAC scheduling of SR reception
|
||||
- Intra-frequency handover
|
||||
- Inter-frequency handover
|
||||
- Measurement gaps are automatically computed at the DU if the CU has neighbor information and the configured
|
||||
neighbors include cells operating on different frequencies
|
||||
- DUs must be synchronized with each other for the measurements to be properly performed
|
||||
- Initial support for RedCap
|
||||
- Scheduling of SIBs (2, 19)
|
||||
|
||||
|
||||
@@ -1,90 +1,53 @@
|
||||
This document describes the broad way in which the VNF and PNF work internally,
|
||||
from configuration, to P5 and P7 message exchange and processing.
|
||||
Their internal processing is broadly independent on which transport mechanism
|
||||
is responsible for exchanging data between the 2 components.
|
||||
# global
|
||||
|
||||
To read more about the transport mechanisms available, and how to run the split, please refer to
|
||||
[this file](./nfapi.md).
|
||||
xnf is pnf or vnf
|
||||
|
||||
[[_TOC_]]
|
||||
The xnf starting functions are configure_nfapi_xnf()
|
||||
|
||||
# VNF/PNF Split
|
||||
The OAI code that read the configuration parameters call these functions that will create autonomous thread for xnf control part
|
||||
|
||||
The gNB is split into VNF(L2+) and PNF(L1)
|
||||
These control threads create a SCTP socket by Linux API call (no use of OpenAir internal architecture with SCTP itti thread).
|
||||
|
||||
These component are configured via the functions:
|
||||
The main() function of softmodem has to create and start the other threads+loop on event for appropriate work: RF Rx in pnf, NGAP, GTP-U, X2, RLC, PDCP for vnf
|
||||
|
||||
- configure_nr_nfapi_vnf()
|
||||
- configure_nr_nfapi_pnf()
|
||||
NFAPI has it's own code directly on Linux+Posix, it doesn't reuse any piece of the OpenAir framework: SCTP thread, thread creation and management, ...
|
||||
|
||||
These functions initialize the configuration appropriate for the transport mechanism selected ( setting the
|
||||
pack/unpack function pointers, as well as the appropriate send functions )
|
||||
## signaling (P5) xnf main loop
|
||||
|
||||
After this, a thread is created for the P5 receive loop, which initializes the transport and receive loop
|
||||
nfapi_vnf_start() create the SCTP socket, then do event waiting in a infinite loop while(vnf->terminate == 0). It accepts the pnf connections, then process the messages on reception
|
||||
|
||||
This created thread may be only for P5 messages, or P5 and P7, depending on the transport type
|
||||
nfapi_pnf_start() initiate connection to vnf until it has a link. Then it enter a similar infinite loop in pnf_message_pump()
|
||||
|
||||
- When using socket-based communication (which uses nFAPI encoding), the receiving loop for P7 messages is separate from
|
||||
P5, it starts upon the PNF_START exchange
|
||||
- In the other transport mechanisms (WLS and nvIPC, which use FAPI encoding), the receiving loop is the same for P5 and
|
||||
P7 messages, the P7 configuration is done immediately after the P5 configuration.
|
||||
|
||||
Since the first P7 messages is only sent/received after the START exchange, we can logically treat the loops as separate
|
||||
, we won't receive P7 messages before finishing the P5 ones ( except for the STOP exchange )
|
||||
|
||||
## P5 interface main loop
|
||||
|
||||
After the P5 configuration, both the VNF and PNF have a thread waiting to "consume" (n)FAPI messages exchanged between
|
||||
them
|
||||
|
||||
Upon the reception of a message (whether in its entirety or segmented in the case of nFAPI), the messages are sent to
|
||||
the appropriate handler:
|
||||
|
||||
- pnf_nr_handle_p5_message
|
||||
- vnf_nr_handle_p4_p5_message
|
||||
|
||||
In each of these functions, there's a switch calling the appropriate handler according to the message ID, for example:
|
||||
After some checks, when a message is obtained, it calls pnf_handle_p5_message() or vnf_handle_p4_p5_message() that have a switch on each p5 message types: the enum nfapi_message_id_e
|
||||
|
||||
Each message type has it's own processing function in the switch, like
|
||||
```
|
||||
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE:
|
||||
vnf_nr_handle_start_response(pRecvMsg, recvMsgLen, config, p5_idx);
|
||||
break;
|
||||
case NFAPI_START_RESPONSE:
|
||||
vnf_handle_start_response(pRecvMsg, recvMsgLen, config, p5_idx);
|
||||
break;
|
||||
```
|
||||
|
||||
These loops are autonomous in their thread waiting incoming message.
|
||||
|
||||
## P7 interface main loop
|
||||
## P7 xnf main loop
|
||||
|
||||
- Note: As explained before, the P7 reception loop is the same as the P5 messages when not using socket-based
|
||||
communication
|
||||
When the p5 interface receives appropriate message, it starts the p7 interface by launching a thread (see the calls to pthread_create() in nfapi/oai_integration/nfapi_xnf.c)
|
||||
|
||||
In this case, when the P5 interface receives appropriate message, it starts the p7 interface by launching a thread
|
||||
The p7 main loops starting is a bit simpler, thanks to UDP non connected protocol. The xnf_dispatch_p7_message() do p7 fragments re-assembly, then
|
||||
calls xnf_dispatch_p7_message() that have the big switch on message type (as in p5 above description)
|
||||
|
||||
- On the PNF, this is done in the START.request handler ( nr_start_request(...) )
|
||||
- On the VNF, this is done in ( configure_nr_p7_vnf(...) )
|
||||
|
||||
Much in the same way as when processing P5 messages, the following functions are called to unpack and process them:
|
||||
|
||||
- pnf_nr_handle_p7_message
|
||||
- vnf_nr_handle_p7_message
|
||||
|
||||
```
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
|
||||
vnf_handle_nr_slot_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
```
|
||||
So, we have the logic for UL reception in vnf, and DL reception in pnf
|
||||
|
||||
## P7 UL transmission by PNF
|
||||
|
||||
RF samples are received, and decoding is done by the PNF using control data transmitted by the VNF to the PNF through
|
||||
downlink p7 messages (UL_TTI.request and UL_DCI.request).
|
||||
RF samples are received, and decoding is done by the PNF using control data transmitted by the VNF to the PNF through downlink p7 messages (UL_TTI_req and UL_DCI_req).
|
||||
|
||||
After decoding, results are accumulated into the gNB->UL_INFO structure at the PNF.
|
||||
After decoding, results are accumulated into the xNB->UL_INFO structure at the PNF.
|
||||
|
||||
The data in the UL_INFO struct is transmitted through the configured send function pointer (send_p7_msg), which packs
|
||||
the message into a buffer according to the encoding and sends it to the VNF
|
||||
The data in the UL_INFO struct is transmitted through a socket in the form of 'uplink indication functions' from the PNF to the VNF. Each uplink indication message is transmitted from their respective handle functions in NR_UL_indication(). For example,
|
||||
|
||||
```
|
||||
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
||||
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
if (UL_info->rach_ind.number_of_pdus>0) {
|
||||
@@ -93,186 +56,67 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
||||
}
|
||||
}
|
||||
|
||||
....
|
||||
|
||||
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) {
|
||||
ind->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION;
|
||||
return nfapi_pnf_p7_nr_rach_ind(p7_config_g, ind);
|
||||
}
|
||||
|
||||
.....
|
||||
|
||||
int nfapi_pnf_p7_nr_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rach_indication_t* ind)
|
||||
{
|
||||
if(config == NULL || ind == NULL)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||
AssertFatal(_this->_public.send_p7_msg, "Function pointer must be configured|");
|
||||
return _this->_public.send_p7_msg(_this, (nfapi_nr_p7_message_header_t*)ind, sizeof(nfapi_nr_rach_indication_t));
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## P7 UL reception at VNF
|
||||
|
||||
Through the P7 reception loop, the VNF receives a buffer containing the messages, which it handles by the following
|
||||
process:
|
||||
|
||||
- Unpack the header by use of the hdr_unpack_func function pointer
|
||||
- According to the Message ID in the header, send the buffer to the appropriate handler by use of a switch statement:
|
||||
|
||||
```
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
|
||||
vnf_handle_nr_slot_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
Through the infinite loop [while(vnf_p7->terminate == 0)] running in nfapi_nr_vnf_p7_start(), the VNF receives and unpacks the uplink indication message received on its socket. Based on the unpacked messages, UL_INFO struct on the VNF side gets populated.
|
||||
|
||||
```
|
||||
|
||||
- In the handler function, unpack the entire message, by using the unpack_func function pointer.
|
||||
- If the unpack procedure is successful, call the previously configure callback for that message type:
|
||||
|
||||
```
|
||||
nfapi_nr_slot_indication_scf_t ind = {0};
|
||||
const bool result = vnf_p7->_public.unpack_func(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config);
|
||||
if(!result)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||
}
|
||||
else
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling NR SLOT Indication\n", __FUNCTION__);
|
||||
if(vnf_p7->_public.nr_slot_indication)
|
||||
// have a p7 message
|
||||
if(FD_ISSET(vnf_p7->socket, &rfds))
|
||||
{
|
||||
(vnf_p7->_public.nr_slot_indication)(&ind);
|
||||
vnf_nr_p7_read_dispatch_message(vnf_p7);
|
||||
}
|
||||
free_slot_indication(&ind);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
vnf_nr_dispatch_p7_message() is the function that contains the switch on various message headers so that the appropriate
|
||||
unpack function is called.
|
||||
vnf_nr_dispatch_p7_message() is the function that contains the switch on various message headers so that the appropriate unpack function is called.
|
||||
|
||||
## P7 DL Transmission by VNF
|
||||
## P7 DL Transmission by VNF
|
||||
|
||||
DL messages are scheduled at the VNF, through gNB_dlsch_ulsch_scheduler(). gNB_dlsch_ulsch_scheduler() is called when
|
||||
handling a SLOT.indication message in trigger_scheduler().
|
||||
DL messages are scheduled at the VNF, through NR_UL_indication(). NR_UL_indication() is called when the SFN/slot in the UL_info structure changes (this acts as a trigger for next slot processing, instead of running a separate clock at the VNF). The SFN/slot at the VNF in UL_info is updated using the slot_indication uplink p7 message, which is sent at the beginning of every slot by the PNF. The slot_indication message contains SFN/slot of the TX_thread, so that the scheduler operates slot_ahead slots ahead of the RX thread. This ensures that UL_tti_req is received before RX slot processing at the PNF.
|
||||
|
||||
The function trigger_scheduler(nfapi_nr_slot_indication_scf_t *slot_ind) calls the functions oai_nfapi_[DL P7 msg]_
|
||||
req(), calling in turn call the send_p7_msg function pointer, which contain the logic to pack the message into a buffer
|
||||
and send it to the PNF.
|
||||
Finally, NR_UL_indication is called to process the other P7 messages received from the PNF that were put in theire
|
||||
respective queues.
|
||||
For example, the TX_DATA.request message is sent in the following manner:
|
||||
The function NR_schedule_response calls oai_nfapi_[DL P7 msg]_req(), which contains the routines for packing + transmission of scheduled messages through the socket to the PNF. For example, to send the 'TX_data_req' p7 message
|
||||
|
||||
```
|
||||
if (g_sched_resp.TX_req.Number_of_PDUs > 0)
|
||||
oai_nfapi_tx_data_req(&g_sched_resp.TX_req);
|
||||
|
||||
...
|
||||
|
||||
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
|
||||
if (Sched_INFO->TX_req->Number_of_PDUs > 0)
|
||||
{
|
||||
LOG_D(NR_PHY, "Entering oai_nfapi_nr_tx_data_req sfn:%d,slot:%d\n", tx_data_req->SFN, tx_data_req->Slot);
|
||||
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
|
||||
tx_data_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
|
||||
//LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
|
||||
bool retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
||||
|
||||
if (!retval) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
tx_data_req->Number_of_PDUs = 0;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
bool nfapi_vnf_p7_tx_data_req(nfapi_vnf_p7_config_t* config, nfapi_nr_tx_data_request_t* req)
|
||||
{
|
||||
if(config == 0 || req == 0)
|
||||
return -1;
|
||||
|
||||
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
||||
AssertFatal(config->send_p7_msg, "Function pointer must be configured|");
|
||||
return config->send_p7_msg(vnf_p7, &req->header);
|
||||
oai_nfapi_tx_data_req(Sched_INFO->TX_req);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## VNF functional flowchart
|
||||
|
||||
```mermaid
|
||||
|
||||
graph TD
|
||||
softmodem_start[nr-softmodem init] --> P5_configuration[configure_nr_nfapi_vnf] --> transport_init[Transport mechanism init] --> send_first_msg[Send first P5 message to PNF]
|
||||
transport_init[Transport mechanism init] --> P5_recv_loop[P5 receive loop] -- P5 Message processing --> P5_recv_loop[P5 receive loop]
|
||||
P5_recv_loop[P5 receive loop] -- Start.response callback called --> P7_config[P7 Configuration] --> P7_loop[P7 Loop] --> P7_msg_recv[P7 message received] --> call_vnf_handle_p7[Call vnf_nr_handle_p7_msg] --> hdr_unpack[Unpack header] --> call_specific_p7_handler[Call specific P7 message handler] --> slot_ind[Is a SLOT.indication?] -- Yes --> trig_scheduler[Call trigger_scheduler] --> gNB_ulsch_dlsch_sched[Call gNB_dlsch_ulsch_scheduler] --> send_p7_dl[Process and send P7 messages to PNF] --> call_ul_ind[Call NR_UL_indication] --> proc_p7[Process P7 messages in queue] --> P7_loop[P7 Loop]
|
||||
slot_ind[Is a SLOT.indication?] -- No --> put_queue[Put message in queue] --> P7_loop[P7 Loop];
|
||||
|
||||
pselect[VNF socket pselect] -- timed out : end of slot --> call_sched[Call Scheduler NR_UL_indication] -- oai_nfapi_***_req sends the DL p7 msg--> slot_inc[Increment sfn/slot];
|
||||
pselect[VNF socket pselect] -- UL p7 xyz msg recvd --> msg_recvd[Read message vnf_nr_p7_read_dispatch_message] --> header_unpack[Unpack Header] -- switch cases on header --> unpack_msg[Handle Message vnf_handle_nr_xyz] --> fill_ul_info[Fill UL info struct with fn pointer vnf_p7->_public.nr_rx_xyz];
|
||||
fill_ul_info -- update pselect_timeout: next_slot_start - time_xyz_msg_recvd-->pselect;
|
||||
slot_inc -- next slot --> pselect
|
||||
|
||||
```
|
||||
Note that since DL P7 message reception and TX/RX processing are done on separate threads, there is the issue of the L1 processing threads trying to do their job before the required P7 message is received. In the case of RX processing, since the scheduler operates slot_ahead slots ahead of the RX thread, the required messages conveniently arrive earlier than they are required. However, in the case of TX processing, this cannot be ensured if the scheduler is exactly in sync with the TX thread.
|
||||
|
||||
## P7 DL Reception at PNF
|
||||
Therefore, we operate the VNF vnf_slot_ahead (which is currently 2) slots ahead of the PNF. This is to ensure that the DL fapi structures for a particular TX slot are all received before TX processing for that slot.
|
||||
|
||||
Through the infinite loop [while(pnf_p7->terminate == 0)] running in pnf_nr_p7_message_pump(), the PNF receives and
|
||||
unpacks the downlink P7 message received on its socket. Based on the unpacked message, the appropriate message
|
||||
structures are filled in the PNF, and these are used further down the pipeline for processing.
|
||||
Through the P7 reception loop, the PNF receives a buffer containing a P7 message from the VNF, which it processes the
|
||||
following way:
|
||||
## P7 DL Reception at PNF
|
||||
|
||||
- Unpack the header by use of the hdr_unpack_func function pointer
|
||||
- According to the Message ID in the header, send the buffer to the appropriate handler by use of a switch statement:
|
||||
Through the infinite loop [while(pnf_p7->terminate == 0)] running in pnf_nr_p7_message_pump(), the PNF receives and unpacks the downlink P7 message received on its socket. Based on the unpacked message, the appropriate message structures are filled in the PNF, and these are used further down the pipeline for processing.
|
||||
|
||||
```
|
||||
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
|
||||
pnf_handle_dl_tti_request(pRecvMsg, recvMsgLen, pnf_p7);
|
||||
break;
|
||||
```
|
||||
|
||||
- In the handler function, the SFN and Slot are peeked from the message
|
||||
- The SFN and slot are checked to determine if the message is inside the appropriate timing window
|
||||
- If so, the message is unpacked into the P7 Slot buffer:
|
||||
|
||||
```
|
||||
pnf_p7->slot_buffer[buffer_index].sfn = frame;
|
||||
pnf_p7->slot_buffer[buffer_index].slot = slot;
|
||||
nfapi_nr_dl_tti_request_t *req = &pnf_p7->slot_buffer[buffer_index].dl_tti_req;
|
||||
pnf_p7->nr_stats.dl_tti.ontime++;
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
|
||||
"POPULATE DL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n",
|
||||
pnf_p7->sfn,
|
||||
pnf_p7->slot,
|
||||
frame,
|
||||
slot,
|
||||
buffer_index);
|
||||
const bool result = pnf_p7->_public.unpack_func(pRecvMsg, recvMsgLen, req, sizeof(*req), &(pnf_p7->_public.codec_config));
|
||||
|
||||
```
|
||||
|
||||
- The messages are later processed in the NR_slot_indication function, which is called in the tx_func function (
|
||||
L1_tx_thread )
|
||||
|
||||
## PNF functional flowchart
|
||||
While receiving the DL P7 message, we check whether the message was received within a timing window from which it was sent. The duration of the window can be set by the user (set as a parameter for xnf in the p5 messages). Note that the DL information must be received by the PNF within a timing window at least lesser than the duration of slot_ahead variable (timing_window <= slot_ahead * slot_duration).
|
||||
|
||||
```mermaid
|
||||
|
||||
graph TD
|
||||
softmodem_start[nr-softmodem init] --> init_l1_tx_thread[Init L1 TX Thread] --> tx_func[Call tx_func] --> nr_slot_ind[Call NR_slot_indication] --> pnf_slot_ind[Call handle_nr_slot_ind] --> send_slot_ind[Send SLOT.ind to VNF] --> get_from_slot_buffer[Get P7 messages from slot_buffer] --> proc_p7_dl[Process P7 messages from VNF] --> tx_func
|
||||
softmodem_start[nr-softmodem init] --> init_l1_rx_thread[Init L1 RX Thread] --> rx_func[Call rx_func] --> nr_ul_ind[Call NR_UL_indication] --> send_p7_vnf[Send P7 messages to VNF] --> rx_func
|
||||
softmodem_start[nr-softmodem init] --> P5_configuration[configure_nr_nfapi_pnf] --> transport_init[Transport mechanism init] --> p5_loop[P5 Loop] -- Process P5 messages --> p5_loop
|
||||
p5_loop -- START.request callback called --> p7_config[P7 Configuration] --> l1_north_init_gnb[Call l1_north_init_gNB] --> nr_if_module_init[Call NR_IF_Module_Init] --> install_slot_ind_cb[Install NR_slot_indication callback]
|
||||
p7_config[P7 Configuration] --> p7_loop[P7 Loop] --> p7_recv[Receive P7 message] --> pnf_handle_p7[Call pnf_nr_handle_p7_message] --> hdr_unpack[Unpack header with hdr_unpack] --> p7_handler[Call pnf_handle_<msg_type>] --> peek_sfn[Peek SFN/Slot and check if in timing window] --> p7_unpack[Unpack message into slot_buffer] --> p7_loop
|
||||
graph TB
|
||||
pselect[PNF socket pselect] -- timed out : end of slot --> slot_inc[Increment sfn/slot];
|
||||
pselect[PNF socket pselect] -- DL p7 xyz msg recvd --> msg_recvd[Read message pnf_nr_nfapi_p7_read_dispatch_message] --> header_unpack[Unpack Header] -- switch cases on header --> unpack_msg[Unpack Message pnf_handle_nr_xyz] --> fill_pnf_p7[Fill pnf_p7 global structure pnf_handle_nr_xyz] --Data from pnf_p7 struct copied to fapi structures using pnf_phy_***_req. Called every slot from handle_nr_slot_ind-->pselect;
|
||||
|
||||
slot_inc -- next slot --> pselect
|
||||
```
|
||||
Once the messages are received, they are filled into slot buffers, and are stored until the processing of the slot that they were meant for.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ There is some general information in the [OpenAirInterface Gitlab Wiki](https://
|
||||
- [How to use the L2 simulator](./L2NFAPI.md)
|
||||
- [How to use the OAI channel simulator](../openair1/SIMULATION/TOOLS/DOC/channel_simulation.md)
|
||||
- [How to use multiple BWPs](./RUN_NR_multiple_BWPs.md)
|
||||
- [How to run OAI-VNF and OAI-PNF](./nfapi.md): how to run the FAPI/nFAPI split,
|
||||
- [How to run OAI-VNF and OAI-PNF](./nfapi.md): how to run the nFAPI split,
|
||||
including some general remarks on FAPI/nFAPI.
|
||||
- [How to use the positioning reference signal (PRS)](./RUN_NR_PRS.md)
|
||||
- [How to use device-to-device communication (D2D, 4G)](./d2d_emulator_setup.txt)
|
||||
|
||||
@@ -291,7 +291,7 @@ Note that while 38.331 requires only one RRC transaction to happen at a time,
|
||||
the 5G RRC does not actually ensure this; it only tries to prevent it by
|
||||
chaining of transactions and some checks. For instance, the Security Mode
|
||||
procedure is followed by a UE capability procedure, and some procedures are not
|
||||
executed if others are ongoing (ex.: handover if there is reconfiguration).
|
||||
executed if others are ongoing (ex.: handover if there is reconfiguratio).
|
||||
However, it might be possible to trigger a procedure while another is ongoing.
|
||||
|
||||
As of now, no queueing mechanims exists to ensure only one operation is
|
||||
@@ -303,7 +303,7 @@ Handover-related data is stored in a per-UE structure of type
|
||||
`nr_handover_context_t`. It is a pointer and only set during handover
|
||||
operation. This data structure has in turn two pointers, one to the source CU
|
||||
(`nr_ho_source_cu_t`), and one to the target CU (`nr_ho_target_cu_t`). In F1,
|
||||
both are present. In N2 and Xn, only one pointer is supposed to be set at the
|
||||
both are present. In N2 and Xn, only one pointer is supposed to be set a the
|
||||
corresponding CU.
|
||||
|
||||
`nr_ho_source_cu_t` contains notably a function pointer `ho_cancel` for
|
||||
|
||||
@@ -54,11 +54,7 @@ Start DU0:
|
||||
|
||||
sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf --rfsimulator.serveraddr 127.0.0.1
|
||||
|
||||
This will show an error `[HW] connect() to 127.0.0.1:4043 failed,
|
||||
errno(111)`. _This is expected_, because the RFsim server is at the UE (to be
|
||||
able to serve two RFsim clients, one DU each; see below for more info). Proceed
|
||||
by starting the UE, and let it connect completely (this should make the error
|
||||
go away):
|
||||
Start the UE, and let it connect completely:
|
||||
|
||||
sudo ./nr-uesoftmodem -C 3450720000 -r 106 --numerology 1 --ssb 516 -O <config> --rfsim --rfsimulator.serveraddr server
|
||||
|
||||
@@ -123,7 +119,7 @@ You can do handover across DUs with a COTS UE. Note that these DUs should be
|
||||
separated by at least multiple meters to ensure that the UE will receive
|
||||
different signal strengths when moving between cells.
|
||||
|
||||
We support both intra-frequency and inter-frequency handovers. We have verified with USRPs
|
||||
We only support intra-frequency handovers yet. We have verified with USRPs
|
||||
only, although other radios should work as well.
|
||||
|
||||
For UEs, we verified Quectel modules and iPhones. Note, though, that not all
|
||||
@@ -146,7 +142,7 @@ neighbour relation of the DUs at the CU. To do so, proceed as follows:
|
||||
```
|
||||
cat nrRRC_stats.log
|
||||
```
|
||||
1. Fill in the [`neighbour-config.conf`](../ci-scripts/conf_files/neighbour-config.conf) configuration file as shown below, and
|
||||
1. Fill in the `neighbour-config.conf` configuration file as shown below, and
|
||||
`@include` it in the CU file.
|
||||
1. Start the CU and both DUs.
|
||||
1. Bring the phone close to one cell, and leave flight mode. It should connect
|
||||
@@ -161,7 +157,7 @@ triggered:
|
||||
- Make sure that both DUs use the same hardware.
|
||||
- Make sure that the UE sees both cells. For instance, you can switch to flight
|
||||
mode, go closer to the other DU, and switch off flight mode -- the UE should
|
||||
connect to that second DU.
|
||||
connect to that second UE.
|
||||
- We did not manage handover with every phone yet -- make sure you use one of
|
||||
the list provided above.
|
||||
|
||||
@@ -250,15 +246,6 @@ nr_measurement_configuration = {
|
||||
})
|
||||
};
|
||||
```
|
||||
`@include` this configuration file inside the gNB section of CU file as shown below.
|
||||
|
||||
```
|
||||
plmn_list = ({ mcc = 222; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1, sd = 0xffffff })});
|
||||
|
||||
|
||||
@include "neighbour-config.conf"
|
||||
|
||||
```
|
||||
|
||||
# Handovers triggers and NTN
|
||||
|
||||
|
||||
124
doc/nfapi.md
124
doc/nfapi.md
@@ -1,6 +1,5 @@
|
||||
This document describes the SmallCellForum (SCF) (n)FAPI split in 5G, i.e.,
|
||||
between the MAC/L2 and PHY/L1. It also describes how to make use of the
|
||||
multiple transport mechanisms between the 2.
|
||||
between the MAC/L2 and PHY/L1.
|
||||
|
||||
The interested reader is recommended to read a copy of the SCF 222.10
|
||||
specification ("FAPI"). This includes information on what is P5, P7, and how
|
||||
@@ -8,8 +7,6 @@ FAPI works. The currently used version is SCF 222.10.02, with some messages
|
||||
upgraded to SCF 222.10.04 due to bugfixes in the spec. Further information
|
||||
about nFAPI can be found in SCF 225.2.0.
|
||||
|
||||
[[_TOC_]]
|
||||
|
||||
# Quickstart
|
||||
|
||||
Compile OAI as normal. Start the CN and make sure that the VNF configuration
|
||||
@@ -111,125 +108,6 @@ can proceed as follows:
|
||||
Note: all L1-specific options have to be passed to the PNF, and remaining
|
||||
options to the VNF.
|
||||
|
||||
## Transport mechanisms between VNF and PNF
|
||||
|
||||
Currently, the VNF/PNF split supports three transport mechanisms between each
|
||||
other:
|
||||
|
||||
1. Socket communication (either regular, or SCTP), this is the default
|
||||
|
||||
The socket type may be changed by editing `nfapi_pnf_config_create()` and
|
||||
`nfapi_vnf_config_create()`, in both of which `_this->sctp = <value, 0 or
|
||||
1>;` indicate whether SCTP or regular sockets are to be used. Note: The
|
||||
value of `_this->sctp` **must** be the same on the VNF and PNF.
|
||||
2. Intel WLS Lib, which uses DPDK to achieve a shared memory communication between components.
|
||||
3. nvIPC, which is used exclusively for the NVIDIA Aerial L1. Thus, it is only
|
||||
applicable for the VNF.
|
||||
|
||||
The change between transport mechanisms is done at compilation time:
|
||||
- No changes to the `build_oai` call are required in order to select socket communication, as it is the default.
|
||||
- In order to select WLS as the transport mechanism between VNF and PNF, first install the WLS library, and afterwards use `-t WLS` as a parameter of `build_oai`:
|
||||
|
||||
### How to use nFAPI
|
||||
|
||||
nFAPI is used by default. Compile and configure as indicated above.
|
||||
|
||||
### How to use Aerial
|
||||
|
||||
Refer to [this document](./Aerial_FAPI_Split_Tutorial.md) for more information.
|
||||
|
||||
### How to use WLS lib
|
||||
|
||||
Before the first compilation with WLS support, the [WLS
|
||||
library](https://docs.o-ran-sc.org/projects/o-ran-sc-o-du-phy/en/latest/wls-lib.html)
|
||||
must first be compiled and installed to the system.
|
||||
|
||||
The WLS library has a few dependencies:
|
||||
- [DPDK](https://doc.dpdk.org/guides/prog_guide/build-sdk-meson.html), specifically version [20.11.3](https://fast.dpdk.org/rel/dpdk-20.11.3.tar.xz).
|
||||
- libelf-dev
|
||||
- libhugetlbfs-dev
|
||||
|
||||
Additionally, a patch needs to be applied to the WLS lib Makefile in order for
|
||||
the shared library and headers to be installed into the system, the necessary
|
||||
patch is available [here](../cmake_targets/tools/install_wls_lib.patch)
|
||||
|
||||
Clone the code and apply the patch
|
||||
|
||||
git clone -b oran_f_release https://gerrit.o-ran-sc.org/r/o-du/phy.git
|
||||
cd phy/wls_lib/
|
||||
git apply ~/openairinterface5g/cmake_targets/tools/install_wls_lib.patch
|
||||
|
||||
Then compile and install the library
|
||||
|
||||
WIRELESS_SDK_TOOLCHAIN=gcc WIRELESS_SDK_TARGET_ISA=avx2 make
|
||||
sudo WIRELESS_SDK_TOOLCHAIN=gcc WIRELESS_SDK_TARGET_ISA=avx2 make install
|
||||
|
||||
After installing WLS, you can run the build command as shown below:
|
||||
|
||||
./build_oai -t WLS -w USRP --gNB --nrUE --ninja -C
|
||||
|
||||
#### How to run OAI PNF with OAI VNF
|
||||
|
||||
Refer to the above steps in [Quickstart](.#quickstart), but run the PNF first as it is the WLS "master".
|
||||
|
||||
#### How to run OAI PNF with OSC/Radisys O-DU
|
||||
|
||||
Set up the hugepages for DPDK (1GB page size, 6 pages; this only needs to be
|
||||
done once):
|
||||
|
||||
sudo nano /etc/default/grub
|
||||
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} default_hugepagesz=1G hugepagesz=1G hugepages=6"
|
||||
|
||||
Then rewrite the bootloader and reboot
|
||||
|
||||
sudo update-grub
|
||||
sudo reboot
|
||||
|
||||
Install dependencies:
|
||||
|
||||
sudo apt-get install libstdc++-14-dev libnsl-dev libpcap-dev libxml2-dev
|
||||
|
||||
Clone the Radisys repository (We're currently using the `oai_integration` branch):
|
||||
|
||||
git clone https://gerrit.o-ran-sc.org/r/o-du/l2 -b oai-integration
|
||||
|
||||
Build the O-DU
|
||||
|
||||
cd ~/l2/build/odu
|
||||
make clean_all;make odu PHY=INTEL_L1 MACHINE=BIT64 MODE=TDD;make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=TDD;make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=TDD
|
||||
|
||||
Setup local interfaces for the cu_stub, ric_stub and o_du
|
||||
|
||||
sudo ifconfig enp7s0:ODU "192.168.130.81" && sudo ifconfig enp7s0:CU_STUB "192.168.130.82" && sudo ifconfig enp7s0:RIC_STUB "192.168.130.80"
|
||||
|
||||
Run cu_stu and ric_stub in separate terminals
|
||||
|
||||
cd ~/l2/bin/
|
||||
./cu_stub/cu_stub
|
||||
clear && ./ric_stub/ric_stub
|
||||
|
||||
Run the OAI PNF first, as it is the WLS memory master
|
||||
|
||||
sudo NFAPI_TRACE_LEVEL=info ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf --nfapi PNF --rfsim --rfsimulator.serveraddr server
|
||||
|
||||
Run the O-DU over GDB
|
||||
|
||||
sudo -E gdb -ex run --readnever --args ./odu/odu
|
||||
|
||||
Note: If you see the following prompt in GDB
|
||||
|
||||
This GDB supports auto-downloading debuginfo from the following URLs:
|
||||
<https://debuginfod.ubuntu.com>
|
||||
Enable debuginfod for this session? (y or [n])
|
||||
|
||||
You can run the following command one time before executing gdb to disable it:
|
||||
|
||||
export DEBUGINFOD_URLS=
|
||||
|
||||
Run the OAI-UE
|
||||
|
||||
sudo ./nr-uesoftmodem -r 273 --numerology 1 --band 78 -C 3400140000 --ssb 1518 --uicc0.imsi 001010000000001 --rfsim
|
||||
|
||||
# nFAPI logging system
|
||||
|
||||
nFAPI has its own logging system, independent of OAI's. It can be activated by
|
||||
|
||||
@@ -71,7 +71,6 @@ WORKDIR /opt/oai-gnb/bin
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/nr-softmodem ./
|
||||
COPY ./docker/scripts/gnb_entrypoint.sh ./entrypoint.sh
|
||||
COPY ./docker/scripts/check-prach-io.sh ./check-prach-io.sh
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
|
||||
@@ -59,7 +59,6 @@ WORKDIR /opt/oai-gnb/bin
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/nr-softmodem ./
|
||||
COPY ./docker/scripts/gnb_entrypoint.sh ./entrypoint.sh
|
||||
COPY ./docker/scripts/check-prach-io.sh ./check-prach-io.sh
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
|
||||
@@ -71,7 +71,6 @@ WORKDIR /opt/oai-gnb/bin
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/nr-softmodem ./
|
||||
COPY ./docker/scripts/gnb_entrypoint.sh ./entrypoint.sh
|
||||
COPY ./docker/scripts/check-prach-io.sh ./check-prach-io.sh
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
|
||||
@@ -60,7 +60,6 @@ WORKDIR /opt/oai-gnb/bin
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/nr-softmodem ./
|
||||
COPY ./docker/scripts/gnb_entrypoint.sh ./entrypoint.sh
|
||||
COPY ./docker/scripts/check-prach-io.sh ./check-prach-io.sh
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
|
||||
@@ -57,7 +57,6 @@ WORKDIR /opt/oai-gnb/bin
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/nr-softmodem ./
|
||||
COPY ./docker/scripts/gnb_entrypoint.sh ./entrypoint.sh
|
||||
COPY ./docker/scripts/check-prach-io.sh ./check-prach-io.sh
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
|
||||
@@ -94,7 +94,6 @@ WORKDIR /opt/oai-gnb/bin
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/nr-softmodem ./
|
||||
COPY ./docker/scripts/gnb_entrypoint.sh ./entrypoint.sh
|
||||
COPY ./docker/scripts/check-prach-io.sh ./check-prach-io.sh
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
|
||||
@@ -54,7 +54,7 @@ fi
|
||||
# the source directory to show correct line numbers
|
||||
docker run --rm -it \
|
||||
-v $COREDUMP:/tmp/coredump \
|
||||
-v $SOURCES:/oai-ran/ \
|
||||
-v $SOURCES:/opt/$TYPEPATH/src \
|
||||
--entrypoint bash \
|
||||
$IMAGE \
|
||||
-c "gdb --dir=src/cmake_targets/ran_build/build $EXEC /tmp/coredump"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
test -f /opt/oai-gnb/nrL1_stats.log && grep -oP 'PRACH I0 = \K[0-9.]*' /opt/oai-gnb/nrL1_stats.log | awk '{if ($1 > 0.0) exit 0; else exit 1}'
|
||||
@@ -97,19 +97,11 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
oai_exit = 1;
|
||||
|
||||
if (ru_m.rfdevice.trx_end_func) {
|
||||
if (ru_m.rfdevice.trx_get_stats_func) {
|
||||
ru_m.rfdevice.trx_get_stats_func(&ru_m.rfdevice);
|
||||
ru_m.rfdevice.trx_get_stats_func = NULL;
|
||||
}
|
||||
ru_m.rfdevice.trx_end_func(&ru_m.rfdevice);
|
||||
ru_m.rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (ru_m.ifdevice.trx_end_func) {
|
||||
if (ru_m.ifdevice.trx_get_stats_func) {
|
||||
ru_m.ifdevice.trx_get_stats_func(&ru_m.ifdevice);
|
||||
ru_m.ifdevice.trx_get_stats_func = NULL;
|
||||
}
|
||||
ru_m.ifdevice.trx_end_func(&ru_m.ifdevice);
|
||||
ru_m.ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
@@ -371,19 +363,11 @@ int main ( int argc, char **argv )
|
||||
end_configmodule(uniqCfg);
|
||||
|
||||
if (ru->rfdevice.trx_end_func) {
|
||||
if (ru->rfdevice.trx_get_stats_func) {
|
||||
ru->rfdevice.trx_get_stats_func(&ru->rfdevice);
|
||||
ru->rfdevice.trx_get_stats_func = NULL;
|
||||
}
|
||||
ru->rfdevice.trx_end_func(&ru->rfdevice);
|
||||
ru->rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (ru->ifdevice.trx_end_func) {
|
||||
if (ru->ifdevice.trx_get_stats_func) {
|
||||
ru->ifdevice.trx_get_stats_func(&ru->ifdevice);
|
||||
ru->ifdevice.trx_get_stats_func = NULL;
|
||||
}
|
||||
ru->ifdevice.trx_end_func(&ru->ifdevice);
|
||||
ru->ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ static void tx_func(processingData_L1tx_t *info)
|
||||
pushNotifiedFIFO(&gNB->resp_L1, res);
|
||||
|
||||
int tx_slot_type = nr_slot_select(cfg, frame_tx, slot_tx);
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT || get_softmodem_params()->continuous_tx || IS_SOFTMODEM_RFSIM) {
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT || get_softmodem_params()->continuous_tx) {
|
||||
start_meas(&info->gNB->phy_proc_tx);
|
||||
phy_procedures_gNB_TX(info, frame_tx, slot_tx, 1);
|
||||
|
||||
@@ -239,26 +239,14 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size
|
||||
if (ru->feprx)
|
||||
output += print_meas_log(&ru->ofdm_demod_stats, "feprx", NULL, NULL, output, end - output);
|
||||
|
||||
bool full_slot = ru->half_slot_parallelization == 0;
|
||||
if (ru->feptx_prec) {
|
||||
output += print_meas_log(&ru->precoding_stats,
|
||||
full_slot ? "feptx_prec (per port)" : "feptx_prec (per port, half_slot)",
|
||||
NULL,
|
||||
NULL,
|
||||
output,
|
||||
end - output);
|
||||
output += print_meas_log(&ru->precoding_stats,"feptx_prec",NULL,NULL, output, end - output);
|
||||
}
|
||||
|
||||
if (ru->feptx_ofdm) {
|
||||
output += print_meas_log(&ru->txdataF_copy_stats,"txdataF_copy",NULL,NULL, output, end - output);
|
||||
output += print_meas_log(&ru->ofdm_mod_stats,
|
||||
full_slot ? "feptx_ofdm (per port)" : "feptx_ofdm (per port, half_slot)",
|
||||
NULL,
|
||||
NULL,
|
||||
output,
|
||||
end - output);
|
||||
output += print_meas_log(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL, output, end - output);
|
||||
output += print_meas_log(&ru->ofdm_total_stats,"feptx_total",NULL,NULL, output, end - output);
|
||||
output += print_meas_log(&ru->txdataF_copy_stats, "txdataF_copy", NULL, NULL, output, end - output);
|
||||
}
|
||||
|
||||
if (ru->fh_north_asynch_in)
|
||||
|
||||
@@ -759,7 +759,7 @@ void tx_rf(RU_t *ru, int frame,int slot, uint64_t timestamp)
|
||||
radio_tx_burst_flag_t flags_burst = TX_BURST_INVALID;
|
||||
radio_tx_gpio_flag_t flags_gpio = 0;
|
||||
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD && !get_softmodem_params()->continuous_tx && !IS_SOFTMODEM_RFSIM) {
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD && !get_softmodem_params()->continuous_tx) {
|
||||
int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
int txsymb = 0;
|
||||
@@ -992,6 +992,36 @@ int setup_RU_buffers(RU_t *ru)
|
||||
return(0);
|
||||
}
|
||||
|
||||
void *ru_stats_thread(void *param) {
|
||||
RU_t *ru = (RU_t *)param;
|
||||
wait_sync("ru_stats_thread");
|
||||
|
||||
while (!oai_exit) {
|
||||
sleep(1);
|
||||
|
||||
if (cpu_meas_enabled) {
|
||||
if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx (all ports)",NULL,NULL);
|
||||
|
||||
if (ru->feptx_ofdm) {
|
||||
print_meas(&ru->precoding_stats,(ru->half_slot_parallelization==0)?"feptx_prec (per port)":"feptx_prec (per port, half_slot)",NULL,NULL);
|
||||
print_meas(&ru->ofdm_mod_stats,(ru->half_slot_parallelization==0)?"feptx_ofdm (per port)":"feptx_ofdm (per port, half_slot)",NULL,NULL);
|
||||
print_meas(&ru->txdataF_copy_stats,"txdataF_copy",NULL,NULL);
|
||||
print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL);
|
||||
}
|
||||
print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
|
||||
if (ru->if_south == REMOTE_IF5) print_meas(&ru->ifdevice.tx_fhaul,"tx_fhaul (IF5)",NULL,NULL);
|
||||
else print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
|
||||
|
||||
if (ru->fh_north_out) {
|
||||
print_meas(&ru->compression,"compression",NULL,NULL);
|
||||
print_meas(&ru->transport,"transport",NULL,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void ru_tx_func(void *param)
|
||||
{
|
||||
processingData_RU_t *info = (processingData_RU_t *) param;
|
||||
@@ -1341,9 +1371,6 @@ int start_rf(RU_t *ru) {
|
||||
}
|
||||
|
||||
int stop_rf(RU_t *ru) {
|
||||
if (ru->rfdevice.trx_get_stats_func) {
|
||||
ru->rfdevice.trx_get_stats_func(&ru->rfdevice);
|
||||
}
|
||||
ru->rfdevice.trx_end_func(&ru->rfdevice);
|
||||
return 0;
|
||||
}
|
||||
@@ -1372,6 +1399,8 @@ void init_RU_proc(RU_t *ru) {
|
||||
|
||||
if(emulate_rf)
|
||||
threadCreate( &proc->pthread_emulateRF, emulatedRF_thread, (void *)proc, "emulateRF", -1, OAI_PRIORITY_RT );
|
||||
if (cpu_meas_enabled)
|
||||
threadCreate(&ru->ru_stats_thread, ru_stats_thread, (void *)ru, "ru_stats", -1, OAI_PRIORITY_RT);
|
||||
LOG_I(PHY, "Initialized RU proc %d (%s,%s),\n", ru->idx, NB_functions[ru->function], NB_timing[ru->if_timing]);
|
||||
}
|
||||
|
||||
@@ -1401,6 +1430,11 @@ void kill_NR_RU_proc(int inst) {
|
||||
pthread_mutex_unlock( &proc->mutex_fep[0] );
|
||||
pthread_join(proc->pthread_FH, NULL);
|
||||
|
||||
if (cpu_meas_enabled) {
|
||||
LOG_D(PHY, "Joining ru_stats_thread\n");
|
||||
pthread_join(ru->ru_stats_thread, NULL);
|
||||
}
|
||||
|
||||
// everything should be stopped now, we can safely stop the RF device
|
||||
if (ru->stop_rf == NULL) {
|
||||
LOG_W(PHY, "No stop_rf() for RU %d defined, cannot stop RF!\n", ru->idx);
|
||||
|
||||
@@ -207,19 +207,11 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
if (RC.ru[ru_id] && RC.ru[ru_id]->rfdevice.trx_end_func) {
|
||||
if (RC.ru[ru_id]->rfdevice.trx_get_stats_func) {
|
||||
RC.ru[ru_id]->rfdevice.trx_get_stats_func(&RC.ru[ru_id]->rfdevice);
|
||||
RC.ru[ru_id]->rfdevice.trx_get_stats_func = NULL;
|
||||
}
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (RC.ru[ru_id] && RC.ru[ru_id]->ifdevice.trx_end_func) {
|
||||
if (RC.ru[ru_id]->ifdevice.trx_get_stats_func) {
|
||||
RC.ru[ru_id]->ifdevice.trx_get_stats_func(&RC.ru[ru_id]->ifdevice);
|
||||
RC.ru[ru_id]->ifdevice.trx_get_stats_func = NULL;
|
||||
}
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
@@ -431,17 +423,11 @@ int stop_L1(module_id_t gnb_id)
|
||||
stop_RU(RC.nb_RU);
|
||||
|
||||
/* stop trx devices, multiple carrier currently not supported by RU */
|
||||
if (ru->rfdevice.trx_get_stats_func) {
|
||||
ru->rfdevice.trx_get_stats_func(&ru->rfdevice);
|
||||
}
|
||||
if (ru->rfdevice.trx_stop_func) {
|
||||
ru->rfdevice.trx_stop_func(&ru->rfdevice);
|
||||
LOG_I(GNB_APP, "turned off RU rfdevice\n");
|
||||
}
|
||||
|
||||
if (ru->ifdevice.trx_get_stats_func) {
|
||||
ru->ifdevice.trx_get_stats_func(&ru->rfdevice);
|
||||
}
|
||||
if (ru->ifdevice.trx_stop_func) {
|
||||
ru->ifdevice.trx_stop_func(&ru->ifdevice);
|
||||
LOG_I(GNB_APP, "turned off RU ifdevice\n");
|
||||
|
||||
@@ -825,8 +825,7 @@ void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockS
|
||||
AssertFatal(writeBlockSize == tmp, "");
|
||||
}
|
||||
|
||||
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_rx_to_tx, bool toTrash)
|
||||
{
|
||||
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, bool toTrash) {
|
||||
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
|
||||
// two frames for initial sync
|
||||
int num_frames = 2;
|
||||
@@ -854,8 +853,7 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_r
|
||||
AssertFatal(read_block_size == tmp, "");
|
||||
|
||||
if (IS_SOFTMODEM_RFSIM) {
|
||||
const openair0_timestamp writeTimestamp =
|
||||
*timestamp + fp->get_samples_slot_timestamp(slot, fp, duration_rx_to_tx) - UE->N_TA_offset - UE->timing_advance;
|
||||
const openair0_timestamp writeTimestamp = *timestamp + fp->get_samples_slot_timestamp(slot, fp, NR_UE_CAPABILITY_SLOT_RX_TO_TX) - UE->N_TA_offset;
|
||||
dummyWrite(UE, writeTimestamp, fp->get_samples_per_slot(slot, fp));
|
||||
}
|
||||
}
|
||||
@@ -866,7 +864,7 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_r
|
||||
free(rxp[i]);
|
||||
}
|
||||
|
||||
static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_rx_to_tx, openair0_timestamp rx_offset)
|
||||
static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, openair0_timestamp rx_offset)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
|
||||
if (UE->sl_mode == 2)
|
||||
@@ -881,8 +879,7 @@ static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int d
|
||||
const int res = UE->rfdevice.trx_read_func(&UE->rfdevice, timestamp, (void **)UE->common_vars.rxdata, unitTransfer, fp->nb_antennas_rx);
|
||||
DevAssert(unitTransfer == res);
|
||||
if (IS_SOFTMODEM_RFSIM) {
|
||||
const openair0_timestamp writeTimestamp =
|
||||
*timestamp + fp->get_samples_slot_timestamp(slot, fp, duration_rx_to_tx) - UE->N_TA_offset - UE->timing_advance;
|
||||
const openair0_timestamp writeTimestamp = *timestamp + fp->get_samples_slot_timestamp(slot, fp, NR_UE_CAPABILITY_SLOT_RX_TO_TX) - UE->N_TA_offset;
|
||||
dummyWrite(UE, writeTimestamp, unitTransfer);
|
||||
}
|
||||
slot = (slot + 1) % fp->slots_per_subframe;
|
||||
@@ -908,8 +905,7 @@ static inline int get_readBlockSize(uint16_t slot, NR_DL_FRAME_PARMS *fp) {
|
||||
|
||||
static inline void apply_ntn_config(PHY_VARS_NR_UE *UE,
|
||||
NR_DL_FRAME_PARMS *fp,
|
||||
int frame_rx,
|
||||
int slot_rx,
|
||||
int slot_nr,
|
||||
int *duration_rx_to_tx,
|
||||
int *timing_advance,
|
||||
int *ntn_koffset)
|
||||
@@ -917,43 +913,22 @@ static inline void apply_ntn_config(PHY_VARS_NR_UE *UE,
|
||||
if (UE->ntn_config_message->update) {
|
||||
UE->ntn_config_message->update = false;
|
||||
|
||||
const int mu = fp->numerology_index;
|
||||
const int koffset = UE->ntn_config_message->ntn_config_params.cell_specific_k_offset;
|
||||
double total_ta_ms = UE->ntn_config_message->ntn_config_params.ntn_total_time_advance_ms;
|
||||
UE->timing_advance = fp->samples_per_subframe * total_ta_ms;
|
||||
|
||||
*duration_rx_to_tx = NR_UE_CAPABILITY_SLOT_RX_TO_TX + (koffset << mu);
|
||||
if (koffset > *ntn_koffset)
|
||||
*timing_advance += fp->get_samples_slot_timestamp(slot_rx, fp, (koffset - *ntn_koffset) << mu);
|
||||
else if (koffset < *ntn_koffset)
|
||||
*timing_advance -= fp->get_samples_slot_timestamp(slot_rx, fp, (*ntn_koffset - koffset) << mu);
|
||||
*ntn_koffset = koffset;
|
||||
|
||||
const int abs_subframe_tx = 10 * frame_rx + ((slot_rx + *duration_rx_to_tx) >> mu);
|
||||
const int abs_subframe_epoch =
|
||||
10 * UE->ntn_config_message->ntn_config_params.epoch_sfn + UE->ntn_config_message->ntn_config_params.epoch_subframe;
|
||||
int ms_since_epoch = abs_subframe_tx - abs_subframe_epoch;
|
||||
// cope with sfn wrap-around
|
||||
// this currently limits us to epoch times that are not more than 5.12 seconds in the future (allowed are up to 10.24 seconds)
|
||||
// and ntn-UlSyncValidityDuration < 5.12 seconds (allowed are up to 900 seconds)
|
||||
// TODO: fix this limitation by introducing the hyper frame number HFN
|
||||
if (ms_since_epoch < -5120)
|
||||
ms_since_epoch += 10240;
|
||||
else if (ms_since_epoch > 5120)
|
||||
ms_since_epoch -= 10240;
|
||||
|
||||
const double total_ta_ms = UE->ntn_config_message->ntn_config_params.ntn_total_time_advance_ms;
|
||||
const double total_ta_drift = UE->ntn_config_message->ntn_config_params.ntn_total_time_advance_drift; // µs/s
|
||||
const double total_ta_drift_variant = UE->ntn_config_message->ntn_config_params.ntn_total_time_advance_drift_variant; // µs/s²
|
||||
UE->timing_advance = fp->samples_per_subframe * (total_ta_ms + (total_ta_drift / 1000.0) * (ms_since_epoch / 1000.0) + (total_ta_drift_variant / 1000.0) * (ms_since_epoch / 1000.0) * (ms_since_epoch / 1000.0));
|
||||
int mu = fp->numerology_index;
|
||||
int koffset = UE->ntn_config_message->ntn_config_params.cell_specific_k_offset;
|
||||
if (*ntn_koffset != koffset) {
|
||||
*duration_rx_to_tx = NR_UE_CAPABILITY_SLOT_RX_TO_TX + (koffset << mu);
|
||||
*timing_advance += fp->get_samples_slot_timestamp(slot_nr, fp, (koffset - *ntn_koffset) << mu);
|
||||
*ntn_koffset = koffset;
|
||||
}
|
||||
|
||||
LOG_I(PHY,
|
||||
"k_offset = %d ms (%d slots), total_ta_ms = %f ms, total_ta_drift = %f µs/s, total_ta_drift_variant = %f µs/s², ms_since_epoch = %d ms, computed "
|
||||
"timing_advance = %d samples\n",
|
||||
"k_offset = %d ms (%d slots), ntn_total_time_advance_ms = %f ms (%d samples)\n",
|
||||
*ntn_koffset,
|
||||
*ntn_koffset << mu,
|
||||
total_ta_ms,
|
||||
total_ta_drift,
|
||||
total_ta_drift_variant,
|
||||
ms_since_epoch,
|
||||
UE->timing_advance);
|
||||
}
|
||||
}
|
||||
@@ -990,10 +965,6 @@ void *UE_thread(void *arg)
|
||||
notifiedFIFO_t freeBlocks;
|
||||
initNotifiedFIFO_nothreadSafe(&freeBlocks);
|
||||
|
||||
double ntn_init_time_drift = get_nrUE_params()->ntn_init_time_drift;
|
||||
int ntn_koffset = 0;
|
||||
|
||||
int duration_rx_to_tx = NR_UE_CAPABILITY_SLOT_RX_TO_TX;
|
||||
int timing_advance = UE->timing_advance;
|
||||
UE->N_TA_offset = determine_N_TA_offset(UE);
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(UE->Mod_id);
|
||||
@@ -1017,9 +988,13 @@ void *UE_thread(void *arg)
|
||||
//warm up the RF board
|
||||
int64_t tmp;
|
||||
for (int i = 0; i < 50; i++)
|
||||
readFrame(UE, &tmp, duration_rx_to_tx, true);
|
||||
readFrame(UE, &tmp, true);
|
||||
}
|
||||
|
||||
double ntn_init_time_drift = get_nrUE_params()->ntn_init_time_drift;
|
||||
int ntn_koffset = 0;
|
||||
int duration_rx_to_tx = NR_UE_CAPABILITY_SLOT_RX_TO_TX;
|
||||
|
||||
while (!oai_exit) {
|
||||
if (syncRunning) {
|
||||
notifiedFIFO_elt_t *res = pollNotifiedFIFO(&nf);
|
||||
@@ -1059,11 +1034,11 @@ void *UE_thread(void *arg)
|
||||
*/
|
||||
const unsigned int sync_in_frames = UE->rfdevice.openair0_cfg->recplay_conf->u_f_sync;
|
||||
while (trashed_frames != sync_in_frames) {
|
||||
readFrame(UE, &sync_timestamp, duration_rx_to_tx, true);
|
||||
readFrame(UE, &sync_timestamp, true);
|
||||
trashed_frames += 2;
|
||||
}
|
||||
} else {
|
||||
readFrame(UE, &sync_timestamp, duration_rx_to_tx, true);
|
||||
readFrame(UE, &sync_timestamp, true);
|
||||
trashed_frames += ((UE->sl_mode == 2) ? SL_NR_PSBCH_REPETITION_IN_FRAMES : 2);
|
||||
}
|
||||
continue;
|
||||
@@ -1073,7 +1048,7 @@ void *UE_thread(void *arg)
|
||||
AssertFatal(!syncRunning, "At this point synchronization can't be running\n");
|
||||
|
||||
if (!UE->is_synchronized) {
|
||||
readFrame(UE, &sync_timestamp, duration_rx_to_tx, false);
|
||||
readFrame(UE, &sync_timestamp, false);
|
||||
notifiedFIFO_elt_t *Msg = newNotifiedFIFO_elt(sizeof(syncData_t), 0, &nf, UE_synch);
|
||||
syncData_t *syncMsg = (syncData_t *)NotifiedFifoData(Msg);
|
||||
*syncMsg = (syncData_t){0};
|
||||
@@ -1090,10 +1065,8 @@ void *UE_thread(void *arg)
|
||||
syncMsg->UE = UE;
|
||||
memset(&syncMsg->proc, 0, sizeof(syncMsg->proc));
|
||||
pushNotifiedFIFO(&UE->sync_actor.fifo, Msg);
|
||||
if (ntn_koffset == 0) { // reset timing_advance for TN
|
||||
timing_advance = 0;
|
||||
UE->timing_advance = 0;
|
||||
}
|
||||
timing_advance = 0;
|
||||
UE->timing_advance = 0;
|
||||
trashed_frames = 0;
|
||||
syncRunning = true;
|
||||
continue;
|
||||
@@ -1101,7 +1074,7 @@ void *UE_thread(void *arg)
|
||||
|
||||
if (stream_status == STREAM_STATUS_UNSYNC) {
|
||||
stream_status = STREAM_STATUS_SYNCING;
|
||||
syncInFrame(UE, &sync_timestamp, duration_rx_to_tx, intialSyncOffset);
|
||||
syncInFrame(UE, &sync_timestamp, intialSyncOffset);
|
||||
openair0_write_reorder_clear_context(&UE->rfdevice);
|
||||
if (get_nrUE_params()->time_sync_I)
|
||||
// ntn_init_time_drift is in µs/s, max_pos_acc * time_sync_I is in samples/frame
|
||||
@@ -1110,6 +1083,9 @@ void *UE_thread(void *arg)
|
||||
UE->max_pos_acc = 0;
|
||||
shiftForNextFrame = -(UE->init_sync_frame + trashed_frames + 2) * UE->max_pos_acc * get_nrUE_params()->time_sync_I; // compensate for the time drift that happened during initial sync
|
||||
LOG_D(PHY, "max_pos_acc = %d, shiftForNextFrame = %d\n", UE->max_pos_acc, shiftForNextFrame);
|
||||
// TODO: remove this autonomous TA and use up-to-date values of ta-Common, ta-CommonDrift and ta-CommonDriftVariant from received SIB19 instead
|
||||
if (get_nrUE_params()->autonomous_ta)
|
||||
UE->timing_advance -= 2 * shiftForNextFrame;
|
||||
// read in first symbol
|
||||
AssertFatal(fp->ofdm_symbol_size + fp->nb_prefix_samples0
|
||||
== UE->rfdevice.trx_read_func(&UE->rfdevice,
|
||||
@@ -1224,7 +1200,7 @@ void *UE_thread(void *arg)
|
||||
int writeBlockSize = fp->get_samples_per_slot((slot_nr + duration_rx_to_tx) % nb_slot_frame, fp) - iq_shift_to_apply;
|
||||
int new_timing_advance = UE->timing_advance;
|
||||
if (new_timing_advance != timing_advance) {
|
||||
writeBlockSize -= new_timing_advance - timing_advance;
|
||||
writeBlockSize -= new_timing_advance- timing_advance;
|
||||
timing_advance = new_timing_advance;
|
||||
}
|
||||
int new_N_TA_offset = determine_N_TA_offset(UE);
|
||||
@@ -1234,8 +1210,8 @@ void *UE_thread(void *arg)
|
||||
UE->N_TA_offset = new_N_TA_offset;
|
||||
}
|
||||
|
||||
if (curMsg.proc.nr_slot_rx == 0)
|
||||
nr_ue_rrc_timer_trigger(UE->Mod_id, curMsg.proc.frame_rx, curMsg.proc.gNB_id);
|
||||
if (curMsg.proc.nr_slot_tx == 0)
|
||||
nr_ue_rrc_timer_trigger(UE->Mod_id, curMsg.proc.frame_tx, curMsg.proc.gNB_id);
|
||||
|
||||
// RX slot processing. We launch and forget.
|
||||
notifiedFIFO_elt_t *newRx = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), curMsg.proc.nr_slot_tx, NULL, UE_dl_processing);
|
||||
@@ -1251,7 +1227,7 @@ void *UE_thread(void *arg)
|
||||
}
|
||||
|
||||
// apply new NTN timing information
|
||||
apply_ntn_config(UE, fp, curMsg.proc.frame_rx, curMsg.proc.nr_slot_rx, &duration_rx_to_tx, &timing_advance, &ntn_koffset);
|
||||
apply_ntn_config(UE, fp, slot_nr, &duration_rx_to_tx, &timing_advance, &ntn_koffset);
|
||||
|
||||
// Start TX slot processing here. It runs in parallel with RX slot processing
|
||||
// in current code, DURATION_RX_TO_TX constant is the limit to get UL data to encode from a RX slot
|
||||
|
||||
@@ -170,12 +170,8 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
|
||||
if (PHY_vars_UE_g && PHY_vars_UE_g[0]) {
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
if (PHY_vars_UE_g[0][CC_id] && PHY_vars_UE_g[0][CC_id]->rfdevice.trx_end_func) {
|
||||
if (PHY_vars_UE_g[0][CC_id]->rfdevice.trx_get_stats_func) {
|
||||
PHY_vars_UE_g[0][CC_id]->rfdevice.trx_get_stats_func(&PHY_vars_UE_g[0][CC_id]->rfdevice);
|
||||
}
|
||||
if (PHY_vars_UE_g[0][CC_id] && PHY_vars_UE_g[0][CC_id]->rfdevice.trx_end_func)
|
||||
PHY_vars_UE_g[0][CC_id]->rfdevice.trx_end_func(&PHY_vars_UE_g[0][CC_id]->rfdevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,15 +197,11 @@ nrUE_params_t *get_nrUE_params(void) {
|
||||
}
|
||||
static void get_options(configmodule_interface_t *cfg)
|
||||
{
|
||||
paramdef_t cmdline_params[] = CMDLINE_NRUEPARAMS_DESC;
|
||||
paramdef_t cmdline_params[] =CMDLINE_NRUEPARAMS_DESC ;
|
||||
int numparams = sizeofArray(cmdline_params);
|
||||
config_get(cfg, cmdline_params, numparams, NULL);
|
||||
if (nrUE_params.vcdflag > 0)
|
||||
ouput_vcd = 1;
|
||||
AssertFatal(nrUE_params.extra_pdu_id != get_softmodem_params()->default_pdu_session_id,
|
||||
"Default PDU ID (%d) and Extra PDU ID (%d) must be different!\n",
|
||||
get_softmodem_params()->default_pdu_session_id,
|
||||
nrUE_params.extra_pdu_id);
|
||||
}
|
||||
|
||||
// set PHY vars from command line
|
||||
@@ -599,8 +591,6 @@ int main(int argc, char **argv)
|
||||
ret = pthread_join(phy_vars->stat_thread, NULL);
|
||||
AssertFatal(ret == 0, "pthread_join error %d, errno %d (%s)\n", ret, errno, strerror(errno));
|
||||
}
|
||||
if (phy_vars->rfdevice.trx_get_stats_func)
|
||||
phy_vars->rfdevice.trx_get_stats_func(&phy_vars->rfdevice);
|
||||
if (phy_vars->rfdevice.trx_end_func)
|
||||
phy_vars->rfdevice.trx_end_func(&phy_vars->rfdevice);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ extern uint16_t ue_id_g;
|
||||
#define CONFIG_HLP_AGC "Rx Gain control used for UE\n"
|
||||
#define CONFIG_HLP_NUM_UL_ACTORS "Number of UL actors to use. Set to 0 to disable UL actor framework and do processing inline\n"
|
||||
#define CONFIG_HLP_NUM_DL_ACTORS "Number of DL actors to use. Set to 0 to disable DL actor framework and do processing inline\n"
|
||||
#define CONFIG_HLP_EXTRA_PDU_ID "ID of an additional PDU session to configure alongside default PDU session\n"
|
||||
|
||||
/***************************************************************************************************************************************/
|
||||
/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument
|
||||
@@ -82,7 +81,6 @@ extern uint16_t ue_id_g;
|
||||
{"agc", CONFIG_HLP_AGC, PARAMFLAG_BOOL, .iptr=&(nrUE_params.agc), .defintval=0, TYPE_INT, 0}, \
|
||||
{"num-ul-actors", CONFIG_HLP_NUM_UL_ACTORS, 0, .iptr=&nrUE_params.num_ul_actors, .defintval=2, TYPE_INT, 0}, \
|
||||
{"num-dl-actors", CONFIG_HLP_NUM_DL_ACTORS, 0, .iptr=&nrUE_params.num_dl_actors, .defintval=4, TYPE_INT, 0}, \
|
||||
{"extra-pdu-id", CONFIG_HLP_EXTRA_PDU_ID, 0, .iptr=&nrUE_params.extra_pdu_id, .defintval=-1, TYPE_INT, 0}, \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
@@ -124,7 +122,6 @@ typedef struct {
|
||||
int tx_max_power;
|
||||
int num_ul_actors;
|
||||
int num_dl_actors;
|
||||
int extra_pdu_id;
|
||||
} nrUE_params_t;
|
||||
extern uint64_t get_nrUE_optmask(void);
|
||||
extern uint64_t set_nrUE_optmask(uint64_t bitmask);
|
||||
|
||||
@@ -41,16 +41,16 @@
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
// clang-format off
|
||||
#define POSITION_CONFIG_PARAMS_DEF { \
|
||||
{CONFIG_STRING_POSITION_X, HELP_STRING_POSITION, 0, .dblptr=&(position->X), .defuintval=0, TYPE_DOUBLE, 0}, \
|
||||
{CONFIG_STRING_POSITION_Y, HELP_STRING_POSITION, 0, .dblptr=&(position->Y), .defuintval=0, TYPE_DOUBLE, 0}, \
|
||||
{CONFIG_STRING_POSITION_Z, HELP_STRING_POSITION, 0, .dblptr=&(position->Z), .defuintval=0, TYPE_DOUBLE, 0} \
|
||||
{CONFIG_STRING_POSITION_X, HELP_STRING_POSITION, 0, .dblptr=&(position->positionX), .defuintval=0, TYPE_DOUBLE, 0}, \
|
||||
{CONFIG_STRING_POSITION_Y, HELP_STRING_POSITION, 0, .dblptr=&(position->positionY), .defuintval=0, TYPE_DOUBLE, 0}, \
|
||||
{CONFIG_STRING_POSITION_Z, HELP_STRING_POSITION, 0, .dblptr=&(position->positionZ), .defuintval=0, TYPE_DOUBLE, 0} \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
typedef struct position {
|
||||
double X;
|
||||
double Y;
|
||||
double Z;
|
||||
double positionX;
|
||||
double positionY;
|
||||
double positionZ;
|
||||
} position_t;
|
||||
|
||||
void get_position_coordinates(int Mod_id, position_t *position);
|
||||
|
||||
@@ -189,7 +189,7 @@ extern int usrp_tx_thread;
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, .iptr=&softmodem_params.threequarter_fs, .defintval=0, TYPE_INT, 0}, \
|
||||
{"imscope" , CONFIG_HLP_IMSCOPE, PARAMFLAG_BOOL, .uptr=&enable_imscope, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"imscope-record" , CONFIG_HLP_IMSCOPE_RECORD,PARAMFLAG_BOOL, .uptr=&enable_imscope_record, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"default-pdu-id", NULL, 0, .iptr=&DEFAULT_PDU_ID, .defintval=10, TYPE_INT, 0}, \
|
||||
{"default_pdu_id", NULL, 0, .iptr=&DEFAULT_PDU_ID, .defintval=10, TYPE_INT, 0}, \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
@@ -347,7 +347,6 @@ typedef struct {
|
||||
int no_itti;
|
||||
int threequarter_fs;
|
||||
int default_pdu_session_id;
|
||||
int extra_pdu_session_id;
|
||||
} softmodem_params_t;
|
||||
|
||||
#define IS_SA_MODE(sM_params) (!(sM_params)->phy_test && !(sM_params)->do_ra && !(sM_params)->nsa)
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
add_subdirectory(oai_integration/aerial)
|
||||
if (OAI_WLS)
|
||||
add_subdirectory(oai_integration/wls_integration)
|
||||
else () # Not WLS, means its SOCKET-based comms, maybe add a flag specific for UDP
|
||||
message(STATUS "No Support for WLS")
|
||||
add_subdirectory(oai_integration/socket)
|
||||
endif ()
|
||||
add_subdirectory(open-nFAPI)
|
||||
add_subdirectory(tests)
|
||||
|
||||
@@ -3,6 +3,7 @@ if (OAI_AERIAL)
|
||||
add_library(aerial_lib
|
||||
fapi_nvIPC.c
|
||||
fapi_vnf_p7.c
|
||||
fapi_vnf_p5.c
|
||||
)
|
||||
|
||||
find_library(NVIPC_LIB nvipc REQUIRED)
|
||||
|
||||
@@ -48,13 +48,12 @@
|
||||
#include <sys/queue.h>
|
||||
#include <sys/epoll.h>
|
||||
#include "fapi_nvIPC.h"
|
||||
#include <nfapi_vnf.h>
|
||||
#include <nr_fapi_p7_utils.h>
|
||||
#include "nfapi_interface.h"
|
||||
#include "nfapi.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "nfapi/open-nFAPI/vnf/inc/vnf_p7.h"
|
||||
#include "system.h"
|
||||
|
||||
#include "fapi_vnf_p5.h"
|
||||
#include "fapi_vnf_p7.h"
|
||||
|
||||
#define MAX_EVENTS 10
|
||||
@@ -94,12 +93,90 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
|
||||
return -1;
|
||||
}
|
||||
|
||||
vnf_p7_t *vnf_p7_config = (vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config;
|
||||
switch (fapi_msg.message_id) {
|
||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE ... NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION:
|
||||
vnf_nr_handle_p4_p5_message(msg->msg_buf, msg->msg_len, 1, vnf_config);
|
||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE:
|
||||
|
||||
if (vnf_config->nr_param_resp) {
|
||||
nfapi_nr_param_response_scf_t msg_param_resp;
|
||||
aerial_unpack_nr_param_response(&pReadPackedMessage, end, &msg_param_resp, &vnf_config->codec_config);
|
||||
(vnf_config->nr_param_resp)(vnf_config, vnf_config->pnf_list->p5_idx, &msg_param_resp);
|
||||
}
|
||||
break;
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CONFIG_RESPONSE: {
|
||||
// unpack message
|
||||
nfapi_nr_config_response_scf_t msg_config_response;
|
||||
aerial_unpack_nr_config_response(&pReadPackedMessage, end, &msg_config_response, &vnf_config->codec_config);
|
||||
// Check the error code
|
||||
if (msg_config_response.error_code == NFAPI_NR_CONFIG_MSG_OK) {
|
||||
// Invoke the call back
|
||||
if (vnf_config->nr_config_resp) {
|
||||
(vnf_config->nr_config_resp)(vnf_config, vnf_config->pnf_list->p5_idx, &msg_config_response);
|
||||
}
|
||||
} else {
|
||||
// Error code not OK (MSG_INVALID_CONFIG)
|
||||
/* MSG_INVALID_CONFIG.response structure
|
||||
* Error code uint8_t
|
||||
* Number of invalid or unsupported TLVs uint8_t
|
||||
* Number of invalid TLVs that can only be configured in IDLE state uint8_t
|
||||
* Number of invalid TLVs that can only be configured in RUNNING state uint8_t
|
||||
* Number of missing TLVs uint8_t
|
||||
* List of invalid or unsupported TLVs
|
||||
* List of invalid TLVs that can only be configured in IDLE state
|
||||
* List of invalid TLVs that can only be configured in RUNNING state
|
||||
* List of missing TLVs
|
||||
* */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION: {
|
||||
// TODO : ADD Support for NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION (0x06)
|
||||
LOG_D(NFAPI_VNF,"Received NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION: {
|
||||
// TODO: Add Support for NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION (0x07)
|
||||
LOG_D(NFAPI_VNF,"Received NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION\n");
|
||||
//for (int i = 0; i < msg->msg_len; i++) {
|
||||
// printf(" msg->msg_buf[%d] = 0x%02x\n", i, ((uint8_t *) msg->msg_buf)[i]);
|
||||
//}
|
||||
LOG_D(NFAPI_VNF,"old sfn %u\n", old_sfn);
|
||||
LOG_D(NFAPI_VNF,"old slot %u\n", old_slot);
|
||||
|
||||
break;
|
||||
}
|
||||
// P7 Messages
|
||||
// P7 Message Handlers -> ((vnf_info *)vnf_config->user_data)->p7_vnfs->config->
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: {
|
||||
nfapi_nr_slot_indication_scf_t ind;
|
||||
aerial_unpack_nr_slot_indication(&pReadPackedMessage,
|
||||
end,
|
||||
&ind,
|
||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
||||
// check if the sfn/slot unpacked come wrong at any time, should be old + 1 (slot 0 -- 19, sfn 0 -- 1023)
|
||||
// add 1 to current sfn number
|
||||
uint16_t old_slot_plus = ((old_slot + 1) % 20);
|
||||
uint16_t old_sfn_plus = old_slot_plus == 0 ? ((old_sfn + 1) % 1024) : old_sfn;
|
||||
if (old_slot_plus != ind.slot || old_sfn_plus != ind.sfn) {
|
||||
LOG_E(NFAPI_VNF,
|
||||
"\n============================================================================\n"
|
||||
"sfn slot doesn't match unpacked one! L2->L1 %d.%d vs L1->L2 %d.%d \n"
|
||||
"============================================================================\n",
|
||||
old_sfn,
|
||||
old_slot,
|
||||
ind.sfn,
|
||||
ind.slot);
|
||||
}
|
||||
old_sfn = ind.sfn;
|
||||
old_slot = ind.slot;
|
||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_slot_indication) {
|
||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_slot_indication)(&ind);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: {
|
||||
uint8_t *pReadData = msg->data_buf;
|
||||
int dataBufLen = msg->data_len;
|
||||
@@ -113,10 +190,10 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
|
||||
&pReadData,
|
||||
data_end,
|
||||
&ind,
|
||||
&vnf_p7_config->_public.codec_config);
|
||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RX Indication\n", __FUNCTION__);
|
||||
if (vnf_p7_config->_public.nr_rx_data_indication) {
|
||||
(vnf_p7_config->_public.nr_rx_data_indication)(&ind);
|
||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_rx_data_indication) {
|
||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_rx_data_indication)(&ind);
|
||||
for (int i = 0; i < ind.number_of_pdus; ++i) {
|
||||
free(ind.pdu_list[i].pdu);
|
||||
}
|
||||
@@ -125,6 +202,53 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: {
|
||||
nfapi_nr_crc_indication_t crc_ind;
|
||||
crc_ind.header.message_id = fapi_msg.message_id;
|
||||
crc_ind.header.message_length = fapi_msg.message_length;
|
||||
aerial_unpack_nr_crc_indication(&pReadPackedMessage,
|
||||
end,
|
||||
&crc_ind,
|
||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_crc_indication) {
|
||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_crc_indication)(&crc_ind);
|
||||
free(crc_ind.crc_list);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: {
|
||||
nfapi_nr_uci_indication_t ind;
|
||||
aerial_unpack_nr_uci_indication(&pReadPackedMessage,
|
||||
end,
|
||||
&ind,
|
||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
||||
|
||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_uci_indication) {
|
||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_uci_indication)(&ind);
|
||||
for (int i = 0; i < ind.num_ucis; i++) {
|
||||
if (ind.uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) {
|
||||
if (ind.uci_list[i].pucch_pdu_format_2_3_4.sr.sr_payload) {
|
||||
free(ind.uci_list[i].pucch_pdu_format_2_3_4.sr.sr_payload);
|
||||
}
|
||||
if(ind.uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload){
|
||||
free(ind.uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
|
||||
}
|
||||
if(ind.uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload){
|
||||
free(ind.uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
|
||||
}
|
||||
if(ind.uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload){
|
||||
free(ind.uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
free(ind.uci_list);
|
||||
ind.uci_list = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: {
|
||||
uint8_t *pReadData = msg->data_buf;
|
||||
int dataBufLen = msg->data_len;
|
||||
@@ -135,47 +259,26 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
|
||||
&pReadData,
|
||||
data_end,
|
||||
&ind,
|
||||
&vnf_p7_config->_public.codec_config);
|
||||
if (vnf_p7_config->_public.nr_srs_indication) {
|
||||
(vnf_p7_config->_public.nr_srs_indication)(&ind);
|
||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_srs_indication) {
|
||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_srs_indication)(&ind);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: {
|
||||
nfapi_nr_slot_indication_scf_t ind;
|
||||
if (!vnf_p7_config->_public.unpack_func(msg->msg_buf, msg->msg_len, &ind, sizeof(ind), &vnf_p7_config->_public.codec_config)) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling NR SLOT Indication\n", __FUNCTION__);
|
||||
// check if the sfn/slot unpacked come wrong at any time, should be old + 1 (slot 0 -- 19, sfn 0 -- 1023)
|
||||
// add 1 to current sfn number
|
||||
uint16_t old_slot_plus = ((old_slot + 1) % 20);
|
||||
uint16_t old_sfn_plus = old_slot_plus == 0 ? ((old_sfn + 1) % 1024) : old_sfn;
|
||||
if (old_slot_plus != ind.slot || old_sfn_plus != ind.sfn) {
|
||||
LOG_E(NFAPI_VNF,
|
||||
"\n============================================================================\n"
|
||||
"sfn slot doesn't match unpacked one! L2->L1 %d.%d vs L1->L2 %d.%d \n"
|
||||
"============================================================================\n",
|
||||
old_sfn,
|
||||
old_slot,
|
||||
ind.sfn,
|
||||
ind.slot);
|
||||
}
|
||||
old_sfn = ind.sfn;
|
||||
old_slot = ind.slot;
|
||||
if (vnf_p7_config->_public.nr_slot_indication) {
|
||||
(vnf_p7_config->_public.nr_slot_indication)(&ind);
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: {
|
||||
nfapi_nr_rach_indication_t ind;
|
||||
aerial_unpack_nr_rach_indication(&pReadPackedMessage,
|
||||
end,
|
||||
&ind,
|
||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_rach_indication) {
|
||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_rach_indication)(&ind);
|
||||
free(ind.pdu_list);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: {
|
||||
vnf_nr_handle_p7_message(msg->msg_buf, msg->msg_len, vnf_p7_config);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s P5 Unknown message ID %d\n", __FUNCTION__, fapi_msg.message_id);
|
||||
|
||||
@@ -190,26 +293,10 @@ int8_t buf[1024];
|
||||
|
||||
nv_ipc_config_t nv_ipc_config;
|
||||
|
||||
bool aerial_nr_send_p5_message(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len)
|
||||
{
|
||||
nfapi_vnf_pnf_info_t *pnf = nfapi_vnf_pnf_list_find(&(vnf->_public), p5_idx);
|
||||
|
||||
if (pnf) {
|
||||
uint8_t tx_messagebufferFAPI[sizeof(vnf->tx_message_buffer)];
|
||||
int packedMessageLengthFAPI = -1;
|
||||
packedMessageLengthFAPI =
|
||||
vnf->_public.pack_func(msg, msg_len, tx_messagebufferFAPI, sizeof(tx_messagebufferFAPI), &vnf->_public.codec_config);
|
||||
return aerial_send_P5_msg(tx_messagebufferFAPI, packedMessageLengthFAPI, msg) == 0;
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p5_message_header_t *header)
|
||||
int aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p5_message_header_t *header)
|
||||
{
|
||||
if (ipc == NULL) {
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
nv_ipc_msg_t send_msg = {0};
|
||||
// look for the specific message
|
||||
@@ -247,7 +334,7 @@ bool aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p
|
||||
if (alloc_retval != 0) {
|
||||
LOG_E(NFAPI_VNF, "%s error: allocate TX buffer failed Error: %d\n", __FUNCTION__, alloc_retval);
|
||||
ipc->tx_release(ipc, &send_msg);
|
||||
return false;
|
||||
return alloc_retval;
|
||||
}
|
||||
|
||||
memcpy(send_msg.msg_buf, packedBuf, send_msg.msg_len);
|
||||
@@ -263,17 +350,17 @@ bool aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p
|
||||
if (send_retval < 0) {
|
||||
LOG_E(NFAPI_VNF, "%s error: send TX message failed Error: %d\n", __FUNCTION__, send_retval);
|
||||
ipc->tx_release(ipc, &send_msg);
|
||||
return false;
|
||||
return send_retval;
|
||||
}
|
||||
|
||||
ipc->notify(ipc, 1); // notify that there's 1 message in queue
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_message_header_t *header)
|
||||
int aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_message_header_t *header)
|
||||
{
|
||||
if (ipc == NULL) {
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
nv_ipc_msg_t send_msg;
|
||||
uint8_t *pPacketBodyField = &((uint8_t *)packedBuf)[8];
|
||||
@@ -334,7 +421,7 @@ bool aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_m
|
||||
if (alloc_retval != 0) {
|
||||
LOG_E(NFAPI_VNF, "%s error: allocate TX buffer failed Error: %d\n", __FUNCTION__, alloc_retval);
|
||||
ipc->tx_release(ipc, &send_msg);
|
||||
return false;
|
||||
return alloc_retval;
|
||||
}
|
||||
|
||||
memcpy(send_msg.msg_buf, packedBuf, send_msg.msg_len);
|
||||
@@ -350,21 +437,21 @@ bool aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_m
|
||||
if (send_retval < 0) {
|
||||
LOG_E(NFAPI_VNF, "%s error: send TX message failed Error: %d\n", __FUNCTION__, send_retval);
|
||||
ipc->tx_release(ipc, &send_msg);
|
||||
return false;
|
||||
return send_retval;
|
||||
}
|
||||
|
||||
ipc->notify(ipc, 1); // notify that there's 1 message in queue
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool aerial_send_P7_msg_with_data(void *packedBuf,
|
||||
int aerial_send_P7_msg_with_data(void *packedBuf,
|
||||
uint32_t packedMsgLength,
|
||||
void *dataBuf,
|
||||
uint32_t dataLength,
|
||||
nfapi_nr_p7_message_header_t *header)
|
||||
{
|
||||
if (ipc == NULL) {
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
nv_ipc_msg_t send_msg;
|
||||
uint8_t *pPacketBodyField = &((uint8_t *)packedBuf)[8];
|
||||
@@ -423,7 +510,7 @@ bool aerial_send_P7_msg_with_data(void *packedBuf,
|
||||
if (alloc_retval != 0) {
|
||||
LOG_E(NFAPI_VNF, "%s error: allocate TX buffer failed Error: %d\n", __FUNCTION__, alloc_retval);
|
||||
ipc->tx_release(ipc, &send_msg);
|
||||
return false;
|
||||
return alloc_retval;
|
||||
}
|
||||
|
||||
memcpy(send_msg.msg_buf, packedBuf, send_msg.msg_len);
|
||||
@@ -440,11 +527,11 @@ bool aerial_send_P7_msg_with_data(void *packedBuf,
|
||||
if (send_retval != 0) {
|
||||
LOG_E(NFAPI_VNF, "%s error: send TX message failed Error: %d\n", __FUNCTION__, send_retval);
|
||||
ipc->tx_release(ipc, &send_msg);
|
||||
return false;
|
||||
return send_retval;
|
||||
}
|
||||
|
||||
ipc->notify(ipc, 1); // notify that there's 1 message in queue
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Always allocate message buffer, but allocate data buffer only when data_len > 0
|
||||
@@ -569,87 +656,6 @@ int nvIPC_Init(nvipc_params_t nvipc_params_s)
|
||||
sleep(1);
|
||||
create_recv_thread(nvipc_params_s.nvipc_poll_core);
|
||||
while(!recv_task_running){usleep(100000);}
|
||||
nfapi_nr_param_response_scf_t resp_msg;
|
||||
vnf_config->nr_param_resp(vnf_config, 1, &resp_msg);
|
||||
aerial_pnf_nr_connection_indication_cb(vnf_config, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req)
|
||||
{
|
||||
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
||||
|
||||
ul_tti_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
ul_tti_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST;
|
||||
|
||||
// int retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
|
||||
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &ul_tti_req->header);
|
||||
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
// Reset number of PDUs so that it is not resent
|
||||
ul_tti_req->n_pdus = 0;
|
||||
ul_tti_req->n_group = 0;
|
||||
ul_tti_req->n_ulcch = 0;
|
||||
ul_tti_req->n_ulsch = 0;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req)
|
||||
{
|
||||
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
||||
ul_dci_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
ul_dci_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST;
|
||||
// int retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
|
||||
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &ul_dci_req->header);
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
ul_dci_req->numPdus = 0;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
|
||||
{
|
||||
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
||||
tx_data_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
|
||||
// LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_data_req->SFN),
|
||||
// tx_data_req->Number_of_PDUs); int retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
||||
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &tx_data_req->header);
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
tx_data_req->Number_of_PDUs = 0;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
|
||||
{
|
||||
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
||||
dl_config_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
||||
dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &dl_config_req->header);
|
||||
dl_config_req->dl_tti_request_body.nPDUs = 0;
|
||||
dl_config_req->dl_tti_request_body.nGroup = 0;
|
||||
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot){
|
||||
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
||||
nfapi_nr_slot_indication_scf_t nr_slot_resp = {.header.message_id = 0x8F, .sfn = frame, .slot = slot};
|
||||
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &nr_slot_resp.header);
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "nv_ipc_utils.h"
|
||||
#include "nvlog.h"
|
||||
#include "nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h"
|
||||
#include "vnf.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
@@ -48,19 +47,14 @@ typedef struct {
|
||||
uint32_t message_length;
|
||||
} fapi_phy_api_msg;
|
||||
|
||||
bool aerial_nr_send_p5_message(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len);
|
||||
bool aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p5_message_header_t *header);
|
||||
bool aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_message_header_t *header);
|
||||
bool aerial_send_P7_msg_with_data(void *packedBuf,
|
||||
int aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p5_message_header_t *header);
|
||||
int aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_message_header_t *header);
|
||||
int aerial_send_P7_msg_with_data(void *packedBuf,
|
||||
uint32_t packedMsgLength,
|
||||
void *dataBuf,
|
||||
uint32_t dataLength,
|
||||
nfapi_nr_p7_message_header_t *header);
|
||||
void set_config(nfapi_vnf_config_t *conf);
|
||||
int nvIPC_Init(nvipc_params_t nvipc_params_s);
|
||||
int oai_fapi_send_end_request(int cell_id, uint32_t frame, uint32_t slot);
|
||||
int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
|
||||
int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req);
|
||||
int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req);
|
||||
int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req);
|
||||
|
||||
#endif // OPENAIRINTERFACE_FAPI_NVIPC_H
|
||||
|
||||
610
nfapi/oai_integration/aerial/fapi_vnf_p5.c
Normal file
610
nfapi/oai_integration/aerial/fapi_vnf_p5.c
Normal file
@@ -0,0 +1,610 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file fapi/oai-integration/fapi_vnf_p5.c
|
||||
* \brief OAI FAPI VNF P5 message handler procedures
|
||||
* \author Ruben S. Silva
|
||||
* \date 2023
|
||||
* \version 0.1
|
||||
* \company OpenAirInterface Software Alliance
|
||||
* \email: contact@openairinterface.org, rsilva@allbesmart.pt
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "fapi_vnf_p5.h"
|
||||
#include "fapi_vnf_p7.h"
|
||||
#include "nfapi/open-nFAPI/vnf/inc/vnf_p7.h"
|
||||
#include "nr_fapi.h"
|
||||
#include "nr_fapi_p5.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern UL_RCC_IND_t UL_RCC_INFO;
|
||||
extern int sf_ahead;
|
||||
extern int slot_ahead;
|
||||
|
||||
void *aerial_vnf_nr_p7_config_init(void *ptr)
|
||||
{
|
||||
vnf_p7_info *p7_vnf = (vnf_p7_info *)ptr;
|
||||
|
||||
init_queue(&gnb_rach_ind_queue);
|
||||
init_queue(&gnb_rx_ind_queue);
|
||||
init_queue(&gnb_crc_ind_queue);
|
||||
init_queue(&gnb_uci_ind_queue);
|
||||
|
||||
p7_vnf->config->port = p7_vnf->local_port;
|
||||
p7_vnf->config->sync_indication = NULL;
|
||||
p7_vnf->config->slot_indication = NULL;
|
||||
p7_vnf->config->harq_indication = NULL;
|
||||
p7_vnf->config->nr_crc_indication = &aerial_phy_nr_crc_indication;
|
||||
p7_vnf->config->nr_rx_data_indication = &aerial_phy_nr_rx_data_indication;
|
||||
p7_vnf->config->nr_rach_indication = &aerial_phy_nr_rach_indication;
|
||||
p7_vnf->config->nr_uci_indication = &aerial_phy_nr_uci_indication;
|
||||
p7_vnf->config->srs_indication = NULL;
|
||||
p7_vnf->config->sr_indication = NULL;
|
||||
p7_vnf->config->cqi_indication = NULL;
|
||||
p7_vnf->config->lbt_dl_indication = NULL;
|
||||
p7_vnf->config->nb_harq_indication = NULL;
|
||||
p7_vnf->config->nrach_indication = NULL;
|
||||
p7_vnf->config->nr_slot_indication = &aerial_phy_nr_slot_indication;
|
||||
p7_vnf->config->nr_srs_indication = &aerial_phy_nr_srs_indication;
|
||||
p7_vnf->config->malloc = &aerial_vnf_allocate;
|
||||
p7_vnf->config->free = &aerial_vnf_deallocate;
|
||||
p7_vnf->config->vendor_ext = &aerial_phy_vendor_ext;
|
||||
p7_vnf->config->user_data = p7_vnf;
|
||||
p7_vnf->mac->user_data = p7_vnf;
|
||||
p7_vnf->config->codec_config.unpack_p7_vendor_extension = &aerial_phy_unpack_p7_vendor_extension;
|
||||
p7_vnf->config->codec_config.pack_p7_vendor_extension = &aerial_phy_pack_p7_vendor_extension;
|
||||
p7_vnf->config->codec_config.unpack_vendor_extension_tlv = &aerial_phy_unpack_vendor_extension_tlv;
|
||||
p7_vnf->config->codec_config.pack_vendor_extension_tlv = &aerial_phy_pack_vendor_extension_tlv;
|
||||
p7_vnf->config->codec_config.allocate = &aerial_vnf_allocate;
|
||||
p7_vnf->config->codec_config.deallocate = &aerial_vnf_deallocate;
|
||||
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;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int aerial_pnf_nr_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx)
|
||||
{
|
||||
printf("[VNF] pnf connection indication idx:%d\n", p5_idx);
|
||||
// in aerial, send first CONFIG.request, not PARAM.request
|
||||
nfapi_nr_config_request_scf_t conf_req;
|
||||
memset(&conf_req, 0, sizeof(conf_req));
|
||||
conf_req.header.message_id = NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST;
|
||||
printf("Try to send first CONFIG.request\n");
|
||||
aerial_nr_send_config_request(config, p5_idx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_pnf_disconnection_indication_cb(nfapi_vnf_config_t *config, int p5_idx)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf disconnection indication idx:%d\n", p5_idx);
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
phy_info *phy = pnf->phys;
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
nfapi_vnf_p7_del_pnf((p7_vnf->config), phy->id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_pnf_nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_param_response_t *resp)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf param response idx:%d error:%d\n", p5_idx, resp->error_code);
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
|
||||
for (int i = 0; i < resp->pnf_phy.number_of_phys; ++i) {
|
||||
phy_info phy;
|
||||
memset(&phy, 0, sizeof(phy));
|
||||
phy.index = resp->pnf_phy.phy[i].phy_config_index;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
|
||||
nfapi_vnf_allocate_phy(config, p5_idx, &(phy.id));
|
||||
|
||||
for (int j = 0; j < resp->pnf_phy.phy[i].number_of_rfs; ++j) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) (RF%d) %d\n", i, j, resp->pnf_phy.phy[i].rf_config[j].rf_config_index);
|
||||
phy.rfs[0] = resp->pnf_phy.phy[i].rf_config[j].rf_config_index;
|
||||
}
|
||||
|
||||
pnf->phys[0] = phy;
|
||||
}
|
||||
nfapi_nr_pnf_config_request_t req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
|
||||
req.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
|
||||
req.pnf_phy_rf_config.number_phy_rf_config_info = 2; // DJP pnf.phys.size();
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "DJP:Hard coded num phy rf to 2\n");
|
||||
|
||||
for (unsigned i = 0; i < 2; ++i) {
|
||||
req.pnf_phy_rf_config.phy_rf_config[i].phy_id = pnf->phys[i].id;
|
||||
req.pnf_phy_rf_config.phy_rf_config[i].phy_config_index = pnf->phys[i].index;
|
||||
req.pnf_phy_rf_config.phy_rf_config[i].rf_config_index = pnf->phys[i].rfs[0];
|
||||
}
|
||||
|
||||
nfapi_nr_vnf_pnf_config_req(config, p5_idx, &req);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_pnf_nr_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_config_response_t *resp)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"[VNF] pnf config response idx:%d resp[header[phy_id:%u message_id:%02x message_length:%u]]\n",
|
||||
p5_idx,
|
||||
resp->header.phy_id,
|
||||
resp->header.message_id,
|
||||
resp->header.message_length);
|
||||
|
||||
if (1) {
|
||||
nfapi_nr_pnf_start_request_t req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.header.phy_id = resp->header.phy_id;
|
||||
req.header.message_id = NFAPI_PNF_START_REQUEST;
|
||||
nfapi_nr_vnf_pnf_start_req(config, p5_idx, &req);
|
||||
} else {
|
||||
// Rather than send the pnf_start_request we will demonstrate
|
||||
// sending a vendor extention message. The start request will be
|
||||
// send when the vendor extension response is received
|
||||
// vnf_info* vnf = (vnf_info*)(config->user_data);
|
||||
vendor_ext_p5_req req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.header.message_id = P5_VENDOR_EXT_REQ;
|
||||
req.dummy1 = 45;
|
||||
req.dummy2 = 1977;
|
||||
nfapi_vnf_vendor_extension(config, p5_idx, &req.header);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_pnf_nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_start_response_t *resp)
|
||||
{
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
nfapi_nr_param_request_scf_t req;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"[VNF] pnf start response idx:%d config:%p user_data:%p p7_vnf[config:%p thread_started:%d]\n",
|
||||
p5_idx,
|
||||
config,
|
||||
config->user_data,
|
||||
vnf->p7_vnfs[0].config,
|
||||
vnf->p7_vnfs[0].thread_started);
|
||||
|
||||
aerial_vnf_nr_p7_config_init(p7_vnf);
|
||||
|
||||
// start all the phys in the pnf.
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Sending NFAPI_VNF_PARAM_REQUEST phy_id:%d\n", pnf->phys[0].id);
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.header.message_id = NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST;
|
||||
req.header.phy_id = pnf->phys[0].id;
|
||||
nfapi_nr_vnf_param_req(config, p5_idx, &req);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_response_scf_t *resp)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_PARAM_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
phy_info *phy = pnf->phys;
|
||||
struct sockaddr_in pnf_p7_sockaddr;
|
||||
nfapi_nr_config_request_scf_t *req = &RC.nrmac[0]->config[0]; // check
|
||||
phy->remote_port = resp->nfapi_config.p7_pnf_port.value;
|
||||
// phy->remote_port = 32123;//resp->nfapi_config.p7_pnf_port.value;
|
||||
memcpy(&pnf_p7_sockaddr.sin_addr.s_addr, &(resp->nfapi_config.p7_pnf_address_ipv4.address[0]), 4);
|
||||
phy->remote_addr = inet_ntoa(pnf_p7_sockaddr.sin_addr);
|
||||
// for now just 1
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n",
|
||||
p5_idx,
|
||||
phy->id,
|
||||
phy->remote_addr,
|
||||
phy->remote_port,
|
||||
p7_vnf->timing_window,
|
||||
p7_vnf->periodic_timing_period,
|
||||
p7_vnf->aperiodic_timing_enabled,
|
||||
p7_vnf->periodic_timing_period);
|
||||
req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST;
|
||||
req->header.phy_id = phy->id;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Send NFAPI_CONFIG_REQUEST\n");
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "\n NR bandP =%d\n",req->nfapi_config.rf_bands.rf_band[0]);
|
||||
|
||||
req->nfapi_config.p7_vnf_port.tl.tag = NFAPI_NR_NFAPI_P7_VNF_PORT_TAG;
|
||||
req->nfapi_config.p7_vnf_port.value = p7_vnf->local_port;
|
||||
req->num_tlv++;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] DJP local_port:%d\n", ntohs(p7_vnf->local_port));
|
||||
req->nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
|
||||
struct sockaddr_in vnf_p7_sockaddr;
|
||||
vnf_p7_sockaddr.sin_addr.s_addr = inet_addr(p7_vnf->local_addr);
|
||||
memcpy(&(req->nfapi_config.p7_vnf_address_ipv4.address[0]), &vnf_p7_sockaddr.sin_addr.s_addr, 4);
|
||||
req->num_tlv++;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] DJP local_addr:%s\n", p7_vnf->local_addr);
|
||||
req->nfapi_config.timing_window.tl.tag = NFAPI_NR_NFAPI_TIMING_WINDOW_TAG;
|
||||
req->nfapi_config.timing_window.value = p7_vnf->timing_window;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"\n[VNF]Timing window tag : %d Timing window:%u\n",
|
||||
NFAPI_NR_NFAPI_TIMING_WINDOW_TAG,
|
||||
p7_vnf->timing_window);
|
||||
req->num_tlv++;
|
||||
|
||||
if (p7_vnf->periodic_timing_enabled || p7_vnf->aperiodic_timing_enabled) {
|
||||
req->nfapi_config.timing_info_mode.tl.tag = NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG;
|
||||
req->nfapi_config.timing_info_mode.value = (p7_vnf->aperiodic_timing_enabled << 1) | (p7_vnf->periodic_timing_enabled);
|
||||
req->num_tlv++;
|
||||
|
||||
if (p7_vnf->periodic_timing_enabled) {
|
||||
req->nfapi_config.timing_info_period.tl.tag = NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG;
|
||||
req->nfapi_config.timing_info_period.value = p7_vnf->periodic_timing_period;
|
||||
req->num_tlv++;
|
||||
}
|
||||
}
|
||||
// TODO: Assign tag and value for P7 message offsets
|
||||
req->nfapi_config.dl_tti_timing_offset.tl.tag = NFAPI_NR_NFAPI_DL_TTI_TIMING_OFFSET;
|
||||
req->nfapi_config.ul_tti_timing_offset.tl.tag = NFAPI_NR_NFAPI_UL_TTI_TIMING_OFFSET;
|
||||
req->nfapi_config.ul_dci_timing_offset.tl.tag = NFAPI_NR_NFAPI_UL_DCI_TIMING_OFFSET;
|
||||
req->nfapi_config.tx_data_timing_offset.tl.tag = NFAPI_NR_NFAPI_TX_DATA_TIMING_OFFSET;
|
||||
|
||||
vendor_ext_tlv_2 ve2;
|
||||
memset(&ve2, 0, sizeof(ve2));
|
||||
ve2.tl.tag = VENDOR_EXT_TLV_2_TAG;
|
||||
ve2.dummy = 2016;
|
||||
req->vendor_extension = &ve2.tl;
|
||||
nfapi_nr_vnf_config_req(config, p5_idx, req);
|
||||
printf("[VNF] Sent NFAPI_VNF_CONFIG_REQ num_tlv:%u\n", req->num_tlv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_nr_send_config_request(nfapi_vnf_config_t *config, int p5_idx)
|
||||
{
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
phy_info *phy = pnf->phys;
|
||||
|
||||
nfapi_nr_config_request_scf_t *req = &RC.nrmac[0]->config[0];
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n",
|
||||
p5_idx,
|
||||
phy->id,
|
||||
phy->remote_addr,
|
||||
phy->remote_port,
|
||||
p7_vnf->timing_window,
|
||||
p7_vnf->periodic_timing_period,
|
||||
p7_vnf->aperiodic_timing_enabled,
|
||||
p7_vnf->periodic_timing_period);
|
||||
req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST;
|
||||
req->header.phy_id = phy->id;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Send NFAPI_CONFIG_REQUEST\n");
|
||||
|
||||
vnf_t *_this = (vnf_t *)(config);
|
||||
|
||||
nfapi_vnf_phy_info_t *vnf_phy = nfapi_vnf_phy_info_list_find(config, req->header.phy_id);
|
||||
|
||||
if (vnf_phy == NULL) {
|
||||
printf("%s failed to find phy information phy_id:%d\n", __FUNCTION__, req->header.phy_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
nfapi_nr_p4_p5_message_header_t *msg = &req->header;
|
||||
uint16_t msg_len = sizeof(nfapi_nr_config_request_scf_t);
|
||||
uint8_t tx_messagebufferFAPI[sizeof(_this->tx_message_buffer)];
|
||||
int packedMessageLengthFAPI = -1;
|
||||
packedMessageLengthFAPI =
|
||||
fapi_nr_p5_message_pack(msg, msg_len, tx_messagebufferFAPI, sizeof(tx_messagebufferFAPI), &_this->_public.codec_config);
|
||||
|
||||
aerial_send_P5_msg(tx_messagebufferFAPI, packedMessageLengthFAPI, msg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_nr_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_config_response_scf_t *resp)
|
||||
{
|
||||
nfapi_nr_start_request_scf_t req;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_CONFIG_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
|
||||
LOG_I(NFAPI_VNF, "Received CONFIG.response, gNB is ready! \n");
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_REQUEST;
|
||||
req.header.phy_id = resp->header.phy_id;
|
||||
nfapi_nr_vnf_start_req(config, p5_idx, &req);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_start_response_scf_t *resp)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_vendor_ext_cb(nfapi_vnf_config_t *config, int p5_idx, void *msg)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s\n", __FUNCTION__);
|
||||
|
||||
switch (((nfapi_nr_p4_p5_message_header_t *)msg)->message_id) {
|
||||
case P5_VENDOR_EXT_RSP: {
|
||||
vendor_ext_p5_rsp *rsp = (vendor_ext_p5_rsp *)msg;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] P5_VENDOR_EXT_RSP error_code:%d\n", rsp->error_code);
|
||||
// send the start request
|
||||
nfapi_nr_pnf_start_request_t req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.header.message_id = NFAPI_PNF_START_REQUEST;
|
||||
nfapi_nr_vnf_pnf_start_req(config, p5_idx, &req);
|
||||
} break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_vnf_unpack_vendor_extension_tlv(nfapi_tl_t *tl,
|
||||
uint8_t **ppReadPackedMessage,
|
||||
uint8_t *end,
|
||||
void **ve,
|
||||
nfapi_p4_p5_codec_config_t *codec)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int aerial_vnf_pack_vendor_extension_tlv(void *vext, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *codec)
|
||||
{
|
||||
nfapi_tl_t *tlv = (nfapi_tl_t *)vext;
|
||||
|
||||
switch (tlv->tag) {
|
||||
case VENDOR_EXT_TLV_2_TAG: {
|
||||
vendor_ext_tlv_2 *ve = (vendor_ext_tlv_2 *)tlv;
|
||||
|
||||
if (!push32(ve->dummy, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
} break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int aerial_vnf_unpack_p4_p5_vendor_extension(void *header,
|
||||
uint8_t **ppReadPackedMessage,
|
||||
uint8_t *end,
|
||||
nfapi_p4_p5_codec_config_t *codec)
|
||||
{
|
||||
if (((nfapi_nr_p4_p5_message_header_t *)header)->message_id == P5_VENDOR_EXT_RSP) {
|
||||
vendor_ext_p5_rsp *req = (vendor_ext_p5_rsp *)(header);
|
||||
return (!pull16(ppReadPackedMessage, &req->error_code, end));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_vnf_pack_p4_p5_vendor_extension(void *header,
|
||||
uint8_t **ppWritePackedMsg,
|
||||
uint8_t *end,
|
||||
nfapi_p4_p5_codec_config_t *codec)
|
||||
{
|
||||
if (((nfapi_nr_p4_p5_message_header_t *)header)->message_id == P5_VENDOR_EXT_REQ) {
|
||||
vendor_ext_p5_req *req = (vendor_ext_p5_req *)(header);
|
||||
return (!(push16(req->dummy1, ppWritePackedMsg, end) && push16(req->dummy2, ppWritePackedMsg, end)));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *aerial_vnf_allocate_p4_p5_vendor_ext(uint16_t message_id, uint16_t *msg_size)
|
||||
{
|
||||
if (message_id == P5_VENDOR_EXT_RSP) {
|
||||
*msg_size = sizeof(vendor_ext_p5_rsp);
|
||||
return malloc(sizeof(vendor_ext_p5_rsp));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void aerial_vnf_deallocate_p4_p5_vendor_ext(void *header)
|
||||
{
|
||||
free(header);
|
||||
}
|
||||
|
||||
void *aerial_vnf_p5_allocate(size_t size)
|
||||
{
|
||||
// return (void*)memory_pool::allocate(size);
|
||||
return (void *)malloc(size);
|
||||
}
|
||||
|
||||
void aerial_vnf_p5_deallocate(void *ptr)
|
||||
{
|
||||
// memory_pool::deallocate((uint8_t*)ptr);
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
static vnf_info aerial_vnf;
|
||||
void aerial_configure_nr_fapi_vnf()
|
||||
{
|
||||
// TODO: Implement for FAPI
|
||||
// nfapi_setmode(NFAPI_MODE_VNF);
|
||||
memset(&aerial_vnf, 0, sizeof(aerial_vnf));
|
||||
memset(aerial_vnf.p7_vnfs, 0, sizeof(aerial_vnf.p7_vnfs));
|
||||
aerial_vnf.p7_vnfs[0].timing_window = 30;
|
||||
aerial_vnf.p7_vnfs[0].periodic_timing_enabled = 0;
|
||||
aerial_vnf.p7_vnfs[0].aperiodic_timing_enabled = 0;
|
||||
aerial_vnf.p7_vnfs[0].periodic_timing_period = 10;
|
||||
aerial_vnf.p7_vnfs[0].config = nfapi_vnf_p7_config_create();
|
||||
aerial_vnf.p7_vnfs[0].mac = (mac_t *)malloc(sizeof(mac_t));
|
||||
nfapi_vnf_config_t *config = nfapi_vnf_config_create();
|
||||
config->malloc = malloc;
|
||||
config->free = free;
|
||||
config->vnf_ipv4 = 1;
|
||||
config->vnf_ipv6 = 0;
|
||||
config->pnf_list = 0;
|
||||
config->phy_list = 0;
|
||||
|
||||
config->pnf_nr_connection_indication = &aerial_pnf_nr_connection_indication_cb;
|
||||
config->pnf_disconnect_indication = &aerial_pnf_disconnection_indication_cb;
|
||||
|
||||
config->pnf_nr_param_resp = &aerial_pnf_nr_param_resp_cb;
|
||||
config->pnf_nr_config_resp = &aerial_pnf_nr_config_resp_cb;
|
||||
config->pnf_nr_start_resp = &aerial_pnf_nr_start_resp_cb;
|
||||
config->nr_param_resp = &aerial_nr_param_resp_cb;
|
||||
config->nr_config_resp = &aerial_nr_config_resp_cb;
|
||||
config->nr_start_resp = &aerial_nr_start_resp_cb;
|
||||
config->vendor_ext = &aerial_vendor_ext_cb;
|
||||
config->user_data = &aerial_vnf;
|
||||
// To allow custom vendor extentions to be added to nfapi
|
||||
config->codec_config.unpack_vendor_extension_tlv = &aerial_vnf_unpack_vendor_extension_tlv;
|
||||
config->codec_config.pack_vendor_extension_tlv = &aerial_vnf_pack_vendor_extension_tlv;
|
||||
config->codec_config.unpack_p4_p5_vendor_extension = &aerial_vnf_unpack_p4_p5_vendor_extension;
|
||||
config->codec_config.pack_p4_p5_vendor_extension = &aerial_vnf_pack_p4_p5_vendor_extension;
|
||||
config->allocate_p4_p5_vendor_ext = &aerial_vnf_allocate_p4_p5_vendor_ext;
|
||||
config->deallocate_p4_p5_vendor_ext = &aerial_vnf_deallocate_p4_p5_vendor_ext;
|
||||
config->codec_config.allocate = &aerial_vnf_allocate;
|
||||
config->codec_config.deallocate = &aerial_vnf_deallocate;
|
||||
memset(&UL_RCC_INFO, 0, sizeof(UL_RCC_IND_t));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
set_config(config);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Created VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
nfapi_vnf_pnf_info_t *pnf = (nfapi_vnf_pnf_info_t *)malloc(sizeof(nfapi_vnf_pnf_info_t));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "MALLOC nfapi_vnf_pnf_info_t for pnf_list pnf:%p\n", pnf);
|
||||
memset(pnf, 0, sizeof(nfapi_vnf_pnf_info_t));
|
||||
pnf->p5_idx = 1;
|
||||
pnf->connected = 1;
|
||||
// Add needed parameters
|
||||
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
pnf_info *pnf_info = vnf->pnfs;
|
||||
|
||||
for (int i = 0; i < 1; ++i) {
|
||||
phy_info phy;
|
||||
memset(&phy, 0, sizeof(phy));
|
||||
phy.index = 0;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) phy_config_idx:%d\n", i, 0);
|
||||
nfapi_vnf_allocate_phy(config, 1, &(phy.id));
|
||||
|
||||
for (int j = 0; j < 1; ++j) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) (RF%d) %d\n", i, j, 0);
|
||||
phy.rfs[0] = 0;
|
||||
}
|
||||
|
||||
pnf_info->phys[0] = phy;
|
||||
}
|
||||
|
||||
|
||||
nfapi_vnf_pnf_list_add(config, pnf);
|
||||
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"[VNF] pnf start response idx:%d config:%p user_data:%p p7_vnf[config:%p thread_started:%d]\n",
|
||||
1,
|
||||
config,
|
||||
config->user_data,
|
||||
vnf->p7_vnfs[0].config,
|
||||
vnf->p7_vnfs[0].thread_started);
|
||||
|
||||
aerial_vnf_nr_p7_config_init(p7_vnf);
|
||||
}
|
||||
uint8_t aerial_unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t *config)
|
||||
{
|
||||
return unpack_nr_param_response(ppReadPackedMsg, end, msg, config);
|
||||
}
|
||||
uint8_t aerial_unpack_nr_config_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t *config)
|
||||
{
|
||||
return unpack_nr_config_response(ppReadPackedMsg, end, msg, config);
|
||||
}
|
||||
|
||||
int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req)
|
||||
{
|
||||
nfapi_vnf_p7_config_t *p7_config = aerial_vnf.p7_vnfs[0].config;
|
||||
|
||||
ul_tti_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
ul_tti_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST;
|
||||
|
||||
// int retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
|
||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &ul_tti_req->header);
|
||||
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
// Reset number of PDUs so that it is not resent
|
||||
ul_tti_req->n_pdus = 0;
|
||||
ul_tti_req->n_group = 0;
|
||||
ul_tti_req->n_ulcch = 0;
|
||||
ul_tti_req->n_ulsch = 0;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req)
|
||||
{
|
||||
nfapi_vnf_p7_config_t *p7_config = aerial_vnf.p7_vnfs[0].config;
|
||||
ul_dci_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
ul_dci_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST;
|
||||
// int retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
|
||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &ul_dci_req->header);
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
ul_dci_req->numPdus = 0;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
|
||||
{
|
||||
nfapi_vnf_p7_config_t *p7_config = aerial_vnf.p7_vnfs[0].config;
|
||||
tx_data_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
|
||||
// LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_data_req->SFN),
|
||||
// tx_data_req->Number_of_PDUs); int retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &tx_data_req->header);
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
tx_data_req->Number_of_PDUs = 0;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
|
||||
{
|
||||
nfapi_vnf_p7_config_t *p7_config = aerial_vnf.p7_vnfs[0].config;
|
||||
dl_config_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
||||
dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &dl_config_req->header);
|
||||
dl_config_req->dl_tti_request_body.nPDUs = 0;
|
||||
dl_config_req->dl_tti_request_body.nGroup = 0;
|
||||
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot){
|
||||
nfapi_vnf_p7_config_t *p7_config = aerial_vnf.p7_vnfs[0].config;
|
||||
nfapi_nr_slot_indication_scf_t nr_slot_resp = {.header.message_id = 0x8F, .sfn = frame, .slot = slot};
|
||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &nr_slot_resp.header);
|
||||
if (retval != 0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
72
nfapi/oai_integration/aerial/fapi_vnf_p5.h
Normal file
72
nfapi/oai_integration/aerial/fapi_vnf_p5.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file fapi/oai-integration/fapi_vnf_p5.h
|
||||
* \brief Header file for fapi_vnf_p5.c
|
||||
* \author Ruben S. Silva
|
||||
* \date 2023
|
||||
* \version 0.1
|
||||
* \company OpenAirInterface Software Alliance
|
||||
* \email: contact@openairinterface.org, rsilva@allbesmart.pt
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef OPENAIRINTERFACE_FAPI_VNF_P5_H
|
||||
#define OPENAIRINTERFACE_FAPI_VNF_P5_H
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "nfapi_vnf_interface.h"
|
||||
#include "nfapi_vnf.h"
|
||||
#include "nfapi.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "fapi_nvIPC.h"
|
||||
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
#include "openair2/PHY_INTERFACE/queue_t.h"
|
||||
#include "gnb_ind_vars.h"
|
||||
#include "nfapi/open-nFAPI/vnf/inc/vnf.h"
|
||||
|
||||
void aerial_configure_nr_fapi_vnf();
|
||||
int aerial_nr_send_config_request(nfapi_vnf_config_t *config, int p5_idx);
|
||||
int oai_fapi_send_end_request(int cell_id, uint32_t frame, uint32_t slot);
|
||||
uint8_t aerial_unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t *config);
|
||||
uint8_t aerial_unpack_nr_config_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t *config);
|
||||
int aerial_pnf_nr_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx);
|
||||
|
||||
int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
|
||||
int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req);
|
||||
int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req);
|
||||
int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req);
|
||||
#endif //OPENAIRINTERFACE_FAPI_VNF_P5_H
|
||||
@@ -35,6 +35,200 @@
|
||||
#include "nr_fapi_p7.h"
|
||||
#include "nr_fapi_p7_utils.h"
|
||||
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" // for handle_nr_srs_measurements()
|
||||
|
||||
extern pthread_cond_t nfapi_sync_cond;
|
||||
extern pthread_mutex_t nfapi_sync_mutex;
|
||||
extern int nfapi_sync_var;
|
||||
|
||||
int aerial_phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind)
|
||||
{
|
||||
nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind));
|
||||
copy_crc_indication(ind, crc_ind);
|
||||
if (!put_queue(&gnb_crc_ind_queue, crc_ind)) {
|
||||
LOG_E(NR_MAC, "Put_queue failed for crc_ind\n");
|
||||
free_crc_indication(crc_ind);
|
||||
free(crc_ind);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int aerial_phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind)
|
||||
{
|
||||
nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind));
|
||||
copy_rx_data_indication(ind, rx_ind);
|
||||
if (!put_queue(&gnb_rx_ind_queue, rx_ind)) {
|
||||
LOG_E(NR_MAC, "Put_queue failed for rx_ind\n");
|
||||
free_rx_data_indication(rx_ind);
|
||||
free(rx_ind);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int aerial_phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
|
||||
{
|
||||
nfapi_nr_rach_indication_t *rach_ind = CALLOC(1, sizeof(*rach_ind));
|
||||
copy_rach_indication(ind, rach_ind);
|
||||
if (!put_queue(&gnb_rach_ind_queue, rach_ind)) {
|
||||
LOG_E(NR_MAC, "Put_queue failed for rach_ind\n");
|
||||
free_rach_indication(rach_ind);
|
||||
free(rach_ind);
|
||||
} else {
|
||||
LOG_I(NR_MAC, "RACH.indication put_queue successfull\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int aerial_phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
|
||||
{
|
||||
nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind));
|
||||
AssertFatal(uci_ind, "Memory not allocated for uci_ind in phy_nr_uci_indication.");
|
||||
copy_uci_indication(ind, uci_ind);
|
||||
if (!put_queue(&gnb_uci_ind_queue, uci_ind)) {
|
||||
LOG_E(NR_MAC, "Put_queue failed for uci_ind\n");
|
||||
free_uci_indication(uci_ind);
|
||||
free(uci_ind);
|
||||
uci_ind = NULL;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, slot_t slot, NR_Sched_Rsp_t* sched_info);
|
||||
int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req);
|
||||
int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
|
||||
int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t* tx_data_req);
|
||||
int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t* ul_dci_req);
|
||||
int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot);
|
||||
extern int trigger_scheduler(nfapi_nr_slot_indication_scf_t *slot_ind);
|
||||
|
||||
int aerial_phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind)
|
||||
{
|
||||
LOG_D(MAC, "VNF SFN/Slot %d.%d \n", ind->sfn, ind->slot);
|
||||
trigger_scheduler(ind);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int aerial_phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind)
|
||||
{
|
||||
// or queue to decouple, but I think it should be fast (in all likelihood,
|
||||
// the VNF has nothing to do)
|
||||
for (int i = 0; i < ind->number_of_pdus; ++i)
|
||||
handle_nr_srs_measurements(0, ind->sfn, ind->slot, &ind->pdu_list[i]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void *aerial_vnf_allocate(size_t size)
|
||||
{
|
||||
// return (void*)memory_pool::allocate(size);
|
||||
return (void *)malloc(size);
|
||||
}
|
||||
|
||||
void aerial_vnf_deallocate(void *ptr)
|
||||
{
|
||||
// memory_pool::deallocate((uint8_t*)ptr);
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
int aerial_phy_vendor_ext(struct nfapi_vnf_p7_config *config, void *msg)
|
||||
{
|
||||
if (((nfapi_nr_p7_message_header_t *)msg)->message_id == P7_VENDOR_EXT_IND) {
|
||||
// vendor_ext_p7_ind* ind = (vendor_ext_p7_ind*)msg;
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] vendor_ext (error_code:%d)\n", ind->error_code);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] unknown %02x\n", ((nfapi_nr_p7_message_header_t *)msg)->message_id);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aerial_phy_unpack_p7_vendor_extension(void *header,
|
||||
uint8_t **ppReadPackedMessage,
|
||||
uint8_t *end,
|
||||
nfapi_p7_codec_config_t *config)
|
||||
{
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
|
||||
if (((nfapi_nr_p7_message_header_t *)header)->message_id == P7_VENDOR_EXT_IND) {
|
||||
vendor_ext_p7_ind *req = (vendor_ext_p7_ind *)(header);
|
||||
|
||||
if (!pull16(ppReadPackedMessage, &req->error_code, end))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int aerial_phy_pack_p7_vendor_extension(void *header, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
|
||||
{
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
|
||||
if (((nfapi_nr_p7_message_header_t *)header)->message_id == P7_VENDOR_EXT_REQ) {
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
|
||||
vendor_ext_p7_req *req = (vendor_ext_p7_req *)(header);
|
||||
|
||||
if (!(push16(req->dummy1, ppWritePackedMsg, end) && push16(req->dummy2, ppWritePackedMsg, end)))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int aerial_phy_unpack_vendor_extension_tlv(nfapi_tl_t *tl,
|
||||
uint8_t **ppReadPackedMessage,
|
||||
uint8_t *end,
|
||||
void **ve,
|
||||
nfapi_p7_codec_config_t *codec)
|
||||
{
|
||||
(void)tl;
|
||||
(void)ppReadPackedMessage;
|
||||
(void)ve;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int aerial_phy_pack_vendor_extension_tlv(void *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *codec)
|
||||
{
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "phy_pack_vendor_extension_tlv\n");
|
||||
nfapi_tl_t *tlv = (nfapi_tl_t *)ve;
|
||||
|
||||
switch (tlv->tag) {
|
||||
case VENDOR_EXT_TLV_1_TAG: {
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "Packing VENDOR_EXT_TLV_1\n");
|
||||
vendor_ext_tlv_1 *ve = (vendor_ext_tlv_1 *)tlv;
|
||||
|
||||
if (!push32(ve->dummy, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
} break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void *aerial_phy_allocate_p7_vendor_ext(uint16_t message_id, uint16_t *msg_size)
|
||||
{
|
||||
if (message_id == P7_VENDOR_EXT_IND) {
|
||||
*msg_size = sizeof(vendor_ext_p7_ind);
|
||||
return (nfapi_nr_p7_message_header_t *)malloc(sizeof(vendor_ext_p7_ind));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void aerial_phy_deallocate_p7_vendor_ext(void *header)
|
||||
{
|
||||
free(header);
|
||||
}
|
||||
|
||||
uint8_t aerial_unpack_nr_slot_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
nfapi_nr_slot_indication_scf_t *msg,
|
||||
nfapi_p7_codec_config_t *config)
|
||||
{
|
||||
return unpack_nr_slot_indication(ppReadPackedMsg, end, msg, config);
|
||||
}
|
||||
|
||||
static uint8_t aerial_unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value,
|
||||
uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
@@ -53,7 +247,6 @@ static uint8_t aerial_unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
uint8_t **pDataMsg,
|
||||
@@ -80,11 +273,11 @@ uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
||||
}
|
||||
// After unpacking the PDU headers, unpack the PDU data from the separate buffer
|
||||
for (int i = 0; i < pNfapiMsg->number_of_pdus; i++) {
|
||||
if (!pullarray8(pDataMsg,
|
||||
pNfapiMsg->pdu_list[i].pdu,
|
||||
pNfapiMsg->pdu_list[i].pdu_length,
|
||||
pNfapiMsg->pdu_list[i].pdu_length,
|
||||
data_end)) {
|
||||
if(!pullarray8(pDataMsg,
|
||||
pNfapiMsg->pdu_list[i].pdu,
|
||||
pNfapiMsg->pdu_list[i].pdu_length,
|
||||
pNfapiMsg->pdu_list[i].pdu_length,
|
||||
data_end)){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -92,6 +285,19 @@ uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t aerial_unpack_nr_crc_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
nfapi_nr_crc_indication_t *msg,
|
||||
nfapi_p7_codec_config_t *config)
|
||||
{
|
||||
return unpack_nr_crc_indication(ppReadPackedMsg, end, msg, config);
|
||||
}
|
||||
|
||||
uint8_t aerial_unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
|
||||
{
|
||||
return unpack_nr_uci_indication(ppReadPackedMsg, end, msg, config);
|
||||
}
|
||||
|
||||
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
uint8_t **pDataMsg,
|
||||
@@ -110,13 +316,20 @@ uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
|
||||
return retval;
|
||||
}
|
||||
|
||||
uint8_t aerial_unpack_nr_rach_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
nfapi_nr_rach_indication_t *msg,
|
||||
nfapi_p7_codec_config_t *config)
|
||||
{
|
||||
return unpack_nr_rach_indication(ppReadPackedMsg, end, msg, config);
|
||||
}
|
||||
|
||||
static int32_t aerial_pack_tx_data_request(void *pMessageBuf,
|
||||
void *pPackedBuf,
|
||||
void *pDataBuf,
|
||||
uint32_t packedBufLen,
|
||||
uint32_t dataBufLen,
|
||||
nfapi_p7_codec_config_t *config,
|
||||
nfapi_vnf_p7_config_t *p7_config,
|
||||
uint32_t *data_len)
|
||||
{
|
||||
if (pMessageBuf == NULL || pPackedBuf == NULL) {
|
||||
@@ -173,15 +386,16 @@ static int32_t aerial_pack_tx_data_request(void *pMessageBuf,
|
||||
uintptr_t dataEnd = (uintptr_t)pPackedDataField;
|
||||
data_len[0] = dataEnd - dataHead;
|
||||
|
||||
if (!p7_config->pack_func(pMessageBuf, pPackedBuf, packedBufLen, config)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!fapi_nr_p7_message_pack(pMessageBuf, pPackedBuf, packedBufLen, config)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return (int32_t)(pMessageHeader->message_length);
|
||||
}
|
||||
|
||||
|
||||
bool aerial_nr_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header)
|
||||
int fapi_nr_pack_and_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header)
|
||||
{
|
||||
uint8_t FAPI_buffer[1024 * 64];
|
||||
// Check if TX_DATA request, if true, need to pack to data_buf
|
||||
@@ -200,20 +414,17 @@ bool aerial_nr_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *h
|
||||
sizeof(FAPI_buffer),
|
||||
sizeof(FAPI_data_buffer),
|
||||
&vnf_p7->_public.codec_config,
|
||||
((nfapi_vnf_p7_config_t *)vnf_p7),
|
||||
&data_len);
|
||||
if (len_FAPI <= 0) {
|
||||
LOG_E(NFAPI_VNF, "Problem packing TX_DATA_request\n");
|
||||
return false;
|
||||
return len_FAPI;
|
||||
} else {
|
||||
return aerial_send_P7_msg_with_data(FAPI_buffer, len_FAPI, FAPI_data_buffer, data_len, header) == 0;
|
||||
int retval = aerial_send_P7_msg_with_data(FAPI_buffer, len_FAPI, FAPI_data_buffer, data_len, header);
|
||||
return retval;
|
||||
}
|
||||
} else {
|
||||
// Create and send FAPI P7 message
|
||||
int len_FAPI = ((nfapi_vnf_p7_config_t *)vnf_p7)->pack_func(header,
|
||||
FAPI_buffer,
|
||||
sizeof(FAPI_buffer),
|
||||
&vnf_p7->_public.codec_config);
|
||||
return aerial_send_P7_msg(FAPI_buffer, len_FAPI, header) == 0;
|
||||
int len_FAPI = fapi_nr_p7_message_pack(header, FAPI_buffer, sizeof(FAPI_buffer), &vnf_p7->_public.codec_config);
|
||||
return aerial_send_P7_msg(FAPI_buffer, len_FAPI, header);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,21 +47,187 @@
|
||||
#include "nfapi_interface.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "nfapi_vnf_interface.h"
|
||||
#include "nfapi_vnf.h"
|
||||
#include "nfapi.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "fapi_nvIPC.h"
|
||||
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "lte-softmodem.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
#include "openair2/PHY_INTERFACE/queue_t.h"
|
||||
#include "gnb_ind_vars.h"
|
||||
#include "nfapi/open-nFAPI/vnf/inc/vnf.h"
|
||||
#include "nfapi/open-nFAPI/vnf/inc/vnf_p7.h"
|
||||
typedef struct {
|
||||
uint8_t enabled;
|
||||
uint32_t rx_port;
|
||||
uint32_t tx_port;
|
||||
char tx_addr[80];
|
||||
} udp_data;
|
||||
|
||||
typedef struct {
|
||||
uint16_t index;
|
||||
uint16_t id;
|
||||
uint8_t rfs[2];
|
||||
uint8_t excluded_rfs[2];
|
||||
|
||||
udp_data udp;
|
||||
|
||||
char local_addr[80];
|
||||
int local_port;
|
||||
|
||||
char *remote_addr;
|
||||
int remote_port;
|
||||
|
||||
uint8_t duplex_mode;
|
||||
uint16_t dl_channel_bw_support;
|
||||
uint16_t ul_channel_bw_support;
|
||||
uint8_t num_dl_layers_supported;
|
||||
uint8_t num_ul_layers_supported;
|
||||
uint16_t release_supported;
|
||||
uint8_t nmm_modes_supported;
|
||||
|
||||
uint8_t dl_ues_per_subframe;
|
||||
uint8_t ul_ues_per_subframe;
|
||||
|
||||
uint8_t first_subframe_ind;
|
||||
|
||||
// timing information recevied from the vnf
|
||||
uint8_t timing_window;
|
||||
uint8_t timing_info_mode;
|
||||
uint8_t timing_info_period;
|
||||
|
||||
} phy_info;
|
||||
|
||||
typedef struct {
|
||||
uint16_t index;
|
||||
uint16_t band;
|
||||
int16_t max_transmit_power;
|
||||
int16_t min_transmit_power;
|
||||
uint8_t num_antennas_supported;
|
||||
uint32_t min_downlink_frequency;
|
||||
uint32_t max_downlink_frequency;
|
||||
uint32_t max_uplink_frequency;
|
||||
uint32_t min_uplink_frequency;
|
||||
} rf_info;
|
||||
|
||||
typedef struct {
|
||||
int release;
|
||||
phy_info phys[2];
|
||||
rf_info rfs[2];
|
||||
|
||||
uint8_t sync_mode;
|
||||
uint8_t location_mode;
|
||||
uint8_t location_coordinates[6];
|
||||
uint32_t dl_config_timing;
|
||||
uint32_t ul_config_timing;
|
||||
uint32_t tx_timing;
|
||||
uint32_t hi_dci0_timing;
|
||||
|
||||
uint16_t max_phys;
|
||||
uint16_t max_total_bw;
|
||||
uint16_t max_total_dl_layers;
|
||||
uint16_t max_total_ul_layers;
|
||||
uint8_t shared_bands;
|
||||
uint8_t shared_pa;
|
||||
int16_t max_total_power;
|
||||
uint8_t oui;
|
||||
|
||||
uint8_t wireshark_test_mode;
|
||||
|
||||
} pnf_info;
|
||||
|
||||
typedef struct mac mac_t;
|
||||
typedef struct mac {
|
||||
void *user_data;
|
||||
|
||||
void (*dl_config_req)(mac_t *mac, nfapi_dl_config_request_t *req);
|
||||
void (*ul_config_req)(mac_t *mac, nfapi_ul_config_request_t *req);
|
||||
void (*hi_dci0_req)(mac_t *mac, nfapi_hi_dci0_request_t *req);
|
||||
void (*tx_req)(mac_t *mac, nfapi_tx_request_t *req);
|
||||
} mac_t;
|
||||
|
||||
typedef struct {
|
||||
int local_port;
|
||||
char local_addr[80];
|
||||
|
||||
unsigned timing_window;
|
||||
unsigned periodic_timing_enabled;
|
||||
unsigned aperiodic_timing_enabled;
|
||||
unsigned periodic_timing_period;
|
||||
|
||||
// This is not really the right place if we have multiple PHY,
|
||||
// should be part of the phy struct
|
||||
udp_data udp;
|
||||
|
||||
uint8_t thread_started;
|
||||
|
||||
nfapi_vnf_p7_config_t *config;
|
||||
|
||||
mac_t *mac;
|
||||
|
||||
} vnf_p7_info;
|
||||
|
||||
typedef struct {
|
||||
uint8_t wireshark_test_mode;
|
||||
pnf_info pnfs[2];
|
||||
vnf_p7_info p7_vnfs[2];
|
||||
|
||||
} vnf_info;
|
||||
|
||||
int aerial_phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind);
|
||||
int aerial_phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind);
|
||||
int aerial_phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind);
|
||||
int aerial_phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind);
|
||||
int aerial_phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind);
|
||||
int aerial_phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind);
|
||||
void *aerial_vnf_allocate(size_t size);
|
||||
void aerial_vnf_deallocate(void *ptr);
|
||||
int aerial_phy_vendor_ext(struct nfapi_vnf_p7_config *config, void *msg);
|
||||
int aerial_phy_unpack_p7_vendor_extension(void *header,
|
||||
uint8_t **ppReadPackedMessage,
|
||||
uint8_t *end,
|
||||
nfapi_p7_codec_config_t *config);
|
||||
int aerial_phy_pack_p7_vendor_extension(void *header, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
|
||||
int aerial_phy_unpack_vendor_extension_tlv(nfapi_tl_t *tl,
|
||||
uint8_t **ppReadPackedMessage,
|
||||
uint8_t *end,
|
||||
void **ve,
|
||||
nfapi_p7_codec_config_t *codec);
|
||||
int aerial_phy_pack_vendor_extension_tlv(void *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *codec);
|
||||
void *aerial_phy_allocate_p7_vendor_ext(uint16_t message_id, uint16_t *msg_size);
|
||||
void aerial_phy_deallocate_p7_vendor_ext(void *header);
|
||||
|
||||
uint8_t aerial_unpack_nr_slot_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
nfapi_nr_slot_indication_scf_t *msg,
|
||||
nfapi_p7_codec_config_t *config);
|
||||
uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
uint8_t **pDataMsg,
|
||||
uint8_t *data_end,
|
||||
nfapi_nr_rx_data_indication_t *msg,
|
||||
nfapi_p7_codec_config_t *config);
|
||||
|
||||
uint8_t aerial_unpack_nr_crc_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
nfapi_nr_crc_indication_t *msg,
|
||||
nfapi_p7_codec_config_t *config);
|
||||
uint8_t aerial_unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
|
||||
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
uint8_t **pDataMsg,
|
||||
uint8_t *data_end,
|
||||
void *msg,
|
||||
nfapi_p7_codec_config_t *config);
|
||||
bool aerial_nr_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header);
|
||||
uint8_t aerial_unpack_nr_rach_indication(uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
nfapi_nr_rach_indication_t *msg,
|
||||
nfapi_p7_codec_config_t *config);
|
||||
|
||||
// int fapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t* config);
|
||||
int fapi_nr_pack_and_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header);
|
||||
#endif // OPENAIRINTERFACE_FAPI_VNF_P7_H
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <pnf.h>
|
||||
|
||||
#include <vendor_ext.h>
|
||||
#include "fapi_stub.h"
|
||||
@@ -63,16 +62,6 @@
|
||||
#include "executables/lte-softmodem.h"
|
||||
#include "nfapi/open-nFAPI/pnf/inc/pnf_p7.h"
|
||||
|
||||
#ifdef ENABLE_WLS
|
||||
#include <nr_fapi_p5.h>
|
||||
#include <nr_fapi_p7.h>
|
||||
#include "nfapi/oai_integration/wls_integration/include/wls_pnf.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SOCKET
|
||||
#include <socket/include/socket_pnf.h>
|
||||
#endif
|
||||
|
||||
#define NUM_P5_PHY 2
|
||||
|
||||
#define _GNU_SOURCE
|
||||
@@ -196,7 +185,7 @@ typedef struct {
|
||||
} pnf_phy_user_data_t;
|
||||
|
||||
static pnf_info pnf;
|
||||
static pthread_t pnf_p5_init_and_receive_pthread;
|
||||
static pthread_t pnf_start_pthread;
|
||||
|
||||
int nfapitooai_level(int nfapi_level) {
|
||||
switch(nfapi_level) {
|
||||
@@ -230,7 +219,12 @@ void *pnf_p7_thread_start(void *ptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void *pnf_nr_p7_thread_start(void *ptr) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[NR_PNF] NR P7 THREAD %s\n", __FUNCTION__);
|
||||
nfapi_pnf_p7_config_t *config = (nfapi_pnf_p7_config_t *)ptr;
|
||||
nfapi_nr_pnf_p7_start(config);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pnf_nr_param_request(nfapi_pnf_config_t *config, nfapi_nr_pnf_param_request_t *req)
|
||||
{
|
||||
@@ -997,10 +991,6 @@ int nr_config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, n
|
||||
phy_info->timing_window,
|
||||
req->nfapi_config.timing_window.value);
|
||||
num_tlv++;
|
||||
}else {
|
||||
// This is a nFAPI TLV, thus not sent when working with FAPI.
|
||||
// When not sent, we still need a default value, otherwise every message from the L2 is treated as late and not processed
|
||||
phy_info->timing_window = 30;
|
||||
}
|
||||
|
||||
if (req->nfapi_config.timing_info_mode.tl.tag == NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG) {
|
||||
@@ -1757,26 +1747,9 @@ int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nf
|
||||
p7_config->codec_config.pack_p7_vendor_extension = &pnf_nr_phy_pack_p7_vendor_extension;
|
||||
p7_config->codec_config.unpack_vendor_extension_tlv = &pnf_nr_phy_unpack_vendor_extension_tlv;
|
||||
p7_config->codec_config.pack_vendor_extension_tlv = &pnf_nr_phy_pack_vendor_extention_tlv;
|
||||
|
||||
#ifdef ENABLE_WLS
|
||||
p7_config->unpack_func = &fapi_nr_p7_message_unpack;
|
||||
p7_config->hdr_unpack_func = &fapi_nr_p7_message_header_unpack;
|
||||
p7_config->pack_func = &fapi_nr_p7_message_pack;
|
||||
p7_config->send_p7_msg = &wls_pnf_nr_send_p7_message;
|
||||
// pass p7_config to WLS handler
|
||||
wls_pnf_set_p7_config(p7_config);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SOCKET
|
||||
p7_config->unpack_func = &nfapi_nr_p7_message_unpack;
|
||||
p7_config->hdr_unpack_func = &nfapi_nr_p7_message_header_unpack;
|
||||
p7_config->pack_func = &nfapi_nr_p7_message_pack;
|
||||
p7_config->send_p7_msg = &pnf_nr_send_p7_message;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating P7 thread %s\n", __FUNCTION__);
|
||||
pthread_t p7_thread;
|
||||
threadCreate(&p7_thread, &pnf_nr_p7_thread_start, p7_config, "pnf_p7_thread", -1, OAI_PRIORITY_RT);
|
||||
#endif
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Calling l1_north_init_eNB() %s\n", __FUNCTION__);
|
||||
l1_north_init_gNB();
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] HACK - Set p7_config global ready for subframe ind%s\n", __FUNCTION__);
|
||||
@@ -1821,11 +1794,10 @@ int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nf
|
||||
usleep(50000);
|
||||
printf("[PNF] waiting for OAI to be started\n");
|
||||
}
|
||||
#ifndef ENABLE_WLS
|
||||
|
||||
printf("[PNF] Sending PNF_START_RESP\n");
|
||||
nfapi_nr_send_pnf_start_resp(config, p7_config->phy_id);
|
||||
printf("[PNF] Sending first P7 slot indication\n");
|
||||
#endif
|
||||
#if 1
|
||||
nfapi_pnf_p7_slot_ind(p7_config, p7_config->phy_id, 0, 0);
|
||||
printf("[PNF] Sent first P7 slot ind\n");
|
||||
@@ -2160,6 +2132,15 @@ void *pnf_start_thread(void *ptr) {
|
||||
return (void *)0;
|
||||
}
|
||||
|
||||
void *pnf_nr_start_thread(void *ptr) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] IN PNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
nfapi_pnf_config_t *config = (nfapi_pnf_config_t *)ptr;
|
||||
struct sched_param sp;
|
||||
sp.sched_priority = 20;
|
||||
pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp);
|
||||
nfapi_nr_pnf_start(config);
|
||||
return (void *)0;
|
||||
}
|
||||
|
||||
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port)
|
||||
{
|
||||
@@ -2207,29 +2188,9 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add
|
||||
config->deallocate_p4_p5_vendor_ext = &pnf_nr_sim_deallocate_p4_p5_vendor_ext;
|
||||
config->codec_config.unpack_p4_p5_vendor_extension = &pnf_nr_sim_unpack_p4_p5_vendor_extension;
|
||||
config->codec_config.pack_p4_p5_vendor_extension = &pnf_nr_sim_pack_p4_p5_vendor_extension;
|
||||
|
||||
#ifdef ENABLE_WLS
|
||||
printf("WLS MODE PNF\n");
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating WLS PNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
// Assume it's the FAPI handler, change from within the PNF if it's not the case
|
||||
config->unpack_func = &fapi_nr_p5_message_unpack;
|
||||
config->hdr_unpack_func = &fapi_nr_message_header_unpack;
|
||||
config->pack_func = &fapi_nr_p5_message_pack;
|
||||
config->send_p5_msg = &wls_pnf_nr_send_p5_message;
|
||||
//wls_fapi_pnf_nr_start_thread(config);
|
||||
threadCreate(&pnf_p5_init_and_receive_pthread, wls_fapi_pnf_nr_start_thread, config, "NFAPI_WLS_PNF", -1, OAI_PRIORITY_RT_MAX);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SOCKET
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating PNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
config->unpack_func = &nfapi_nr_p5_message_unpack;
|
||||
config->hdr_unpack_func = &nfapi_nr_p5_message_header_unpack;
|
||||
config->pack_func = &nfapi_nr_p5_message_pack;
|
||||
config->send_p5_msg = &pnf_nr_send_p5_message;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating PNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
pthread_create(&pnf_p5_init_and_receive_pthread, NULL, &pnf_start_p5_thread, config);
|
||||
pthread_setname_np(pnf_p5_init_and_receive_pthread, "NFAPI_PNF");
|
||||
#endif
|
||||
pthread_create(&pnf_start_pthread, NULL, &pnf_nr_start_thread, config);
|
||||
pthread_setname_np(pnf_start_pthread, "NFAPI_PNF");
|
||||
}
|
||||
|
||||
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {
|
||||
@@ -2279,8 +2240,8 @@ void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr,
|
||||
config->codec_config.unpack_p4_p5_vendor_extension = &pnf_sim_unpack_p4_p5_vendor_extension;
|
||||
config->codec_config.pack_p4_p5_vendor_extension = &pnf_sim_pack_p4_p5_vendor_extension;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating PNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
pthread_create(&pnf_p5_init_and_receive_pthread, NULL, &pnf_start_thread, config);
|
||||
pthread_setname_np(pnf_p5_init_and_receive_pthread, "NFAPI_PNF");
|
||||
pthread_create(&pnf_start_pthread, NULL, &pnf_start_thread, config);
|
||||
pthread_setname_np(pnf_start_pthread, "NFAPI_PNF");
|
||||
}
|
||||
|
||||
void oai_subframe_ind(uint16_t sfn, uint16_t sf) {
|
||||
@@ -2339,11 +2300,7 @@ void handle_nr_slot_ind(uint16_t sfn, uint16_t slot)
|
||||
//send VNF slot indication, which is aligned with TX thread, so that it can call the scheduler
|
||||
//we give four additional slots (2ms) which should be enough time for the VNF to
|
||||
//answer
|
||||
#ifndef ENABLE_WLS
|
||||
int slot_ahead = 2 << mu;
|
||||
#else
|
||||
int slot_ahead = 1;
|
||||
#endif
|
||||
uint16_t sfn_tx = sfn;
|
||||
uint16_t slot_tx = slot;
|
||||
sfnslot_add_slot(mu, &sfn_tx, &slot_tx, slot_ahead); // modify: do in place
|
||||
|
||||
@@ -32,19 +32,8 @@
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "nfapi_vnf_interface.h"
|
||||
#include "nfapi_vnf.h"
|
||||
#include <vnf.h>
|
||||
#include <vnf_p7.h>
|
||||
#ifdef ENABLE_WLS
|
||||
#include <wls_integration/include/wls_vnf.h>
|
||||
#include "nr_fapi_p5.h"
|
||||
#include "nr_fapi_p7.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SOCKET
|
||||
#include <socket/include/socket_vnf.h>
|
||||
#endif
|
||||
|
||||
#include "nfapi.h"
|
||||
#include "vendor_ext.h"
|
||||
|
||||
@@ -59,14 +48,10 @@
|
||||
#include "openair2/PHY_INTERFACE/queue_t.h"
|
||||
#include "gnb_ind_vars.h"
|
||||
#include "nr_fapi_p7_utils.h"
|
||||
#include "nr_fapi_p5_utils.h"
|
||||
#include <NR_MAC_gNB/mac_proto.h>
|
||||
|
||||
#ifdef ENABLE_AERIAL
|
||||
#include "aerial/fapi_nvIPC.h"
|
||||
#include "aerial/fapi_vnf_p7.h"
|
||||
#include "nr_fapi_p5.h"
|
||||
#include "nr_fapi_p7.h"
|
||||
#include "aerial/fapi_vnf_p5.h"
|
||||
#endif
|
||||
|
||||
#define TEST
|
||||
@@ -74,6 +59,128 @@
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern UL_RCC_IND_t UL_RCC_INFO;
|
||||
|
||||
typedef struct {
|
||||
uint8_t enabled;
|
||||
uint32_t rx_port;
|
||||
uint32_t tx_port;
|
||||
char tx_addr[80];
|
||||
} udp_data;
|
||||
|
||||
typedef struct {
|
||||
uint16_t index;
|
||||
uint16_t id;
|
||||
uint8_t rfs[2];
|
||||
uint8_t excluded_rfs[2];
|
||||
|
||||
udp_data udp;
|
||||
|
||||
char local_addr[80];
|
||||
int local_port;
|
||||
|
||||
char *remote_addr;
|
||||
int remote_port;
|
||||
|
||||
uint8_t duplex_mode;
|
||||
uint16_t dl_channel_bw_support;
|
||||
uint16_t ul_channel_bw_support;
|
||||
uint8_t num_dl_layers_supported;
|
||||
uint8_t num_ul_layers_supported;
|
||||
uint16_t release_supported;
|
||||
uint8_t nmm_modes_supported;
|
||||
|
||||
uint8_t dl_ues_per_subframe;
|
||||
uint8_t ul_ues_per_subframe;
|
||||
|
||||
uint8_t first_subframe_ind;
|
||||
|
||||
// timing information recevied from the vnf
|
||||
uint8_t timing_window;
|
||||
uint8_t timing_info_mode;
|
||||
uint8_t timing_info_period;
|
||||
|
||||
} phy_info;
|
||||
|
||||
typedef struct {
|
||||
uint16_t index;
|
||||
uint16_t band;
|
||||
int16_t max_transmit_power;
|
||||
int16_t min_transmit_power;
|
||||
uint8_t num_antennas_supported;
|
||||
uint32_t min_downlink_frequency;
|
||||
uint32_t max_downlink_frequency;
|
||||
uint32_t max_uplink_frequency;
|
||||
uint32_t min_uplink_frequency;
|
||||
} rf_info;
|
||||
|
||||
typedef struct {
|
||||
|
||||
int release;
|
||||
phy_info phys[2];
|
||||
rf_info rfs[2];
|
||||
|
||||
uint8_t sync_mode;
|
||||
uint8_t location_mode;
|
||||
uint8_t location_coordinates[6];
|
||||
uint32_t dl_config_timing;
|
||||
uint32_t ul_config_timing;
|
||||
uint32_t tx_timing;
|
||||
uint32_t hi_dci0_timing;
|
||||
|
||||
uint16_t max_phys;
|
||||
uint16_t max_total_bw;
|
||||
uint16_t max_total_dl_layers;
|
||||
uint16_t max_total_ul_layers;
|
||||
uint8_t shared_bands;
|
||||
uint8_t shared_pa;
|
||||
int16_t max_total_power;
|
||||
uint8_t oui;
|
||||
|
||||
uint8_t wireshark_test_mode;
|
||||
|
||||
} pnf_info;
|
||||
|
||||
typedef struct mac mac_t;
|
||||
|
||||
typedef struct mac {
|
||||
|
||||
void *user_data;
|
||||
|
||||
void (*dl_config_req)(mac_t *mac, nfapi_dl_config_request_t *req);
|
||||
void (*ul_config_req)(mac_t *mac, nfapi_ul_config_request_t *req);
|
||||
void (*hi_dci0_req)(mac_t *mac, nfapi_hi_dci0_request_t *req);
|
||||
void (*tx_req)(mac_t *mac, nfapi_tx_request_t *req);
|
||||
} mac_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
int local_port;
|
||||
char local_addr[80];
|
||||
|
||||
unsigned timing_window;
|
||||
unsigned periodic_timing_enabled;
|
||||
unsigned aperiodic_timing_enabled;
|
||||
unsigned periodic_timing_period;
|
||||
|
||||
// This is not really the right place if we have multiple PHY,
|
||||
// should be part of the phy struct
|
||||
udp_data udp;
|
||||
|
||||
uint8_t thread_started;
|
||||
|
||||
nfapi_vnf_p7_config_t *config;
|
||||
|
||||
mac_t *mac;
|
||||
|
||||
} vnf_p7_info;
|
||||
|
||||
typedef struct {
|
||||
|
||||
uint8_t wireshark_test_mode;
|
||||
pnf_info pnfs[2];
|
||||
vnf_p7_info p7_vnfs[2];
|
||||
|
||||
} vnf_info;
|
||||
|
||||
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");
|
||||
nfapi_tl_t *tlv = (nfapi_tl_t *)ve;
|
||||
@@ -600,7 +707,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
|
||||
|
||||
int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
|
||||
{
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF || NFAPI_MODE == NFAPI_MODE_AERIAL) {
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF) {
|
||||
nfapi_nr_rach_indication_t *rach_ind = CALLOC(1, sizeof(*rach_ind));
|
||||
copy_rach_indication(ind, rach_ind);
|
||||
if (!put_queue(&gnb_rach_ind_queue, rach_ind)) {
|
||||
@@ -617,7 +724,7 @@ int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
|
||||
int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
|
||||
{
|
||||
LOG_D(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n", __FUNCTION__, ind->sfn, ind->slot, ind->num_ucis);
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF || NFAPI_MODE == NFAPI_MODE_AERIAL) {
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF) {
|
||||
nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind));
|
||||
AssertFatal(uci_ind, "Memory not allocated for uci_ind in phy_nr_uci_indication.");
|
||||
copy_uci_indication(ind, uci_ind);
|
||||
@@ -722,7 +829,7 @@ int phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind)
|
||||
{
|
||||
LOG_D(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n", __FUNCTION__, ind->sfn, ind->slot, ind->number_crcs);
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF || NFAPI_MODE == NFAPI_MODE_AERIAL) {
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF) {
|
||||
nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind));
|
||||
copy_crc_indication(ind, crc_ind);
|
||||
if (!put_queue(&gnb_crc_ind_queue, crc_ind)) {
|
||||
@@ -823,7 +930,7 @@ int phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind)
|
||||
ind->number_of_pdus,
|
||||
ind->pdu_list[0].pdu);
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF || NFAPI_MODE == NFAPI_MODE_AERIAL) {
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF) {
|
||||
nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind));
|
||||
copy_rx_data_indication(ind, rx_ind);
|
||||
if (!put_queue(&gnb_rx_ind_queue, rx_ind)) {
|
||||
@@ -1282,9 +1389,16 @@ int vnf_nr_pack_p4_p5_vendor_extension(void *header, uint8_t **ppWritePackedMsg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static pthread_t vnf_p5_init_and_receive_pthread;
|
||||
static pthread_t vnf_start_pthread;
|
||||
static pthread_t vnf_p7_start_pthread;
|
||||
|
||||
void *vnf_nr_p7_start_thread(void *ptr) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
|
||||
pthread_setname_np(pthread_self(), "VNF_P7");
|
||||
nfapi_vnf_p7_config_t *config = (nfapi_vnf_p7_config_t *)ptr;
|
||||
nfapi_nr_vnf_p7_start(config);
|
||||
return config;
|
||||
}
|
||||
|
||||
void *vnf_p7_start_thread(void *ptr) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
|
||||
@@ -1294,7 +1408,7 @@ void *vnf_p7_start_thread(void *ptr) {
|
||||
return config;
|
||||
}
|
||||
|
||||
void *configure_nr_p7_vnf(void *ptr)
|
||||
void *vnf_nr_p7_thread_start(void *ptr)
|
||||
{
|
||||
init_queue(&gnb_rach_ind_queue);
|
||||
init_queue(&gnb_rx_ind_queue);
|
||||
@@ -1303,23 +1417,19 @@ void *configure_nr_p7_vnf(void *ptr)
|
||||
|
||||
vnf_p7_info *p7_vnf = (vnf_p7_info *)ptr;
|
||||
p7_vnf->config->port = p7_vnf->local_port;
|
||||
#ifndef ENABLE_AERIAL
|
||||
p7_vnf->config->sync_indication = &phy_sync_indication;
|
||||
p7_vnf->config->slot_indication = &phy_slot_indication;
|
||||
p7_vnf->config->harq_indication = &phy_harq_indication;
|
||||
#endif
|
||||
p7_vnf->config->nr_crc_indication = &phy_nr_crc_indication;
|
||||
p7_vnf->config->nr_rx_data_indication = &phy_nr_rx_data_indication;
|
||||
p7_vnf->config->nr_rach_indication = &phy_nr_rach_indication;
|
||||
p7_vnf->config->nr_uci_indication = &phy_nr_uci_indication;
|
||||
#ifndef ENABLE_AERIAL
|
||||
p7_vnf->config->srs_indication = &phy_srs_indication;
|
||||
p7_vnf->config->sr_indication = &phy_sr_indication;
|
||||
p7_vnf->config->cqi_indication = &phy_cqi_indication;
|
||||
p7_vnf->config->lbt_dl_indication = &phy_lbt_dl_indication;
|
||||
p7_vnf->config->nb_harq_indication = &phy_nb_harq_indication;
|
||||
p7_vnf->config->nrach_indication = &phy_nrach_indication;
|
||||
#endif
|
||||
p7_vnf->config->nr_slot_indication = &phy_nr_slot_indication;
|
||||
p7_vnf->config->nr_srs_indication = &phy_nr_srs_indication;
|
||||
p7_vnf->config->malloc = &vnf_allocate;
|
||||
@@ -1335,30 +1445,8 @@ void *configure_nr_p7_vnf(void *ptr)
|
||||
p7_vnf->config->codec_config.deallocate = &vnf_deallocate;
|
||||
p7_vnf->config->allocate_p7_vendor_ext = &phy_nr_allocate_p7_vendor_ext;
|
||||
p7_vnf->config->deallocate_p7_vendor_ext = &phy_nr_deallocate_p7_vendor_ext;
|
||||
|
||||
#ifdef ENABLE_WLS
|
||||
p7_vnf->config->unpack_func = &fapi_nr_p7_message_unpack;
|
||||
p7_vnf->config->hdr_unpack_func = &fapi_nr_p7_message_header_unpack;
|
||||
p7_vnf->config->pack_func = &fapi_nr_p7_message_pack;
|
||||
p7_vnf->config->send_p7_msg = &wls_vnf_nr_send_p7_message;
|
||||
wls_vnf_set_p7_config(p7_vnf->config);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SOCKET
|
||||
p7_vnf->config->unpack_func = &nfapi_nr_p7_message_unpack;
|
||||
p7_vnf->config->hdr_unpack_func = &nfapi_nr_p7_message_header_unpack;
|
||||
p7_vnf->config->pack_func = &nfapi_nr_p7_message_pack;
|
||||
p7_vnf->config->send_p7_msg = &vnf_nr_send_p7_msg;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI P7 start thread %s\n", __FUNCTION__);
|
||||
threadCreate(&vnf_p7_start_pthread, &vnf_nr_start_p7_thread, p7_vnf->config, "vnf_p7_thread", -1, OAI_PRIORITY_RT);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_AERIAL
|
||||
p7_vnf->config->unpack_func = &fapi_nr_p7_message_unpack;
|
||||
p7_vnf->config->hdr_unpack_func = &fapi_nr_p7_message_header_unpack;
|
||||
p7_vnf->config->pack_func = &fapi_nr_p7_message_pack;
|
||||
p7_vnf->config->send_p7_msg = &aerial_nr_send_p7_message;
|
||||
#endif
|
||||
pthread_create(&vnf_p7_start_pthread, NULL, &vnf_nr_p7_start_thread, p7_vnf->config);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1406,7 +1494,7 @@ int pnf_nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_st
|
||||
|
||||
if(p7_vnf->thread_started == 0) {
|
||||
pthread_t vnf_p7_thread;
|
||||
threadCreate(&vnf_p7_thread, &configure_nr_p7_vnf, p7_vnf, "vnf_p7_thread", -1, OAI_PRIORITY_RT);
|
||||
threadCreate(&vnf_p7_thread, &vnf_nr_p7_thread_start, p7_vnf, "vnf_p7_thread", -1, OAI_PRIORITY_RT);
|
||||
p7_vnf->thread_started = 1;
|
||||
} else {
|
||||
// P7 thread already running.
|
||||
@@ -1416,12 +1504,7 @@ int pnf_nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_st
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Sending NFAPI_VNF_PARAM_REQUEST phy_id:%d\n", pnf->phys[0].id);
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.header.message_id = NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST;
|
||||
#ifdef ENABLE_WLS
|
||||
req.header.phy_id = 0;
|
||||
#endif
|
||||
#ifdef ENABLE_SOCKET
|
||||
req.header.phy_id = pnf->phys[0].id;
|
||||
#endif
|
||||
nfapi_nr_vnf_param_req(config, p5_idx, &req);
|
||||
return 0;
|
||||
}
|
||||
@@ -1459,9 +1542,8 @@ int nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_resp
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
phy_info *phy = pnf->phys;
|
||||
nfapi_nr_config_request_scf_t *req = &RC.nrmac[0]->config[0]; // check
|
||||
#ifndef ENABLE_AERIAL
|
||||
struct sockaddr_in pnf_p7_sockaddr;
|
||||
nfapi_nr_config_request_scf_t *req = &RC.nrmac[0]->config[0]; // check
|
||||
phy->remote_port = resp->nfapi_config.p7_pnf_port.value;
|
||||
//phy->remote_port = 32123;//resp->nfapi_config.p7_pnf_port.value;
|
||||
memcpy(&pnf_p7_sockaddr.sin_addr.s_addr, &(resp->nfapi_config.p7_pnf_address_ipv4.address[0]), 4);
|
||||
@@ -1469,7 +1551,6 @@ int nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_resp
|
||||
// for now just 1
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled,
|
||||
p7_vnf->periodic_timing_period);
|
||||
#endif
|
||||
// Hack? the VNF might need the subcarrier spacing for some calculations
|
||||
// (that we actually don't use as of now...). We therefore need to save the
|
||||
// mu, for the current PNF connection (together with where we have frame/slot
|
||||
@@ -1485,7 +1566,7 @@ int nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_resp
|
||||
req->header.phy_id = phy->id;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Send NFAPI_CONFIG_REQUEST\n");
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "\n NR bandP =%d\n",req->nfapi_config.rf_bands.rf_band[0]);
|
||||
#ifndef ENABLE_AERIAL
|
||||
|
||||
req->nfapi_config.p7_vnf_port.tl.tag = NFAPI_NR_NFAPI_P7_VNF_PORT_TAG;
|
||||
req->nfapi_config.p7_vnf_port.value = p7_vnf->local_port;
|
||||
req->num_tlv++;
|
||||
@@ -1523,7 +1604,6 @@ req->nfapi_config.tx_data_timing_offset.tl.tag = NFAPI_NR_NFAPI_TX_DATA_TIMING_O
|
||||
ve2.tl.tag = VENDOR_EXT_TLV_2_TAG;
|
||||
ve2.dummy = 2016;
|
||||
req->vendor_extension = &ve2.tl;
|
||||
#endif
|
||||
nfapi_nr_vnf_config_req(config, p5_idx, req);
|
||||
printf("[VNF] Sent NFAPI_VNF_CONFIG_REQ num_tlv:%u\n",req->num_tlv);
|
||||
return 0;
|
||||
@@ -1623,21 +1703,6 @@ int nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_start_resp
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nr_error_ind_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_error_indication_scf_t *resp)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN,
|
||||
"[VNF] Received NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION idx:%d phy_id:%d\n",
|
||||
p5_idx,
|
||||
resp->header.phy_id);
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "[VNF] Previous message 0x%02x resulted in an error on the PNF \n", resp->message_id);
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN,
|
||||
"[VNF] Received error code 0x%02x (%s)\n",
|
||||
resp->error_code,
|
||||
error_ind_code_to_str(resp->error_code));
|
||||
// TODO: add error handling to the VNF instead of only reporting the received error
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vendor_ext_cb(nfapi_vnf_config_t *config, int p5_idx, void *msg)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s\n", __FUNCTION__);
|
||||
@@ -1729,19 +1794,28 @@ void vnf_nr_deallocate_p4_p5_vendor_ext(void *header) {
|
||||
free(header);
|
||||
}
|
||||
|
||||
|
||||
nfapi_vnf_config_t *config = 0;
|
||||
|
||||
void vnf_nr_start_thread(void *ptr) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] VNF NFAPI thread - nfapi_vnf_start()%s\n", __FUNCTION__);
|
||||
pthread_setname_np(pthread_self(), "VNF");
|
||||
config = (nfapi_vnf_config_t *)ptr;
|
||||
nfapi_nr_vnf_start(config);
|
||||
}
|
||||
|
||||
void vnf_start_thread(void *ptr) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] VNF NFAPI thread - nfapi_vnf_start()%s\n", __FUNCTION__);
|
||||
pthread_setname_np(pthread_self(), "VNF");
|
||||
nfapi_vnf_start((nfapi_vnf_config_t *)ptr);
|
||||
config = (nfapi_vnf_config_t *)ptr;
|
||||
nfapi_vnf_start(config);
|
||||
}
|
||||
|
||||
static vnf_info vnf;
|
||||
|
||||
void configure_nr_nfapi_vnf(eth_params_t params)
|
||||
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port)
|
||||
{
|
||||
#ifndef ENABLE_AERIAL
|
||||
nfapi_setmode(NFAPI_MODE_VNF);
|
||||
#endif
|
||||
memset(&vnf, 0, sizeof(vnf));
|
||||
memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs));
|
||||
vnf.p7_vnfs[0].timing_window = 30;
|
||||
@@ -1749,21 +1823,19 @@ void configure_nr_nfapi_vnf(eth_params_t params)
|
||||
vnf.p7_vnfs[0].aperiodic_timing_enabled = 0;
|
||||
vnf.p7_vnfs[0].periodic_timing_period = 1;
|
||||
vnf.p7_vnfs[0].config = nfapi_vnf_p7_config_create();
|
||||
#ifndef ENABLE_AERIAL
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"[VNF] %s() vnf.p7_vnfs[0].config:%p VNF ADDRESS:%s:%d\n",
|
||||
__FUNCTION__,
|
||||
vnf.p7_vnfs[0].config,
|
||||
params.my_addr,
|
||||
params.my_portc);
|
||||
strcpy(vnf.p7_vnfs[0].local_addr, params.my_addr);
|
||||
vnf.p7_vnfs[0].local_port = params.my_portd;
|
||||
#endif
|
||||
vnf_addr,
|
||||
vnf_p5_port);
|
||||
strcpy(vnf.p7_vnfs[0].local_addr, vnf_addr);
|
||||
vnf.p7_vnfs[0].local_port = vnf_p7_port;
|
||||
vnf.p7_vnfs[0].mac = (mac_t *)malloc(sizeof(mac_t));
|
||||
nfapi_vnf_config_t *config = nfapi_vnf_config_create();
|
||||
config->malloc = malloc;
|
||||
config->free = free;
|
||||
config->vnf_p5_port = params.my_portc;
|
||||
config->vnf_p5_port = vnf_p5_port;
|
||||
config->vnf_ipv4 = 1;
|
||||
config->vnf_ipv6 = 0;
|
||||
config->pnf_list = 0;
|
||||
@@ -1778,7 +1850,6 @@ void configure_nr_nfapi_vnf(eth_params_t params)
|
||||
config->nr_param_resp = &nr_param_resp_cb;
|
||||
config->nr_config_resp = &nr_config_resp_cb;
|
||||
config->nr_start_resp = &nr_start_resp_cb;
|
||||
config->nr_error_ind = &nr_error_ind_cb;
|
||||
config->vendor_ext = &vendor_nr_ext_cb;
|
||||
config->user_data = &vnf;
|
||||
// To allow custom vendor extentions to be added to nfapi
|
||||
@@ -1791,73 +1862,9 @@ void configure_nr_nfapi_vnf(eth_params_t params)
|
||||
config->codec_config.allocate = &vnf_nr_allocate;
|
||||
config->codec_config.deallocate = &vnf_nr_deallocate;
|
||||
memset(&UL_RCC_INFO, 0, sizeof(UL_RCC_IND_t));
|
||||
|
||||
#ifdef ENABLE_WLS
|
||||
config->unpack_func = &fapi_nr_p5_message_unpack;
|
||||
config->hdr_unpack_func = &fapi_nr_message_header_unpack;
|
||||
config->pack_func = &fapi_nr_p5_message_pack;
|
||||
config->send_p5_msg = &wls_vnf_nr_send_p5_message;
|
||||
printf("WLS MODE PNF\n");
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating WLS VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
//wls_fapi_pnf_nr_start_thread(config);
|
||||
threadCreate(&vnf_p5_init_and_receive_pthread, wls_fapi_vnf_nr_start_thread, config, "NFAPI_WLS_VNF", -1, OAI_PRIORITY_RT_MAX);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SOCKET
|
||||
config->unpack_func = &nfapi_nr_p5_message_unpack;
|
||||
config->hdr_unpack_func = &nfapi_nr_p5_message_header_unpack;
|
||||
config->pack_func = &nfapi_nr_p5_message_pack;
|
||||
config->send_p5_msg = &vnf_nr_send_p5_msg;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
pthread_create(&vnf_p5_init_and_receive_pthread, NULL, (void *)&vnf_start_p5_thread, config);
|
||||
pthread_create(&vnf_start_pthread, NULL, (void *)&vnf_nr_start_thread, config);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Created VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
#endif
|
||||
#ifdef ENABLE_AERIAL
|
||||
config->unpack_func = &fapi_nr_p5_message_unpack;
|
||||
config->hdr_unpack_func = &fapi_nr_message_header_unpack;
|
||||
config->pack_func = &fapi_nr_p5_message_pack;
|
||||
config->send_p5_msg = &aerial_nr_send_p5_message;
|
||||
set_config(config);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Created VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
nfapi_vnf_pnf_info_t *pnf = (nfapi_vnf_pnf_info_t *)malloc(sizeof(nfapi_vnf_pnf_info_t));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "MALLOC nfapi_vnf_pnf_info_t for pnf_list pnf:%p\n", pnf);
|
||||
memset(pnf, 0, sizeof(nfapi_vnf_pnf_info_t));
|
||||
pnf->p5_idx = 1;
|
||||
pnf->connected = 1;
|
||||
// Add needed parameters
|
||||
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
pnf_info *pnf_info = vnf->pnfs;
|
||||
|
||||
for (int i = 0; i < 1; ++i) {
|
||||
phy_info phy;
|
||||
memset(&phy, 0, sizeof(phy));
|
||||
phy.index = 0;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) phy_config_idx:%d\n", i, 0);
|
||||
nfapi_vnf_allocate_phy(config, 1, &(phy.id));
|
||||
|
||||
for (int j = 0; j < 1; ++j) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) (RF%d) %d\n", i, j, 0);
|
||||
phy.rfs[0] = 0;
|
||||
}
|
||||
|
||||
pnf_info->phys[0] = phy;
|
||||
}
|
||||
|
||||
|
||||
nfapi_vnf_pnf_list_add(config, pnf);
|
||||
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"[VNF] pnf start response idx:%d config:%p user_data:%p p7_vnf[config:%p thread_started:%d]\n",
|
||||
1,
|
||||
config,
|
||||
config->user_data,
|
||||
vnf->p7_vnfs[0].config,
|
||||
vnf->p7_vnfs[0].thread_started);
|
||||
configure_nr_p7_vnf(p7_vnf);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1905,7 +1912,7 @@ void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int
|
||||
config->codec_config.deallocate = &vnf_deallocate;
|
||||
memset(&UL_RCC_INFO,0,sizeof(UL_RCC_IND_t));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
pthread_create(&vnf_p5_init_and_receive_pthread, NULL, (void *)&vnf_start_thread, config);
|
||||
pthread_create(&vnf_start_pthread, NULL, (void *)&vnf_start_thread, config);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Created VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
@@ -1950,13 +1957,13 @@ int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
|
||||
dl_config_req->header.message_id= NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
||||
dl_config_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||
|
||||
bool retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req);
|
||||
int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req);
|
||||
|
||||
dl_config_req->dl_tti_request_body.nPDUs = 0;
|
||||
dl_config_req->dl_tti_request_body.nGroup = 0;
|
||||
|
||||
|
||||
if (!retval) {
|
||||
if (retval!=0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
}
|
||||
return retval;
|
||||
@@ -1969,9 +1976,9 @@ int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
|
||||
tx_data_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
|
||||
//LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
|
||||
bool retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
||||
int retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
||||
|
||||
if (!retval) {
|
||||
if (retval!=0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
tx_data_req->Number_of_PDUs = 0;
|
||||
@@ -2002,9 +2009,9 @@ int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req) {
|
||||
ul_dci_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||
ul_dci_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST;
|
||||
//LOG_D(PHY, "[VNF] %s() HI_DCI0_REQ sfn_sf:%d dci:%d hi:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(hi_dci0_req->sfn_sf), hi_dci0_req->hi_dci0_request_body.number_of_dci, hi_dci0_req->hi_dci0_request_body.number_of_hi);
|
||||
bool retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
|
||||
int retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
|
||||
|
||||
if (!retval) {
|
||||
if (retval!=0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
ul_dci_req->numPdus = 0;
|
||||
@@ -2055,9 +2062,9 @@ int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req) {
|
||||
ul_tti_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||
ul_tti_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST;
|
||||
|
||||
bool retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
|
||||
int retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
|
||||
|
||||
if (!retval) {
|
||||
if (retval!=0) {
|
||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||
} else {
|
||||
// Reset number of PDUs so that it is not resent
|
||||
|
||||
@@ -21,132 +21,8 @@
|
||||
|
||||
#ifndef NFAPI_VNF_H_
|
||||
#define NFAPI_VNF_H_
|
||||
#include <common_lib.h>
|
||||
|
||||
#include "nfapi_vnf_interface.h"
|
||||
typedef struct {
|
||||
uint8_t enabled;
|
||||
uint32_t rx_port;
|
||||
uint32_t tx_port;
|
||||
char tx_addr[80];
|
||||
} udp_data;
|
||||
|
||||
typedef struct {
|
||||
uint16_t index;
|
||||
uint16_t id;
|
||||
uint8_t rfs[2];
|
||||
uint8_t excluded_rfs[2];
|
||||
|
||||
udp_data udp;
|
||||
|
||||
char local_addr[80];
|
||||
int local_port;
|
||||
|
||||
char *remote_addr;
|
||||
int remote_port;
|
||||
|
||||
uint8_t duplex_mode;
|
||||
uint16_t dl_channel_bw_support;
|
||||
uint16_t ul_channel_bw_support;
|
||||
uint8_t num_dl_layers_supported;
|
||||
uint8_t num_ul_layers_supported;
|
||||
uint16_t release_supported;
|
||||
uint8_t nmm_modes_supported;
|
||||
|
||||
uint8_t dl_ues_per_subframe;
|
||||
uint8_t ul_ues_per_subframe;
|
||||
|
||||
uint8_t first_subframe_ind;
|
||||
|
||||
// timing information recevied from the vnf
|
||||
uint8_t timing_window;
|
||||
uint8_t timing_info_mode;
|
||||
uint8_t timing_info_period;
|
||||
|
||||
} phy_info;
|
||||
|
||||
typedef struct {
|
||||
uint16_t index;
|
||||
uint16_t band;
|
||||
int16_t max_transmit_power;
|
||||
int16_t min_transmit_power;
|
||||
uint8_t num_antennas_supported;
|
||||
uint32_t min_downlink_frequency;
|
||||
uint32_t max_downlink_frequency;
|
||||
uint32_t max_uplink_frequency;
|
||||
uint32_t min_uplink_frequency;
|
||||
} rf_info;
|
||||
|
||||
typedef struct {
|
||||
|
||||
int release;
|
||||
phy_info phys[2];
|
||||
rf_info rfs[2];
|
||||
|
||||
uint8_t sync_mode;
|
||||
uint8_t location_mode;
|
||||
uint8_t location_coordinates[6];
|
||||
uint32_t dl_config_timing;
|
||||
uint32_t ul_config_timing;
|
||||
uint32_t tx_timing;
|
||||
uint32_t hi_dci0_timing;
|
||||
|
||||
uint16_t max_phys;
|
||||
uint16_t max_total_bw;
|
||||
uint16_t max_total_dl_layers;
|
||||
uint16_t max_total_ul_layers;
|
||||
uint8_t shared_bands;
|
||||
uint8_t shared_pa;
|
||||
int16_t max_total_power;
|
||||
uint8_t oui;
|
||||
|
||||
uint8_t wireshark_test_mode;
|
||||
|
||||
} pnf_info;
|
||||
|
||||
typedef struct mac mac_t;
|
||||
|
||||
typedef struct mac {
|
||||
|
||||
void *user_data;
|
||||
|
||||
void (*dl_config_req)(mac_t *mac, nfapi_dl_config_request_t *req);
|
||||
void (*ul_config_req)(mac_t *mac, nfapi_ul_config_request_t *req);
|
||||
void (*hi_dci0_req)(mac_t *mac, nfapi_hi_dci0_request_t *req);
|
||||
void (*tx_req)(mac_t *mac, nfapi_tx_request_t *req);
|
||||
} mac_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
int local_port;
|
||||
char local_addr[80];
|
||||
|
||||
unsigned timing_window;
|
||||
unsigned periodic_timing_enabled;
|
||||
unsigned aperiodic_timing_enabled;
|
||||
unsigned periodic_timing_period;
|
||||
|
||||
// This is not really the right place if we have multiple PHY,
|
||||
// should be part of the phy struct
|
||||
udp_data udp;
|
||||
|
||||
uint8_t thread_started;
|
||||
|
||||
nfapi_vnf_p7_config_t *config;
|
||||
|
||||
mac_t *mac;
|
||||
|
||||
} vnf_p7_info;
|
||||
|
||||
typedef struct {
|
||||
|
||||
uint8_t wireshark_test_mode;
|
||||
pnf_info pnfs[2];
|
||||
vnf_p7_info p7_vnfs[2];
|
||||
|
||||
} vnf_info;
|
||||
|
||||
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||
void configure_nr_nfapi_vnf(eth_params_t params);
|
||||
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||
|
||||
#endif /* NFAPI_VNF_H_ */
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
add_library(nfapi_socket_lib
|
||||
socket_pnf.c
|
||||
socket_vnf.c
|
||||
socket_common.c
|
||||
)
|
||||
|
||||
target_include_directories(nfapi_socket_lib PRIVATE include/)
|
||||
|
||||
target_compile_definitions(nfapi_socket_lib PUBLIC ENABLE_SOCKET)
|
||||
target_link_libraries(nfapi_socket_lib PRIVATE NFAPI_LIB NFAPI_USER_LIB)
|
||||
target_link_libraries(nfapi_socket_lib PRIVATE LOG)
|
||||
add_dependencies(nfapi_socket_lib generate_T)
|
||||
target_link_libraries(nfapi_socket_lib PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
|
||||
target_link_libraries(nfapi_socket_lib PRIVATE nr_fapi_p5 nr_fapi_p7)
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#ifndef SOCKET_COMMON_H
|
||||
#define SOCKET_COMMON_H
|
||||
|
||||
#define _GNU_SOURCE /* required for pthread_getname_np */
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/sctp.h>
|
||||
#include <assertions.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <pthread.h>
|
||||
#include <netdb.h>
|
||||
|
||||
int socket_send_p5_msg(const int sctp,
|
||||
const int socket,
|
||||
const void* remote_addr,
|
||||
const void* msg,
|
||||
const uint32_t len,
|
||||
const uint16_t stream);
|
||||
int socket_send_p7_msg(const int socket, const void* remote_addr, const void* msg, const uint32_t len);
|
||||
|
||||
#endif // SOCKET_COMMON_H
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef SOCKET_PNF_H
|
||||
#define SOCKET_PNF_H
|
||||
#include "socket_common.h"
|
||||
#include <sys/time.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include "pnf.h"
|
||||
#include "pnf_p7.h"
|
||||
#include "nr_fapi_p5.h"
|
||||
#include "nr_nfapi_p7.h"
|
||||
|
||||
int pnf_connect_socket(pnf_t *pnf);
|
||||
int pnf_nr_message_pump(pnf_t *pnf);
|
||||
bool pnf_nr_send_p5_message(pnf_t *pnf, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len);
|
||||
bool pnf_nr_send_p7_message(pnf_p7_t* pnf_p7, nfapi_nr_p7_message_header_t* header, uint32_t msg_len);
|
||||
void *pnf_start_p5_thread(void *ptr);
|
||||
void *pnf_nr_p7_thread_start(void *ptr);
|
||||
#endif // SOCKET_PNF_H
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#include "socket_common.h"
|
||||
#include "LOG/log.h"
|
||||
|
||||
int socket_send_p5_msg(const int sctp,
|
||||
const int socket,
|
||||
const void* remote_addr,
|
||||
const void* msg,
|
||||
const uint32_t len,
|
||||
const uint16_t stream)
|
||||
{
|
||||
if (sctp == 1) {
|
||||
struct sockaddr* to = (struct sockaddr*)remote_addr;
|
||||
const int retval = sctp_sendmsg(socket, msg, len, to, 0, 42, 0, stream, 0, 0);
|
||||
if (retval < 0) {
|
||||
LOG_E(NR_PHY, "sctp_sendmsg failed errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (send(socket, msg, len, 0) != len) {
|
||||
LOG_E(NR_PHY, "write failed errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
int socket_send_p7_msg(const int socket, const void* remote_addr, const void* msg, const uint32_t len)
|
||||
{
|
||||
const struct sockaddr* to = (struct sockaddr*)remote_addr;
|
||||
const long sendto_result = sendto(socket, msg, len, 0, to, sizeof(struct sockaddr_in));
|
||||
if (sendto_result != len) {
|
||||
LOG_E(NR_PHY, "%s() sendto_result %ld %d\n", __FUNCTION__, sendto_result, errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,867 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#include "socket_pnf.h"
|
||||
#include "nfapi.h"
|
||||
|
||||
bool pnf_nr_send_p5_message(pnf_t *pnf, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len)
|
||||
{
|
||||
int packed_len =
|
||||
pnf->_public.pack_func(msg, msg_len, pnf->tx_message_buffer, sizeof(pnf->tx_message_buffer), &pnf->_public.codec_config);
|
||||
|
||||
if (packed_len < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "p5_message_pack failed (%d)\n", packed_len);
|
||||
return false;
|
||||
}
|
||||
|
||||
return socket_send_p5_msg(pnf->sctp, pnf->p5_sock, NULL, pnf->tx_message_buffer, packed_len, 0) == packed_len;
|
||||
}
|
||||
|
||||
static int send_p7_msg(pnf_p7_t *pnf_p7, uint8_t *msg, uint32_t len)
|
||||
{
|
||||
// todo : consider how to do this only once
|
||||
struct sockaddr_in remote_addr = {.sin_family = AF_INET, .sin_port = htons(pnf_p7->_public.remote_p7_port)};
|
||||
|
||||
if (inet_aton(pnf_p7->_public.remote_p7_addr, &remote_addr.sin_addr) == -1) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "inet_aton failed %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
socklen_t remote_addr_len = sizeof(struct sockaddr_in);
|
||||
|
||||
int sendto_result = socket_send_p7_msg((int)pnf_p7->p7_sock, &remote_addr, msg, len);
|
||||
if (sendto_result < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR,
|
||||
"%s %s:%d sendto(%d, %p, %d) %d failed errno: %d\n",
|
||||
__FUNCTION__,
|
||||
pnf_p7->_public.remote_p7_addr,
|
||||
pnf_p7->_public.remote_p7_port,
|
||||
(int)pnf_p7->p7_sock,
|
||||
(const char *)msg,
|
||||
len,
|
||||
remote_addr_len,
|
||||
errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sendto_result != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s sendto failed to send the entire message %d %d\n", __FUNCTION__, sendto_result, len);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool pnf_nr_send_p7_message(pnf_p7_t *pnf_p7, nfapi_nr_p7_message_header_t *header, uint32_t msg_len)
|
||||
{
|
||||
header->m_segment_sequence = NFAPI_NR_P7_SET_MSS(0, 0, pnf_p7->sequence_number);
|
||||
|
||||
// Need to guard against different threads calling the encode function at the same time
|
||||
if (pthread_mutex_lock(&(pnf_p7->pack_mutex)) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t tx_buf[131072]; // four times NFAPI_MAX_PACKED_MESSAGE_SIZE as of this commit
|
||||
int len = pnf_p7->_public.pack_func(header, tx_buf, sizeof(tx_buf), &pnf_p7->_public.codec_config);
|
||||
|
||||
if (len < 0) {
|
||||
if (pthread_mutex_unlock(&(pnf_p7->pack_mutex)) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p7_message_pack failed with return %d\n", len);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (len > pnf_p7->_public.segment_size) {
|
||||
int msg_body_len = len - NFAPI_NR_P7_HEADER_LENGTH;
|
||||
int seg_body_len = pnf_p7->_public.segment_size - NFAPI_NR_P7_HEADER_LENGTH;
|
||||
int segment_count = (msg_body_len / (seg_body_len)) + ((msg_body_len % seg_body_len) ? 1 : 0);
|
||||
|
||||
int segment = 0;
|
||||
int offset = NFAPI_NR_P7_HEADER_LENGTH;
|
||||
uint8_t buffer[pnf_p7->_public.segment_size];
|
||||
for (segment = 0; segment < segment_count; ++segment) {
|
||||
uint8_t last = 0;
|
||||
uint32_t size = pnf_p7->_public.segment_size - NFAPI_NR_P7_HEADER_LENGTH;
|
||||
if (segment + 1 == segment_count) {
|
||||
last = 1;
|
||||
size = (msg_body_len) - (seg_body_len * segment);
|
||||
}
|
||||
|
||||
uint32_t segment_size = size + NFAPI_NR_P7_HEADER_LENGTH;
|
||||
|
||||
// Update the header with the m and segement
|
||||
memcpy(&buffer[0], tx_buf, NFAPI_NR_P7_HEADER_LENGTH);
|
||||
|
||||
// set the segment length , update and push m_segment_sequence
|
||||
uint8_t *buf_ptr = &buffer[4];
|
||||
uint8_t *buf_ptr_end = &buffer[10];
|
||||
push32(segment_size, (&buf_ptr), buf_ptr_end);
|
||||
header->m_segment_sequence = NFAPI_NR_P7_SET_MSS((!last), segment, pnf_p7->sequence_number);
|
||||
push16(header->m_segment_sequence, (&buf_ptr), buf_ptr_end);
|
||||
memcpy(&buffer[NFAPI_NR_P7_HEADER_LENGTH], tx_buf + offset, size);
|
||||
offset += size;
|
||||
|
||||
if (pnf_p7->_public.checksum_enabled) {
|
||||
nfapi_nr_p7_update_checksum(buffer, segment_size);
|
||||
}
|
||||
|
||||
send_p7_msg(pnf_p7, &buffer[0], segment_size);
|
||||
}
|
||||
} else {
|
||||
if (pnf_p7->_public.checksum_enabled) {
|
||||
nfapi_nr_p7_update_checksum(tx_buf, len);
|
||||
}
|
||||
|
||||
// simple case that the message fits in a single segment
|
||||
send_p7_msg(pnf_p7, tx_buf, len);
|
||||
}
|
||||
|
||||
pnf_p7->sequence_number++;
|
||||
|
||||
if (pthread_mutex_unlock(&(pnf_p7->pack_mutex)) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void *pnf_start_p5_thread(void *ptr)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] IN PNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
nfapi_pnf_config_t *config = (nfapi_pnf_config_t *)ptr;
|
||||
struct sched_param sp;
|
||||
sp.sched_priority = 20;
|
||||
pthread_setschedparam(pthread_self(), SCHED_FIFO, &sp);
|
||||
|
||||
// Verify that config is not null
|
||||
if (config == 0)
|
||||
return (void *)-1;
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
|
||||
|
||||
pnf_t *_this = (pnf_t *)(config);
|
||||
|
||||
while (_this->terminate == 0) {
|
||||
int connect_result = pnf_connect_socket(_this);
|
||||
|
||||
if (connect_result > 0) {
|
||||
pnf_nr_message_pump(_this);
|
||||
} else if (connect_result < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() Error connecting to P5 socket\n", __FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() terminate=1 - EXITTING............\n", __FUNCTION__);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pnf_connect_socket(pnf_t *pnf)
|
||||
{
|
||||
uint8_t socketConnected = 0;
|
||||
|
||||
if (pnf->_public.vnf_ip_addr == 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnfIpAddress is null\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Starting P5 PNF connection to VNF at %s:%u\n", pnf->_public.vnf_ip_addr, pnf->_public.vnf_p5_port);
|
||||
|
||||
// todo split the vnf address list. currently only supporting 1
|
||||
|
||||
struct addrinfo hints = {0}, *servinfo;
|
||||
|
||||
hints.ai_socktype = SOCK_STREAM; // For SCTP we are only interested in SOCK_STREAM
|
||||
// todo : allow the client to restrict IPV4 or IPV6
|
||||
// todo : randomize which address to connect to?
|
||||
|
||||
char port_str[8];
|
||||
snprintf(port_str, sizeof(port_str), "%d", pnf->_public.vnf_p5_port);
|
||||
if (getaddrinfo(pnf->_public.vnf_ip_addr, port_str, &hints, &servinfo) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to get host (%s) addr info h_errno:%d \n", pnf->_public.vnf_ip_addr, h_errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct addrinfo *p = servinfo;
|
||||
int connected = 0;
|
||||
|
||||
while (p != NULL && connected == 0) {
|
||||
#ifdef NFAPI_TRACE_ENABLED
|
||||
char *family = "Unknown";
|
||||
char *address = "Unknown";
|
||||
char _addr[128];
|
||||
|
||||
if (p->ai_family == AF_INET6) {
|
||||
family = "IPV6";
|
||||
struct sockaddr_in6 *addr = (struct sockaddr_in6 *)p->ai_addr;
|
||||
inet_ntop(AF_INET6, &addr->sin6_addr, _addr, sizeof(_addr));
|
||||
address = &_addr[0];
|
||||
} else if (p->ai_family == AF_INET) {
|
||||
family = "IPV4";
|
||||
struct sockaddr_in *addr = (struct sockaddr_in *)p->ai_addr;
|
||||
address = inet_ntoa(addr->sin_addr);
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Host address info %d Family:%s Address:%s\n", i++, family, address);
|
||||
#endif
|
||||
|
||||
if (pnf->sctp) {
|
||||
// open the SCTP socket
|
||||
if ((pnf->p5_sock = socket(p->ai_family, SOCK_STREAM, IPPROTO_SCTP)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P5 socket errno: %d\n", errno);
|
||||
freeaddrinfo(servinfo);
|
||||
return -1;
|
||||
}
|
||||
int noDelay;
|
||||
struct sctp_initmsg initMsg = {0};
|
||||
|
||||
// configure the socket options
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF Setting the SCTP_INITMSG\n");
|
||||
initMsg.sinit_num_ostreams = 5; // MAX_SCTP_STREAMS; // number of output streams can be greater
|
||||
initMsg.sinit_max_instreams = 5; // MAX_SCTP_STREAMS; // number of output streams can be greater
|
||||
if (setsockopt(pnf->p5_sock, IPPROTO_SCTP, SCTP_INITMSG, &initMsg, sizeof(initMsg)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt errno: %d\n", errno);
|
||||
freeaddrinfo(servinfo);
|
||||
return -1;
|
||||
}
|
||||
noDelay = 1;
|
||||
if (setsockopt(pnf->p5_sock, IPPROTO_SCTP, SCTP_NODELAY, &noDelay, sizeof(noDelay)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt errno: %d\n", errno);
|
||||
freeaddrinfo(servinfo);
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct sctp_event_subscribe events = {0};
|
||||
events.sctp_data_io_event = 1;
|
||||
|
||||
if (setsockopt(pnf->p5_sock, SOL_SCTP, SCTP_EVENTS, (const void *)&events, sizeof(events)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt errno: %d\n", errno);
|
||||
freeaddrinfo(servinfo);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
// Create an IP socket point
|
||||
if ((pnf->p5_sock = socket(p->ai_family, SOCK_STREAM, IPPROTO_IP)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P5 socket errno: %d\n", errno);
|
||||
freeaddrinfo(servinfo);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "P5 socket created...\n");
|
||||
|
||||
if (connect(pnf->p5_sock, p->ai_addr, p->ai_addrlen) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR,
|
||||
"After connect (address:%s port:%d) errno: %d\n",
|
||||
pnf->_public.vnf_ip_addr,
|
||||
pnf->_public.vnf_p5_port,
|
||||
errno);
|
||||
|
||||
if (errno == EINVAL) {
|
||||
freeaddrinfo(servinfo);
|
||||
return -1;
|
||||
}
|
||||
if (pnf->terminate != 0) {
|
||||
freeaddrinfo(servinfo);
|
||||
return 0;
|
||||
}
|
||||
close(pnf->p5_sock);
|
||||
sleep(1);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "connect succeeded...\n");
|
||||
|
||||
connected = 1;
|
||||
}
|
||||
|
||||
p = p->ai_next;
|
||||
}
|
||||
|
||||
freeaddrinfo(servinfo);
|
||||
|
||||
// If we have failed to connect return 0 and it is retry
|
||||
if (connected == 0)
|
||||
return 0;
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "After connect loop\n");
|
||||
if (pnf->sctp) {
|
||||
socklen_t optLen;
|
||||
struct sctp_status status = {0};
|
||||
|
||||
// check the connection status
|
||||
optLen = (socklen_t)sizeof(struct sctp_status);
|
||||
if (getsockopt(pnf->p5_sock, IPPROTO_SCTP, SCTP_STATUS, &status, &optLen) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After getsockopt errno: %d\n", errno);
|
||||
return -1;
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Association ID = %d\n", status.sstat_assoc_id);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Receiver window size = %d\n", status.sstat_rwnd);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "In Streams = %d\n", status.sstat_instrms);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Out Streams = %d\n", status.sstat_outstrms);
|
||||
|
||||
socketConnected = 1;
|
||||
}
|
||||
} else {
|
||||
int error;
|
||||
socklen_t len = sizeof(error);
|
||||
|
||||
if (getsockopt(pnf->p5_sock, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After getsockopt errno: %d\n", errno);
|
||||
return -1;
|
||||
} else {
|
||||
// If error is zero, the socket is connected
|
||||
if (error == 0) {
|
||||
socketConnected = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Socket %s\n", socketConnected ? "CONNECTED" : "NOT_CONNECTED");
|
||||
return socketConnected;
|
||||
}
|
||||
|
||||
static int pnf_nr_read_dispatch_message(pnf_t *pnf)
|
||||
{
|
||||
int socket_connected = 1;
|
||||
|
||||
// 1. Peek the message header
|
||||
// 2. If the message is larger than the stack buffer, then create a dynamic buffer
|
||||
// 3. Read the buffer
|
||||
// 4. Handle the p5 message
|
||||
|
||||
uint32_t header_buffer_size = NFAPI_NR_P5_HEADER_LENGTH;
|
||||
uint8_t header_buffer[header_buffer_size];
|
||||
|
||||
uint32_t stack_buffer_size = 32; // should it be the size of then sctp_notificatoin structure
|
||||
uint8_t stack_buffer[stack_buffer_size];
|
||||
|
||||
uint8_t *dynamic_buffer = 0;
|
||||
|
||||
uint8_t *read_buffer = &stack_buffer[0];
|
||||
uint32_t message_size = 0;
|
||||
|
||||
struct sockaddr_in addr;
|
||||
socklen_t addr_len = sizeof(addr);
|
||||
|
||||
struct sctp_sndrcvinfo sndrcvinfo = {0};
|
||||
|
||||
{
|
||||
int flags = MSG_PEEK;
|
||||
if (pnf->sctp) {
|
||||
message_size = sctp_recvmsg(pnf->p5_sock,
|
||||
header_buffer,
|
||||
header_buffer_size,
|
||||
/*(struct sockaddr*)&addr, &addr_len*/
|
||||
0,
|
||||
0,
|
||||
&sndrcvinfo,
|
||||
&flags);
|
||||
} else {
|
||||
message_size = recv(pnf->p5_sock, header_buffer, header_buffer_size, flags);
|
||||
}
|
||||
|
||||
if (message_size < NFAPI_NR_P5_HEADER_LENGTH) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF Failed to peek sctp message size errno:%d\n", errno);
|
||||
return 0;
|
||||
}
|
||||
|
||||
nfapi_nr_p4_p5_message_header_t header;
|
||||
const bool result = pnf->_public.hdr_unpack_func(header_buffer, header_buffer_size, &header, sizeof(header), 0);
|
||||
if (!result) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF Failed to unpack p5 message header\n");
|
||||
return 0;
|
||||
}
|
||||
message_size = header.message_length + header_buffer_size;
|
||||
|
||||
// now have the size of the mesage
|
||||
}
|
||||
|
||||
if (message_size > stack_buffer_size) {
|
||||
dynamic_buffer = (uint8_t *)malloc(message_size);
|
||||
|
||||
if (dynamic_buffer == NULL) {
|
||||
// todo : add error mesage
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF Failed to allocate dynamic buffer for sctp_recvmsg size:%d\n", message_size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
read_buffer = dynamic_buffer;
|
||||
}
|
||||
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
ssize_t recvmsg_result = 0;
|
||||
if (pnf->sctp) {
|
||||
recvmsg_result =
|
||||
sctp_recvmsg(pnf->p5_sock, read_buffer, message_size, (struct sockaddr *)&addr, &addr_len, &sndrcvinfo, &flags);
|
||||
} else {
|
||||
if ((recvmsg_result = recv(pnf->p5_sock, read_buffer, message_size, flags)) <= 0) {
|
||||
recvmsg_result = -1;
|
||||
}
|
||||
}
|
||||
if (recvmsg_result == -1) {
|
||||
int tmp = errno;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Failed to read sctp message size error %s errno:%d\n", strerror(tmp), tmp);
|
||||
} else {
|
||||
#if 0
|
||||
// print the received message
|
||||
printf("\n MESSAGE RECEIVED: \n");
|
||||
for(int i=0; i<message_size; i++){
|
||||
printf("read_buffer[%d] = 0x%02x\n",i, read_buffer[i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
if (flags & MSG_NOTIFICATION) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Notification received from %s:%u\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
|
||||
|
||||
// todo - handle the events
|
||||
} else {
|
||||
/*
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Received message fd:%d from %s:%u assoc:%d on stream %d, PPID %d, length %d, flags 0x%x\n",
|
||||
pnf->p5_sock,
|
||||
inet_ntoa(addr.sin_addr),
|
||||
ntohs(addr.sin_port),
|
||||
sndrcvinfo.sinfo_assoc_id,
|
||||
sndrcvinfo.sinfo_stream,
|
||||
ntohl(sndrcvinfo.sinfo_ppid),
|
||||
message_size,
|
||||
flags);
|
||||
*/
|
||||
|
||||
// handle now if complete message in one or more segments
|
||||
if ((flags & 0x80) == 0x80 || !pnf->sctp) {
|
||||
pnf_nr_handle_p5_message(pnf, read_buffer, message_size);
|
||||
} else {
|
||||
int tmp = errno;
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN,
|
||||
"sctp_recvmsg: unhandled mode with flags 0x%x and error %s errno:%d\n",
|
||||
flags,
|
||||
strerror(tmp),
|
||||
tmp);
|
||||
// assume socket disconnected
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Disconnected socket\n");
|
||||
socket_connected = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dynamic_buffer) {
|
||||
free(dynamic_buffer);
|
||||
}
|
||||
|
||||
return socket_connected;
|
||||
}
|
||||
|
||||
int pnf_nr_message_pump(pnf_t *pnf)
|
||||
{
|
||||
uint8_t socketConnected = 1;
|
||||
|
||||
while (socketConnected && pnf->terminate == 0) {
|
||||
fd_set rfds;
|
||||
int selectRetval = 0;
|
||||
|
||||
// select on a timeout and then get the message
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(pnf->p5_sock, &rfds);
|
||||
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
selectRetval = select(pnf->p5_sock + 1, &rfds, NULL, NULL, &timeout);
|
||||
|
||||
if (selectRetval == 0) {
|
||||
// timeout
|
||||
continue;
|
||||
} else if (selectRetval == -1 && (errno == EINTR)) {
|
||||
// interrupted by signal
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "P5 Signal Interrupt %d\n", errno);
|
||||
continue;
|
||||
} else if (selectRetval == -1) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "P5 select() failed\n");
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (FD_ISSET(pnf->p5_sock, &rfds)) {
|
||||
socketConnected = pnf_nr_read_dispatch_message(pnf);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Why are we here\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Drop back to idle if we have lost connection
|
||||
pnf->_public.state = NFAPI_PNF_IDLE;
|
||||
|
||||
// close the connection and socket
|
||||
if (close(pnf->p5_sock) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "close(sctpSock) failed errno: %d\n", errno);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pnf_nr_reassemble_nfapi_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t *pnf_p7, uint32_t rx_hr_time)
|
||||
{
|
||||
nfapi_nr_p7_message_header_t messageHeader;
|
||||
|
||||
// validate the input params
|
||||
if (pRecvMsg == NULL || recvMsgLen < 4 || pnf_p7 == NULL) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "pnf_handle_p7_message: invalid input params (%p %d %p)\n", pRecvMsg, recvMsgLen, pnf_p7);
|
||||
return;
|
||||
}
|
||||
|
||||
// unpack the message header
|
||||
const bool result =
|
||||
pnf_p7->_public.hdr_unpack_func(pRecvMsg, recvMsgLen, &messageHeader, sizeof(messageHeader), &pnf_p7->_public.codec_config);
|
||||
if (!result) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t m = NFAPI_P7_GET_MORE(messageHeader.m_segment_sequence);
|
||||
uint8_t sequence_num = NFAPI_P7_GET_SEQUENCE(messageHeader.m_segment_sequence);
|
||||
uint8_t segment_num = NFAPI_P7_GET_SEGMENT(messageHeader.m_segment_sequence);
|
||||
|
||||
if (pnf_p7->_public.checksum_enabled) {
|
||||
uint32_t checksum = nfapi_nr_p7_calculate_checksum(pRecvMsg, recvMsgLen);
|
||||
if (checksum != messageHeader.checksum) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Checksum verification failed %d %d\n", checksum, messageHeader.checksum);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m == 0 && segment_num == 0) {
|
||||
// we have a complete message
|
||||
// ensure the message is sensible
|
||||
if (recvMsgLen < 8 || pRecvMsg == NULL) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Invalid message size: %d, ignoring\n", recvMsgLen);
|
||||
return;
|
||||
}
|
||||
|
||||
pnf_nr_handle_p7_message(pRecvMsg, recvMsgLen, pnf_p7, rx_hr_time);
|
||||
} else {
|
||||
pnf_p7_rx_message_t *rx_msg = pnf_p7_rx_reassembly_queue_add_segment(pnf_p7,
|
||||
&(pnf_p7->reassembly_queue),
|
||||
rx_hr_time,
|
||||
sequence_num,
|
||||
segment_num,
|
||||
m,
|
||||
pRecvMsg,
|
||||
recvMsgLen);
|
||||
|
||||
if (rx_msg->num_segments_received == rx_msg->num_segments_expected) {
|
||||
// send the buffer on
|
||||
uint16_t i = 0;
|
||||
uint32_t length = 0;
|
||||
for (i = 0; i < rx_msg->num_segments_expected; ++i) {
|
||||
length += rx_msg->segments[i].length - (i > 0 ? NFAPI_NR_P7_HEADER_LENGTH : 0);
|
||||
}
|
||||
|
||||
if (pnf_p7->reassemby_buffer_size < length) {
|
||||
pnf_p7_free(pnf_p7, pnf_p7->reassemby_buffer);
|
||||
pnf_p7->reassemby_buffer = 0;
|
||||
}
|
||||
|
||||
if (pnf_p7->reassemby_buffer == 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Resizing PNF_P7 Reassembly buffer %d->%d\n", pnf_p7->reassemby_buffer_size, length);
|
||||
pnf_p7->reassemby_buffer = (uint8_t *)pnf_p7_malloc(pnf_p7, length);
|
||||
|
||||
if (pnf_p7->reassemby_buffer == 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Failed to allocate PNF_P7 reassemby buffer len:%d\n", length);
|
||||
return;
|
||||
}
|
||||
memset(pnf_p7->reassemby_buffer, 0, length);
|
||||
pnf_p7->reassemby_buffer_size = length;
|
||||
}
|
||||
|
||||
uint32_t offset = 0;
|
||||
for (i = 0; i < rx_msg->num_segments_expected; ++i) {
|
||||
if (i == 0) {
|
||||
memcpy(pnf_p7->reassemby_buffer, rx_msg->segments[i].buffer, rx_msg->segments[i].length);
|
||||
offset += rx_msg->segments[i].length;
|
||||
} else {
|
||||
memcpy(pnf_p7->reassemby_buffer + offset,
|
||||
rx_msg->segments[i].buffer + NFAPI_NR_P7_HEADER_LENGTH,
|
||||
rx_msg->segments[i].length - NFAPI_NR_P7_HEADER_LENGTH);
|
||||
offset += rx_msg->segments[i].length - NFAPI_NR_P7_HEADER_LENGTH;
|
||||
}
|
||||
}
|
||||
|
||||
pnf_nr_handle_p7_message(pnf_p7->reassemby_buffer, length, pnf_p7, rx_msg->rx_hr_time);
|
||||
|
||||
// delete the structure
|
||||
pnf_p7_rx_reassembly_queue_remove_msg(pnf_p7, &(pnf_p7->reassembly_queue), rx_msg);
|
||||
}
|
||||
}
|
||||
|
||||
// The timeout used to be 1000, i.e., 1ms, which is too short. The below 10ms
|
||||
// is selected to be able to encompass any "reasonable" slot ahead time for the VNF.
|
||||
// Ideally, we would remove old msg (segments) if we detect packet loss
|
||||
// (e.g., if the sequence numbers advances sufficiently); in the branch of
|
||||
// this commit, our goal is to make the PNF work, so we content ourselves to
|
||||
// just remove very old messages.
|
||||
pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7, &(pnf_p7->reassembly_queue), rx_hr_time, 10000);
|
||||
}
|
||||
|
||||
static void pnf_nr_nfapi_p7_read_dispatch_message(pnf_p7_t *pnf_p7, uint32_t now_hr_time)
|
||||
{
|
||||
int recvfrom_result = 0;
|
||||
struct sockaddr_in remote_addr;
|
||||
socklen_t remote_addr_size = sizeof(remote_addr);
|
||||
remote_addr.sin_family = 2; // hardcoded
|
||||
do {
|
||||
// peek the header
|
||||
uint8_t header_buffer[NFAPI_NR_P7_HEADER_LENGTH];
|
||||
recvfrom_result = recvfrom(pnf_p7->p7_sock,
|
||||
header_buffer,
|
||||
NFAPI_NR_P7_HEADER_LENGTH,
|
||||
MSG_DONTWAIT | MSG_PEEK,
|
||||
(struct sockaddr *)&remote_addr,
|
||||
&remote_addr_size);
|
||||
if (recvfrom_result > 0) {
|
||||
// get the segment size
|
||||
nfapi_nr_p7_message_header_t header;
|
||||
pnf_p7->_public.hdr_unpack_func(header_buffer, NFAPI_NR_P7_HEADER_LENGTH, &header, 34, 0);
|
||||
|
||||
// resize the buffer if we have a large segment
|
||||
if (header.message_length > pnf_p7->rx_message_buffer_size) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "reallocing rx buffer %d\n", header.message_length);
|
||||
pnf_p7->rx_message_buffer = realloc(pnf_p7->rx_message_buffer, header.message_length);
|
||||
pnf_p7->rx_message_buffer_size = header.message_length;
|
||||
}
|
||||
|
||||
// read the segment
|
||||
recvfrom_result = recvfrom(pnf_p7->p7_sock,
|
||||
pnf_p7->rx_message_buffer,
|
||||
header.message_length,
|
||||
MSG_DONTWAIT,
|
||||
(struct sockaddr *)&remote_addr,
|
||||
&remote_addr_size);
|
||||
|
||||
now_hr_time = pnf_get_current_time_hr(); // moved to here - get closer timestamp???
|
||||
|
||||
if (recvfrom_result > 0) {
|
||||
pnf_nr_reassemble_nfapi_p7_message(pnf_p7->rx_message_buffer, recvfrom_result, pnf_p7, now_hr_time);
|
||||
// printf("\npnf_handle_p7_message sfn=%d,slot=%d\n",pnf_p7->sfn,pnf_p7->slot);
|
||||
}
|
||||
} else if (recvfrom_result == 0) {
|
||||
// recv zero length message
|
||||
recvfrom_result =
|
||||
recvfrom(pnf_p7->p7_sock, header_buffer, 0, MSG_DONTWAIT, (struct sockaddr *)&remote_addr, &remote_addr_size);
|
||||
}
|
||||
|
||||
if (recvfrom_result == -1) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
// return to the select
|
||||
// NFAPI_TRACE(NFAPI_TRACE_WARN, "%s recvfrom would block :%d\n", __FUNCTION__, errno);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "%s recvfrom failed errno:%d\n", __FUNCTION__, errno);
|
||||
}
|
||||
}
|
||||
|
||||
// need to update the time as we would only use the value from the
|
||||
// select
|
||||
} while (recvfrom_result > 0);
|
||||
}
|
||||
|
||||
int pnf_nr_p7_message_pump(pnf_p7_t *pnf_p7)
|
||||
{
|
||||
// initialize the mutex lock
|
||||
if (pthread_mutex_init(&(pnf_p7->mutex), NULL) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P7 mutex init: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pthread_mutex_init(&(pnf_p7->pack_mutex), NULL) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P7 mutex init: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// create the pnf p7 socket
|
||||
if ((pnf_p7->p7_sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P7 socket errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 socket created (%d)...\n", pnf_p7->p7_sock);
|
||||
|
||||
// configure the UDP socket options
|
||||
int reuseaddr_enable = 1;
|
||||
if (setsockopt(pnf_p7->p7_sock, SOL_SOCKET, SO_REUSEADDR, &reuseaddr_enable, sizeof(int)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF P7 setsockopt (SOL_SOCKET, SO_REUSEADDR) failed errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
int reuseport_enable = 1;
|
||||
if (setsockopt(pnf_p7->p7_sock, SOL_SOCKET, SO_REUSEPORT, &reuseport_enable, sizeof(int)) < 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF P7 setsockopt (SOL_SOCKET, SO_REUSEPORT) failed errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
int iptos_value = 0;
|
||||
if (setsockopt(pnf_p7->p7_sock, IPPROTO_IP, IP_TOS, &iptos_value, sizeof(iptos_value)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF P7 setsockopt (IPPROTO_IP, IP_TOS) failed errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct sockaddr_in addr = {0};
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(pnf_p7->_public.local_p7_port);
|
||||
|
||||
if (pnf_p7->_public.local_p7_addr == 0) {
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
} else {
|
||||
// addr.sin_addr.s_addr = inet_addr(pnf_p7->_public.local_p7_addr);
|
||||
if (inet_aton(pnf_p7->_public.local_p7_addr, &addr.sin_addr) == -1) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "inet_aton failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 binding %d too %s:%d\n", pnf_p7->p7_sock, inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
|
||||
if (bind(pnf_p7->p7_sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF_P7 bind error fd:%d errno: %d\n", pnf_p7->p7_sock, errno);
|
||||
return -1;
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 bind succeeded...\n");
|
||||
|
||||
// Initializaing timing structures needed for slot ticking
|
||||
|
||||
struct timespec slot_start;
|
||||
clock_gettime(CLOCK_MONOTONIC, &slot_start);
|
||||
|
||||
struct timespec pselect_start;
|
||||
|
||||
struct timespec slot_duration;
|
||||
slot_duration.tv_sec = 0;
|
||||
slot_duration.tv_nsec = 0.5e6;
|
||||
|
||||
// Infinite loop
|
||||
|
||||
while (pnf_p7->terminate == 0) {
|
||||
fd_set rfds;
|
||||
int selectRetval = 0;
|
||||
|
||||
// select on a timeout and then get the message
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(pnf_p7->p7_sock, &rfds);
|
||||
|
||||
struct timespec timeout;
|
||||
timeout.tv_sec = 100;
|
||||
timeout.tv_nsec = 0;
|
||||
clock_gettime(CLOCK_MONOTONIC, &pselect_start);
|
||||
|
||||
// setting the timeout
|
||||
|
||||
if ((pselect_start.tv_sec > slot_start.tv_sec)
|
||||
|| ((pselect_start.tv_sec == slot_start.tv_sec) && (pselect_start.tv_nsec > slot_start.tv_nsec))) {
|
||||
// overran the end of the subframe we do not want to wait
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
// struct timespec overrun = pnf_timespec_sub(pselect_start, sf_start);
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "Subframe overrun detected of %d.%d running to catchup\n", overrun.tv_sec, overrun.tv_nsec);
|
||||
} else {
|
||||
// still time before the end of the subframe wait
|
||||
timeout = pnf_timespec_sub(slot_start, pselect_start);
|
||||
}
|
||||
|
||||
selectRetval = pselect(pnf_p7->p7_sock + 1, &rfds, NULL, NULL, &timeout, NULL);
|
||||
|
||||
uint32_t now_hr_time = pnf_get_current_time_hr();
|
||||
|
||||
if (selectRetval == 0) {
|
||||
// timeout
|
||||
|
||||
// update slot start timing
|
||||
slot_start = pnf_timespec_add(slot_start, slot_duration);
|
||||
|
||||
// increment sfn/slot
|
||||
if (++pnf_p7->slot == 20) {
|
||||
pnf_p7->slot = 0;
|
||||
pnf_p7->sfn = (pnf_p7->sfn + 1) % 1024;
|
||||
}
|
||||
|
||||
continue;
|
||||
} else if (selectRetval == -1 && (errno == EINTR)) {
|
||||
// interrupted by signal
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "PNF P7 Signal Interrupt %d\n", errno);
|
||||
continue;
|
||||
} else if (selectRetval == -1) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "PNF P7 select() failed\n");
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (FD_ISSET(pnf_p7->p7_sock, &rfds))
|
||||
|
||||
{
|
||||
pnf_nr_nfapi_p7_read_dispatch_message(pnf_p7, now_hr_time);
|
||||
}
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF_P7 Terminating..\n");
|
||||
|
||||
// close the connection and socket
|
||||
if (close(pnf_p7->p7_sock) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "close failed errno: %d\n", errno);
|
||||
}
|
||||
|
||||
if (pthread_mutex_destroy(&(pnf_p7->pack_mutex)) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "mutex destroy failed errno: %d\n", errno);
|
||||
}
|
||||
|
||||
if (pthread_mutex_destroy(&(pnf_p7->mutex)) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "mutex destroy failed errno: %d\n", errno);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nfapi_nr_pnf_p7_start(nfapi_pnf_p7_config_t *config)
|
||||
{
|
||||
// Verify that config is not null
|
||||
if (config == 0)
|
||||
return -1;
|
||||
|
||||
pnf_p7_t *_this = (pnf_p7_t *)(config);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
|
||||
|
||||
pnf_nr_p7_message_pump(_this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *pnf_nr_p7_thread_start(void *ptr)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[NR_PNF] NR P7 THREAD %s\n", __FUNCTION__);
|
||||
nfapi_pnf_p7_config_t *config = (nfapi_pnf_p7_config_t *)ptr;
|
||||
nfapi_nr_pnf_p7_start(config);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,847 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#include "socket_vnf.h"
|
||||
|
||||
#include "nfapi.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h" //TODO: Remove this include when removing the Aerial transport stuff
|
||||
|
||||
static bool send_p5_msg(vnf_t *vnf, nfapi_vnf_pnf_info_t *pnf, const void *msg, int len, uint8_t stream)
|
||||
{
|
||||
int result = socket_send_p5_msg(vnf->sctp, pnf->p5_sock, &pnf->p5_pnf_sockaddr, msg, len, stream);
|
||||
|
||||
if (result != len) {
|
||||
if (result < 0) {
|
||||
// error
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "sctp sendto failed errno: %d\n", errno);
|
||||
} else {
|
||||
// did not send the entire message
|
||||
}
|
||||
}
|
||||
return result == len;
|
||||
}
|
||||
|
||||
bool vnf_nr_send_p5_msg(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len)
|
||||
{
|
||||
nfapi_vnf_pnf_info_t *pnf = nfapi_vnf_pnf_list_find(&(vnf->_public), p5_idx);
|
||||
|
||||
if (pnf) {
|
||||
// pack the message for transmission
|
||||
int packedMessageLength = 0;
|
||||
|
||||
packedMessageLength =
|
||||
vnf->_public.pack_func(msg, msg_len, vnf->tx_message_buffer, sizeof(vnf->tx_message_buffer), &vnf->_public.codec_config);
|
||||
|
||||
if (packedMessageLength < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_nr_p5_message_pack failed with return %d\n", packedMessageLength);
|
||||
return false;
|
||||
}
|
||||
|
||||
return send_p5_msg(vnf, pnf, vnf->tx_message_buffer, packedMessageLength, 0);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool vnf_nr_send_p7_msg(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header)
|
||||
{
|
||||
nfapi_vnf_p7_connection_info_t *p7_connection = vnf_p7_connection_info_list_find(vnf_p7, header->phy_id);
|
||||
if (p7_connection) {
|
||||
int send_result = 0;
|
||||
uint8_t buffer[1024 * 1024 * 3];
|
||||
|
||||
header->m_segment_sequence = NFAPI_NR_P7_SET_MSS(0, 0, p7_connection->sequence_number);
|
||||
|
||||
int len = vnf_p7->_public.pack_func(header, buffer, sizeof(buffer), &vnf_p7->_public.codec_config);
|
||||
|
||||
if (len < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() failed to pack p7 message phy_id:%d\n", __FUNCTION__, header->phy_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (len > vnf_p7->_public.segment_size) {
|
||||
// todo : consider replacing with the sendmmsg call
|
||||
// todo : worry about blocking writes?
|
||||
|
||||
// segmenting the transmit
|
||||
int msg_body_len = len - NFAPI_NR_P7_HEADER_LENGTH;
|
||||
int seg_body_len = vnf_p7->_public.segment_size - NFAPI_NR_P7_HEADER_LENGTH;
|
||||
int segment_count = (msg_body_len / (seg_body_len)) + ((msg_body_len % seg_body_len) ? 1 : 0);
|
||||
|
||||
int segment = 0;
|
||||
int offset = NFAPI_NR_P7_HEADER_LENGTH;
|
||||
uint8_t tx_buffer[vnf_p7->_public.segment_size];
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
|
||||
"%s() MORE THAN ONE SEGMENT phy_id:%d nfapi_p7_message_pack()=len=%d vnf_p7->_public.segment_size:%u\n",
|
||||
__FUNCTION__,
|
||||
header->phy_id,
|
||||
len,
|
||||
vnf_p7->_public.segment_size);
|
||||
for (segment = 0; segment < segment_count; ++segment) {
|
||||
uint8_t last = 0;
|
||||
uint16_t size = vnf_p7->_public.segment_size - NFAPI_NR_P7_HEADER_LENGTH;
|
||||
if (segment + 1 == segment_count) {
|
||||
last = 1;
|
||||
size = (msg_body_len) - (seg_body_len * segment);
|
||||
}
|
||||
|
||||
uint32_t segment_size = size + NFAPI_NR_P7_HEADER_LENGTH;
|
||||
|
||||
// Update the header with the m and segement
|
||||
memcpy(&tx_buffer[0], buffer, NFAPI_NR_P7_HEADER_LENGTH);
|
||||
|
||||
// set the segment length, update and push m_segment_sequence
|
||||
uint8_t *buf_ptr = &tx_buffer[4];
|
||||
uint8_t *buf_ptr_end = &tx_buffer[10];
|
||||
push32(segment_size, (&buf_ptr), buf_ptr_end);
|
||||
header->m_segment_sequence = NFAPI_NR_P7_SET_MSS((!last), segment, p7_connection->sequence_number);
|
||||
push16(header->m_segment_sequence, (&buf_ptr), buf_ptr_end);
|
||||
|
||||
memcpy(&tx_buffer[NFAPI_NR_P7_HEADER_LENGTH], &buffer[0] + offset, size);
|
||||
offset += size;
|
||||
|
||||
if (vnf_p7->_public.checksum_enabled) {
|
||||
nfapi_nr_p7_update_checksum(tx_buffer, segment_size);
|
||||
}
|
||||
const uint32_t time =
|
||||
calculate_transmit_timestamp(p7_connection->mu, p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr);
|
||||
nfapi_nr_p7_update_transmit_timestamp(tx_buffer, time);
|
||||
send_result = socket_send_p7_msg(vnf_p7->socket, &(p7_connection->remote_addr), &tx_buffer[0], segment_size);
|
||||
}
|
||||
} else {
|
||||
if (vnf_p7->_public.checksum_enabled) {
|
||||
nfapi_nr_p7_update_checksum(buffer, len);
|
||||
}
|
||||
const uint32_t time =
|
||||
calculate_transmit_timestamp(p7_connection->mu, p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr);
|
||||
nfapi_nr_p7_update_transmit_timestamp(buffer, time);
|
||||
send_result = socket_send_p7_msg(vnf_p7->socket, &(p7_connection->remote_addr), &buffer[0], len);
|
||||
}
|
||||
p7_connection->sequence_number++;
|
||||
return send_result == 0;
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find p7 connection info for phy_id:%d\n", __FUNCTION__, header->phy_id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static int vnf_nr_read_dispatch_message(nfapi_vnf_config_t *config, nfapi_vnf_pnf_info_t *pnf)
|
||||
{
|
||||
if (1) {
|
||||
int socket_connected = 1;
|
||||
vnf_t *vnf = (vnf_t *)(config);
|
||||
// 1. Peek the message header
|
||||
// 2. If the message is larger than the stack buffer then create a dynamic buffer
|
||||
// 3. Read the buffer
|
||||
// 4. Handle the p5 message
|
||||
|
||||
uint32_t header_buffer_size = NFAPI_NR_P5_HEADER_LENGTH;
|
||||
uint8_t header_buffer[header_buffer_size];
|
||||
|
||||
uint32_t stack_buffer_size = 32; // should it be the size of then sctp_notificatoin structure
|
||||
uint8_t stack_buffer[stack_buffer_size];
|
||||
|
||||
uint8_t *dynamic_buffer = 0;
|
||||
|
||||
uint8_t *read_buffer = &stack_buffer[0];
|
||||
uint32_t message_size = 0;
|
||||
|
||||
struct sockaddr_in addr;
|
||||
socklen_t addr_len = sizeof(addr);
|
||||
|
||||
struct sctp_sndrcvinfo sndrcvinfo;
|
||||
(void)memset(&sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo));
|
||||
|
||||
{
|
||||
int flags = MSG_PEEK;
|
||||
if (vnf->sctp) {
|
||||
message_size =
|
||||
sctp_recvmsg(pnf->p5_sock, header_buffer, header_buffer_size, (struct sockaddr *)&addr, &addr_len, &sndrcvinfo, &flags);
|
||||
} else {
|
||||
message_size = recv(pnf->p5_sock, header_buffer, header_buffer_size, flags);
|
||||
}
|
||||
|
||||
if (message_size == -1) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Failed to peek sctp message size errno:%d\n", errno);
|
||||
return 0;
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Peeked message with length :0x%02x\n", message_size);
|
||||
|
||||
for (int i = 0; i < message_size; i++) {
|
||||
printf("%02x ", header_buffer[i]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
nfapi_nr_p4_p5_message_header_t header;
|
||||
const bool result = config->hdr_unpack_func(header_buffer, header_buffer_size, &header, sizeof(header), 0);
|
||||
if (!result) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Failed to decode message header\n");
|
||||
return 0;
|
||||
}
|
||||
message_size = header.message_length + header_buffer_size;
|
||||
|
||||
// now have the size of the mesage
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF After header unpacking msg size is :0x%02x\n", message_size);
|
||||
}
|
||||
|
||||
if (message_size > stack_buffer_size) {
|
||||
dynamic_buffer = (uint8_t *)malloc(message_size);
|
||||
|
||||
if (dynamic_buffer == NULL) {
|
||||
// todo : add error mesage
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Failed to allocate dynamic buffer for sctp_recvmsg size:%d\n", message_size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
read_buffer = dynamic_buffer;
|
||||
}
|
||||
|
||||
{
|
||||
int flags = 0;
|
||||
(void)memset(&sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo));
|
||||
|
||||
ssize_t recvmsg_result = 0;
|
||||
if (vnf->sctp) {
|
||||
recvmsg_result =
|
||||
sctp_recvmsg(pnf->p5_sock, read_buffer, message_size, (struct sockaddr *)&addr, &addr_len, &sndrcvinfo, &flags);
|
||||
} else {
|
||||
recvmsg_result = recv(pnf->p5_sock, read_buffer, message_size, 0);
|
||||
}
|
||||
|
||||
if (recvmsg_result == -1) {
|
||||
int tmp = errno;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Failed to read sctp message size error %s errno:%d\n", strerror(tmp), tmp);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF after recv flags are :0x%02x\n", flags);
|
||||
|
||||
if (flags & MSG_NOTIFICATION) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Notification received from %s:%u\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
|
||||
|
||||
// todo - handle the events
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"Received message fd:%d from %s:%u assoc:%d on stream %d, PPID %d, length %d, flags 0x%x\n",
|
||||
pnf->p5_sock,
|
||||
inet_ntoa(addr.sin_addr),
|
||||
ntohs(addr.sin_port),
|
||||
sndrcvinfo.sinfo_assoc_id,
|
||||
sndrcvinfo.sinfo_stream,
|
||||
ntohl(sndrcvinfo.sinfo_ppid),
|
||||
message_size,
|
||||
flags);
|
||||
|
||||
// handle now if complete message in one or more segments
|
||||
if ((flags & 0x80) == 0x80 || !vnf->sctp) {
|
||||
vnf_nr_handle_p4_p5_message(read_buffer, message_size, pnf->p5_idx, config);
|
||||
} else {
|
||||
int tmp = errno;
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN,
|
||||
"sctp_recvmsg: unhandled mode with flags 0x%x and error %s errno:%d\n",
|
||||
flags,
|
||||
strerror(tmp),
|
||||
tmp);
|
||||
// assume socket disconnected
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Disconnected socket\n");
|
||||
socket_connected = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dynamic_buffer) {
|
||||
free(dynamic_buffer);
|
||||
}
|
||||
|
||||
return socket_connected;
|
||||
}
|
||||
}
|
||||
|
||||
static int nfapi_nr_vnf_p5_start(nfapi_vnf_config_t *config)
|
||||
{
|
||||
// Verify that config is not null
|
||||
if (config == 0)
|
||||
return -1;
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
|
||||
|
||||
int p5ListenSock, p5Sock;
|
||||
|
||||
struct sockaddr_in addr = {0};
|
||||
socklen_t addrSize;
|
||||
|
||||
struct sockaddr_in6 addr6 = {0};
|
||||
|
||||
struct sctp_event_subscribe events = {0};
|
||||
struct sctp_initmsg initMsg = {0};
|
||||
int noDelay;
|
||||
|
||||
vnf_t *vnf = (vnf_t *)(config);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Starting P5 VNF connection on port %u\n", config->vnf_p5_port);
|
||||
|
||||
{
|
||||
int protocol;
|
||||
int domain;
|
||||
|
||||
if (vnf->sctp)
|
||||
protocol = IPPROTO_SCTP;
|
||||
else
|
||||
protocol = IPPROTO_IP;
|
||||
|
||||
if (config->vnf_ipv6) {
|
||||
domain = PF_INET6;
|
||||
} else {
|
||||
domain = AF_INET;
|
||||
}
|
||||
|
||||
// open the SCTP socket
|
||||
if ((p5ListenSock = socket(domain, SOCK_STREAM, protocol)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P5 socket errno: %d\n", errno);
|
||||
return 0;
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "P5 socket created... %d\n", p5ListenSock);
|
||||
}
|
||||
|
||||
if (vnf->sctp) {
|
||||
// configure for MSG_NOTIFICATION
|
||||
if (setsockopt(p5ListenSock, IPPROTO_SCTP, SCTP_EVENTS, &events, sizeof(struct sctp_event_subscribe)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (SCTP_EVENTS) errno: %d\n", errno);
|
||||
close(p5ListenSock);
|
||||
return 0;
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF Setting the SCTP_INITMSG\n");
|
||||
// configure the SCTP socket options
|
||||
initMsg.sinit_num_ostreams = 5; // MAX_SCTP_STREAMS; // number of output streams can be greater
|
||||
initMsg.sinit_max_instreams = 5; // MAX_SCTP_STREAMS; // number of output streams can be greater
|
||||
if (setsockopt(p5ListenSock, IPPROTO_SCTP, SCTP_INITMSG, &initMsg, sizeof(initMsg)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (SCTP_INITMSG) errno: %d\n", errno);
|
||||
close(p5ListenSock);
|
||||
return 0;
|
||||
}
|
||||
noDelay = 1;
|
||||
if (setsockopt(p5ListenSock, IPPROTO_SCTP, SCTP_NODELAY, &noDelay, sizeof(noDelay)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (STCP_NODELAY) errno: %d\n", errno);
|
||||
close(p5ListenSock);
|
||||
return 0;
|
||||
}
|
||||
struct sctp_event_subscribe events;
|
||||
memset((void *)&events, 0, sizeof(events));
|
||||
events.sctp_data_io_event = 1;
|
||||
|
||||
if (setsockopt(p5ListenSock, SOL_SCTP, SCTP_EVENTS, (const void *)&events, sizeof(events)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt errno: %d\n", errno);
|
||||
close(p5ListenSock);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
int error;
|
||||
socklen_t len = sizeof(error);
|
||||
|
||||
if (getsockopt(p5ListenSock, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After getsockopt errno: %d\n", errno);
|
||||
close(p5ListenSock);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (config->vnf_ipv6) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "IPV6 binding to port %d %d\n", config->vnf_p5_port, p5ListenSock);
|
||||
addr6.sin6_family = AF_INET6;
|
||||
addr6.sin6_port = htons(config->vnf_p5_port);
|
||||
addr6.sin6_addr = in6addr_any;
|
||||
|
||||
// bind to the configured address and port
|
||||
if (bind(p5ListenSock, (struct sockaddr *)&addr6, sizeof(struct sockaddr_in6)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After bind errno: %d\n", errno);
|
||||
close(p5ListenSock);
|
||||
return 0;
|
||||
}
|
||||
} else if (config->vnf_ipv4) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "IPV4 binding to port %d\n", config->vnf_p5_port);
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(config->vnf_p5_port);
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
// bind to the configured address and port
|
||||
if (bind(p5ListenSock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After bind errno: %d\n", errno);
|
||||
close(p5ListenSock);
|
||||
AssertFatal(1 == 0, "Failed to bind socket with errno: %d\n", errno);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "bind succeeded..%d.\n", p5ListenSock);
|
||||
|
||||
// put the socket into listen mode
|
||||
if (listen(p5ListenSock, 2) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After listen errno: %d\n", errno);
|
||||
close(p5ListenSock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "listen succeeded...\n");
|
||||
|
||||
struct timeval tv;
|
||||
fd_set read_fd_set;
|
||||
|
||||
int p5_idx = 0;
|
||||
while (vnf->terminate == 0) {
|
||||
FD_ZERO(&read_fd_set);
|
||||
|
||||
FD_SET(p5ListenSock, &read_fd_set);
|
||||
int max_fd = p5ListenSock;
|
||||
|
||||
tv.tv_sec = 5;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
nfapi_vnf_pnf_info_t *pnf = config->pnf_list;
|
||||
while (pnf != 0) {
|
||||
if (pnf->connected) {
|
||||
FD_SET(pnf->p5_sock, &read_fd_set);
|
||||
if (pnf->p5_sock > max_fd) {
|
||||
max_fd = pnf->p5_sock;
|
||||
}
|
||||
}
|
||||
|
||||
pnf = pnf->next;
|
||||
}
|
||||
|
||||
int select_result = select(max_fd + 1, &read_fd_set, 0, 0, &tv);
|
||||
|
||||
if (select_result == -1) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "select result %d errno %d\n", select_result, errno);
|
||||
close(p5ListenSock);
|
||||
return 0;
|
||||
} else if (select_result) {
|
||||
if (FD_ISSET(p5ListenSock, &read_fd_set)) {
|
||||
addrSize = sizeof(struct sockaddr_in);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Accepting connection from PNF...\n");
|
||||
|
||||
p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
|
||||
|
||||
if (p5Sock < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to accept PNF connection reason:%d\n", errno);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"PNF connection (fd:%d) accepted from %s:%d \n",
|
||||
p5Sock,
|
||||
inet_ntoa(addr.sin_addr),
|
||||
ntohs(addr.sin_port));
|
||||
nfapi_vnf_pnf_info_t *pnf = (nfapi_vnf_pnf_info_t *)malloc(sizeof(nfapi_vnf_pnf_info_t));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "MALLOC nfapi_vnf_pnf_info_t for pnf_list pnf:%p\n", pnf);
|
||||
memset(pnf, 0, sizeof(nfapi_vnf_pnf_info_t));
|
||||
pnf->p5_sock = p5Sock;
|
||||
pnf->p5_idx = p5_idx++;
|
||||
pnf->p5_pnf_sockaddr = addr;
|
||||
pnf->connected = 1;
|
||||
|
||||
nfapi_vnf_pnf_list_add(config, pnf);
|
||||
|
||||
// Inform mac that a pnf connection has been established
|
||||
// todo : allow mac to 'accept' the connection. i.e. to
|
||||
// reject it.
|
||||
if (config->pnf_nr_connection_indication != 0) {
|
||||
(config->pnf_nr_connection_indication)(config, pnf->p5_idx);
|
||||
}
|
||||
|
||||
// check the connection status
|
||||
if (vnf->sctp) {
|
||||
struct sctp_status status;
|
||||
(void)memset(&status, 0, sizeof(struct sctp_status));
|
||||
socklen_t optLen = (socklen_t)sizeof(struct sctp_status);
|
||||
if (getsockopt(p5Sock, IPPROTO_SCTP, SCTP_STATUS, &status, &optLen) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After getsockopt errno: %d\n", errno);
|
||||
return -1;
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Association ID = %d\n", status.sstat_assoc_id);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Receiver window size = %d\n", status.sstat_rwnd);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF In Streams = %d\n", status.sstat_instrms);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Out Streams = %d\n", status.sstat_outstrms);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uint8_t delete_pnfs = 0;
|
||||
|
||||
nfapi_vnf_pnf_info_t *pnf = config->pnf_list;
|
||||
while (pnf != 0) {
|
||||
if (FD_ISSET(pnf->p5_sock, &read_fd_set)) {
|
||||
if (vnf_nr_read_dispatch_message(config, pnf) == 0) {
|
||||
if (config->pnf_disconnect_indication != 0) {
|
||||
(config->pnf_disconnect_indication)(config, pnf->p5_idx);
|
||||
}
|
||||
|
||||
close(pnf->p5_sock);
|
||||
|
||||
pnf->to_delete = 1;
|
||||
delete_pnfs = 1;
|
||||
}
|
||||
}
|
||||
|
||||
pnf = pnf->next;
|
||||
}
|
||||
|
||||
if (delete_pnfs) {
|
||||
nfapi_vnf_pnf_info_t *pnf = config->pnf_list;
|
||||
nfapi_vnf_pnf_info_t *prev = 0;
|
||||
while (pnf != 0) {
|
||||
nfapi_vnf_pnf_info_t *curr = pnf;
|
||||
|
||||
if (pnf->to_delete == 1) {
|
||||
if (prev == 0) {
|
||||
config->pnf_list = pnf->next;
|
||||
} else {
|
||||
prev->next = pnf->next;
|
||||
}
|
||||
|
||||
pnf = pnf->next;
|
||||
|
||||
free(curr);
|
||||
} else {
|
||||
prev = pnf;
|
||||
pnf = pnf->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
} else {
|
||||
// timeout
|
||||
|
||||
// Should we test for socket closure here every second?
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Closing p5Sock socket's\n");
|
||||
{
|
||||
nfapi_vnf_pnf_info_t *curr = config->pnf_list;
|
||||
while (curr != NULL) {
|
||||
if (config->pnf_disconnect_indication) {
|
||||
(config->pnf_disconnect_indication)(config, curr->p5_idx);
|
||||
}
|
||||
|
||||
close(curr->p5_sock);
|
||||
curr = curr->next;
|
||||
}
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Closing p5Listen socket\n");
|
||||
close(p5ListenSock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void vnf_start_p5_thread(void *ptr)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] VNF NFAPI thread - nfapi_vnf_start()%s\n", __FUNCTION__);
|
||||
pthread_setname_np(pthread_self(), "VNF");
|
||||
nfapi_nr_vnf_p5_start((nfapi_vnf_config_t *)ptr);
|
||||
}
|
||||
|
||||
void vnf_nr_reassemble_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t *vnf_p7)
|
||||
{
|
||||
nfapi_nr_p7_message_header_t messageHeader;
|
||||
|
||||
// validate the input params
|
||||
if (pRecvMsg == NULL || recvMsgLen < 4 || vnf_p7 == NULL) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_p7_message: invalid input params (%p %d %p)\n", pRecvMsg, recvMsgLen, vnf_p7);
|
||||
return;
|
||||
}
|
||||
|
||||
// unpack the message header
|
||||
const bool result =
|
||||
vnf_p7->_public.hdr_unpack_func(pRecvMsg, recvMsgLen, &messageHeader, sizeof(messageHeader), &vnf_p7->_public.codec_config);
|
||||
if (!result) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (vnf_p7->_public.checksum_enabled) {
|
||||
uint32_t checksum = nfapi_nr_p7_calculate_checksum(pRecvMsg, recvMsgLen);
|
||||
if (checksum != messageHeader.checksum) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR,
|
||||
"Checksum verification failed %d %d msg:%d len:%d\n",
|
||||
checksum,
|
||||
messageHeader.checksum,
|
||||
messageHeader.message_id,
|
||||
recvMsgLen);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t m = NFAPI_P7_GET_MORE(messageHeader.m_segment_sequence);
|
||||
uint8_t segment_num = NFAPI_P7_GET_SEGMENT(messageHeader.m_segment_sequence);
|
||||
uint8_t sequence_num = NFAPI_P7_GET_SEQUENCE(messageHeader.m_segment_sequence);
|
||||
|
||||
if (m == 0 && segment_num == 0) {
|
||||
// we have a complete message
|
||||
// ensure the message is sensible
|
||||
if (recvMsgLen < 8 || pRecvMsg == NULL) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Invalid message size: %d, ignoring\n", recvMsgLen);
|
||||
return;
|
||||
}
|
||||
|
||||
// vnf_dispatch_p7_message(&messageHeader, pRecvMsg, recvMsgLen, vnf_p7);
|
||||
vnf_nr_handle_p7_message(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
} else {
|
||||
nfapi_vnf_p7_connection_info_t *phy = vnf_p7_connection_info_list_find(vnf_p7, messageHeader.phy_id);
|
||||
|
||||
if (phy) {
|
||||
vnf_p7_rx_message_t *rx_msg = vnf_p7_rx_reassembly_queue_add_segment(vnf_p7,
|
||||
&(phy->reassembly_queue),
|
||||
sequence_num,
|
||||
segment_num,
|
||||
m,
|
||||
pRecvMsg,
|
||||
recvMsgLen);
|
||||
|
||||
if (rx_msg->num_segments_received == rx_msg->num_segments_expected) {
|
||||
// send the buffer on
|
||||
uint16_t i = 0;
|
||||
uint16_t length = 0;
|
||||
for (i = 0; i < rx_msg->num_segments_expected; ++i) {
|
||||
length += rx_msg->segments[i].length - (i > 0 ? NFAPI_NR_P7_HEADER_LENGTH : 0);
|
||||
}
|
||||
|
||||
if (phy->reassembly_buffer_size < length) {
|
||||
vnf_p7_free(vnf_p7, phy->reassembly_buffer);
|
||||
phy->reassembly_buffer = 0;
|
||||
}
|
||||
|
||||
if (phy->reassembly_buffer == 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Resizing VNF_P7 Reassembly buffer %d->%d\n", phy->reassembly_buffer_size, length);
|
||||
phy->reassembly_buffer = (uint8_t *)vnf_p7_malloc(vnf_p7, length);
|
||||
|
||||
if (phy->reassembly_buffer == 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Failed to allocate VNF_P7 reassemby buffer len:%d\n", length);
|
||||
return;
|
||||
}
|
||||
memset(phy->reassembly_buffer, 0, length);
|
||||
phy->reassembly_buffer_size = length;
|
||||
}
|
||||
|
||||
uint16_t offset = 0;
|
||||
for (i = 0; i < rx_msg->num_segments_expected; ++i) {
|
||||
if (i == 0) {
|
||||
memcpy(phy->reassembly_buffer, rx_msg->segments[i].buffer, rx_msg->segments[i].length);
|
||||
offset += rx_msg->segments[i].length;
|
||||
} else {
|
||||
memcpy(phy->reassembly_buffer + offset,
|
||||
rx_msg->segments[i].buffer + NFAPI_NR_P7_HEADER_LENGTH,
|
||||
rx_msg->segments[i].length - NFAPI_NR_P7_HEADER_LENGTH);
|
||||
offset += rx_msg->segments[i].length - NFAPI_NR_P7_HEADER_LENGTH;
|
||||
}
|
||||
}
|
||||
|
||||
vnf_nr_handle_p7_message(phy->reassembly_buffer, length, vnf_p7);
|
||||
|
||||
// delete the structure
|
||||
vnf_p7_rx_reassembly_queue_remove_msg(vnf_p7, &(phy->reassembly_queue), rx_msg);
|
||||
}
|
||||
|
||||
// see corresponding comment in pnf_nr_handle_p7_message() [same commit]
|
||||
vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7, &(phy->reassembly_queue), 10000);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Unknown phy id %d\n", messageHeader.phy_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int vnf_nr_p7_read_dispatch_message(vnf_p7_t *vnf_p7)
|
||||
{
|
||||
int recvfrom_result = 0;
|
||||
struct sockaddr_in remote_addr;
|
||||
socklen_t remote_addr_size = sizeof(remote_addr);
|
||||
|
||||
do {
|
||||
// peek the header
|
||||
uint8_t header_buffer[NFAPI_NR_P7_HEADER_LENGTH];
|
||||
recvfrom_result = recvfrom(vnf_p7->socket,
|
||||
header_buffer,
|
||||
NFAPI_NR_P7_HEADER_LENGTH,
|
||||
MSG_DONTWAIT | MSG_PEEK,
|
||||
(struct sockaddr *)&remote_addr,
|
||||
&remote_addr_size);
|
||||
|
||||
if (recvfrom_result > 0) {
|
||||
// get the segment size
|
||||
nfapi_nr_p7_message_header_t header;
|
||||
const bool result = vnf_p7->_public.hdr_unpack_func(header_buffer, NFAPI_NR_P7_HEADER_LENGTH, &header, sizeof(header), 0);
|
||||
if (!result) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// resize the buffer if we have a large segment
|
||||
if (header.message_length > vnf_p7->rx_message_buffer_size) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "reallocing rx buffer %d\n", header.message_length);
|
||||
vnf_p7->rx_message_buffer = realloc(vnf_p7->rx_message_buffer, header.message_length);
|
||||
vnf_p7->rx_message_buffer_size = header.message_length;
|
||||
}
|
||||
|
||||
// read the segment
|
||||
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) {
|
||||
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_reassemble_p7_message from %d\n", __LINE__);
|
||||
vnf_nr_reassemble_p7_message(vnf_p7->rx_message_buffer, recvfrom_result, vnf_p7);
|
||||
return 0;
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "recvfrom failed %d %d\n", recvfrom_result, errno);
|
||||
}
|
||||
}
|
||||
|
||||
if (recvfrom_result == -1) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
// return to the select
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "%s recvfrom failed errno:%d\n", __FUNCTION__, errno);
|
||||
}
|
||||
}
|
||||
} while (recvfrom_result > 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t *config)
|
||||
{
|
||||
if (config == 0)
|
||||
return -1;
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
|
||||
|
||||
vnf_p7_t *vnf_p7 = (vnf_p7_t *)config;
|
||||
|
||||
// Create p7 receive udp port
|
||||
// todo : this needs updating for Ipv6
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Initialising VNF P7 port:%u\n", config->port);
|
||||
|
||||
// open the UDP socket
|
||||
if ((vnf_p7->socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P7 socket errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 socket created...\n");
|
||||
|
||||
// configure the UDP socket options
|
||||
int iptos_value = 0;
|
||||
if (setsockopt(vnf_p7->socket, IPPROTO_IP, IP_TOS, &iptos_value, sizeof(iptos_value)) < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (IP_TOS) errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 setsockopt succeeded...\n");
|
||||
|
||||
// Create the address structure
|
||||
struct sockaddr_in addr;
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(config->port);
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
// bind to the configured port
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 binding too %s:%d\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
|
||||
if (bind(vnf_p7->socket, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) < 0)
|
||||
// if (sctp_bindx(config->socket, (struct sockaddr *)&addr, sizeof(struct sockaddr_in), 0) < 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After bind errno: %d\n", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 bind succeeded...\n");
|
||||
|
||||
// struct timespec original_pselect_timeout;
|
||||
struct timespec pselect_timeout;
|
||||
pselect_timeout.tv_sec = 100;
|
||||
pselect_timeout.tv_nsec = 0;
|
||||
|
||||
struct timespec ref_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ref_time);
|
||||
while (vnf_p7->terminate == 0) {
|
||||
fd_set rfds;
|
||||
int maxSock = 0;
|
||||
FD_ZERO(&rfds);
|
||||
int selectRetval = 0;
|
||||
|
||||
// Add the p7 socket
|
||||
FD_SET(vnf_p7->socket, &rfds);
|
||||
maxSock = vnf_p7->socket;
|
||||
|
||||
selectRetval = pselect(maxSock + 1, &rfds, NULL, NULL, &pselect_timeout, NULL);
|
||||
|
||||
if (selectRetval == 0) {
|
||||
// pselect timed out, continue
|
||||
} else if (selectRetval > 0) {
|
||||
// have a p7 message
|
||||
if (FD_ISSET(vnf_p7->socket, &rfds)) {
|
||||
vnf_nr_p7_read_dispatch_message(vnf_p7);
|
||||
}
|
||||
} else {
|
||||
// pselect error
|
||||
if (selectRetval == -1 && errno == EINTR) {
|
||||
// a sigal was received.
|
||||
} else {
|
||||
// should we exit now?
|
||||
if (selectRetval == -1 && errno == 22) // invalid argument??? not sure about timeout duration
|
||||
{
|
||||
usleep(100000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Closing p7 socket\n");
|
||||
close(vnf_p7->socket);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() returning\n", __FUNCTION__);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *vnf_nr_start_p7_thread(void *ptr)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
|
||||
pthread_setname_np(pthread_self(), "VNF_P7");
|
||||
nfapi_vnf_p7_config_t *config = (nfapi_vnf_p7_config_t *)ptr;
|
||||
nfapi_nr_vnf_p7_start(config);
|
||||
return config;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
message(STATUS "Building with support for WLS")
|
||||
add_library(wls_integration_lib
|
||||
wls_pnf.c
|
||||
wls_vnf.c
|
||||
wls_common.c
|
||||
)
|
||||
|
||||
find_library(WLS_LIB wls REQUIRED)
|
||||
message(STATUS " wls library found in ${WLS_LIB}")
|
||||
|
||||
find_library(hugetlbfs_LIB hugetlbfs REQUIRED)
|
||||
message(STATUS " hugetlbfs library found in ${hugetlbfs_LIB}")
|
||||
|
||||
pkg_check_modules(dpdk REQUIRED libdpdk=20.11.3)
|
||||
target_link_libraries(wls_integration_lib PRIVATE ${dpdk_LINK_LIBRARIES})
|
||||
target_include_directories(wls_integration_lib PRIVATE ${dpdk_INCLUDE_DIRS})
|
||||
target_include_directories(wls_integration_lib PRIVATE include/)
|
||||
|
||||
target_compile_definitions(wls_integration_lib PUBLIC ENABLE_WLS)
|
||||
target_link_libraries(wls_integration_lib PRIVATE NFAPI_LIB NFAPI_USER_LIB)
|
||||
target_link_libraries(wls_integration_lib PRIVATE nr_fapi_p5 nr_fapi_p7)
|
||||
target_link_libraries(wls_integration_lib PRIVATE "${WLS_LIB}" "${hugetlbfs_LIB}")
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef OPENAIRINTERFACE_WLS_COMMON_H
|
||||
#define OPENAIRINTERFACE_WLS_COMMON_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "wls_lib.h"
|
||||
#include "nfapi/open-nFAPI/fapi/inc/nr_fapi_p5_utils.h"
|
||||
#include "nfapi/open-nFAPI/fapi/inc/nr_fapi_p7_utils.h"
|
||||
|
||||
#define WLS_DEV_NAME "wls"
|
||||
#define WLS_MAC_MEMORY_SIZE 0x7F000000
|
||||
#define WLS_PHY_MEMORY_SIZE 0x7F000000
|
||||
|
||||
#define MAX_NUM_LOCATIONS (508)
|
||||
|
||||
#define MIN_DL_BUF_LOCATIONS (0) /* Used for stats collection 0-49 */
|
||||
#define MIN_UL_BUF_LOCATIONS (MIN_DL_BUF_LOCATIONS + MAX_NUM_LOCATIONS) /* Used for stats collection 50-99 */
|
||||
|
||||
#define MAX_DL_BUF_LOCATIONS (MIN_DL_BUF_LOCATIONS + MAX_NUM_LOCATIONS) /* Used for stats collection 0-49 */
|
||||
#define MAX_UL_BUF_LOCATIONS (MIN_UL_BUF_LOCATIONS + MAX_NUM_LOCATIONS) /* Used for stats collection 50-99 */
|
||||
|
||||
#define ALLOC_TRACK_SIZE ( 16384 )
|
||||
|
||||
typedef struct {
|
||||
uint64_t *values;
|
||||
uint16_t values_size;
|
||||
uint16_t values_count;
|
||||
}pa_store_t;
|
||||
|
||||
/* ----- WLS Operation --- */
|
||||
#define FAPI_VENDOR_MSG_HEADER_IND 0x1A
|
||||
// Linked list header present at the top of all messages
|
||||
typedef struct _fapi_api_queue_elem {
|
||||
struct _fapi_api_queue_elem *p_next;
|
||||
// p_tx_data_elm_list used for TX_DATA.request processing
|
||||
struct _fapi_api_queue_elem *p_tx_data_elm_list;
|
||||
uint8_t msg_type;
|
||||
uint8_t num_message_in_block;
|
||||
uint32_t msg_len;
|
||||
uint32_t align_offset;
|
||||
uint64_t time_stamp;
|
||||
} fapi_api_queue_elem_t,
|
||||
*p_fapi_api_queue_elem_t;
|
||||
|
||||
|
||||
typedef struct wls_mac_mem_array
|
||||
{
|
||||
void **ppFreeBlock;
|
||||
void *pStorage;
|
||||
void *pEndOfStorage;
|
||||
uint32_t nBlockSize;
|
||||
uint32_t nBlockCount;
|
||||
} WLS_MAC_MEM_SRUCT, *PWLS_MAC_MEM_SRUCT;
|
||||
|
||||
typedef struct wls_mac_ctx
|
||||
{
|
||||
void *hWls;
|
||||
void *pWlsMemBase;
|
||||
void *pWlsMemBaseUsable;
|
||||
WLS_MAC_MEM_SRUCT sWlsStruct;
|
||||
|
||||
uint64_t nTotalMemorySize;
|
||||
uint64_t nTotalMemorySizeUsable;
|
||||
uint32_t nBlockSize;
|
||||
uint32_t nTotalBlocks;
|
||||
uint32_t nAllocBlocks;
|
||||
uint32_t nTotalAllocCnt;
|
||||
uint32_t nTotalFreeCnt;
|
||||
uint32_t nTotalUlBufAllocCnt;
|
||||
uint32_t nTotalUlBufFreeCnt;
|
||||
uint32_t nTotalDlBufAllocCnt;
|
||||
uint32_t nTotalDlBufFreeCnt;
|
||||
// Support for FAPI Translator
|
||||
uint32_t nPartitionMemSize;
|
||||
void *pPartitionMemBase;
|
||||
|
||||
volatile pthread_mutex_t lock;
|
||||
volatile pthread_mutex_t lock_alloc;
|
||||
} WLS_MAC_CTX, *PWLS_MAC_CTX;
|
||||
|
||||
void fill_fapi_list_elem(p_fapi_api_queue_elem_t currElem, p_fapi_api_queue_elem_t nextElem, const uint8_t msgType, const uint8_t numMsgInBlock, const uint32_t alignOffset);
|
||||
uint64_t dequeueBlock(PWLS_MAC_CTX pWls);
|
||||
void wls_return_msg_to_master(PWLS_MAC_CTX pWls, const uint64_t msg_PA);
|
||||
uint8_t wls_send_fapi_msg(PWLS_MAC_CTX pWls, const uint16_t message_id, const int packed_len, const uint8_t *message );
|
||||
uint8_t wls_msg_send(PWLS_MAC_CTX pWls, p_fapi_api_queue_elem_t currMsg);
|
||||
#endif //OPENAIRINTERFACE_WLS_COMMON_H
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef OPENAIRINTERFACE_WLS_PNF_H
|
||||
#define OPENAIRINTERFACE_WLS_PNF_H
|
||||
#include "nfapi_pnf_interface.h"
|
||||
#include "pnf.h"
|
||||
#include "wls_common.h"
|
||||
|
||||
bool wls_pnf_nr_send_p5_message(pnf_t *pnf, nfapi_nr_p4_p5_message_header_t* msg, uint32_t msg_len);
|
||||
bool wls_pnf_nr_send_p7_message(pnf_p7_t* pnf_p7,nfapi_nr_p7_message_header_t *msg, uint32_t msg_len);
|
||||
void *wls_fapi_pnf_nr_start_thread(void *ptr);
|
||||
int wls_fapi_nr_pnf_start();
|
||||
void wls_pnf_set_p7_config(void *p7_config);
|
||||
#endif // OPENAIRINTERFACE_WLS_PNF_H
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef OPENAIRINTERFACE_WLS_VNF_H
|
||||
#define OPENAIRINTERFACE_WLS_VNF_H
|
||||
#include "nfapi_vnf_interface.h"
|
||||
#include "vnf.h"
|
||||
#include "wls_common.h"
|
||||
|
||||
void *wls_fapi_vnf_nr_start_thread(void *ptr);
|
||||
int wls_fapi_nr_vnf_start();
|
||||
void wls_vnf_set_p7_config(void *p7_config);
|
||||
bool wls_vnf_nr_send_p5_message(vnf_t *vnf,uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t* msg, uint32_t msg_len);
|
||||
bool wls_vnf_nr_send_p7_message(vnf_p7_t* vnf_p7,nfapi_nr_p7_message_header_t* msg);
|
||||
#endif //OPENAIRINTERFACE_WLS_VNF_H
|
||||
@@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "wls_common.h"
|
||||
|
||||
void fill_fapi_list_elem(p_fapi_api_queue_elem_t currElem, p_fapi_api_queue_elem_t nextElem, const uint8_t msgType, const uint8_t numMsgInBlock, const uint32_t alignOffset)
|
||||
{
|
||||
currElem->msg_type = msgType;
|
||||
currElem->num_message_in_block = numMsgInBlock;
|
||||
currElem->align_offset = alignOffset;
|
||||
currElem->msg_len = numMsgInBlock * alignOffset;
|
||||
currElem->p_next = nextElem;
|
||||
currElem->p_tx_data_elm_list = NULL;
|
||||
currElem->time_stamp = 0;
|
||||
}
|
||||
|
||||
uint64_t dequeueBlock(PWLS_MAC_CTX pWls)
|
||||
{
|
||||
uint64_t pa = WLS_DequeueBlock(pWls->hWls);
|
||||
AssertFatal(pa, "WLS_DequeueBlock failed for pa_hdr\n");
|
||||
unsigned long* va = WLS_PA2VA(pWls->hWls, pa);
|
||||
AssertFatal(va, "WLS_PA2VA failed for headerElem\n");
|
||||
while (*va != -1) {
|
||||
pa = WLS_DequeueBlock(pWls->hWls);
|
||||
AssertFatal(pa, "WLS_DequeueBlock failed for pa_hdr\n");
|
||||
va = WLS_PA2VA(pWls->hWls, pa);
|
||||
}
|
||||
return pa;
|
||||
}
|
||||
|
||||
uint8_t wls_msg_send(PWLS_MAC_CTX pWls, p_fapi_api_queue_elem_t currMsg)
|
||||
{
|
||||
uint32_t msgLen = 0;
|
||||
|
||||
AssertFatal(currMsg, "currMsg can't be NULL");
|
||||
AssertFatal(currMsg->p_next, "There needs to be at least 2 blocks to send!");
|
||||
msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
|
||||
// Send the first block
|
||||
if (WLS_Put(pWls, WLS_VA2PA(pWls, currMsg), msgLen, currMsg->msg_type, WLS_SG_FIRST) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failure in sending the header block\n");
|
||||
return false;
|
||||
}
|
||||
// Iterate over the linked list, until a NULL block or a block set to 0xFFFFFFFFFFFFFFFF ( invalid )
|
||||
while (((currMsg = currMsg->p_next)) && (uint64_t)(currMsg) != -1) {
|
||||
msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
|
||||
/* Send the block with appropriate flags, either WLS_SG_NEXT or WLS_SG_LAST */
|
||||
const unsigned short flags = currMsg->p_next != NULL ? WLS_SG_NEXT : WLS_SG_LAST;
|
||||
if (WLS_Put(pWls, WLS_VA2PA(pWls, currMsg), msgLen, currMsg->msg_type, flags) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failure in sending the message block\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void wls_return_msg_to_master(PWLS_MAC_CTX pWls,const uint64_t msg_PA)
|
||||
{
|
||||
p_fapi_api_queue_elem_t fapiMsgElem = WLS_PA2VA(pWls->hWls, msg_PA);
|
||||
AssertFatal(fapiMsgElem, "WLS_PA2VA failed for fapiMsgElem\n");
|
||||
const uint8_t wls_header[] = {1, 0}; // num_messages , opaque_handle
|
||||
// No need to return the message contents, just the block
|
||||
fill_fapi_list_elem(fapiMsgElem, NULL, FAPI_VENDOR_MSG_HEADER_IND, 1, 2);
|
||||
memcpy((uint8_t *)(fapiMsgElem + 1), wls_header, 2);
|
||||
const uint32_t msgLen = fapiMsgElem->msg_len + sizeof(fapi_api_queue_elem_t);
|
||||
/* Send the block with appropriate only WLS_SG_FIRST flag, since we send only 1 block*/
|
||||
if (WLS_Put(pWls->hWls, msg_PA, msgLen, FAPI_VENDOR_MSG_HEADER_IND, WLS_SG_FIRST) != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR,"Failure in sending block back to master\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t wls_send_fapi_msg(PWLS_MAC_CTX pWls, const uint16_t message_id, const int packed_len, const uint8_t *message)
|
||||
{
|
||||
int num_avail_blocks = WLS_NumBlocks(pWls->hWls);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG,"num_avail_blocks is %d\n", num_avail_blocks);
|
||||
while (num_avail_blocks < 2) {
|
||||
num_avail_blocks = WLS_NumBlocks(pWls->hWls);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG,"num_avail_blocks is %d\n", num_avail_blocks);
|
||||
}
|
||||
/* get PA blocks for header and msg */
|
||||
uint64_t pa_hdr = dequeueBlock(pWls);
|
||||
AssertFatal(pa_hdr, "WLS_DequeueBlock failed for pa_hdr\n");
|
||||
uint64_t pa_msg = dequeueBlock(pWls);
|
||||
AssertFatal(pa_msg, "WLS_DequeueBlock failed for pa_msg\n");
|
||||
p_fapi_api_queue_elem_t headerElem = WLS_PA2VA(pWls->hWls, pa_hdr);
|
||||
AssertFatal(headerElem, "WLS_PA2VA failed for headerElem\n");
|
||||
p_fapi_api_queue_elem_t fapiMsgElem = WLS_PA2VA(pWls->hWls, pa_msg);
|
||||
AssertFatal(fapiMsgElem, "WLS_PA2VA failed for fapiMsgElem\n");
|
||||
fill_fapi_list_elem(fapiMsgElem, NULL, message_id, 1, packed_len + NFAPI_HEADER_LENGTH);
|
||||
memcpy((uint8_t *)(fapiMsgElem + 1), message, packed_len + NFAPI_HEADER_LENGTH);
|
||||
uint8_t wls_header[] = {1, 0}; // num_messages , opaque_handle
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF) {
|
||||
// Use the opaque handle to signal to our PNF to not progress the FAPI PNF state machine
|
||||
wls_header[1] = 0xff;
|
||||
}
|
||||
fill_fapi_list_elem(headerElem, fapiMsgElem, FAPI_VENDOR_MSG_HEADER_IND, 1, 2);
|
||||
memcpy((uint8_t *)(headerElem + 1), wls_header, 2);
|
||||
uint8_t retval = wls_msg_send(pWls->hWls, headerElem);
|
||||
return retval;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user