Commit bf55d13c authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'develop_integration_2018_w39' into 'develop'

Develop integration 2018 w39

See merge request oai/openairinterface5g!405
parents 7d602d5c b83395c6
No related merge requests found
...@@ -31,6 +31,9 @@ def testXMLFile = params.pythonTestXmlFile ...@@ -31,6 +31,9 @@ def testXMLFile = params.pythonTestXmlFile
// Name of the test stage // Name of the test stage
def testStageName = params.pipelineTestStageName def testStageName = params.pipelineTestStageName
// Name of the phone resource
def ciSmartPhoneResource = params.smartphonesResource
// Terminate Status // Terminate Status
def termUE = 0 def termUE = 0
def termENB = 1 def termENB = 1
...@@ -70,6 +73,7 @@ pipeline { ...@@ -70,6 +73,7 @@ pipeline {
string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run') string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run')
string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage') string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage')
booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact') booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact')
string(name: 'smartphonesResource', defaultValue: 'CI-Bench-1-Phones', description: 'Lockeable Resource to prevent multiple jobs to run simultaneously with the same resource')
//eNB parameters //eNB parameters
string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB') string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB')
...@@ -112,6 +116,9 @@ pipeline { ...@@ -112,6 +116,9 @@ pipeline {
testStageName = 'Template Test Stage' testStageName = 'Template Test Stage'
} }
if (params.smartphonesResource == null) {
allParametersPresent = false
}
if (params.eNB_IPAddress == null) { if (params.eNB_IPAddress == null) {
allParametersPresent = false allParametersPresent = false
} }
...@@ -178,6 +185,7 @@ pipeline { ...@@ -178,6 +185,7 @@ pipeline {
steps { steps {
script { script {
dir ('ci-scripts') { dir ('ci-scripts') {
lock (ciSmartPhoneResource) {
try { try {
echo "\u2705 \u001B[32m${testStageName}\u001B[0m" echo "\u2705 \u001B[32m${testStageName}\u001B[0m"
withCredentials([ withCredentials([
...@@ -190,6 +198,7 @@ pipeline { ...@@ -190,6 +198,7 @@ pipeline {
} catch (Exception e) { } catch (Exception e) {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
} }
}
} }
} }
} }
......
...@@ -120,21 +120,34 @@ echo "Source Branch is : $SOURCE_BRANCH" ...@@ -120,21 +120,34 @@ echo "Source Branch is : $SOURCE_BRANCH"
echo "Target Branch is : $TARGET_BRANCH" echo "Target Branch is : $TARGET_BRANCH"
echo "Merged Commit is : $MERGE_COMMMIT" echo "Merged Commit is : $MERGE_COMMMIT"
echo "Target Init is : $TARGET_INIT_COMMIT" echo "Target Init is : $TARGET_INIT_COMMIT"
echo ""
echo " ----------------------------------------------------------"
echo ""
# Retrieve the list of modified files since the latest develop commit # Retrieve the list of modified files since the latest develop commit
MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq` MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
NB_TO_FORMAT=0 NB_TO_FORMAT=0
if [ -f oai_rules_result_list.txt ]
then
rm -f oai_rules_result_list.txt
fi
for FULLFILE in $MODIFIED_FILES for FULLFILE in $MODIFIED_FILES
do do
echo $FULLFILE
filename=$(basename -- "$FULLFILE") filename=$(basename -- "$FULLFILE")
EXT="${filename##*.}" EXT="${filename##*.}"
if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ] if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
then then
TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted ` TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted `
NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT)) NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
if [ $TO_FORMAT -ne 0 ]
then
echo $FULLFILE
echo $FULLFILE >> ./oai_rules_result_list.txt
fi
fi fi
done done
echo ""
echo " ----------------------------------------------------------"
echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT" echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT"
echo $NB_TO_FORMAT > ./oai_rules_result.txt echo $NB_TO_FORMAT > ./oai_rules_result.txt
......
...@@ -228,6 +228,15 @@ RUs = ( ...@@ -228,6 +228,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
NETWORK_CONTROLLER : NETWORK_CONTROLLER :
{ {
FLEXRAN_ENABLED = "no"; FLEXRAN_ENABLED = "no";
......
...@@ -228,6 +228,15 @@ RUs = ( ...@@ -228,6 +228,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
NETWORK_CONTROLLER : NETWORK_CONTROLLER :
{ {
FLEXRAN_ENABLED = "no"; FLEXRAN_ENABLED = "no";
......
...@@ -228,6 +228,15 @@ RUs = ( ...@@ -228,6 +228,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
NETWORK_CONTROLLER : NETWORK_CONTROLLER :
{ {
FLEXRAN_ENABLED = "no"; FLEXRAN_ENABLED = "no";
......
...@@ -229,6 +229,15 @@ RUs = ( ...@@ -229,6 +229,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
NETWORK_CONTROLLER : NETWORK_CONTROLLER :
{ {
FLEXRAN_ENABLED = "no"; FLEXRAN_ENABLED = "no";
......
...@@ -90,38 +90,50 @@ class SSHConnection(): ...@@ -90,38 +90,50 @@ class SSHConnection():
self.htmlUEConnected = 0 self.htmlUEConnected = 0
def open(self, ipaddress, username, password): def open(self, ipaddress, username, password):
self.ssh = pexpect.spawn('ssh', [username + '@' + ipaddress], timeout = 5) count = 0
self.sshresponse = self.ssh.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', 'Last login', pexpect.EOF, pexpect.TIMEOUT]) connect_status = False
if self.sshresponse == 0: while count < 4:
self.ssh.sendline('yes') self.ssh = pexpect.spawn('ssh', [username + '@' + ipaddress], timeout = 5)
self.ssh.expect('password:') self.sshresponse = self.ssh.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', 'Last login', pexpect.EOF, pexpect.TIMEOUT])
self.ssh.sendline(password)
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0:
pass
else:
logging.debug('self.sshresponse = ' + str(self.sshresponse))
sys.exit('SSH Connection Failed')
elif self.sshresponse == 1:
self.ssh.sendline(password)
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0: if self.sshresponse == 0:
pass self.ssh.sendline('yes')
self.ssh.expect('password:')
self.ssh.sendline(password)
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0:
count = 10
connect_status = True
else:
logging.debug('self.sshresponse = ' + str(self.sshresponse))
elif self.sshresponse == 1:
self.ssh.sendline(password)
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0:
count = 10
connect_status = True
else:
logging.debug('self.sshresponse = ' + str(self.sshresponse))
elif self.sshresponse == 2:
# Checking if we are really on the remote client defined by its IP address
self.command('stdbuf -o0 ifconfig | egrep --color=never "inet addr:"', '\$', 5)
result = re.search(str(ipaddress), str(self.ssh.before))
if result is None:
self.close()
else:
count = 10
connect_status = True
else: else:
# debug output
logging.debug(str(self.ssh.before))
logging.debug('self.sshresponse = ' + str(self.sshresponse)) logging.debug('self.sshresponse = ' + str(self.sshresponse))
sys.exit('SSH Connection Failed') # adding a tempo when failure
elif self.sshresponse == 2: if not connect_status:
# Checking if we are really on the remote client defined by its IP address time.sleep(1)
self.command('stdbuf -o0 ifconfig | egrep --color=never "inet addr:"', '\$', 5) count += 1
result = re.search(str(ipaddress), str(self.ssh.before)) if connect_status:
if result is None:
sys.exit('SSH Connection Failed: TIMEOUT !!!')
pass pass
else: else:
# debug output sys.exit('SSH Connection Failed')
logging.debug(str(self.ssh.before))
logging.debug('self.sshresponse = ' + str(self.sshresponse))
sys.exit('SSH Connection Failed!!!')
def command(self, commandline, expectedline, timeout): def command(self, commandline, expectedline, timeout):
logging.debug(commandline) logging.debug(commandline)
......
...@@ -260,7 +260,7 @@ function sca_summary_table_footer { ...@@ -260,7 +260,7 @@ function sca_summary_table_footer {
echo " </tr>" >> ./build_results.html echo " </tr>" >> ./build_results.html
echo " </table>" >> ./build_results.html echo " </table>" >> ./build_results.html
echo " <p>Full details in zipped artifact (cppcheck/cppcheck.xml) </p>" >> ./build_results.html echo " <p>Full details in zipped artifact (cppcheck/cppcheck.xml) </p>" >> ./build_results.html
echo " <p>Graphical Interface tool : <code>cppcheck-gui -l cppcheck/cppcheck.xml</code> </p>" >> ./build_results.html echo " <p style=\"margin-left: 30px\">Graphical Interface tool : <strong><code>cppcheck-gui -l cppcheck/cppcheck.xml</code></strong></p>" >> ./build_results.html
} }
jb_checker=0 jb_checker=0
...@@ -490,12 +490,20 @@ then ...@@ -490,12 +490,20 @@ then
then then
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All files in repository follow OAI rules. </td>" >> ./build_results.html; fi if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All files in repository follow OAI rules. </td>" >> ./build_results.html; fi
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All modified files in Merge-Request follow OAI rules.</td>" >> ./build_results.html; fi if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All modified files in Merge-Request follow OAI rules.</td>" >> ./build_results.html; fi
echo " </tr>" >> ./build_results.html
echo " </table>" >> ./build_results.html
else else
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES files in repository DO NOT follow OAI rules. </td>" >> ./build_results.html; fi if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES files in repository DO NOT follow OAI rules. </td>" >> ./build_results.html; fi
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES modified files in Merge-Request DO NOT follow OAI rules.</td>" >> ./build_results.html; fi if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES modified files in Merge-Request DO NOT follow OAI rules.</td>" >> ./build_results.html; fi
echo " </tr>" >> ./build_results.html
if [ -f ./oai_rules_result_list.txt ]
then
awk '{print " <tr><td></td><td>"$1"</td></tr>"}' ./oai_rules_result_list.txt >> ./build_results.html
fi
echo " </table>" >> ./build_results.html
echo " <p>Please apply the following command to this(ese) file(s): </p>" >> ./build_results.html
echo " <p style=\"margin-left: 30px\"><strong><code>astyle --options=ci-scripts/astyle-options.txt filename(s)</code></strong></p>" >> ./build_results.html
fi fi
echo " </tr>" >> ./build_results.html
echo " </table>" >> ./build_results.html
fi fi
echo " <h2>Ubuntu 16.04 LTS -- Summary</h2>" >> ./build_results.html echo " <h2>Ubuntu 16.04 LTS -- Summary</h2>" >> ./build_results.html
......
...@@ -474,12 +474,12 @@ include_directories ("${X2AP_DIR}") ...@@ -474,12 +474,12 @@ include_directories ("${X2AP_DIR}")
add_library(X2AP_ENB add_library(X2AP_ENB
${X2AP_DIR}/x2ap_eNB.c ${X2AP_DIR}/x2ap_eNB.c
# ${X2AP_DIR}/x2ap_eNB_decoder.c ${X2AP_DIR}/x2ap_eNB_decoder.c
# ${X2AP_DIR}/x2ap_eNB_encoder.c ${X2AP_DIR}/x2ap_eNB_encoder.c
${X2AP_DIR}/x2ap_eNB_handler.c ${X2AP_DIR}/x2ap_eNB_handler.c
# ${X2AP_DIR}/x2ap_eNB_itti_messaging.c ${X2AP_DIR}/x2ap_eNB_itti_messaging.c
${X2AP_DIR}/x2ap_eNB_management_procedures.c ${X2AP_DIR}/x2ap_eNB_management_procedures.c
# ${X2AP_DIR}/x2ap_eNB_generate_messages.c ${X2AP_DIR}/x2ap_eNB_generate_messages.c
) )
# Hardware dependant options # Hardware dependant options
......
...@@ -63,6 +63,8 @@ typedef enum { ...@@ -63,6 +63,8 @@ typedef enum {
MSC_S6A_MME, MSC_S6A_MME,
MSC_HSS, MSC_HSS,
MAX_MSC_PROTOS, MAX_MSC_PROTOS,
MSC_X2AP_SRC_ENB,
MSC_X2AP_TARGET_ENB,
} msc_proto_t; } msc_proto_t;
......
...@@ -115,11 +115,15 @@ extern "C" { ...@@ -115,11 +115,15 @@ extern "C" {
task_list_t *t=&tasks[destination_task_id]; task_list_t *t=&tasks[destination_task_id];
pthread_mutex_lock (&t->queue_cond_lock); pthread_mutex_lock (&t->queue_cond_lock);
int ret=itti_send_msg_to_task_locked(destination_task_id, instance, message); int ret=itti_send_msg_to_task_locked(destination_task_id, instance, message);
pthread_mutex_unlock (&t->queue_cond_lock);
while ( t->message_queue.size()>0 && t->admin.func != NULL ) while ( t->message_queue.size()>0 && t->admin.func != NULL ) {
if (t->message_queue.size()>1)
LOG_W(TMR,"queue in no thread mode is %ld\n", t->message_queue.size());
pthread_mutex_unlock (&t->queue_cond_lock);
t->admin.func(NULL); t->admin.func(NULL);
pthread_mutex_lock (&t->queue_cond_lock);
}
pthread_mutex_unlock (&t->queue_cond_lock);
return ret; return ret;
} }
...@@ -193,6 +197,8 @@ extern "C" { ...@@ -193,6 +197,8 @@ extern "C" {
pthread_mutex_unlock(&t->queue_cond_lock); pthread_mutex_unlock(&t->queue_cond_lock);
LOG_D(TMR,"enter blocking wait for %s\n", itti_get_task_name(task_id)); LOG_D(TMR,"enter blocking wait for %s\n", itti_get_task_name(task_id));
t->nb_events = epoll_wait(t->epoll_fd,t->events,t->nb_fd_epoll, epoll_timeout); t->nb_events = epoll_wait(t->epoll_fd,t->events,t->nb_fd_epoll, epoll_timeout);
if ( t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) )
pthread_mutex_lock(&t->queue_cond_lock);
} while (t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) ); } while (t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) );
AssertFatal (t->nb_events >=0, AssertFatal (t->nb_events >=0,
...@@ -278,6 +284,18 @@ extern "C" { ...@@ -278,6 +284,18 @@ extern "C" {
"Thread creation for task %d failed!\n", task_id); "Thread creation for task %d failed!\n", task_id);
pthread_setname_np( t->thread, itti_get_task_name(task_id) ); pthread_setname_np( t->thread, itti_get_task_name(task_id) );
LOG_I(TMR,"Created Posix thread %s\n", itti_get_task_name(task_id) ); LOG_I(TMR,"Created Posix thread %s\n", itti_get_task_name(task_id) );
#if 1 // BMC test RT prio
{
int policy;
struct sched_param sparam;
memset(&sparam, 0, sizeof(sparam));
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-10;
policy = SCHED_FIFO ;
if (pthread_setschedparam(t->thread, policy, &sparam) != 0) {
LOG_E(TMR,"task %s : Failed to set pthread priority\n", itti_get_task_name(task_id) );
}
}
#endif
return 0; return 0;
} }
......
...@@ -233,6 +233,11 @@ typedef struct IttiMsgText_s { ...@@ -233,6 +233,11 @@ typedef struct IttiMsgText_s {
#include <openair3/S1AP/s1ap_eNB.h> #include <openair3/S1AP/s1ap_eNB.h>
//#include <proto.h> //#include <proto.h>
#include <openair3/GTPV1-U/gtpv1u_eNB_task.h>
void *rrc_enb_process_itti_msg(void *);
#include <openair3/SCTP/sctp_eNB_task.h>
#include <openair3/S1AP/s1ap_eNB.h>
/* /*
static const char *const messages_definition_xml = { static const char *const messages_definition_xml = {
#include <messages_xml.h> #include <messages_xml.h>
......
...@@ -169,6 +169,13 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -169,6 +169,13 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
} }
else ru->N_TA_offset=0; else ru->N_TA_offset=0;
#if BASIC_SIMULATOR
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
UE->N_TA_offset = 0;
#endif
printf("Done lte_param_init\n"); printf("Done lte_param_init\n");
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
uint64_t runtime, uint64_t runtime,
uint64_t deadline, uint64_t deadline,
uint64_t period);*/ uint64_t period);*/
extern WORKER_CONF_t get_thread_worker_conf(void);
extern int codingw;
void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
{ {
...@@ -615,8 +615,10 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -615,8 +615,10 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
} }
} }
if(C >= 8 && get_nprocs()>=16 && codingw)//one main three worker if(get_thread_worker_conf() == WORKER_ENABLE)
{ {
if(C >= 8)//one main three worker
{
encoding_return = encoding_return =
dlsch_encoding_2threads(eNB, dlsch_encoding_2threads(eNB,
a, a,
...@@ -632,9 +634,9 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -632,9 +634,9 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
te_wakeup_stats1, te_wakeup_stats1,
i_stats, i_stats,
3); 3);
} }
else if(C >= 6 && get_nprocs()>=8 && codingw)//one main two worker else if(C >= 6)//one main two worker
{ {
encoding_return = encoding_return =
dlsch_encoding_2threads(eNB, dlsch_encoding_2threads(eNB,
a, a,
...@@ -650,9 +652,9 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -650,9 +652,9 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
te_wakeup_stats1, te_wakeup_stats1,
i_stats, i_stats,
2); 2);
} }
else if(C >= 4 && get_nprocs()>=4 && codingw)//one main one worker else if(C >= 4)//one main one worker
{ {
encoding_return = encoding_return =
dlsch_encoding_2threads(eNB, dlsch_encoding_2threads(eNB,
a, a,
...@@ -668,9 +670,23 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -668,9 +670,23 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
te_wakeup_stats1, te_wakeup_stats1,
i_stats, i_stats,
1); 1);
}
else
{
encoding_return =
dlsch_encoding(eNB,
a,
num_pdcch_symbols,
dlsch,
frame,
subframe,
rm_stats,
te_stats,
i_stats);
}
} }
else else
{ {
encoding_return = encoding_return =
dlsch_encoding(eNB, dlsch_encoding(eNB,
a, a,
...@@ -681,7 +697,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -681,7 +697,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
rm_stats, rm_stats,
te_stats, te_stats,
i_stats); i_stats);
} }
return encoding_return; return encoding_return;
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "targets/RT/USER/rt_wrapper.h" #include "targets/RT/USER/rt_wrapper.h"
#include "transport_proto.h" #include "transport_proto.h"
extern int codingw; extern WORKER_CONF_t get_thread_worker_conf(void);
void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
{ {
...@@ -723,7 +723,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -723,7 +723,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
int ulsch_decoding_data_all(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) int ulsch_decoding_data_all(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
{ {
int ret = 0; int ret = 0;
/*if(codingw) /*if(get_thread_worker_conf() == WORKER_ENABLE)
{ {
ret = ulsch_decoding_data_2thread(eNB,UE_id,harq_pid,llr8_flag); ret = ulsch_decoding_data_2thread(eNB,UE_id,harq_pid,llr8_flag);
} }
......
...@@ -862,7 +862,22 @@ typedef enum { ...@@ -862,7 +862,22 @@ typedef enum {
RESYNCH=4 RESYNCH=4
} UE_MODE_t; } UE_MODE_t;
/// Threading Parameter
typedef enum {
PARALLEL_SINGLE_THREAD =0,
PARALLEL_RU_L1_SPLIT =1,
PARALLEL_RU_L1_TRX_SPLIT =2
}PARALLEL_CONF_t;
typedef enum {
WORKER_DISABLE =0,
WORKER_ENABLE =1
}WORKER_CONF_t;
typedef struct THREAD_STRUCT_s {
PARALLEL_CONF_t parallel_conf;
WORKER_CONF_t worker_conf;
} THREAD_STRUCT;
typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t; typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
......
...@@ -270,7 +270,6 @@ typedef enum { ...@@ -270,7 +270,6 @@ typedef enum {
REMOTE_IF4p5 =3, REMOTE_IF4p5 =3,
REMOTE_IF1pp =4, REMOTE_IF1pp =4,
MAX_RU_IF_TYPES =5 MAX_RU_IF_TYPES =5
//EMULATE_RF =6
} RU_if_south_t; } RU_if_south_t;
typedef struct RU_t_s{ typedef struct RU_t_s{
......
...@@ -82,7 +82,30 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for rx */ ...@@ -82,7 +82,30 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for rx */
int n_tx_dropped = 0; /*!< \brief initial max process time for tx */ int n_tx_dropped = 0; /*!< \brief initial max process time for tx */
int n_rx_dropped = 0; /*!< \brief initial max process time for rx */ int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
int codingw = 0; char *parallel_config = NULL;
char *worker_config = NULL;
static THREAD_STRUCT thread_struct;
void set_parallel_conf(char *parallel_conf)
{
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
}
void set_worker_conf(char *worker_conf)
{
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
}
PARALLEL_CONF_t get_thread_parallel_conf(void)
{
return thread_struct.parallel_conf;
}
WORKER_CONF_t get_thread_worker_conf(void)
{
return thread_struct.worker_conf;
}
int emulate_rf = 0; int emulate_rf = 0;
...@@ -1041,6 +1064,8 @@ int main(int argc, char **argv) ...@@ -1041,6 +1064,8 @@ int main(int argc, char **argv)
break; break;
} }
} }
set_parallel_conf("PARALLEL_RU_L1_TRX_SPLIT");
set_worker_conf("WORKER_ENABLE");
if (transmission_mode>1) pa=dBm3; if (transmission_mode>1) pa=dBm3;
printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa); printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa);
......
...@@ -97,7 +97,30 @@ nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU]; ...@@ -97,7 +97,30 @@ nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU];
nfapi_tx_request_t TX_req; nfapi_tx_request_t TX_req;
Sched_Rsp_t sched_resp; Sched_Rsp_t sched_resp;
int codingw = 0; char *parallel_config = NULL;
char *worker_config = NULL;
static THREAD_STRUCT thread_struct;
void set_parallel_conf(char *parallel_conf)
{
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
}
void set_worker_conf(char *worker_conf)
{
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
}
PARALLEL_CONF_t get_thread_parallel_conf(void)
{
return thread_struct.parallel_conf;
}
WORKER_CONF_t get_thread_worker_conf(void)
{
return thread_struct.worker_conf;
}
void void
fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu, fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
...@@ -725,6 +748,8 @@ int main(int argc, char **argv) ...@@ -725,6 +748,8 @@ int main(int argc, char **argv)
break; break;
} }
} }
set_parallel_conf("PARALLEL_RU_L1_TRX_SPLIT");
set_worker_conf("WORKER_ENABLE");
RC.nb_L1_inst = 1; RC.nb_L1_inst = 1;
RC.nb_RU = 1; RC.nb_RU = 1;
......
...@@ -25,3 +25,4 @@ MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_del ...@@ -25,3 +25,4 @@ MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_del
MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_resp_t, Gtpv1uDeleteTunnelResp) MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_resp_t, Gtpv1uDeleteTunnelResp)
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_ind_t, Gtpv1uTunnelDataInd) MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_ind_t, Gtpv1uTunnelDataInd)
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq) MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq)
MESSAGE_DEF(GTPV1U_ENB_S1_REQ, MESSAGE_PRIORITY_MED, Gtpv1uS1Req, gtpv1uS1Req)
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp #define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp
#define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd #define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq #define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF #define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
...@@ -98,4 +99,8 @@ typedef struct gtpv1u_enb_tunnel_data_req_s { ...@@ -98,4 +99,8 @@ typedef struct gtpv1u_enb_tunnel_data_req_s {
rb_id_t rab_id; rb_id_t rab_id;
} gtpv1u_enb_tunnel_data_req_t; } gtpv1u_enb_tunnel_data_req_t;
typedef struct {
in_addr_t enb_ip_address_for_S1u_S12_S4_up;
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
} Gtpv1uS1Req;
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */ #endif /* GTPV1_U_MESSAGES_TYPES_H_ */
...@@ -63,17 +63,21 @@ typedef struct x2ap_register_enb_req_s { ...@@ -63,17 +63,21 @@ typedef struct x2ap_register_enb_req_s {
uint8_t mnc_digit_length; uint8_t mnc_digit_length;
/* /*
* EARFCN * CC Params
*/ */
uint16_t fdd_uL_EARFCN; int16_t eutra_band[MAX_NUM_CCs];
uint16_t fdd_dL_EARFCN; uint32_t downlink_frequency[MAX_NUM_CCs];
uint16_t tdd_EARFCN; int32_t uplink_frequency_offset[MAX_NUM_CCs];
uint32_t Nid_cell[MAX_NUM_CCs];
int16_t N_RB_DL[MAX_NUM_CCs];
uint16_t fdd_uL_Transmission_Bandwidth; lte_frame_type_t frame_type[MAX_NUM_CCs];
uint16_t fdd_dL_Transmission_Bandwidth; uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
uint16_t tdd_Transmission_Bandwidth; uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
int num_cc;
/* To be considered for TDD */
//uint16_t tdd_EARFCN;
//uint16_t tdd_Transmission_Bandwidth;
/* The local eNB IP address to bind */ /* The local eNB IP address to bind */
net_ip_address_t enb_x2_ip_address; net_ip_address_t enb_x2_ip_address;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -879,3 +879,28 @@ typedef enum { ...@@ -879,3 +879,28 @@ typedef enum {
#define MACRLC_SCHED_MODE_IDX 17 #define MACRLC_SCHED_MODE_IDX 17
#define MACRLC_PHY_TEST_IDX 18 #define MACRLC_PHY_TEST_IDX 18
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* thread configuration parameters section name */
#define THREAD_CONFIG_STRING_THREAD_STRUCT "THREAD_STRUCT"
/* thread configuration parameters names */
#define THREAD_CONFIG_STRING_PARALLEL "parallel_config"
#define THREAD_CONFIG_STRING_WORKER "worker_config"
#define THREAD_PARALLEL_IDX 0
#define THREAD_WORKER_IDX 1
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* thread configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define THREAD_CONF_DESC { \
{THREAD_CONFIG_STRING_PARALLEL, CONFIG_HLP_PARALLEL, 0, strptr:NULL, defstrval:"PARALLEL_RU_L1_TRX_SPLIT", TYPE_STRING, 0}, \
{THREAD_CONFIG_STRING_WORKER, CONFIG_HLP_WORKER, 0, strptr:NULL, defstrval:"WORKER_ENABLE", TYPE_STRING, 0} \
}
#define CONFIG_HLP_WORKER "coding and FEP worker thread WORKER_DISABLE or WORKER_ENABLE\n"
#define CONFIG_HLP_PARALLEL "PARALLEL_SINGLE_THREAD, PARALLEL_RU_L1_SPLIT, or PARALLEL_RU_L1_TRX_SPLIT(RU_L1_TRX_SPLIT by defult)\n"
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
...@@ -160,6 +160,58 @@ uint32_t to_earfcn(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw) ...@@ -160,6 +160,58 @@ uint32_t to_earfcn(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw)
(eutra_bandtable[i].N_OFFs_DL / 10)); (eutra_bandtable[i].N_OFFs_DL / 10));
} }
uint32_t to_earfcn_DL(int eutra_bandP, long long int dl_CarrierFreq, uint32_t bw)
{
uint32_t dl_CarrierFreq_by_100k = dl_CarrierFreq / 100000;
int bw_by_100 = bw / 100;
int i;
AssertFatal(eutra_bandP < 69, "eutra_band %d > 68\n", eutra_bandP);
for (i = 0; i < 69 && eutra_bandtable[i].band != eutra_bandP; i++);
AssertFatal(dl_CarrierFreq_by_100k >= eutra_bandtable[i].dl_min,
"Band %d, bw %u : DL carrier frequency %lld Hz < %u\n",
eutra_bandP, bw, dl_CarrierFreq,
eutra_bandtable[i].dl_min);
AssertFatal(dl_CarrierFreq_by_100k <=
(eutra_bandtable[i].dl_max - bw_by_100),
"Band %d, bw %u : DL carrier frequency %lld Hz > %d\n",
eutra_bandP, bw, dl_CarrierFreq,
eutra_bandtable[i].dl_max - bw_by_100);
return (dl_CarrierFreq_by_100k - eutra_bandtable[i].dl_min +
(eutra_bandtable[i].N_OFFs_DL / 10));
}
uint32_t to_earfcn_UL(int eutra_bandP, long long int ul_CarrierFreq, uint32_t bw)
{
uint32_t ul_CarrierFreq_by_100k = ul_CarrierFreq / 100000;
int bw_by_100 = bw / 100;
int i;
AssertFatal(eutra_bandP < 69, "eutra_band %d > 68\n", eutra_bandP);
for (i = 0; i < 69 && eutra_bandtable[i].band != eutra_bandP; i++);
AssertFatal(ul_CarrierFreq_by_100k >= eutra_bandtable[i].ul_min,
"Band %d, bw %u : UL carrier frequency %lld Hz < %u\n",
eutra_bandP, bw, ul_CarrierFreq,
eutra_bandtable[i].ul_min);
AssertFatal(ul_CarrierFreq_by_100k <=
(eutra_bandtable[i].ul_max - bw_by_100),
"Band %d, bw %u : UL carrier frequency %lld Hz > %d\n",
eutra_bandP, bw, ul_CarrierFreq,
eutra_bandtable[i].ul_max - bw_by_100);
return (ul_CarrierFreq_by_100k - eutra_bandtable[i].ul_min +
((eutra_bandtable[i].N_OFFs_DL + 180000) / 10));
}
uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn) uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn)
{ {
......
...@@ -71,7 +71,7 @@ schedule_ue_spec_phy_test( ...@@ -71,7 +71,7 @@ schedule_ue_spec_phy_test(
uint16_t rnti = 0x1235; uint16_t rnti = 0x1235;
uint32_t rb_alloc = 0x1FFFFF; uint32_t rb_alloc = 0x1FFFFF;
int32_t tpc = 1; int32_t tpc = 1;
int32_t mcs = 10; int32_t mcs = 28;
int32_t cqi = 15; int32_t cqi = 15;
int32_t ndi = (frameP*10+subframeP)/8; int32_t ndi = (frameP*10+subframeP)/8;
int32_t dai = 0; int32_t dai = 0;
......
...@@ -7201,29 +7201,24 @@ void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP, ...@@ -7201,29 +7201,24 @@ void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(ctxt_pP, ue_context_pP, 0); rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(ctxt_pP, ue_context_pP, 0);
} }
//-----------------------------------------------------------------------------
void*
rrc_enb_task(
void* args_p
)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ void rrc_enb_init(void) {
MessageDef *msg_p;
const char *msg_name_p;
instance_t instance;
int result;
SRB_INFO *srb_info_p;
int CC_id;
protocol_ctxt_t ctxt;
pthread_mutex_init(&lock_ue_freelist, NULL); pthread_mutex_init(&lock_ue_freelist, NULL);
pthread_mutex_init(&rrc_release_freelist, NULL); pthread_mutex_init(&rrc_release_freelist, NULL);
memset(&rrc_release_info,0,sizeof(RRC_release_list_t)); memset(&rrc_release_info,0,sizeof(RRC_release_list_t));
itti_mark_task_ready(TASK_RRC_ENB); }
LOG_I(RRC,"Entering main loop of RRC message task\n");
while (1) { //-----------------------------------------------------------------------------
void *rrc_enb_process_itti_msg(void *notUsed) {
MessageDef *msg_p;
const char *msg_name_p;
instance_t instance;
int result;
SRB_INFO *srb_info_p;
int CC_id;
protocol_ctxt_t ctxt;
// Wait for a message // Wait for a message
itti_receive_msg(TASK_RRC_ENB, &msg_p); itti_receive_msg(TASK_RRC_ENB, &msg_p);
...@@ -7363,9 +7358,28 @@ rrc_enb_task( ...@@ -7363,9 +7358,28 @@ rrc_enb_task(
result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p); result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
if (result != EXIT_SUCCESS) { if (result != EXIT_SUCCESS) {
LOG_I(RRC, "Failed to free memory (%d)!\n",result); LOG_I(RRC, "Failed to free memory (%d)!\n",result);
continue;
} }
msg_p = NULL; msg_p = NULL;
return NULL;
}
//-----------------------------------------------------------------------------
void*
rrc_enb_task(
void* args_p
)
//-----------------------------------------------------------------------------
{
rrc_enb_init();
itti_mark_task_ready(TASK_RRC_ENB);
LOG_I(RRC,"Entering main loop of RRC message task\n");
while (1) {
(void) rrc_enb_process_itti_msg(NULL);
} }
} }
#endif #endif
......
...@@ -336,6 +336,10 @@ rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP, ...@@ -336,6 +336,10 @@ rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* ue_context_pP); rrc_eNB_ue_context_t* ue_context_pP);
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
void rrc_enb_init(void);
void *rrc_enb_process_itti_msg(void *);
/**\brief RRC eNB task. /**\brief RRC eNB task.
\param void *args_p Pointer on arguments to start the task. */ \param void *args_p Pointer on arguments to start the task. */
void *rrc_enb_task(void *args_p); void *rrc_enb_task(void *args_p);
......
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
#include "X2AP_InitiatingMessage.h" #include "X2AP_InitiatingMessage.h"
#include "X2AP_SuccessfulOutcome.h" #include "X2AP_SuccessfulOutcome.h"
#include "X2AP_UnsuccessfulOutcome.h" #include "X2AP_UnsuccessfulOutcome.h"
#include "X2AP_ProtocolIE-Field.h"
#include "X2AP_ProtocolIE-FieldPair.h" #include "X2AP_ProtocolIE-FieldPair.h"
#include "X2AP_ProtocolIE-ContainerPair.h" #include "X2AP_ProtocolIE-ContainerPair.h"
#include "X2AP_ProtocolExtensionField.h" #include "X2AP_ProtocolExtensionField.h"
#include "X2AP_ProtocolExtensionContainer.h" #include "X2AP_ProtocolExtensionContainer.h"
#include "X2AP_asn_constant.h" #include "X2AP_asn_constant.h"
#include "intertask_interface.h"
#ifndef X2AP_COMMON_H_ #ifndef X2AP_COMMON_H_
#define X2AP_COMMON_H_ #define X2AP_COMMON_H_
...@@ -87,15 +87,13 @@ extern int asn1_xer_print; ...@@ -87,15 +87,13 @@ extern int asn1_xer_print;
if (mandatory) DevAssert(ie != NULL); \ if (mandatory) DevAssert(ie != NULL); \
} while(0) } while(0)
//Forward declaration
struct x2ap_message_s;
/** \brief Function callback prototype. /** \brief Function callback prototype.
**/ **/
typedef int (*x2ap_message_decoded_callback)( typedef int (*x2ap_message_decoded_callback)(
instance_t instance,
uint32_t assocId, uint32_t assocId,
uint32_t stream, uint32_t stream,
struct x2ap_message_s *message); X2AP_X2AP_PDU_t *pdu);
/** \brief Encode a successfull outcome message /** \brief Encode a successfull outcome message
\param buffer pointer to buffer in which data will be encoded \param buffer pointer to buffer in which data will be encoded
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "x2ap_eNB_defs.h" #include "x2ap_eNB_defs.h"
#include "x2ap_eNB_management_procedures.h" #include "x2ap_eNB_management_procedures.h"
#include "x2ap_eNB_handler.h" #include "x2ap_eNB_handler.h"
#include "x2ap_eNB_generate_messages.h"
#include "x2ap_common.h" #include "x2ap_common.h"
#include "queue.h" #include "queue.h"
...@@ -42,9 +43,9 @@ struct x2ap_eNB_data_s; ...@@ -42,9 +43,9 @@ struct x2ap_eNB_data_s;
RB_PROTOTYPE(x2ap_enb_map, x2ap_eNB_data_s, entry, x2ap_eNB_compare_assoc_id); RB_PROTOTYPE(x2ap_enb_map, x2ap_eNB_data_s, entry, x2ap_eNB_compare_assoc_id);
//static static
//void x2ap_eNB_handle_sctp_data_ind(instance_t instance, void x2ap_eNB_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind);
// sctp_data_ind_t *sctp_data_ind);
static static
void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
...@@ -63,22 +64,21 @@ void x2ap_eNB_register_eNB(x2ap_eNB_instance_t *instance_p, ...@@ -63,22 +64,21 @@ void x2ap_eNB_register_eNB(x2ap_eNB_instance_t *instance_p,
uint32_t enb_port_for_X2C, uint32_t enb_port_for_X2C,
int multi_sd); int multi_sd);
/*
static static
void x2ap_eNB_handle_sctp_data_ind(instance_t instance, void x2ap_eNB_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
sctp_data_ind_t *sctp_data_ind) {
int result; int result;
DevAssert(sctp_data_ind != NULL); DevAssert(sctp_data_ind != NULL);
x2ap_eNB_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream, x2ap_eNB_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length); sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer); result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}*/ }
static static
void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp)
...@@ -143,7 +143,7 @@ printf("x2ap_eNB_handle_sctp_association_resp at 4\n"); ...@@ -143,7 +143,7 @@ printf("x2ap_eNB_handle_sctp_association_resp at 4\n");
dump_trees(); dump_trees();
/* Prepare new x2 Setup Request */ /* Prepare new x2 Setup Request */
//x2ap_eNB_generate_x2_setup_request(instance_p, x2ap_enb_data_p); x2ap_eNB_generate_x2_setup_request(instance_p, x2ap_enb_data_p);
} }
static static
...@@ -325,6 +325,19 @@ void x2ap_eNB_handle_register_eNB(instance_t instance, ...@@ -325,6 +325,19 @@ void x2ap_eNB_handle_register_eNB(instance_t instance,
new_instance->mnc = x2ap_register_eNB->mnc; new_instance->mnc = x2ap_register_eNB->mnc;
new_instance->mnc_digit_length = x2ap_register_eNB->mnc_digit_length; new_instance->mnc_digit_length = x2ap_register_eNB->mnc_digit_length;
new_instance->num_cc = x2ap_register_eNB->num_cc;
for (int i = 0; i< x2ap_register_eNB->num_cc; i++){
new_instance->eutra_band[i] = x2ap_register_eNB->eutra_band[i];
new_instance->downlink_frequency[i] = x2ap_register_eNB->downlink_frequency[i];
new_instance->uplink_frequency_offset[i] = x2ap_register_eNB->uplink_frequency_offset[i];
new_instance->Nid_cell[i] = x2ap_register_eNB->Nid_cell[i];
new_instance->N_RB_DL[i] = x2ap_register_eNB->N_RB_DL[i];
new_instance->frame_type[i] = x2ap_register_eNB->frame_type[i];
new_instance->fdd_earfcn_DL[i] = x2ap_register_eNB->fdd_earfcn_DL[i];
new_instance->fdd_earfcn_UL[i] = x2ap_register_eNB->fdd_earfcn_UL[i];
}
DevCheck(x2ap_register_eNB->nb_x2 <= X2AP_MAX_NB_ENB_IP_ADDRESS, DevCheck(x2ap_register_eNB->nb_x2 <= X2AP_MAX_NB_ENB_IP_ADDRESS,
X2AP_MAX_NB_ENB_IP_ADDRESS, x2ap_register_eNB->nb_x2, 0); X2AP_MAX_NB_ENB_IP_ADDRESS, x2ap_register_eNB->nb_x2, 0);
memcpy(new_instance->target_enb_x2_ip_address, memcpy(new_instance->target_enb_x2_ip_address,
...@@ -432,8 +445,8 @@ void *x2ap_task(void *arg) ...@@ -432,8 +445,8 @@ void *x2ap_task(void *arg)
break; break;
case SCTP_DATA_IND: case SCTP_DATA_IND:
//x2ap_eNB_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg), x2ap_eNB_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &received_msg->ittiMsg.sctp_data_ind); &received_msg->ittiMsg.sctp_data_ind);
break; break;
default: default:
......
/*
* 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 <stdio.h>
#include "assertions.h"
#include "intertask_interface.h"
#include "x2ap_common.h"
#include "x2ap_eNB_decoder.h"
static int x2ap_eNB_decode_initiating_message(X2AP_X2AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage.procedureCode) {
case X2AP_ProcedureCode_id_x2Setup:
asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
X2AP_INFO("x2ap_eNB_decode_initiating_message!\n");
break;
default:
X2AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage.procedureCode);
AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage.procedureCode);
return -1;
}
return 0;
}
static int x2ap_eNB_decode_successful_outcome(X2AP_X2AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome.procedureCode) {
case X2AP_ProcedureCode_id_x2Setup:
asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
X2AP_INFO("x2ap_eNB_decode_successfuloutcome_message!\n");
break;
default:
X2AP_ERROR("Unknown procedure ID (%d) for successfull outcome message\n",
(int)pdu->choice.successfulOutcome.procedureCode);
return -1;
}
return 0;
}
static int x2ap_eNB_decode_unsuccessful_outcome(X2AP_X2AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome.procedureCode) {
case X2AP_ProcedureCode_id_x2Setup:
asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
X2AP_INFO("x2ap_eNB_decode_unsuccessfuloutcome_message!\n");
break;
default:
X2AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)pdu->choice.unsuccessfulOutcome.procedureCode);
return -1;
}
return 0;
}
int x2ap_eNB_decode_pdu(X2AP_X2AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
{
asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL);
dec_ret = aper_decode(NULL,
&asn_DEF_X2AP_X2AP_PDU,
(void **)&pdu,
buffer,
length,
0,
0);
xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, pdu);
if (dec_ret.code != RC_OK) {
X2AP_ERROR("Failed to decode pdu\n");
return -1;
}
switch(pdu->present) {
case X2AP_X2AP_PDU_PR_initiatingMessage:
return x2ap_eNB_decode_initiating_message(pdu);
case X2AP_X2AP_PDU_PR_successfulOutcome:
return x2ap_eNB_decode_successful_outcome(pdu);
case X2AP_X2AP_PDU_PR_unsuccessfulOutcome:
return x2ap_eNB_decode_unsuccessful_outcome(pdu);
default:
X2AP_DEBUG("Unknown presence (%d) or not implemented\n", (int)pdu->present);
break;
}
return -1;
}
/*
* 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 X2AP_ENB_DECODER_H_
#define X2AP_ENB_DECODER_H_
int x2ap_eNB_decode_pdu(X2AP_X2AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
__attribute__ ((warn_unused_result));
#endif /* X2AP_ENB_DECODER_H_ */
...@@ -151,6 +151,17 @@ typedef struct x2ap_eNB_instance_s { ...@@ -151,6 +151,17 @@ typedef struct x2ap_eNB_instance_s {
uint16_t mnc; uint16_t mnc;
uint8_t mnc_digit_length; uint8_t mnc_digit_length;
/* CC params */
int16_t eutra_band[MAX_NUM_CCs];
uint32_t downlink_frequency[MAX_NUM_CCs];
int32_t uplink_frequency_offset[MAX_NUM_CCs];
uint32_t Nid_cell[MAX_NUM_CCs];
int16_t N_RB_DL[MAX_NUM_CCs];
lte_frame_type_t frame_type[MAX_NUM_CCs];
uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
int num_cc;
net_ip_address_t target_enb_x2_ip_address[X2AP_MAX_NB_ENB_IP_ADDRESS]; net_ip_address_t target_enb_x2_ip_address[X2AP_MAX_NB_ENB_IP_ADDRESS];
uint8_t nb_x2; uint8_t nb_x2;
net_ip_address_t enb_x2_ip_address; net_ip_address_t enb_x2_ip_address;
......
/*
* 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 <stdio.h>
#include <string.h>
#include <stdint.h>
#include "assertions.h"
#include "conversions.h"
#include "intertask_interface.h"
#include "x2ap_common.h"
#include "x2ap_eNB_encoder.h"
int x2ap_eNB_encode_pdu(X2AP_X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
{
ssize_t encoded;
DevAssert(pdu != NULL);
DevAssert(buffer != NULL);
DevAssert(len != NULL);
if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)pdu);
}
encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_X2AP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) {
return -1;
}
*len = encoded;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_X2AP_X2AP_PDU, pdu);
return encoded;
}
/*
* 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 X2AP_ENB_ENCODER_H_
#define X2AP_ENB_ENCODER_H_
int x2ap_eNB_encode_pdu(X2AP_X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
__attribute__ ((warn_unused_result));
#endif /* X2AP_ENB_ENCODER_H_ */
This diff is collapsed.
/*
* 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 X2AP_ENB_GENERATE_MESSAGES_H_
#define X2AP_ENB_GENERATE_MESSAGES_H_
#include "x2ap_eNB_defs.h"
#include "x2ap_common.h"
int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
x2ap_eNB_data_t *x2ap_enb_data_p);
int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_data_t *x2ap_enb_data_p);
int x2ap_eNB_generate_x2_setup_failure(instance_t instance,
uint32_t assoc_id,
X2AP_Cause_PR cause_type,
long cause_value,
long time_to_wait);
int x2ap_eNB_set_cause (X2AP_Cause_t * cause_p,
X2AP_Cause_PR cause_type,
long cause_value);
#endif /* X2AP_ENB_GENERATE_MESSAGES_H_ */
This diff is collapsed.
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
#include "x2ap_eNB_defs.h" #include "x2ap_eNB_defs.h"
void x2ap_handle_x2_setup_message(x2ap_eNB_data_t *mme_desc_p, int sctp_shutdown); void x2ap_handle_x2_setup_message(x2ap_eNB_data_t *eNB_desc_p, int sctp_shutdown);
//int x2ap_eNB_handle_message(uint32_t assoc_id, int32_t stream, int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
// const uint8_t * const data, const uint32_t data_length); const uint8_t * const data, const uint32_t data_length);
#endif /* X2AP_ENB_HANDLERS_H_ */ #endif /* X2AP_ENB_HANDLERS_H_ */
/*
* 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 "intertask_interface.h"
#include "x2ap_eNB_itti_messaging.h"
void x2ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream)
{
MessageDef *message_p;
sctp_data_req_t *sctp_data_req;
message_p = itti_alloc_new_message(TASK_X2AP, SCTP_DATA_REQ);
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
void x2ap_eNB_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id)
{
MessageDef *message_p = NULL;
sctp_close_association_t *sctp_close_association_p = NULL;
message_p = itti_alloc_new_message(TASK_X2AP, SCTP_CLOSE_ASSOCIATION);
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
sctp_close_association_p->assoc_id = assoc_id;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
/*
* 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 X2AP_ENB_ITTI_MESSAGING_H_
#define X2AP_ENB_ITTI_MESSAGING_H_
void x2ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream);
void x2ap_eNB_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id);
#endif /* X2AP_ENB_ITTI_MESSAGING_H_ */
...@@ -49,120 +49,13 @@ ...@@ -49,120 +49,13 @@
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/ran_context.h" #include "common/ran_context.h"
#include "gtpv1u_eNB_defs.h" #include "gtpv1u_eNB_defs.h"
#include "gtpv1u_eNB_task.h"
#undef GTP_DUMP_SOCKET #undef GTP_DUMP_SOCKET
/*
extern boolean_t pdcp_data_req(
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_buffer_sizeP,
unsigned char *const sdu_buffer_pP,
const pdcp_transmission_mode_t modeP
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id
#endif
);
const pdcp_transmission_mode_t modeP);
*/
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
static int
gtpv1u_eNB_send_init_udp(
uint16_t port_number);
NwGtpv1uRcT
gtpv1u_eNB_log_request(
NwGtpv1uLogMgrHandleT hLogMgr,
uint32_t logLevel,
NwCharT *file,
uint32_t line,
NwCharT *logStr);
NwGtpv1uRcT
gtpv1u_eNB_send_udp_msg(
NwGtpv1uUdpHandleT udpHandle,
uint8_t *buffer,
uint32_t buffer_len,
uint32_t buffer_offset,
uint32_t peerIpAddr,
uint16_t peerPort);
NwGtpv1uRcT
gtpv1u_eNB_process_stack_req(
NwGtpv1uUlpHandleT hUlp,
NwGtpv1uUlpApiT *pUlpApi);
int
data_recv_callback(
uint16_t portP,
uint32_t address,
uint8_t *buffer,
uint32_t length,
void *arg_p);
//int
//gtpv1u_create_tunnel_endpoint(
// gtpv1u_data_t *gtpv1u_data_pP,
// uint8_t ue_idP,
// uint8_t rab_idP,
// char *sgw_ip_addr_pP,
// uint16_t portP);
static NwGtpv1uRcT
gtpv1u_start_timer_wrapper(
NwGtpv1uTimerMgrHandleT tmrMgrHandle,
uint32_t timeoutSec,
uint32_t timeoutUsec,
uint32_t tmrType,
void *timeoutArg,
NwGtpv1uTimerHandleT *hTmr);
static NwGtpv1uRcT
gtpv1u_stop_timer_wrapper(
NwGtpv1uTimerMgrHandleT tmrMgrHandle,
NwGtpv1uTimerHandleT hTmr);
int
gtpv1u_initial_req(
gtpv1u_data_t *gtpv1u_data_pP,
teid_t teidP,
tcp_udp_port_t portP,
uint32_t address);
int
gtpv1u_new_data_req(
uint8_t enb_module_idP,
rnti_t ue_rntiP,
uint8_t rab_idP,
uint8_t *buffer_pP,
uint32_t buf_lenP,
uint32_t buf_offsetP
);
int
gtpv1u_create_s1u_tunnel(
const instance_t instanceP,
const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP,
gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP);
static int
gtpv1u_delete_s1u_tunnel(
const instance_t instanceP,
const gtpv1u_enb_delete_tunnel_req_t * const req_pP);
static int
gtpv1u_eNB_init(void);
void *
gtpv1u_eNB_task(void *args);
//static gtpv1u_data_t gtpv1u_data_g;
#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 #if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0
#include <linux/if.h> #include <linux/if.h>
static int gtpv1u_dump_socket_g; static int gtpv1u_dump_socket_g;
...@@ -215,11 +108,11 @@ static void gtpv1u_eNB_write_dump_socket(uint8_t *buffer_pP, uint32_t buffer_len ...@@ -215,11 +108,11 @@ static void gtpv1u_eNB_write_dump_socket(uint8_t *buffer_pP, uint32_t buffer_len
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static int gtpv1u_eNB_send_init_udp(uint16_t port_number) static int gtpv1u_eNB_send_init_udp(const Gtpv1uS1Req * req)
{ {
// Create and alloc new message // Create and alloc new message
MessageDef *message_p; MessageDef *message_p;
struct in_addr addr; struct in_addr addr={0};
message_p = itti_alloc_new_message(TASK_GTPV1_U, UDP_INIT); message_p = itti_alloc_new_message(TASK_GTPV1_U, UDP_INIT);
...@@ -227,12 +120,10 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number) ...@@ -227,12 +120,10 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
return -1; return -1;
} }
UDP_INIT(message_p).port = port_number; UDP_INIT(message_p).port = req->enb_port_for_S1u_S12_S4_up;
//LG UDP_INIT(message_p).address = "0.0.0.0"; //ANY address addr.s_addr = req->enb_ip_address_for_S1u_S12_S4_up;
addr.s_addr = RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up;
UDP_INIT(message_p).address = inet_ntoa(addr); UDP_INIT(message_p).address = inet_ntoa(addr);
LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up); LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port);
MSC_LOG_EVENT( MSC_LOG_EVENT(
MSC_GTPU_ENB, MSC_GTPU_ENB,
...@@ -242,6 +133,16 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number) ...@@ -242,6 +133,16 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
} }
static int gtpv1u_s1_req(
const instance_t instanceP,
const Gtpv1uS1Req * const req) {
memcpy(&RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up,
&req->enb_ip_address_for_S1u_S12_S4_up,
sizeof (req->enb_ip_address_for_S1u_S12_S4_up));
gtpv1u_eNB_send_init_udp(req);
return 0;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr, NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr,
uint32_t logLevel, uint32_t logLevel,
...@@ -999,23 +900,17 @@ static int gtpv1u_delete_s1u_tunnel( ...@@ -999,23 +900,17 @@ static int gtpv1u_delete_s1u_tunnel(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static int gtpv1u_eNB_init(void) int gtpv1u_eNB_init(void)
{ {
int ret;
NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; NwGtpv1uRcT rc = NW_GTPV1U_FAILURE;
NwGtpv1uUlpEntityT ulp; NwGtpv1uUlpEntityT ulp;
NwGtpv1uUdpEntityT udp; NwGtpv1uUdpEntityT udp;
NwGtpv1uLogMgrEntityT log; NwGtpv1uLogMgrEntityT log;
NwGtpv1uTimerMgrEntityT tmr; NwGtpv1uTimerMgrEntityT tmr;
// enb_properties_p = enb_config_get()->properties[0]; // enb_properties_p = enb_config_get()->properties[0];
RC.gtpv1u_data_g = (gtpv1u_data_t*)malloc(sizeof(gtpv1u_data_t)); RC.gtpv1u_data_g = (gtpv1u_data_t*)calloc(sizeof(gtpv1u_data_t),1);
memset(RC.gtpv1u_data_g, 0, sizeof(gtpv1u_data_t));
RCconfig_gtpu();
LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.gtpv1u_data_g); LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.gtpv1u_data_g);
//gtpv1u_data_g.gtpv1u_stack; //gtpv1u_data_g.gtpv1u_stack;
/* Initialize UE hashtable */ /* Initialize UE hashtable */
...@@ -1024,7 +919,6 @@ static int gtpv1u_eNB_init(void) ...@@ -1024,7 +919,6 @@ static int gtpv1u_eNB_init(void)
RC.gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL); RC.gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL);
AssertFatal(RC.gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n"); AssertFatal(RC.gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n");
// RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U; // RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U;
RC.gtpv1u_data_g->ip_addr = NULL;
//gtpv1u_data_g.udp_data; //gtpv1u_data_g.udp_data;
RC.gtpv1u_data_g->seq_num = 0; RC.gtpv1u_data_g->seq_num = 0;
...@@ -1089,35 +983,21 @@ static int gtpv1u_eNB_init(void) ...@@ -1089,35 +983,21 @@ static int gtpv1u_eNB_init(void)
} }
#endif #endif
ret = gtpv1u_eNB_send_init_udp(RC.gtpv1u_data_g->enb_port_for_S1u_S12_S4_up);
if (ret < 0) {
return ret;
}
LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n"); LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n");
return 0; return 0;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void *gtpv1u_eNB_task(void *args) void *gtpv1u_eNB_process_itti_msg(void *notUsed) {
{
int rc = 0;
instance_t instance;
//const char *msg_name_p;
rc = gtpv1u_eNB_init();
AssertFatal(rc == 0, "gtpv1u_eNB_init Failed");
itti_mark_task_ready(TASK_GTPV1_U);
MSC_START_USE();
while(1) {
/* Trying to fetch a message from the message queue. /* Trying to fetch a message from the message queue.
* If the queue is empty, this function will block till a * If the queue is empty, this function will block till a
* message is sent to the task. * message is sent to the task.
*/ */
instance_t instance;
MessageDef *received_message_p = NULL; MessageDef *received_message_p = NULL;
int rc = 0;
itti_receive_msg(TASK_GTPV1_U, &received_message_p); itti_receive_msg(TASK_GTPV1_U, &received_message_p);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_IN);
DevAssert(received_message_p != NULL); DevAssert(received_message_p != NULL);
...@@ -1127,6 +1007,9 @@ void *gtpv1u_eNB_task(void *args) ...@@ -1127,6 +1007,9 @@ void *gtpv1u_eNB_task(void *args)
switch (ITTI_MSG_ID(received_message_p)) { switch (ITTI_MSG_ID(received_message_p)) {
case GTPV1U_ENB_S1_REQ:
gtpv1u_s1_req(instance, &received_message_p->ittiMsg.gtpv1uS1Req);
case GTPV1U_ENB_DELETE_TUNNEL_REQ: { case GTPV1U_ENB_DELETE_TUNNEL_REQ: {
gtpv1u_delete_s1u_tunnel(instance, &received_message_p->ittiMsg.Gtpv1uDeleteTunnelReq); gtpv1u_delete_s1u_tunnel(instance, &received_message_p->ittiMsg.Gtpv1uDeleteTunnelReq);
} }
...@@ -1258,6 +1141,22 @@ void *gtpv1u_eNB_task(void *args) ...@@ -1258,6 +1141,22 @@ void *gtpv1u_eNB_task(void *args)
AssertFatal(rc == EXIT_SUCCESS, "Failed to free memory (%d)!\n", rc); AssertFatal(rc == EXIT_SUCCESS, "Failed to free memory (%d)!\n", rc);
received_message_p = NULL; received_message_p = NULL;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_OUT);
return NULL;
}
//-----------------------------------------------------------------------------
void *gtpv1u_eNB_task(void *args)
{
int rc = 0;
rc = gtpv1u_eNB_init();
AssertFatal(rc == 0, "gtpv1u_eNB_init Failed");
itti_mark_task_ready(TASK_GTPV1_U);
MSC_START_USE();
while(1) {
(void) gtpv1u_eNB_process_itti_msg (NULL);
} }
return NULL; return NULL;
......
...@@ -97,8 +97,6 @@ typedef struct gtpv1u_data_s { ...@@ -97,8 +97,6 @@ typedef struct gtpv1u_data_s {
//RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head; //RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head;
/* Local IP address to use */ /* Local IP address to use */
in_addr_t enb_ip_address_for_S1u_S12_S4_up; in_addr_t enb_ip_address_for_S1u_S12_S4_up;
char *ip_addr;
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
/* UDP internal data */ /* UDP internal data */
//udp_data_t udp_data; //udp_data_t udp_data;
......
...@@ -40,6 +40,8 @@ gtpv1u_new_data_req( ...@@ -40,6 +40,8 @@ gtpv1u_new_data_req(
uint32_t buf_len, uint32_t buf_len,
uint32_t buf_offset);*/ uint32_t buf_offset);*/
int gtpv1u_eNB_init(void);
void *gtpv1u_eNB_process_itti_msg(void*);
void *gtpv1u_eNB_task(void *args); void *gtpv1u_eNB_task(void *args);
int int
......
...@@ -286,19 +286,20 @@ void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) ...@@ -286,19 +286,20 @@ void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} }
void *s1ap_eNB_task(void *arg) void s1ap_eNB_init(void)
{ {
MessageDef *received_msg = NULL;
int result;
S1AP_DEBUG("Starting S1AP layer\n"); S1AP_DEBUG("Starting S1AP layer\n");
s1ap_eNB_prepare_internal_data(); s1ap_eNB_prepare_internal_data();
itti_mark_task_ready(TASK_S1AP); itti_mark_task_ready(TASK_S1AP);
MSC_START_USE(); MSC_START_USE();
}
while (1) { void *s1ap_eNB_process_itti_msg(void* notUsed)
{
MessageDef *received_msg = NULL;
int result;
itti_receive_msg(TASK_S1AP, &received_msg); itti_receive_msg(TASK_S1AP, &received_msg);
switch (ITTI_MSG_ID(received_msg)) { switch (ITTI_MSG_ID(received_msg)) {
...@@ -413,6 +414,16 @@ void *s1ap_eNB_task(void *arg) ...@@ -413,6 +414,16 @@ void *s1ap_eNB_task(void *arg)
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL; received_msg = NULL;
return NULL;
}
void *s1ap_eNB_task(void *arg)
{
s1ap_eNB_init();
while (1) {
(void) s1ap_eNB_process_itti_msg(NULL);
} }
return NULL; return NULL;
......
...@@ -39,6 +39,8 @@ extern s1ap_eNB_config_t s1ap_config; ...@@ -39,6 +39,8 @@ extern s1ap_eNB_config_t s1ap_config;
#define EPC_MODE_ENABLED s1ap_config.mme_enabled #define EPC_MODE_ENABLED s1ap_config.mme_enabled
void *s1ap_eNB_process_itti_msg(void*);
void s1ap_eNB_init(void);
void *s1ap_eNB_task(void *arg); void *s1ap_eNB_task(void *arg);
uint32_t s1ap_generate_eNB_id(void); uint32_t s1ap_generate_eNB_id(void);
......
...@@ -1039,15 +1039,9 @@ sctp_eNB_flush_sockets( ...@@ -1039,15 +1039,9 @@ sctp_eNB_flush_sockets(
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void *sctp_eNB_task(void *arg) void sctp_eNB_init(void)
{ {
int nb_events;
struct epoll_event *events;
MessageDef *received_msg = NULL;
int result;
SCTP_DEBUG("Starting SCTP layer\n"); SCTP_DEBUG("Starting SCTP layer\n");
STAILQ_INIT(&sctp_cnx_list); STAILQ_INIT(&sctp_cnx_list);
...@@ -1055,7 +1049,16 @@ void *sctp_eNB_task(void *arg) ...@@ -1055,7 +1049,16 @@ void *sctp_eNB_task(void *arg)
itti_mark_task_ready(TASK_SCTP); itti_mark_task_ready(TASK_SCTP);
MSC_START_USE(); MSC_START_USE();
while (1) { }
//------------------------------------------------------------------------------
void *sctp_eNB_process_itti_msg(void *notUsed)
{
int nb_events;
struct epoll_event *events;
MessageDef *received_msg = NULL;
int result;
itti_receive_msg(TASK_SCTP, &received_msg); itti_receive_msg(TASK_SCTP, &received_msg);
/* Check if there is a packet to handle */ /* Check if there is a packet to handle */
...@@ -1142,6 +1145,17 @@ void *sctp_eNB_task(void *arg) ...@@ -1142,6 +1145,17 @@ void *sctp_eNB_task(void *arg)
nb_events = itti_get_events(TASK_SCTP, &events); nb_events = itti_get_events(TASK_SCTP, &events);
/* Now handle notifications for other sockets */ /* Now handle notifications for other sockets */
sctp_eNB_flush_sockets(events, nb_events); sctp_eNB_flush_sockets(events, nb_events);
return NULL;
}
//------------------------------------------------------------------------------
void *sctp_eNB_task(void *arg)
{
sctp_eNB_init();
while (1) {
(void) sctp_eNB_process_itti_msg(NULL);
} }
return NULL; return NULL;
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#ifndef SCTP_ENB_TASK_H_ #ifndef SCTP_ENB_TASK_H_
#define SCTP_ENB_TASK_H_ #define SCTP_ENB_TASK_H_
void sctp_eNB_init(void);
void *sctp_eNB_process_itti_msg(void *);
void *sctp_eNB_task(void *arg); void *sctp_eNB_task(void *arg);
#endif /* SCTP_ENB_TASK_H_ */ #endif /* SCTP_ENB_TASK_H_ */
...@@ -44,6 +44,7 @@ typedef struct { ...@@ -44,6 +44,7 @@ typedef struct {
int sock; int sock;
int samples_per_subframe; int samples_per_subframe;
uint64_t timestamp; uint64_t timestamp;
uint64_t next_tx_timestamp;
int is_enb; int is_enb;
} tcp_bridge_state_t; } tcp_bridge_state_t;
...@@ -141,11 +142,27 @@ int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void ...@@ -141,11 +142,27 @@ int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void
{ {
if (cc != 1) { printf("tcp_bridge: only 1 antenna supported\n"); exit(1); } if (cc != 1) { printf("tcp_bridge: only 1 antenna supported\n"); exit(1); }
tcp_bridge_state_t *t = device->priv; tcp_bridge_state_t *t = device->priv;
/* deal with discontinuities in output (think: eNB in TDD mode) */
if (t->next_tx_timestamp && timestamp != t->next_tx_timestamp) {
uint32_t b[4096];
uint64_t to_send = timestamp - t->next_tx_timestamp;
memset(b, 0, 4096 * sizeof(uint32_t));
while (to_send) {
int len = to_send > 4096 ? 4096 : to_send;
int n = fullwrite(t->sock, b, len * 4);
if (n != len * 4) {
printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno));
abort();
}
to_send -= len;
}
}
int n = fullwrite(t->sock, buff[0], nsamps * 4); int n = fullwrite(t->sock, buff[0], nsamps * 4);
if (n != nsamps * 4) { if (n != nsamps * 4) {
printf("tcp_bridge: write error ret %d (wanted %d) error %s\n", n, nsamps*4, strerror(errno)); printf("tcp_bridge: write error ret %d (wanted %d) error %s\n", n, nsamps*4, strerror(errno));
abort(); abort();
} }
t->next_tx_timestamp = timestamp + nsamps;
return nsamps; return nsamps;
} }
......
...@@ -156,6 +156,15 @@ eNBs = ...@@ -156,6 +156,15 @@ eNBs =
ENB_PORT_FOR_X2C = 36422; # Spec 36422 ENB_PORT_FOR_X2C = 36422; # Spec 36422
}; };
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config : log_config :
{ {
global_log_level ="debug"; global_log_level ="debug";
......
...@@ -156,6 +156,15 @@ eNBs = ...@@ -156,6 +156,15 @@ eNBs =
ENB_PORT_FOR_X2C = 36422; # Spec 36422 ENB_PORT_FOR_X2C = 36422; # Spec 36422
}; };
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config : log_config :
{ {
global_log_level ="debug"; global_log_level ="debug";
......
...@@ -193,6 +193,15 @@ RUs = ( ...@@ -193,6 +193,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config : log_config :
{ {
global_log_level ="info"; global_log_level ="info";
......
...@@ -235,6 +235,15 @@ NETWORK_CONTROLLER : ...@@ -235,6 +235,15 @@ NETWORK_CONTROLLER :
FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no"; FLEXRAN_AWAIT_RECONF = "no";
}; };
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
/* /*
log_config : log_config :
{ {
......
...@@ -225,6 +225,15 @@ RUs = ( ...@@ -225,6 +225,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config : log_config :
{ {
global_log_level ="info"; global_log_level ="info";
......
...@@ -238,6 +238,15 @@ NETWORK_CONTROLLER : ...@@ -238,6 +238,15 @@ NETWORK_CONTROLLER :
FLEXRAN_AWAIT_RECONF = "no"; FLEXRAN_AWAIT_RECONF = "no";
}; };
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config : log_config :
{ {
global_log_level ="info"; global_log_level ="info";
......
...@@ -192,6 +192,15 @@ RUs = ( ...@@ -192,6 +192,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config : log_config :
{ {
global_log_level ="info"; global_log_level ="info";
......
...@@ -199,6 +199,15 @@ RUs = ( ...@@ -199,6 +199,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config = { log_config = {
global_log_level ="info"; global_log_level ="info";
global_log_verbosity ="medium"; global_log_verbosity ="medium";
......
...@@ -182,6 +182,15 @@ MACRLCs = ( ...@@ -182,6 +182,15 @@ MACRLCs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config : log_config :
{ {
global_log_level ="debug"; global_log_level ="debug";
......
...@@ -210,6 +210,15 @@ MACRLCs = ( ...@@ -210,6 +210,15 @@ MACRLCs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config = log_config =
{ {
global_log_level ="info"; global_log_level ="info";
......
...@@ -198,6 +198,15 @@ RUs = ( ...@@ -198,6 +198,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config = { log_config = {
global_log_level ="info"; global_log_level ="info";
global_log_verbosity ="medium"; global_log_verbosity ="medium";
......
...@@ -197,6 +197,15 @@ RUs = ( ...@@ -197,6 +197,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config = { log_config = {
global_log_level ="info"; global_log_level ="info";
global_log_verbosity ="medium"; global_log_verbosity ="medium";
......
...@@ -17,6 +17,15 @@ RUs = ( ...@@ -17,6 +17,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config = { log_config = {
global_log_level ="info"; global_log_level ="info";
global_log_verbosity ="medium"; global_log_verbosity ="medium";
......
...@@ -18,6 +18,15 @@ RUs = ( ...@@ -18,6 +18,15 @@ RUs = (
} }
); );
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
log_config = { log_config = {
global_log_level ="info"; global_log_level ="info";
global_log_verbosity ="medium"; global_log_verbosity ="medium";
......
...@@ -151,7 +151,8 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); ...@@ -151,7 +151,8 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
#endif #endif
extern int codingw; extern PARALLEL_CONF_t get_thread_parallel_conf(void);
extern WORKER_CONF_t get_thread_worker_conf(void);
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf); extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
...@@ -223,7 +224,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -223,7 +224,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 );
if(!eNB->single_thread_flag && get_nprocs() >= 8){ if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT){
if(wait_on_condition(&proc[1].mutex_rxtx,&proc[1].cond_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) { if(wait_on_condition(&proc[1].mutex_rxtx,&proc[1].cond_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) {
LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx); LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx);
return(-1); return(-1);
...@@ -245,7 +246,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -245,7 +246,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
/* CONFLICT RESOLUTION: BEGIN */ /* CONFLICT RESOLUTION: BEGIN */
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
if(oai_exit) return(-1); if(oai_exit) return(-1);
if(eNB->single_thread_flag || get_nprocs() <= 4){ if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD){
#ifndef PHY_TX_THREAD #ifndef PHY_TX_THREAD
phy_procedures_eNB_TX(eNB, proc, 1); phy_procedures_eNB_TX(eNB, proc, 1);
#endif #endif
...@@ -421,8 +422,8 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -421,8 +422,8 @@ static void* eNB_thread_rxtx( void* param ) {
} }
pthread_mutex_unlock( &proc->mutex_rxtx ); pthread_mutex_unlock( &proc->mutex_rxtx );
if (nfapi_mode!=2){ if (nfapi_mode!=2){
if(get_nprocs() >= 8) wakeup_tx(eNB,eNB->proc.ru_proc); if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,eNB->proc.ru_proc);
else else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT)
{ {
phy_procedures_eNB_TX(eNB, proc, 1); phy_procedures_eNB_TX(eNB, proc, 1);
wakeup_txfh(proc,eNB->proc.ru_proc); wakeup_txfh(proc,eNB->proc.ru_proc);
...@@ -881,7 +882,7 @@ static void* process_stats_thread(void* param) { ...@@ -881,7 +882,7 @@ static void* process_stats_thread(void* param) {
void init_eNB_proc(int inst) { void init_eNB_proc(int inst) {
int i=0; /*int i=0;*/
int CC_id; int CC_id;
PHY_VARS_eNB *eNB; PHY_VARS_eNB *eNB;
eNB_proc_t *proc; eNB_proc_t *proc;
...@@ -953,7 +954,7 @@ void init_eNB_proc(int inst) { ...@@ -953,7 +954,7 @@ void init_eNB_proc(int inst) {
// attr_te = &proc->attr_te; // attr_te = &proc->attr_te;
#endif #endif
if(get_nprocs() > 2 && codingw) if(get_thread_worker_conf() == WORKER_ENABLE)
{ {
init_te_thread(eNB); init_te_thread(eNB);
init_td_thread(eNB); init_td_thread(eNB);
...@@ -962,7 +963,7 @@ void init_eNB_proc(int inst) { ...@@ -962,7 +963,7 @@ void init_eNB_proc(int inst) {
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag); LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
if (eNB->single_thread_flag==0 && nfapi_mode!=2) { if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc ); pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc); pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc);
} }
...@@ -970,13 +971,13 @@ void init_eNB_proc(int inst) { ...@@ -970,13 +971,13 @@ void init_eNB_proc(int inst) {
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB ); pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
#endif #endif
char name[16]; /*char name[16];
if (eNB->single_thread_flag==0) { if (eNB->single_thread_flag==0) {
snprintf( name, sizeof(name), "RXTX0 %d", i ); snprintf( name, sizeof(name), "RXTX0 %d", i );
pthread_setname_np( proc_rxtx[0].pthread_rxtx, name ); pthread_setname_np( proc_rxtx[0].pthread_rxtx, name );
snprintf( name, sizeof(name), "RXTX1 %d", i ); snprintf( name, sizeof(name), "RXTX1 %d", i );
pthread_setname_np( proc_rxtx[1].pthread_rxtx, name ); pthread_setname_np( proc_rxtx[1].pthread_rxtx, name );
} }*/
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach); AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
...@@ -1029,7 +1030,7 @@ void kill_eNB_proc(int inst) { ...@@ -1029,7 +1030,7 @@ void kill_eNB_proc(int inst) {
proc = &eNB->proc; proc = &eNB->proc;
proc_rxtx = &proc->proc_rxtx[0]; proc_rxtx = &proc->proc_rxtx[0];
if(get_nprocs() > 2 && codingw) { if(get_thread_worker_conf() == WORKER_ENABLE) {
kill_td_thread(eNB); kill_td_thread(eNB);
kill_te_thread(eNB); kill_te_thread(eNB);
} }
...@@ -1323,8 +1324,8 @@ void init_eNB(int single_thread_flag,int wait_for_sync) { ...@@ -1323,8 +1324,8 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
#endif #endif
eNB->td = ulsch_decoding_data_all;//(get_nprocs()<=4) ? ulsch_decoding_data : ulsch_decoding_data_2thread; eNB->td = ulsch_decoding_data_all;
eNB->te = dlsch_encoding_all;//(get_nprocs()<=4) ? dlsch_encoding : dlsch_encoding_2threads; eNB->te = dlsch_encoding_all;
LOG_I(PHY,"Registering with MAC interface module\n"); LOG_I(PHY,"Registering with MAC interface module\n");
......
...@@ -119,10 +119,10 @@ static int DEFENBS[] = {0}; ...@@ -119,10 +119,10 @@ static int DEFENBS[] = {0};
extern volatile int oai_exit; extern volatile int oai_exit;
extern int emulate_rf; extern int emulate_rf;
extern int numerology; extern int numerology;
extern int fepw;
extern int single_thread_flag;
extern clock_source_t clock_source; extern clock_source_t clock_source;
extern PARALLEL_CONF_t get_thread_parallel_conf(void);
extern WORKER_CONF_t get_thread_worker_conf(void);
extern void phy_init_RU(RU_t*); extern void phy_init_RU(RU_t*);
extern void phy_free_RU(RU_t*); extern void phy_free_RU(RU_t*);
...@@ -1257,7 +1257,7 @@ void wakeup_eNBs(RU_t *ru) { ...@@ -1257,7 +1257,7 @@ void wakeup_eNBs(RU_t *ru) {
LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top); LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
if (ru->num_eNB==1 && ru->eNB_top!=0 && (get_nprocs() <= 4 || single_thread_flag)) { if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) {
// call eNB function directly // call eNB function directly
char string[20]; char string[20];
...@@ -1456,6 +1456,12 @@ int setup_RU_buffers(RU_t *ru) { ...@@ -1456,6 +1456,12 @@ int setup_RU_buffers(RU_t *ru) {
if (frame_parms->N_RB_DL == 100) ru->N_TA_offset = 624; if (frame_parms->N_RB_DL == 100) ru->N_TA_offset = 624;
else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2; else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2;
else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4; else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4;
#if BASIC_SIMULATOR
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
ru->N_TA_offset = 0;
#endif
} }
if (ru->openair0_cfg.mmapped_dma == 1) { if (ru->openair0_cfg.mmapped_dma == 1) {
// replace RX signal buffers with mmaped HW versions // replace RX signal buffers with mmaped HW versions
...@@ -1782,7 +1788,7 @@ static void* ru_thread( void* param ) { ...@@ -1782,7 +1788,7 @@ static void* ru_thread( void* param ) {
if (ru->num_eNB>0) wakeup_eNBs(ru); if (ru->num_eNB>0) wakeup_eNBs(ru);
#ifndef PHY_TX_THREAD #ifndef PHY_TX_THREAD
if(get_nprocs() <= 4 || ru->num_eNB==0 || single_thread_flag){ if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0){
// do TX front-end processing if needed (precoding and/or IDFTs) // do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru); if (ru->feptx_prec) ru->feptx_prec(ru);
...@@ -2195,7 +2201,7 @@ void init_RU_proc(RU_t *ru) { ...@@ -2195,7 +2201,7 @@ void init_RU_proc(RU_t *ru) {
if(emulate_rf) if(emulate_rf)
pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void*)proc ); pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void*)proc );
if (!single_thread_flag && get_nprocs() > 4) if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)
pthread_create( &proc->pthread_FH1, attr_FH1, ru_thread_tx, (void*)ru ); pthread_create( &proc->pthread_FH1, attr_FH1, ru_thread_tx, (void*)ru );
if (ru->function == NGFI_RRU_IF4p5) { if (ru->function == NGFI_RRU_IF4p5) {
...@@ -2222,7 +2228,7 @@ void init_RU_proc(RU_t *ru) { ...@@ -2222,7 +2228,7 @@ void init_RU_proc(RU_t *ru) {
pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru ); pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru );
} }
if (get_nprocs()> 2 && fepw) { if (get_thread_worker_conf() == WORKER_ENABLE) {
init_fep_thread(ru,NULL); init_fep_thread(ru,NULL);
init_feptx_thread(ru,NULL); init_feptx_thread(ru,NULL);
} }
...@@ -2260,7 +2266,7 @@ void kill_RU_proc(RU_t *ru) ...@@ -2260,7 +2266,7 @@ void kill_RU_proc(RU_t *ru)
pthread_cond_destroy( &proc->cond_rf_tx); pthread_cond_destroy( &proc->cond_rf_tx);
#endif #endif
if (get_nprocs() > 2 && fepw) { if (get_thread_worker_conf() == WORKER_ENABLE) {
LOG_D(PHY, "killing FEP thread\n"); LOG_D(PHY, "killing FEP thread\n");
kill_fep_thread(ru); kill_fep_thread(ru);
LOG_D(PHY, "killing FEP TX thread\n"); LOG_D(PHY, "killing FEP TX thread\n");
...@@ -2309,7 +2315,7 @@ void kill_RU_proc(RU_t *ru) ...@@ -2309,7 +2315,7 @@ void kill_RU_proc(RU_t *ru)
LOG_D(PHY, "Joining pthread_FH\n"); LOG_D(PHY, "Joining pthread_FH\n");
pthread_join(proc->pthread_FH, NULL); pthread_join(proc->pthread_FH, NULL);
if (!single_thread_flag && get_nprocs() > 4) { if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) {
LOG_D(PHY, "Joining pthread_FHTX\n"); LOG_D(PHY, "Joining pthread_FHTX\n");
pthread_join(proc->pthread_FH1, NULL); pthread_join(proc->pthread_FH1, NULL);
} }
...@@ -2583,8 +2589,8 @@ void set_function_spec_param(RU_t *ru) ...@@ -2583,8 +2589,8 @@ void set_function_spec_param(RU_t *ru)
ru->fh_north_out = fh_if4p5_north_out; // send_IF4p5 on reception ru->fh_north_out = fh_if4p5_north_out; // send_IF4p5 on reception
ru->fh_south_out = tx_rf; // send output to RF ru->fh_south_out = tx_rf; // send output to RF
ru->fh_north_asynch_in = fh_if4p5_north_asynch_in; // TX packets come asynchronously ru->fh_north_asynch_in = fh_if4p5_north_asynch_in; // TX packets come asynchronously
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full :ru_fep_full_2thread; // RX DFTs ru->feprx = (get_thread_worker_conf() == WORKER_DISABLE) ? fep_full :ru_fep_full_2thread; // RX DFTs
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft only (no precoding in RRU) ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_DISABLE) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft only (no precoding in RRU)
ru->feptx_prec = NULL; ru->feptx_prec = NULL;
ru->start_if = start_if; // need to start the if interface for if4p5 ru->start_if = start_if; // need to start the if interface for if4p5
ru->ifdevice.host_type = RRU_HOST; ru->ifdevice.host_type = RRU_HOST;
...@@ -2605,8 +2611,8 @@ void set_function_spec_param(RU_t *ru) ...@@ -2605,8 +2611,8 @@ void set_function_spec_param(RU_t *ru)
} }
else if (ru->function == eNodeB_3GPP) { else if (ru->function == eNodeB_3GPP) {
ru->do_prach = 0; // no prach processing in RU ru->do_prach = 0; // no prach processing in RU
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full : ru_fep_full_2thread; // RX DFTs ru->feprx = (get_thread_worker_conf() == WORKER_DISABLE) ? fep_full : ru_fep_full_2thread; // RX DFTs
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft and precoding ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_DISABLE) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft and precoding
ru->feptx_prec = feptx_prec; // this is fep with idft and precoding ru->feptx_prec = feptx_prec; // this is fep with idft and precoding
ru->fh_north_in = NULL; // no incoming fronthaul from north ru->fh_north_in = NULL; // no incoming fronthaul from north
ru->fh_north_out = NULL; // no outgoing fronthaul to north ru->fh_north_out = NULL; // no outgoing fronthaul to north
...@@ -2634,9 +2640,9 @@ void set_function_spec_param(RU_t *ru) ...@@ -2634,9 +2640,9 @@ void set_function_spec_param(RU_t *ru)
case REMOTE_IF5: // the remote unit is IF5 RRU case REMOTE_IF5: // the remote unit is IF5 RRU
ru->do_prach = 0; ru->do_prach = 0;
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full : fep_full; // this is frequency-shift + DFTs ru->feprx = (get_thread_worker_conf() == WORKER_DISABLE) ? fep_full : fep_full; // this is frequency-shift + DFTs
ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_DISABLE) ? feptx_ofdm : feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs
if (ru->if_timing == synch_to_other) { if (ru->if_timing == synch_to_other) {
ru->fh_south_in = fh_slave_south_in; // synchronize to master ru->fh_south_in = fh_slave_south_in; // synchronize to master
ru->fh_south_out = fh_if5_mobipass_south_out; // use send_IF5 for mobipass ru->fh_south_out = fh_if5_mobipass_south_out; // use send_IF5 for mobipass
......
...@@ -219,8 +219,31 @@ extern void init_eNB_afterRU(void); ...@@ -219,8 +219,31 @@ extern void init_eNB_afterRU(void);
int transmission_mode=1; int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
int codingw = 0; char *parallel_config = NULL;
int fepw = 0; char *worker_config = NULL;
static THREAD_STRUCT thread_struct;
void set_parallel_conf(char *parallel_conf)
{
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
}
void set_worker_conf(char *worker_conf)
{
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
}
PARALLEL_CONF_t get_thread_parallel_conf(void)
{
return thread_struct.parallel_conf;
}
WORKER_CONF_t get_thread_worker_conf(void)
{
return thread_struct.worker_conf;
}
...@@ -321,7 +344,15 @@ void signal_handler(int sig) { ...@@ -321,7 +344,15 @@ void signal_handler(int sig) {
#define KBLU "\x1B[34m" #define KBLU "\x1B[34m"
#define RESET "\033[0m" #define RESET "\033[0m"
#if defined(ENABLE_ITTI)
void signal_handler_itti(int sig) {
// Call exit function
char msg[256];
memset(msg, 0, 256);
sprintf(msg, "caught signal %s\n", strsignal(sig));
exit_function(__FILE__, __FUNCTION__, __LINE__, msg);
}
#endif
void exit_function(const char* file, const char* function, const int line, const char* s) void exit_function(const char* file, const char* function, const int line, const char* s)
{ {
...@@ -546,6 +577,8 @@ static void get_options(unsigned int *start_msc) { ...@@ -546,6 +577,8 @@ static void get_options(unsigned int *start_msc) {
RC.nb_nb_iot_rrc_inst=RC.nb_nb_iot_L1_inst=RC.nb_nb_iot_macrlc_inst=0; RC.nb_nb_iot_rrc_inst=RC.nb_nb_iot_L1_inst=RC.nb_nb_iot_macrlc_inst=0;
} }
} }
if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config);
} }
...@@ -954,6 +987,11 @@ int main( int argc, char **argv ) ...@@ -954,6 +987,11 @@ int main( int argc, char **argv )
signal(SIGINT, signal_handler); signal(SIGINT, signal_handler);
#endif #endif
#if defined(ENABLE_ITTI)
signal(SIGINT, signal_handler_itti);
signal(SIGTERM, signal_handler_itti);
signal(SIGABRT, signal_handler_itti);
#endif
check_clock(); check_clock();
......
...@@ -92,9 +92,9 @@ ...@@ -92,9 +92,9 @@
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
#define CONFIG_HLP_CODINGW "coding worker thread enable(disable by defult)\n"
#define CONFIG_HLP_FEPW "FEP worker thread enabled(disable by defult)\n"
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n"
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
...@@ -186,9 +186,9 @@ ...@@ -186,9 +186,9 @@
{"s" , CONFIG_HLP_SNR, 0, iptr:&snr_dB, defintval:25, TYPE_INT, 0}, \ {"s" , CONFIG_HLP_SNR, 0, iptr:&snr_dB, defintval:25, TYPE_INT, 0}, \
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \ {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \ {"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
{"codingw" , CONFIG_HLP_CODINGW, PARAMFLAG_BOOL, iptr:&codingw, defintval:0, TYPE_INT, 0}, \ {"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \
{"fepw" , CONFIG_HLP_FEPW, PARAMFLAG_BOOL, iptr:&fepw, defintval:0, TYPE_INT, 0}, \ {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
} }
#define CONFIG_HLP_FLOG "Enable online log \n" #define CONFIG_HLP_FLOG "Enable online log \n"
...@@ -279,6 +279,10 @@ PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -279,6 +279,10 @@ PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t UE_id, uint8_t UE_id,
uint8_t abstraction_flag); uint8_t abstraction_flag);
void init_eNB_afterRU(void); void init_eNB_afterRU(void);
PARALLEL_CONF_t get_thread_parallel_conf(void);
WORKER_CONF_t get_thread_worker_conf(void);
void set_parallel_conf(char *parallel_conf);
void set_worker_conf(char *worker_conf);
extern int stop_L1L2(module_id_t enb_id); extern int stop_L1L2(module_id_t enb_id);
extern int restart_L1L2(module_id_t enb_id); extern int restart_L1L2(module_id_t enb_id);
......
...@@ -333,6 +333,13 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti ...@@ -333,6 +333,13 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
} }
else UE->N_TA_offset = 0; else UE->N_TA_offset = 0;
#if BASIC_SIMULATOR
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
UE->N_TA_offset = 0;
#endif
if (simL1flag == 1) init_ue_devices(UE); if (simL1flag == 1) init_ue_devices(UE);
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
init_UE_threads(inst); init_UE_threads(inst);
......
...@@ -220,8 +220,31 @@ int transmission_mode=1; ...@@ -220,8 +220,31 @@ int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
int codingw = 0; char *parallel_config = NULL;
int fepw = 0; char *worker_config = NULL;
static THREAD_STRUCT thread_struct;
void set_parallel_conf(char *parallel_conf)
{
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
}
void set_worker_conf(char *worker_conf)
{
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
}
PARALLEL_CONF_t get_thread_parallel_conf(void)
{
return thread_struct.parallel_conf;
}
WORKER_CONF_t get_thread_worker_conf(void)
{
return thread_struct.worker_conf;
}
/* struct for ethernet specific parameters given in eNB conf file */ /* struct for ethernet specific parameters given in eNB conf file */
eth_params_t *eth_params; eth_params_t *eth_params;
...@@ -583,6 +606,8 @@ static void get_options(unsigned int *start_msc) { ...@@ -583,6 +606,8 @@ static void get_options(unsigned int *start_msc) {
if(nfapi_mode!=3) if(nfapi_mode!=3)
uecap_xer_in=1; uecap_xer_in=1;
} *//* UE with config file */ } *//* UE with config file */
if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config);
} }
...@@ -800,6 +825,8 @@ int main( int argc, char **argv ) ...@@ -800,6 +825,8 @@ int main( int argc, char **argv )
for (int i=0;i<MAX_NUM_CCs;i++) tx_max_power[i]=23; for (int i=0;i<MAX_NUM_CCs;i++) tx_max_power[i]=23;
get_options (&start_msc); get_options (&start_msc);
printf("~~~~~~~~~~~~~~~~~~~~successfully get the parallel config[%d], worker config [%d] \n", get_thread_parallel_conf(), get_thread_worker_conf());
printf("Running with %d UE instances\n",NB_UE_INST); printf("Running with %d UE instances\n",NB_UE_INST);
if (NB_UE_INST > 1 && simL1flag != 1) { if (NB_UE_INST > 1 && simL1flag != 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment