Commit 89d7353d authored by hardy's avatar hardy
Browse files

Merge remote-tracking branch 'origin/fixes-tun' into integration_2020_wk44

parents 97ae4300 a6126a39
......@@ -825,7 +825,6 @@ add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchang
add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
########################
# Include order
......
......@@ -42,7 +42,6 @@ MSC_GEN=0
XFORMS="True"
SKIP_SHARED_LIB_FLAG="False"
UE_EXPANSION="False"
UESIM_EXPANSION="False"
PRINT_STATS="False"
VCD_TIMING="False"
DEADLINE_SCHEDULER_FLAG_USER=""
......@@ -264,10 +263,6 @@ function main() {
UE_EXPANSION="True"
echo_info "Will compile with UE_EXPANSION"
shift;;
--musim)
UESIM_EXPANSION="True"
echo_info "Will compile with UESIM_EXPANSION"
shift;;
--UE-conf-nvram)
conf_nvram_path=$(readlink -f $2)
shift 2;;
......@@ -593,7 +588,6 @@ function main() {
echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file
# echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file
echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file
echo "set ( UESIM_EXPANSION $UESIM_EXPANSION )" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
......
......@@ -4,7 +4,6 @@ set ( CMAKE_BUILD_TYPE )
set ( CFLAGS_PROCESSOR_USER "" )
set ( UE_EXPANSION False )
set ( PRE_SCD_THREAD False )
set ( UESIM_EXPANSION False )
set ( ENABLE_VCD_FIFO False )
set ( RF_BOARD "None")
set ( TRANSP_PRO "None")
......
......@@ -65,18 +65,6 @@
#define MAX_NR_RRC_UE_CONTEXTS 64
#ifndef UE_EXPANSION
// TODO:L2 FAPI simulator.
// UESIM_EXPANSION is used to be same value of MAX_MOBILES_PER_ENB
// in eNB and UE.
// now , if we use --mu option in UE, compiling error will occur.
// This problem will be fixed in the future.
#ifdef UESIM_EXPANSION
#define MAX_MOBILES_PER_ENB 256
#define MAX_MOBILES_PER_ENB_NB_IoT 256
#define MAX_MOBILES_PER_GNB 256
#define MAX_eNB 2
#define MAX_gNB 2
#else
#ifdef LARGE_SCALE
#define MAX_MOBILES_PER_ENB 128
#define MAX_MOBILES_PER_ENB_NB_IoT 128
......@@ -90,7 +78,6 @@
#define MAX_eNB 2
#define MAX_gNB 2
#endif
#endif
#else
#define MAX_MOBILES_PER_ENB 256
#define MAX_MOBILES_PER_ENB_NB_IoT 256
......
......@@ -996,17 +996,7 @@ pdcp_data_ind(
* TODO: be sure of this
*/
if (NFAPI_MODE == NFAPI_UE_STUB_PNF ) {
#ifdef UESIM_EXPANSION
if (UE_NAS_USE_TUN) {
pdcpHead->inst = ctxt_pP->module_id;
} else {
pdcpHead->inst = 0;
}
#else
pdcpHead->inst = ctxt_pP->module_id;
#endif
} else { // nfapi_mode
if (UE_NAS_USE_TUN) {
pdcpHead->inst = ctxt_pP->module_id;
......@@ -2287,7 +2277,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
nas_getparams();
if(UE_NAS_USE_TUN) {
int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 )?MAX_NUMBER_NETIF:1;
int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 )? MAX_MOBILES_PER_ENB : 1;
netlink_init_tun("ue",num_if);
if (IS_SOFTMODEM_NOS1)
nas_config(1, 1, 2, "ue");
......
......@@ -53,9 +53,6 @@ typedef rlc_op_status_t (*send_rlc_data_req_func_t)(const protocol_ctxt_t *cons
typedef boolean_t (*pdcp_data_ind_func_t)( const protocol_ctxt_t *, const srb_flag_t,
const MBMS_flag_t, const rb_id_t, const sdu_size_t,
mem_block_t *,const uint32_t *const, const uint32_t *const);
/* maximum number of tun interfaces that will be created to emulates UEs */
/* UEs beyond that will be multiplexed on the same tun */
#define MAX_NUMBER_NETIF 16
#define ENB_NAS_USE_TUN_W_MBMS_BIT (1<< 10)
#define PDCP_USE_NETLINK_BIT (1<< 11)
......
......@@ -86,12 +86,6 @@ extern struct msghdr nas_msg_rx;
#ifdef UESIM_EXPANSION
extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
#endif
# include "gtpv1u_eNB_task.h"
# include "gtpv1u_eNB_defs.h"
......@@ -503,11 +497,7 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
}
} else { // ctxt.enb_flag => UE
if (NFAPI_MODE == NFAPI_UE_STUB_PNF) {
#ifdef UESIM_EXPANSION
ctxt.module_id = inst_pdcp_list[pdcp_read_header_g.inst];
#else
ctxt.module_id = pdcp_read_header_g.inst;
#endif
} else {
ctxt.module_id = 0;
}
......
......@@ -368,7 +368,7 @@ uint64_t pdcp_module_init(uint64_t _pdcp_optmask)
nas_getparams();
if(UE_NAS_USE_TUN) {
int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 )?MAX_NUMBER_NETIF:1;
int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 )? MAX_MOBILES_PER_ENB : 1;
netlink_init_tun("ue",num_if);
//Add --nr-ip-over-lte option check for next line
if (IS_SOFTMODEM_NOS1)
......
......@@ -287,18 +287,6 @@ ue_ip_common_ip2wireless(
printk("[UE_IP_DRV][%s] Dest %d.%d.%d.%d\n",__FUNCTION__, dst_addr[0],dst_addr[1],dst_addr[2],dst_addr[3]);
}
// modify inst by IP address for the U-Plane of multiple UEs while L2 fapi simulator start
#ifdef UESIM_EXPANSION
if ((src_addr[3] - 2)> instP) {
pdcph.inst = src_addr[3] - 2;
printk("[UE_IP_DRV] change INST from %d to %d\n",instP, pdcph.inst);
instP = src_addr[3] - 2;
priv_p=netdev_priv(ue_ip_dev[instP]);
}
#endif
// modify inst by IP address for the U-Plane of multiple UEs while L2 fapi simulator end
//get Ipv4 address and pass to PCDP header
printk("[UE_IP_DRV] source Id: 0x%08x\n",pdcph.sourceL2Id );
printk("[UE_IP_DRV] destinationL2Id Id: 0x%08x\n",pdcph.destinationL2Id );
......
......@@ -55,10 +55,6 @@ Description Defines functions used to handle EPS bearer contexts.
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef UESIM_EXPANSION
#include "openairinterface5g_limits.h"
extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
#endif
/****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/
......@@ -200,7 +196,7 @@ int esm_ebr_context_create(
char *tmp = NULL;
char ipv4_addr[INET_ADDRSTRLEN];
//char ipv6_addr[INET6_ADDRSTRLEN];
char *netmask = NULL;
int netmask = 32;
char broadcast[INET_ADDRSTRLEN];
struct in_addr in_addr;
char command_line[500];
......@@ -227,7 +223,7 @@ int esm_ebr_context_create(
strcpy(ipv4_addr, tmp);
if (IN_CLASSA(ntohl(in_addr.s_addr))) {
netmask = "255.0.0.0";
netmask = 8;
in_addr.s_addr = pdn->ip_addr[0] << 24 |
((255 << 16) & 0x00FF0000) |
((255 << 8) & 0x0000FF00) |
......@@ -239,7 +235,7 @@ int esm_ebr_context_create(
// in_addr.s_addr);
strcpy(broadcast, tmp);
} else if (IN_CLASSB(ntohl(in_addr.s_addr))) {
netmask = "255.255.0.0";
netmask = 16;
in_addr.s_addr = pdn->ip_addr[0] << 24 |
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
((255 << 8) & 0x0000FF00) |
......@@ -251,7 +247,7 @@ int esm_ebr_context_create(
// in_addr.s_addr);
strcpy(broadcast, tmp);
} else if (IN_CLASSC(ntohl(in_addr.s_addr))) {
netmask = "255.255.255.0";
netmask = 24;
in_addr.s_addr = pdn->ip_addr[0] << 24 |
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
((pdn->ip_addr[2] << 8) & 0x0000FF00) |
......@@ -263,56 +259,23 @@ int esm_ebr_context_create(
// in_addr.s_addr);
strcpy(broadcast, tmp);
} else {
netmask = "255.255.255.255";
netmask = 32;
strcpy(broadcast, ipv4_addr);
}
if(NFAPI_MODE==NFAPI_UE_STUB_PNF) {
// this is for L2 FAPI simulator.
// change for multiple UE's like 256UEs.
// if it's made too many tables , OS may crush so we use one table.
if(PDCP_USE_NETLINK) {
#ifdef UESIM_EXPANSION
uint16_t inst_nic = (pdn->ip_addr[3] & 0x000000FF) - 2;
res = sprintf(command_line,
"ifconfig %s%d %s netmask %s broadcast %s up && "
"ip rule add from %s/24 table %d && "
"ip rule add to %s/24 table %d && "
"ip route add default dev %s%d table %d",
UE_NAS_USE_TUN?"oaitun_ue":"oip",
inst_nic + 1, ipv4_addr, netmask, broadcast,
ipv4_addr, 201,
ipv4_addr, 201,
UE_NAS_USE_TUN?"oaitun_ue":"oip",
inst_nic + 1, 201);
inst_pdcp_list[inst_nic] = ueid;
#else
res = sprintf(command_line,
"ifconfig %s%d %s netmask %s broadcast %s up && "
"ip rule add from %s/32 table %d && "
"ip rule add to %s/32 table %d && "
"ip route add default dev %s%d table %d",
UE_NAS_USE_TUN?"oaitun_ue":"oip",
ueid + 1, ipv4_addr, netmask, broadcast,
ipv4_addr, ueid + 201,
ipv4_addr, ueid + 201,
UE_NAS_USE_TUN?"oaitun_ue":"oip",
ueid + 1, ueid + 201);
#endif
} // PDCP_USE_NETLINK
} else {
res = sprintf(command_line,
"ifconfig %s%d %s netmask %s broadcast %s up && "
"ip rule add from %s/32 table %d && "
"ip rule add to %s/32 table %d && "
"ip route add default dev %s%d table %d",
UE_NAS_USE_TUN?"oaitun_ue":"oip",
ueid + 1, ipv4_addr, netmask, broadcast,
ipv4_addr, ueid + 201,
ipv4_addr, ueid + 201,
UE_NAS_USE_TUN?"oaitun_ue":"oip",
ueid + 1, ueid + 201);
}
res = sprintf(command_line,
"ip address add %s/%d broadcast %s dev %s%d && "
"ip link set %s%d up && "
"ip rule add from %s/32 table %d && "
"ip rule add to %s/32 table %d && "
"ip route add default dev %s%d table %d",
ipv4_addr, netmask, broadcast,
UE_NAS_USE_TUN ? "oaitun_ue" : "oip", ueid + 1,
UE_NAS_USE_TUN ? "oaitun_ue" : "oip", ueid + 1,
ipv4_addr, ueid + 10000,
ipv4_addr, ueid + 10000,
UE_NAS_USE_TUN ? "oaitun_ue" : "oip",
ueid + 1, ueid + 10000);
if ( res<0 ) {
LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string");
......
......@@ -8,23 +8,11 @@
# define NUMBER_OF_NR_RU_MAX 2
# ifndef PHYSIM
# ifndef UE_EXPANSION
// TODO:L2 FAPI simulator.
// UESIM_EXPANSION is used to be same value of NUMBER_OF_UE_MAX
// in eNB and UE.
// now , if we use --mu option in UE, compiling error will occur.
// This problem will be fixed in the future.
# ifndef UESIM_EXPANSION
# define NUMBER_OF_UE_MAX 4
# define NUMBER_OF_NR_UE_MAX 4
# define NUMBER_OF_UCI_VARS_MAX 14
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 1
# else
# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_UCI_VARS_MAX 256
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 3
# endif
# else
# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_UCI_VARS_MAX 256
......@@ -48,17 +36,10 @@ eNB process will exit because unexpected access happens.
Now some parts are using NUMBER_OF_UE_MAX
and the other are using MAX_MOBILES_PER_ENB in for-loop.
*/
# ifndef UESIM_EXPANSION
# define NUMBER_OF_UE_MAX 16
# define NUMBER_OF_UCI_VARS_MAX 56
# define NUMBER_OF_CONNECTED_eNB_MAX 3
# define NUMBER_OF_CONNECTED_gNB_MAX 3
# else
# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_UCI_VARS_MAX 256
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 3
# endif
# else
# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_UCI_VARS_MAX 256
......
......@@ -95,9 +95,6 @@ pthread_mutex_t nfapi_sync_mutex;
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
#ifdef UESIM_EXPANSION
uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
#endif
uint16_t sf_ahead=2;
int tddflag;
char *emul_iface;
......@@ -546,9 +543,6 @@ void init_pdcp(void) {
int main( int argc, char **argv ) {
int CC_id;
uint8_t abstraction_flag=0;
#ifdef UESIM_EXPANSION
memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
#endif
// Default value for the number of UEs. It will hold,
// if not changed from the command line option --num-ues
NB_UE_INST=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