diff --git a/ci-scripts/args_parse.py b/ci-scripts/args_parse.py index 7196d266d8..af9eb8ca6b 100644 --- a/ci-scripts/args_parse.py +++ b/ci-scripts/args_parse.py @@ -227,14 +227,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM,CLUST elif re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE) EPC.ContainerPrefix=matchReg.group(1) - elif re.match('^\-\-ADBIPAddress=(.+)$', myArgv, re.IGNORECASE): - print("ignoring --ADBIPAddress parameter") - elif re.match('^\-\-ADBUserName=(.+)$', myArgv, re.IGNORECASE): - print("ignoring --ADBUserName parameter") - elif re.match('^\-\-ADBType=(.+)$', myArgv, re.IGNORECASE): - print("ignoring --ADBType parameter") - elif re.match('^\-\-ADBPassword=(.+)$', myArgv, re.IGNORECASE): - print("ignoring --ADBPassword parameter") elif re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE) CiTestObj.testXMLfiles.append(matchReg.group(1)) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 7cddae85db..8c684a62d8 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -879,8 +879,8 @@ class Containerize(): cnt += 1 mySSH.command('docker inspect --format="ImageUsed: {{.Config.Image}}" ' + containerName, '\$', 5) for stdoutLine in mySSH.getBefore().split('\n'): - if stdoutLine.count('ImageUsed: porcepix'): - usedImage = stdoutLine.replace('ImageUsed: porcepix', 'porcepix').strip() + if stdoutLine.count('ImageUsed: oai-ci'): + usedImage = stdoutLine.replace('ImageUsed: oai-ci', 'oai-ci').strip() logging.debug('Used image is ' + usedImage) if usedImage != '': mySSH.command('docker image inspect --format "* Size = {{.Size}} bytes\n* Creation = {{.Created}}\n* Id = {{.Id}}" ' + usedImage, '\$', 5, silent=True) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 3e23712ea2..623fc928c0 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -58,79 +58,6 @@ logging.getLogger("matplotlib").setLevel(logging.WARNING) import matplotlib.pyplot as plt import numpy as np -#----------------------------------------------------------- -# Utility functions -#----------------------------------------------------------- - -def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold): - #ping time values read from file - t_ping=[] - #ping stats (dictionary) to be returned by the function - ping_stat={} - if (os.path.isfile(ping_log_file)): - with open(ping_log_file,"r") as f: - for line in f: - #looking for time=xxx ms field - result=re.match('^.+time=(?P[0-9\.]+)',line) - if result != None: - t_ping.append(float(result.group('ping_time'))) - - #initial stats - ping_stat['min_0']=min(t_ping) - ping_stat['mean_0']=stat.mean(t_ping) - ping_stat['median_0']=stat.median(t_ping) - ping_stat['max_0']=max(t_ping) - - #get index of max value - - max_loc=t_ping.index(max(t_ping)) - ping_stat['max_loc']=max_loc - #remove it - t_ping_post=t_ping.copy() - t_ping_post.pop(max_loc) - #new stats after removing max value - ping_stat['min_1']=min(t_ping_post) - ping_stat['mean_1']=stat.mean(t_ping_post) - ping_stat['median_1']=stat.median(t_ping_post) - ping_stat['max_1']=max(t_ping_post) - - #plot ping over time and save png for artifacts - ticks = np.arange(0, len(t_ping), 1) - figure, axis = plt.subplots(figsize=(10, 10)) - axis.plot(ticks,t_ping,marker='o') - axis.set_xlabel('Ping Events') - axis.set_ylabel("Ping RTT (in ms)") - axis.set_title(ping_log_file) - axis.set_xticks(ticks) - axis.set_xticklabels([]) - YMAX=20 #base scale - if max(t_ping) > YMAX: - y_max=max(t_ping)+1 - else: - y_max=YMAX+1 - plt.ylim(0,y_max) - if ping_rttavg_threshold != '': - th_label="AVG Ping Fail Threshold="+ping_rttavg_threshold - plt.axhline(y=float(ping_rttavg_threshold), color='r', linestyle='-',label=th_label) - axis.legend() - plt.savefig(ping_log_file+'.png') - - #copy the png file already to enb to move it move it later into the artifacts - try: - mySSH = sshconnection.SSHConnection() - mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/') - mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file, RAN.eNBSourceCodePath + '/cmake_targets/') - except: - logging.debug('\u001B[1;37;41m Ping PNG SCP to eNB FAILED\u001B[0m') - - return ping_stat - - else: - logging.error("GetPingTimeAnalysis : Ping log file does not exist") - return -1 - - - #----------------------------------------------------------- # OaiCiTest Class Definition #----------------------------------------------------------- @@ -576,298 +503,133 @@ class OaiCiTest(): statusQueue.put(message) lock.release() - def Ping_common(self, lock, statusQueue,EPC, ue, RAN): - try: - # Launch ping on the EPC side (true for ltebox and old open-air-cn) - # But for OAI-Rel14-CUPS, we launch from python executor - ping_status = 0 + def Ping_common(self, EPC, ue, RAN): + # Launch ping on the EPC side (true for ltebox and old open-air-cn) + # But for OAI-Rel14-CUPS, we launch from python executor + ping_status = 0 + ueIP = ue.getIP() + if not ueIP: + return (False, f"UE {ue.getName()} has no IP address") + launchFromEpc = False + ping_log_file = f'ping_{self.testCase_id}_{ue.getName()}.log' + if re.match('OAI-Rel14-CUPS', EPC.Type, re.IGNORECASE): launchFromEpc = False - ping_log_file = f'ping_{self.testCase_id}_{ue.getName()}.log' - if re.match('OAI-Rel14-CUPS', EPC.Type, re.IGNORECASE): - launchFromEpc = False - ping_time = re.findall("-c *(\d+)",str(self.ping_args)) - if launchFromEpc: - SSH = sshconnection.SSHConnection() - SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) - SSH.command('cd ' + EPC.SourceCodePath, '\$', 5) - SSH.command('cd scripts', '\$', 5) - # In case of a docker-based deployment, we need to ping from the trf-gen container - launchFromTrfContainer = False - if (re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE)) or (re.match('OAICN5G', EPC.Type, re.IGNORECASE)): - launchFromTrfContainer = True - if launchFromTrfContainer: - ping_status = SSH.command(f'docker exec -it prod-trf-gen /bin/bash -c "ping {self.ping_args} {ue.getIP()}" 2>&1 | tee {ping_log_file}', '\$', int(ping_time[0])*1.5) - else: - ping_status = SSH.command(f'stdbuf -o0 ping {self.ping_args} {ue.getIP()} 2>&1 | stdbuf -o0 tee {ping_log_file}', '\$', int(ping_time[0])*1.5) - #copy the ping log file to have it locally for analysis (ping stats) - SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/scripts/{ping_log_file}', '.') - SSH.close() + ping_time = re.findall("-c *(\d+)",str(self.ping_args)) + if launchFromEpc: + SSH = sshconnection.SSHConnection() + SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + SSH.command('cd ' + EPC.SourceCodePath, '\$', 5) + SSH.command('cd scripts', '\$', 5) + # In case of a docker-based deployment, we need to ping from the trf-gen container + launchFromTrfContainer = False + if (re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE)) or (re.match('OAICN5G', EPC.Type, re.IGNORECASE)): + launchFromTrfContainer = True + if launchFromTrfContainer: + ping_status = SSH.command(f'docker exec -it prod-trf-gen /bin/bash -c "ping {self.ping_args} {ueIP}" 2>&1 | tee {ping_log_file}', '\$', int(ping_time[0])*1.5) else: - #target address is different depending on EPC type - if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE): - Target = EPC.MmeIPAddress - elif re.match('OAICN5G', EPC.Type, re.IGNORECASE): - Target = EPC.MmeIPAddress - elif re.match('OC-OAI-CN5G', EPC.Type, re.IGNORECASE): - Target = "172.21.6.100" - else: - Target = EPC.IPAddress - #ping from module NIC rather than IP address to make sure round trip is over the air - interface = f'-I {ue.getIFName()}' if ue.getIFName() else '' - ping_cmd = f'{ue.getCmdPrefix()} ping {interface} {self.ping_args} {Target} &> /tmp/{ping_log_file}' - cmd = cls_cmd.getConnection(ue.getHost()) - response = cmd.run(ping_cmd, timeout=int(ping_time[0])*1.5) - if response.returncode != 0: - ping_status = -1 - else: - #copy the ping log file to have it locally for analysis (ping stats) - cmd.copyin(src=f'/tmp/{ping_log_file}', tgt=ping_log_file) - - cmd.close() - - # TIMEOUT CASE - if ping_status < 0: - message = 'Ping with UE (' + str(ue.getIP()) + ') crashed due to TIMEOUT!' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.ping_iperf_wrong_exit(lock, ue.getIP(), ue.getName(), statusQueue, message) - return - #search is done on cat result - with open(ping_log_file, 'r') as f: - ping_output = "".join(f.readlines()) - result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', ping_output) - if result is None: - message = 'Packet Loss Not Found!' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.ping_iperf_wrong_exit(lock, ue.getIP(), ue.getName(), statusQueue, message) - return - packetloss = result.group('packetloss') - if float(packetloss) == 100: - message = 'Packet Loss is 100%' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.ping_iperf_wrong_exit(lock, ue.getIP(), ue.getName(), statusQueue, message) - return - result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', ping_output) - if result is None: - message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.ping_iperf_wrong_exit(lock, ue.getIP(), ue.getName(), statusQueue, message) - return - rtt_min = result.group('rtt_min') - rtt_avg = result.group('rtt_avg') - rtt_max = result.group('rtt_max') - pal_msg = 'Packet Loss : ' + packetloss + '%' - min_msg = 'RTT(Min) : ' + rtt_min + ' ms' - avg_msg = 'RTT(Avg) : ' + rtt_avg + ' ms' - max_msg = 'RTT(Max) : ' + rtt_max + ' ms' - - lock.acquire() - logging.debug('\u001B[1;37;44m ping result (' + ue.getIP() + ') \u001B[0m') - logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') - - #adding extra ping stats from local file - #ping_log_file variable is defined above in this function, depending on device/ue - ping_stat_msg='' - logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file) - ping_stat=GetPingTimeAnalysis(RAN,ping_log_file,self.ping_rttavg_threshold) - - if (ping_stat!=-1) and (len(ping_stat)!=0): - ping_stat_msg+='Ping stats before removing largest value : \n' - ping_stat_msg+='RTT(Min) : ' + str("{:.2f}".format(ping_stat['min_0'])) + 'ms \n' - ping_stat_msg+='RTT(Mean) : ' + str("{:.2f}".format(ping_stat['mean_0'])) + 'ms \n' - ping_stat_msg+='RTT(Median) : ' + str("{:.2f}".format(ping_stat['median_0'])) + 'ms \n' - ping_stat_msg+='RTT(Max) : ' + str("{:.2f}".format(ping_stat['max_0'])) + 'ms \n' - ping_stat_msg+='Max Index : ' + str(ping_stat['max_loc']) + '\n' - ping_stat_msg+='Ping stats after removing largest value : \n' - ping_stat_msg+='RTT(Min) : ' + str("{:.2f}".format(ping_stat['min_1'])) + 'ms \n' - ping_stat_msg+='RTT(Mean) : ' + str("{:.2f}".format(ping_stat['mean_1'])) + 'ms \n' - ping_stat_msg+='RTT(Median) : ' + str("{:.2f}".format(ping_stat['median_1'])) + 'ms \n' - ping_stat_msg+='RTT(Max) : ' + str("{:.2f}".format(ping_stat['max_1'])) + 'ms \n' - - #building html message - qMsg = pal_msg + '\n' + min_msg + '\n' + avg_msg + '\n' + max_msg + '\n' + ping_stat_msg - - #checking packet loss compliance - packetLossOK = True - if (packetloss is not None) : - if float(packetloss) > float(self.ping_packetloss_threshold): - qMsg += '\nPacket Loss too high' - logging.debug('\u001B[1;37;41m Packet Loss too high; Target: '+ self.ping_packetloss_threshold + '%\u001B[0m') - packetLossOK = False - elif float(packetloss) > 0: - qMsg += '\nPacket Loss is not 0%' - logging.debug('\u001B[1;30;43m Packet Loss is not 0% \u001B[0m') - - #checking RTT avg compliance - rttavgOK = True - if self.ping_rttavg_threshold != '': - if float(rtt_avg)>float(self.ping_rttavg_threshold): - ping_rttavg_error_msg = 'RTT(Avg) too high: ' + rtt_avg + ' ms; Target: '+ self.ping_rttavg_threshold+ ' ms' - qMsg += '\n'+ping_rttavg_error_msg - logging.debug('\u001B[1;37;41m'+ ping_rttavg_error_msg +' \u001B[0m') - rttavgOK = False - - if packetLossOK and rttavgOK: - statusQueue.put(0) - else: - statusQueue.put(-1) - statusQueue.put(ue.getName()) - statusQueue.put(ue.getIP()) - statusQueue.put(qMsg) - lock.release() - except: - logging.debug('exit from Ping_Common except') - os.kill(os.getppid(),signal.SIGUSR1) - - def PingNoS1_wrong_exit(self, qMsg,HTML): - message = 'OAI UE ping result\n{qMsg}' - HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', [message]) - - def PingNoS1(self,HTML,RAN,EPC,CONTAINERS): - SSH=sshconnection.SSHConnection() - check_eNB = True - check_OAI_UE = True - ping_from_eNB = re.search('oaitun_enb1', str(self.ping_args)) - if ping_from_eNB is not None: - if RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - else: - if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - try: - if ping_from_eNB is not None: - SSH.open(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword) - SSH.command('cd ' + RAN.eNBSourceCodePath + '/cmake_targets/', '\$', 5) - else: - SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword) - SSH.command('cd ' + self.UESourceCodePath + '/cmake_targets/', '\$', 5) - ping_time = re.findall("-c (\d+)",str(self.ping_args)) - ping_status = SSH.command('stdbuf -o0 ping ' + self.ping_args + ' 2>&1 | stdbuf -o0 tee ping_' + self.testCase_id + '.log', '\$', int(ping_time[0])*1.5) - # TIMEOUT CASE - if ping_status < 0: - message = 'Ping with OAI UE crashed due to TIMEOUT!' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.PingNoS1_wrong_exit(message,HTML) - return - result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', SSH.getBefore()) - if result is None: - message = 'Packet Loss Not Found!' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.PingNoS1_wrong_exit(message,HTML) - return - packetloss = result.group('packetloss') - if float(packetloss) == 100: - message = 'Packet Loss is 100%' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.PingNoS1_wrong_exit(message,HTML) - return - result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', SSH.getBefore()) - if result is None: - message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.PingNoS1_wrong_exit(message,HTML) - return - rtt_min = result.group('rtt_min') - rtt_avg = result.group('rtt_avg') - rtt_max = result.group('rtt_max') - pal_msg = 'Packet Loss : ' + packetloss + '%' - min_msg = 'RTT(Min) : ' + rtt_min + ' ms' - avg_msg = 'RTT(Avg) : ' + rtt_avg + ' ms' - max_msg = 'RTT(Max) : ' + rtt_max + ' ms' - logging.debug('\u001B[1;37;44m OAI UE ping result \u001B[0m') - logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') - qMsg = pal_msg + '\n' + min_msg + '\n' + avg_msg + '\n' + max_msg - packetLossOK = True - if packetloss is not None: - if float(packetloss) > float(self.ping_packetloss_threshold): - qMsg += '\nPacket Loss too high' - logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m') - packetLossOK = False - elif float(packetloss) > 0: - qMsg += '\nPacket Loss is not 0%' - logging.debug('\u001B[1;30;43m Packet Loss is not 0% \u001B[0m') + ping_status = SSH.command(f'stdbuf -o0 ping {self.ping_args} {ueIP} 2>&1 | stdbuf -o0 tee {ping_log_file}', '\$', int(ping_time[0])*1.5) + #copy the ping log file to have it locally for analysis (ping stats) + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/scripts/{ping_log_file}', '.') SSH.close() - message = f'OAI UE ping result\n{qMsg}' - if packetLossOK: - HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', [message]) + else: + #target address is different depending on EPC type + if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE): + Target = EPC.MmeIPAddress + elif re.match('OAICN5G', EPC.Type, re.IGNORECASE): + Target = EPC.MmeIPAddress + elif re.match('OC-OAI-CN5G', EPC.Type, re.IGNORECASE): + Target = "172.21.6.100" else: - HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', [message]) + Target = EPC.IPAddress + #ping from module NIC rather than IP address to make sure round trip is over the air + interface = f'-I {ue.getIFName()}' if ue.getIFName() else '' + ping_cmd = f'{ue.getCmdPrefix()} ping {interface} {self.ping_args} {Target} &> /tmp/{ping_log_file}' + cmd = cls_cmd.getConnection(ue.getHost()) + response = cmd.run(ping_cmd, timeout=int(ping_time[0])*1.5) + if response.returncode != 0: + ping_status = -1 + else: + #copy the ping log file to have it locally for analysis (ping stats) + cmd.copyin(src=f'/tmp/{ping_log_file}', tgt=ping_log_file) - # copying on the EPC server for logCollection - if ping_from_eNB is not None: - copyin_res = SSH.copyin(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, RAN.eNBSourceCodePath + '/cmake_targets/ping_' + self.testCase_id + '.log', '.') - else: - copyin_res = SSH.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/ping_' + self.testCase_id + '.log', '.') - if (copyin_res == 0): - SSH.copyout(EPC.IPAddress, EPC.UserName, EPC.Password, 'ping_' + self.testCase_id + '.log', EPC.SourceCodePath + '/scripts') - except: - os.kill(os.getppid(),signal.SIGUSR1) + cmd.close() + + # TIMEOUT CASE + ue_header = f'UE {ue.getName()} ({ueIP})' + if ping_status < 0: + message = ue_header + ': ping crashed: TIMEOUT?' + logging.error('\u001B[1;37;41m ' + message + ' \u001B[0m') + return (False, message) + #search is done on cat result + logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file) + with open(ping_log_file, 'r') as f: + ping_output = "".join(f.readlines()) + result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', ping_output) + if result is None: + message = ue_header + ': Packet Loss Not Found!' + logging.error('\u001B[1;37;41m ' + message + ' \u001B[0m') + return (False, message) + packetloss = result.group('packetloss') + result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', ping_output) + if result is None: + message = ue_header + ': Ping RTT_Min RTT_Avg RTT_Max Not Found!' + logging.error('\u001B[1;37;41m ' + message + ' \u001B[0m') + return (False, message) + rtt_min = result.group('rtt_min') + rtt_avg = result.group('rtt_avg') + rtt_max = result.group('rtt_max') + + pal_msg = f'Packet Loss: {packetloss}%' + min_msg = f'RTT(Min) : {rtt_min} ms' + avg_msg = f'RTT(Avg) : {rtt_avg} ms' + max_msg = f'RTT(Max) : {rtt_max} ms' + + logging.info(f'\u001B[1;37;44m ping result for {ue_header} \u001B[0m') + logging.info(f'\u001B[1;34m ' + pal_msg + '\u001B[0m') + logging.info(f'\u001B[1;34m ' + min_msg + '\u001B[0m') + logging.info(f'\u001B[1;34m ' + avg_msg + '\u001B[0m') + logging.info(f'\u001B[1;34m ' + max_msg + '\u001B[0m') + + message = f'{ue_header}\n{pal_msg}\n{min_msg}\n{avg_msg}\n{max_msg}' + + #checking packet loss compliance + if float(packetloss) > float(self.ping_packetloss_threshold): + message += '\nPacket Loss too high' + logging.error(f'\u001B[1;37;41m Packet Loss too high; Target: {self.ping_packetloss_threshold}%\u001B[0m') + return (False, message) + elif float(packetloss) > 0: + message += '\nPacket Loss is not 0%' + logging.info('\u001B[1;30;43m Packet Loss is not 0% \u001B[0m') + + if self.ping_rttavg_threshold != '': + if float(rtt_avg) > float(self.ping_rttavg_threshold): + ping_rttavg_error_msg = f'RTT(Avg) too high: {rtt_avg} ms; Target: {self.ping_rttavg_threshold} ms' + message += '\n' + ping_rttavg_error_msg + logging.error('\u001B[1;37;41m'+ ping_rttavg_error_msg +' \u001B[0m') + return (False, message) + + return (True, message) def Ping(self,HTML,RAN,EPC,CONTAINERS): - result = re.search('noS1', str(RAN.Initialize_eNB_args)) - if result is not None: - self.PingNoS1(HTML,RAN,EPC,CONTAINERS) - return if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') - check_eNB = True - if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'): - check_OAI_UE = True - else: - check_OAI_UE = False if self.ue_ids == []: raise Exception("no module names in self.ue_ids provided") - ues = [] - for ue_id in self.ue_ids: - ue = cls_module_ue.Module_UE(ue_id) - if not ue.getIP(): - logging.error("no IP addresses returned") - HTML.CreateHtmlTestRow(self.ping_args, 'KO', len(self.UEDevices), html_queue) - self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) - ues.append(ue) + + ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids] logging.debug(ues) - - multi_jobs = [] - i = 0 - lock = Lock() - status_queue = SimpleQueue() - for ue in ues: - p = Process(target = self.Ping_common, args = (lock,status_queue,EPC,ue,RAN,)) - p.daemon = True - p.start() - multi_jobs.append(p) - i = i + 1 - for job in multi_jobs: - job.join() - - if (status_queue.empty()): - HTML.CreateHtmlTestRow(self.ping_args, 'KO', CONST.ALL_PROCESSES_OK) - self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) + with concurrent.futures.ThreadPoolExecutor() as executor: + futures = [executor.submit(self.Ping_common, EPC, ue, RAN) for ue in ues] + results = [f.result() for f in futures] + # each result in results is a tuple, first member goes to successes, second to messages + successes, messages = map(list, zip(*results)) + if len(successes) == len(ues) and all(successes): + HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', messages) else: - ping_status = True - messages = [] - while (not status_queue.empty()): - count = status_queue.get() - if (count < 0): - ping_status = False - device_id = status_queue.get() - ip_addr = status_queue.get() - message = status_queue.get() - messages.append(f'UE ({device_id})\nIP Address : {ip_addr}\n{message}') - if (ping_status): - HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', messages) - else: - HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', messages) - self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) + HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', messages) + self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) def Iperf_ComputeTime(self): result = re.search('-t (?P\d+)', str(self.iperf_args)) diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 80da31a490..ee264b6c43 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -228,8 +228,8 @@ ci-scripts/yaml_files/nsa_b200_gnb 1 1 - 1,100,100,100 - 1,100,100,100 + 10,100,100,100 + 10,100,100,100 diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml index b862d90cfb..97b77e2499 100644 --- a/ci-scripts/xml_files/container_sa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml @@ -179,8 +179,8 @@ ci-scripts/yaml_files/sa_b200_gnb 0 0 - 1,100,100,100 - 1,100,100,100 + 10,100,100,100 + 10,100,100,100 diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 681ea63a0f..2d5769e3c9 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -121,6 +121,8 @@ check_supported_distribution() { "rhel8.5") return 0 ;; "rhel8.6") return 0 ;; "rhel8.7") return 0 ;; + "rhel8.8") return 0 ;; + "rhel8.9") return 0 ;; "rhel9.0") return 0 ;; "rhel9.1") return 0 ;; "rhel9.2") return 0 ;; diff --git a/openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu b/openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu index 72517edcdd..4c678699b5 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu +++ b/openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu @@ -56,13 +56,13 @@ __device__ char dev_dt [46*68*384]; __device__ char dev_llr[68*384]; __device__ unsigned char dev_tmp[68*384]; -h_element h_compact1 [46*19] = {}; +h_element h_compact1 [46*23] = {}; h_element h_compact2 [68*30] = {}; -__device__ h_element dev_h_compact1[46*19]; // used in kernel 1 +__device__ h_element dev_h_compact1[46*23]; // used in kernel 1 __device__ h_element dev_h_compact2[68*30]; // used in kernel 2 -// __device__ __constant__ h_element dev_h_compact1[46*19]; // used in kernel 1 +// __device__ __constant__ h_element dev_h_compact1[46*23]; // used in kernel 1 // __device__ __constant__ h_element dev_h_compact2[68*30]; // used in kernel 2 // row and col element count diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 3d5268b363..1c406eae98 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -554,7 +554,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB) AssertFatal(pdcch_dmrs!=NULL, "NR init: pdcch_dmrs malloc failed\n"); gNB->bad_pucch = 0; - + if (gNB->TX_AMP == 0) + gNB->TX_AMP = AMP; // ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK) int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1; diff --git a/openair1/PHY/MODULATION/modulation_common.h b/openair1/PHY/MODULATION/modulation_common.h index 7c214fa821..d1546da9b5 100644 --- a/openair1/PHY/MODULATION/modulation_common.h +++ b/openair1/PHY/MODULATION/modulation_common.h @@ -51,7 +51,7 @@ void PHY_ofdm_mod(int *input, void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms); void nr_normal_prefix_mod(c16_t *txdataF, c16_t *txdata, uint8_t nsymb, NR_DL_FRAME_PARMS *frame_parms, uint32_t slot); -void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); +void do_OFDM_mod(c16_t **txdataF, c16_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); /** @}*/ diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index 8e17fc0a4a..a15708305a 100644 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -45,16 +45,16 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA - PHY_ofdm_mod(txdataF, // input - txdata, // output - frame_parms->ofdm_symbol_size, + PHY_ofdm_mod((int *)txdataF, // input + (int *)txdata, // output + frame_parms->ofdm_symbol_size, 1, // number of symbols frame_parms->nb_prefix_samples0, // number of prefix samples CYCLIC_PREFIX); - PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size, // input - txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0, // output - frame_parms->ofdm_symbol_size, + PHY_ofdm_mod((int *)txdataF+frame_parms->ofdm_symbol_size, // input + (int *)txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0, // output + frame_parms->ofdm_symbol_size, nsymb-1, frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); @@ -280,7 +280,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input } -void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) +void do_OFDM_mod(c16_t **txdataF, c16_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) { int aa, slot_offset, slot_offset_F; @@ -292,39 +292,39 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne if (is_pmch_subframe(frame,next_slot>>1,frame_parms)) { if ((next_slot%2)==0) { LOG_D(PHY,"Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)\n",frame,next_slot>>1,slot_offset); - PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input - &txdata[aa][slot_offset], // output + PHY_ofdm_mod((int *)&txdataF[aa][slot_offset_F], // input + (int *)&txdata[aa][slot_offset], // output frame_parms->ofdm_symbol_size, 12, // number of symbols frame_parms->ofdm_symbol_size>>2, // number of prefix samples CYCLIC_PREFIX); if (frame_parms->Ncp == EXTENDED) - PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input - &txdata[aa][slot_offset], // output + PHY_ofdm_mod((int *)&txdataF[aa][slot_offset_F], // input + (int *)&txdata[aa][slot_offset], // output frame_parms->ofdm_symbol_size, 2, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); else { LOG_D(PHY,"Frame %d, subframe %d: Doing PDCCH modulation\n",frame,next_slot>>1); - normal_prefix_mod(&txdataF[aa][slot_offset_F], - &txdata[aa][slot_offset], + normal_prefix_mod((int32_t *)&txdataF[aa][slot_offset_F], + (int32_t *)&txdata[aa][slot_offset], 2, frame_parms); } } } else { if (frame_parms->Ncp == EXTENDED) - PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input - &txdata[aa][slot_offset], // output + PHY_ofdm_mod((int *)&txdataF[aa][slot_offset_F], // input + (int *)&txdata[aa][slot_offset], // output frame_parms->ofdm_symbol_size, 6, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); else { - normal_prefix_mod(&txdataF[aa][slot_offset_F], - &txdata[aa][slot_offset], + normal_prefix_mod((int32_t *)&txdataF[aa][slot_offset_F], + (int32_t *)&txdata[aa][slot_offset], 7, frame_parms); } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index ea3c84be57..fe9ef9e356 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -60,7 +60,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, PHY_VARS_gNB *gNB = msgTx->gNB; NR_gNB_DLSCH_t *dlsch; c16_t** txdataF = gNB->common_vars.txdataF; - int16_t amp = AMP; + int16_t amp = gNB->TX_AMP; int xOverhead = 0; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; time_stats_t *dlsch_encoding_stats=&gNB->dlsch_encoding_stats; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 0b5c7ba564..c82db65718 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -644,6 +644,8 @@ typedef struct PHY_VARS_gNB_s { /// CSI variables nr_csi_info_t *nr_csi_info; + // reference amplitude for TX + int16_t TX_AMP; // PUCCH0 Look-up table for cyclic-shifts NR_gNB_PUCCH0_LUT_t pucch0_lut; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 3b5592753a..0e8e2cfd56 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -81,13 +81,23 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier, prb_offset, sc_offset); LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol); - nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); - nr_generate_sss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_pss(&txdataF[0][txdataF_offset], gNB->TX_AMP, ssb_start_symbol, cfg, fp); + nr_generate_sss(&txdataF[0][txdataF_offset], gNB->TX_AMP, ssb_start_symbol, cfg, fp); if (fp->Lmax == 4) - nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index & 7], + &txdataF[0][txdataF_offset], + gNB->TX_AMP, + ssb_start_symbol, + cfg, + fp); else - nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index & 7], + &txdataF[0][txdataF_offset], + gNB->TX_AMP, + ssb_start_symbol, + cfg, + fp); if (T_ACTIVE(T_GNB_PHY_MIB)) { unsigned char bch[3]; @@ -107,9 +117,12 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ nr_generate_pbch(&ssb_pdu, gNB->nr_pbch_interleaver, &txdataF[0][txdataF_offset], - AMP, + gNB->TX_AMP, ssb_start_symbol, - n_hf, frame, cfg, fp); + n_hf, + frame, + cfg, + fp); } @@ -170,9 +183,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); - nr_generate_dci_top(msgTx, slot, - (int32_t *)&gNB->common_vars.txdataF[0][txdataF_offset], - AMP, fp); + nr_generate_dci_top(msgTx, slot, (int32_t *)&gNB->common_vars.txdataF[0][txdataF_offset], gNB->TX_AMP, fp); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,0); } @@ -189,7 +200,20 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, if (csirs->active == 1) { LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot); nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params = &csirs->csirs_pdu.csi_rs_pdu_rel15; - nr_generate_csi_rs(&gNB->frame_parms, (int32_t **)gNB->common_vars.txdataF, AMP, gNB->nr_csi_info, csi_params, slot, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + nr_generate_csi_rs(&gNB->frame_parms, + (int32_t **)gNB->common_vars.txdataF, + gNB->TX_AMP, + gNB->nr_csi_info, + csi_params, + slot, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL); csirs->active = 0; } } diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 492fbdeafd..ac9b2e3bec 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -191,7 +191,7 @@ int main(int argc, char **argv) double sigma2, sigma2_dB=10,SNR,snr0=-2.0,snr1=2.0; double cfo=0; uint8_t snr1set=0; - int **txdata; + c16_t **txdata; double **s_re,**s_im,**r_re,**r_im; //double iqim = 0.0; double ip =0.0; @@ -586,7 +586,7 @@ int main(int argc, char **argv) s_im = malloc(2*sizeof(double*)); r_re = malloc(2*sizeof(double*)); r_im = malloc(2*sizeof(double*)); - txdata = calloc(2,sizeof(int*)); + txdata = calloc(2, sizeof(c16_t*)); for (i=0; i<2; i++) { @@ -596,7 +596,7 @@ int main(int argc, char **argv) r_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); r_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); printf("Allocating %d samples for txdata\n",frame_length_complex_samples); - txdata[i] = malloc16_clear(frame_length_complex_samples*sizeof(int)); + txdata[i] = malloc16_clear(frame_length_complex_samples * sizeof(c16_t)); } if (pbch_file_fd!=NULL) { @@ -655,7 +655,7 @@ int main(int argc, char **argv) 12); PHY_ofdm_mod((int *)gNB->common_vars.txdataF[aa], - &txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)], + (int *)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)], frame_parms->ofdm_symbol_size, 12, frame_parms->nb_prefix_samples, @@ -726,8 +726,8 @@ int main(int argc, char **argv) for (i=0; inb_antennas_tx; aa++) { - r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); - r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]); + r_re[aa][i] = (double)txdata[aa][i].r; + r_im[aa][i] = (double)txdata[aa][i].i; } } @@ -761,8 +761,8 @@ int main(int argc, char **argv) for (i=0; inb_antennas_rx; aa++) { - ((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); - ((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); + UE->common_vars.rxdata[aa][i].r = (short)(r_re[aa][i] + sqrt(sigma2 / 2) * gaussdouble(0.0, 1.0)); + UE->common_vars.rxdata[aa][i].i = (short)(r_im[aa][i] + sqrt(sigma2 / 2) * gaussdouble(0.0, 1.0)); } } diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 8c4381d8bd..933039cd16 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -56,6 +56,8 @@ #define CONFIG_STRING_L1_RX_THREAD_CORE "L1_rx_thread_core" #define CONFIG_STRING_L1_TX_THREAD_CORE "L1_tx_thread_core" #define HLP_TP_SIZ "thread_pool_size paramter removed, please use --thread-pool" +#define CONFIG_STRING_L1_TX_AMP_BACKOFF_dB "tx_amp_backoff_dB" +#define HLP_L1TX_BO "Backoff from full-scale output at the L1 entity(frequency domain), ex. 12 would corresponding to 14-bit input level (6 dB/bit). Default 36 dBFS for OAI RU entity" /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /* L1 configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -80,6 +82,7 @@ {CONFIG_STRING_L1_MAX_LDPC_ITERATIONS, NULL, 0, .uptr=NULL, .defintval=5, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_RX_THREAD_CORE, NULL, 0, .uptr=NULL, .defintval=-1, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_TX_THREAD_CORE, NULL, 0, .uptr=NULL, .defintval=-1, TYPE_UINT, 0}, \ + {CONFIG_STRING_L1_TX_AMP_BACKOFF_dB, HLP_L1TX_BO,0, .uptr=NULL, .defintval=36, TYPE_UINT, 0}, \ } // clang-format on #define L1_CC_IDX 0 @@ -100,6 +103,7 @@ #define L1_MAX_LDPC_ITERATIONS 15 #define L1_RX_THREAD_CORE 16 #define L1_TX_THREAD_CORE 17 +#define L1_TX_AMP_BACKOFF_dB 18 /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ #endif diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index a9ce850d9b..b59aa6e823 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -773,6 +773,9 @@ void RCconfig_NR_L1(void) RC.gNB[j]->L1_rx_thread_core = *(L1_ParamList.paramarray[j][L1_RX_THREAD_CORE].iptr); RC.gNB[j]->L1_tx_thread_core = *(L1_ParamList.paramarray[j][L1_TX_THREAD_CORE].iptr); LOG_I(PHY,"L1_RX_THREAD_CORE %d (%d)\n",*(L1_ParamList.paramarray[j][L1_RX_THREAD_CORE].iptr),L1_RX_THREAD_CORE); + RC.gNB[j]->TX_AMP = (int16_t)(32767.0 / pow(10.0, .05 * (double)(*L1_ParamList.paramarray[j][L1_TX_AMP_BACKOFF_dB].uptr))); + LOG_I(PHY, "TX_AMP = %d (-%d dBFS)\n", RC.gNB[j]->TX_AMP, *L1_ParamList.paramarray[j][L1_TX_AMP_BACKOFF_dB].uptr); + AssertFatal(RC.gNB[j]->TX_AMP > 300, "TX_AMP is too small, must be larger than 300 (is %d)\n", RC.gNB[j]->TX_AMP); if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { // sf_ahead = 2; // Need 4 subframe gap between RX and TX } else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) { diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index d4409c94cb..d62a5466b3 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1286,7 +1286,6 @@ int rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(MessageDef *msg_p, instance_ UE->pduSession[j].param.pdusession_id = cmd->pdusession_release_params[pdusession].pdusession_id; UE->pduSession[j].cause = NGAP_CAUSE_RADIO_NETWORK; UE->pduSession[j].cause_value = 30; - pduSession->xid = xid; continue; } if (pduSession->status == PDU_SESSION_STATUS_FAILED) {