From 1efbfa530425c9ec304ddf1b46b1dc2762fd5b40 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 20 May 2019 11:26:06 +0200 Subject: [PATCH 1/2] bugfix: fix UE realtime bug When pushing traffic with iperf the UE was crashing. The argument passed to pthread_mutex_timedlock is absolute time based on the CLOCK_REALTIME timer, not relative time. That seems to be the root cause of the bug. (That there is a timeout is another story.) This commit uses absolute value. Also we separate cases between IS_SOFTMODEM_BASICSIM / IS_SOFTMODEM_RFSIM and standard realtime UE. In the 'sim' modes we don't care about timeout and just call pthread_mutex_lock. It seems to be the idea of the original work. If not, then to be fixed. --- targets/RT/USER/lte-ue.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 0a6df78682..d2e8c6ad46 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1503,6 +1503,7 @@ void *UE_thread(void *arg) { int i; int th_id; static uint8_t thread_idx = 0; + int ret; cpu_set_t cpuset; CPU_ZERO(&cpuset); @@ -1724,15 +1725,27 @@ void *UE_thread(void *arg) { } pickTime(gotIQs); - struct timespec tv= {0}; - tv.tv_nsec=10*1000; - if( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) - tv.tv_sec=INT_MAX; + /* no timeout in IS_SOFTMODEM_BASICSIM or IS_SOFTMODEM_RFSIM mode */ + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) { + ret = pthread_mutex_lock(&proc->mutex_rxtx); + } else { + struct timespec tv; + if (clock_gettime(CLOCK_REALTIME, &tv) != 0) { + perror("clock_gettime"); + exit(1); + } + tv.tv_nsec += 10*1000; + if (tv.tv_nsec >= 1000 * 1000 * 1000) { + tv.tv_sec++; + tv.tv_nsec -= 1000 * 1000 * 1000; + } + ret = pthread_mutex_timedlock(&proc->mutex_rxtx, &tv); + } // operate on thread sf mod 2 - if (pthread_mutex_timedlock(&proc->mutex_rxtx, &tv) !=0) { - if ( errno == ETIMEDOUT) { + if (ret != 0) { + if (ret == ETIMEDOUT) { LOG_E(PHY,"Missed real time\n"); continue; } else { From cbf1e1f7f233bb480fa200e973950924fe3ecf31 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 20 May 2019 16:37:19 +0200 Subject: [PATCH 2/2] CI: adding high throughput DL iperf tests w/ OAI UE Signed-off-by: Raphael Defosseux --- ci-scripts/reportTestLocally.sh | 8 ++++---- ci-scripts/runTestOnVM.sh | 2 +- .../xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml | 6 +++--- .../xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index e4195edde0..228f9882d7 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -508,26 +508,26 @@ function report_test { NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG` NB_ENB_SYNCED_WITH_UE=`egrep -c "Sending NFAPI_START_RESPONSE" $UE_LOG` - if [ $NB_ENB_GOT_SYNC -eq 1 ] && [ $NB_UE_GOT_SYNC -eq 3 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] + if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 2 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] then echo " OK" >> ./test_simulator_results.html else echo " KO" >> ./test_simulator_results.html fi echo "
" >> ./test_simulator_results.html
-                    if [ $NB_ENB_GOT_SYNC -eq 1 ]
+                    if [ $NB_ENB_GOT_SYNC -gt 0 ]
                     then
                         echo "- eNB --> got sync" >> ./test_simulator_results.html
                     else
                         echo "- eNB NEVER got sync" >> ./test_simulator_results.html
                     fi
-                    if [ $NB_UE_GOT_SYNC -eq 3 ]
+                    if [ $NB_UE_GOT_SYNC -gt 2 ]
                     then
                         echo "- UE --> got sync" >> ./test_simulator_results.html
                     else
                         echo "- UE NEVER got sync" >> ./test_simulator_results.html
                     fi
-                    if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
+                    if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
                     then
                         echo "- UE attached to eNB" >> ./test_simulator_results.html
                     else
diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh
index 9433167e54..dbd2930dee 100755
--- a/ci-scripts/runTestOnVM.sh
+++ b/ci-scripts/runTestOnVM.sh
@@ -1279,7 +1279,7 @@ function run_test_on_vm {
           do
               # Not Running in TDD-10MHz and TDD-20MHz : too unstable
               #if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then continue; fi
-              #if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi
+              if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi
 
               if [[ $BW =~ .*05.* ]]; then PRB=25; fi
               if [[ $BW =~ .*10.* ]]; then PRB=50; fi
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
index cded08284a..f20001b29a 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
@@ -26,7 +26,7 @@
 	tasks
 	
  030201 090109
- 030101 000001 090101 000002 040501 040502 000001 040601 040641 040642 000001 090109 030201
+ 030101 000001 090101 000002 040501 040502 000001 040601 040602 040641 040642 000001 090109 030201
 	
 	
 
@@ -93,8 +93,8 @@
 
         
 		Iperf
-		iperf (5MHz - DL/1.2Mbps/UDP)(30 sec)
-		-c 10.0.1.2 -u -b 1.2M -t 30 -i 1 -fm -B 10.0.1.1
+		iperf (5MHz - DL/14Mbps/UDP)(30 sec)
+		-c 10.0.1.2 -u -b 14M -t 30 -i 1 -fm -B 10.0.1.1
 		50
         
 
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
index 15735d94db..3a7ddfba0b 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
@@ -26,7 +26,7 @@
 	tasks
 	
  030201 090109
- 030102 000001 090102 000002 040503 000001 040603 040643 040644 000001 090109 030201
+ 030102 000001 090102 000002 040503 000001 040603 040604 040643 040644 000001 090109 030201
 	
 	
 
@@ -80,8 +80,8 @@
 
         
 		Iperf
-		iperf (5MHz - DL/1.2Mbps/UDP)(30 sec)
-		-b 1.2M -t 30 -i 1 -fm
+		iperf (5MHz - DL/14Mbps/UDP)(30 sec)
+		-u -b 14M -t 30 -i 1 -fm
 		50