Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UPF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UPF
Commits
064600a8
Commit
064600a8
authored
Aug 12, 2021
by
wangyongshou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify system config
parent
619c65e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
20 deletions
+122
-20
scripts/build_upf.sh
scripts/build_upf.sh
+60
-7
scripts/install_upf.sh
scripts/install_upf.sh
+34
-5
scripts/new_run_upf.sh
scripts/new_run_upf.sh
+28
-8
No files found.
scripts/build_upf.sh
View file @
064600a8
...
@@ -19,6 +19,14 @@ UPFINSTALL="$base/install/upf"
...
@@ -19,6 +19,14 @@ UPFINSTALL="$base/install/upf"
UPF_PKG
=
"upf.tar.gz"
UPF_PKG
=
"upf.tar.gz"
#init value
OS_KERNEL_VERSION_V1
=
"5.3.0-28-generic"
OS_KERNEL_VERSION_V2
=
"5.4.0-80-generic"
OS_ID_VALUE
=
"ubuntu"
OS_VERSION_ID_VALUE
=
"18.04"
OS_ARCH_VALUE
=
"x86_64"
OS_ID
=
""
OS_ID
=
""
OS_VERSION_ID
=
""
OS_VERSION_ID
=
""
OS_KERNEL_VERSION
=
""
OS_KERNEL_VERSION
=
""
...
@@ -36,6 +44,9 @@ function pre_create(){
...
@@ -36,6 +44,9 @@ function pre_create(){
#sudo mkdir -p $UPFINSTALL
#sudo mkdir -p $UPFINSTALL
#fi
#fi
rm
-f
$UPFINSTALL
/
$UPF_PKG
#re create
#re create
mkdir
-p
$UPFINSTALL
mkdir
-p
$UPFINSTALL
...
@@ -233,9 +244,27 @@ function clear_all()
...
@@ -233,9 +244,27 @@ function clear_all()
rm
-rf
$VPPPATH
/build/external/downloads/
*
rm
-rf
$VPPPATH
/build/external/downloads/
*
}
}
function
system_requirement
()
{
echo
"Minimum system requirements"
echo
""
echo
"ubuntu"
echo
"18.04"
echo
"5.4.0-80-generic or 5.3.0-28-generic"
echo
"x86_64"
echo
""
echo
""
return
0
}
function
check_system
()
function
check_system
()
{
{
echo
"check_system..."
echo
"check system config"
echo
""
if
[
!
-f
/etc/os-release
]
;
then
if
[
!
-f
/etc/os-release
]
;
then
echo
"ERROR /etc/os-release is not exist....."
echo
"ERROR /etc/os-release is not exist....."
...
@@ -244,34 +273,58 @@ function check_system()
...
@@ -244,34 +273,58 @@ function check_system()
OS_ID
=
$(
echo
`
grep
'^ID='
/etc/os-release |
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_ID
=
$(
echo
`
grep
'^ID='
/etc/os-release |
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_VERSION_ID
=
$(
echo
`
grep
'^VERSION_ID='
/etc/os-release |
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_VERSION_ID
=
$(
echo
`
grep
'^VERSION_ID='
/etc/os-release |
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_KERNEL_VERSION
=
$(
echo
`
uname
-r
`
)
OS_KERNEL_VERSION
=
$(
echo
`
uname
-r
|
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_ARCH
=
$(
echo
`
uname
--m
`
)
OS_ARCH
=
$(
echo
`
uname
--m
`
)
if
[
$OS_KERNEL_VERSION
!=
$OS_KERNEL_VERSION_V1
]
;
then
if
[
$OS_KERNEL_VERSION
!=
$OS_KERNEL_VERSION_V2
]
;
then
echo
"kernel version error:
$OS_KERNEL_VERSION
"
echo
""
system_requirement
echo
"build, exit..."
exit
0
fi
fi
#ubuntu
#ubuntu
if
[
$OS_ID
==
"ubuntu"
-a
$OS_VERSION_ID
==
"18.04"
-a
$OS_KERNEL_VERSION
==
"5.4.0-80-generic"
-a
$OS_ARCH
==
"x86_64"
]
;
then
if
[
$OS_ID
==
$OS_ID_VALUE
-a
$OS_VERSION_ID
==
$OS_VERSION_ID_VALUE
-a
$OS_ARCH
==
$OS_ARCH_VALUE
]
;
then
echo
$OS_ID
echo
$OS_ID
echo
$OS_VERSION_ID
echo
$OS_VERSION_ID
echo
$OS_KERNEL_VERSION
echo
$OS_KERNEL_VERSION
echo
$OS_ARCH
echo
$OS_ARCH
OS_SYS_TYPE
=
"ubuntu"
OS_SYS_TYPE
=
"ubuntu"
else
else
echo
"don't know system"
echo
$OS_ID
echo
$OS_ID
echo
$OS_VERSION_ID
echo
$OS_VERSION_ID
echo
$OS_KERNEL_VERSION
echo
$OS_KERNEL_VERSION
echo
$OS_ARCH
echo
$OS_ARCH
echo
"build exit..."
echo
""
echo
"don't support system config"
echo
""
system_requirement
echo
"build exit..."
exit
0
exit
0
fi
fi
return
0
return
0
}
}
function
help
()
function
help
()
{
{
echo
" "
echo
" "
...
...
scripts/install_upf.sh
View file @
064600a8
...
@@ -15,6 +15,18 @@ ROOT_PATH=/opt/5gc/upf
...
@@ -15,6 +15,18 @@ ROOT_PATH=/opt/5gc/upf
VPP_PRO
=
"vpp"
VPP_PRO
=
"vpp"
N4_PRO
=
"main"
N4_PRO
=
"main"
#init value
OS_KERNEL_VERSION_V1
=
"5.3.0-28-generic"
OS_KERNEL_VERSION_V2
=
"5.4.0-80-generic"
OS_ID_VALUE
=
"ubuntu"
OS_VERSION_ID_VALUE
=
"18.04"
OS_ARCH_VALUE
=
"x86_64"
OS_CPU_NUM_VALUE
=
16
OS_FREE_VALUE
=
14
OS_ID
=
""
OS_ID
=
""
OS_VERSION_ID
=
""
OS_VERSION_ID
=
""
OS_KERNEL_VERSION
=
""
OS_KERNEL_VERSION
=
""
...
@@ -108,7 +120,7 @@ function system_requirement()
...
@@ -108,7 +120,7 @@ function system_requirement()
echo
""
echo
""
echo
"ubuntu"
echo
"ubuntu"
echo
"18.04"
echo
"18.04"
echo
"5.4.0-80-generic"
echo
"5.4.0-80-generic
or 5.3.0-28-generic
"
echo
"x86_64"
echo
"x86_64"
echo
"cpu num: 16"
echo
"cpu num: 16"
echo
"free total mem: 14G"
echo
"free total mem: 14G"
...
@@ -132,7 +144,7 @@ function check_system()
...
@@ -132,7 +144,7 @@ function check_system()
OS_ID
=
$(
echo
`
grep
'^ID='
/etc/os-release |
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_ID
=
$(
echo
`
grep
'^ID='
/etc/os-release |
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_VERSION_ID
=
$(
echo
`
grep
'^VERSION_ID='
/etc/os-release |
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_VERSION_ID
=
$(
echo
`
grep
'^VERSION_ID='
/etc/os-release |
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_KERNEL_VERSION
=
$(
echo
`
uname
-r
`
)
OS_KERNEL_VERSION
=
$(
echo
`
uname
-r
|
cut
-f2-
-d
=
|
sed
-e
's/\"//g'
`
)
OS_ARCH
=
$(
echo
`
uname
--m
`
)
OS_ARCH
=
$(
echo
`
uname
--m
`
)
OS_CPU_NUM_T
=
$(
echo
`
cat
/proc/cpuinfo|
grep
"processor"
|
wc
-l
`
)
OS_CPU_NUM_T
=
$(
echo
`
cat
/proc/cpuinfo|
grep
"processor"
|
wc
-l
`
)
...
@@ -141,14 +153,30 @@ function check_system()
...
@@ -141,14 +153,30 @@ function check_system()
OS_CPU_NUM
=
$(
echo
`
echo
$OS_CPU_NUM_T
|
awk
'{print int($0)}'
`
)
OS_CPU_NUM
=
$(
echo
`
echo
$OS_CPU_NUM_T
|
awk
'{print int($0)}'
`
)
OS_FREE
=
$(
echo
`
echo
$OS_FREE_T
|
awk
'{print int($0)}'
`
)
OS_FREE
=
$(
echo
`
echo
$OS_FREE_T
|
awk
'{print int($0)}'
`
)
if
[
$OS_KERNEL_VERSION
!=
$OS_KERNEL_VERSION_V1
]
;
then
if
[
$OS_KERNEL_VERSION
!=
$OS_KERNEL_VERSION_V2
]
;
then
echo
"kernel version error:
$OS_KERNEL_VERSION
"
echo
""
system_requirement
echo
"exit..."
exit
0
fi
fi
#ubuntu
#ubuntu
if
[
$OS_ID
==
"ubuntu"
-a
$OS_VERSION_ID
==
"18.04"
-a
$OS_KERNEL_VERSION
==
"5.4.0-80-generic"
-a
$OS_ARCH
==
"x86_64"
-a
$OS_CPU_NUM
-ge
16
-a
$OS_FREE
-ge
14
]
;
then
if
[
$OS_ID
==
$OS_ID_VALUE
-a
$OS_VERSION_ID
==
$OS_VERSION_ID_VALUE
-a
$OS_ARCH
==
$OS_ARCH_VALUE
-a
$OS_CPU_NUM
-ge
$OS_CPU_NUM_VALUE
-a
$OS_FREE
-ge
$OS_FREE_VALUE
]
;
then
echo
$OS_ID
echo
$OS_ID
echo
$OS_VERSION_ID
echo
$OS_VERSION_ID
echo
$OS_KERNEL_VERSION
echo
$OS_KERNEL_VERSION
echo
$OS_ARCH
echo
$OS_ARCH
echo
"cpu num:
$OS_CPU_NUM
"
echo
"cpu num:
$OS_CPU_NUM
"
echo
"free mem:
$OS_FREE
"
echo
"free mem:
$OS_FREE
"
...
@@ -163,12 +191,13 @@ function check_system()
...
@@ -163,12 +191,13 @@ function check_system()
echo
$OS_CPU_NUM
echo
$OS_CPU_NUM
echo
$OS_FREE
echo
$OS_FREE
echo
""
echo
"don't support system config"
echo
"don't support system config"
echo
""
echo
""
system_requirement
system_requirement
echo
"
exit..."
echo
"exit..."
exit
0
exit
0
fi
fi
...
...
scripts/new_run_upf.sh
View file @
064600a8
#!/bin/bash
#!/bin/bash
current
=
"
$PWD
"
#
current="$PWD"
base
=
$(
dirname
"
$PWD
"
)
#
base=$(dirname "$PWD")
base
=
/opt/5gc/upf
VPPPROCESS
=
"vpp"
VPPPROCESS
=
"vpp"
N4PROCESS
=
"main"
N4PROCESS
=
"main"
N4PATH
=
"
$base
/install/n4"
#
N4PATH="$base/install/n4"
DPDK_ENTRY_PCI
=
""
DPDK_ENTRY_PCI
=
""
DPDK_EXPORT_PCI
=
""
DPDK_EXPORT_PCI
=
""
...
@@ -16,7 +17,7 @@ CPUNUMBER=""
...
@@ -16,7 +17,7 @@ CPUNUMBER=""
UPF_CONFIG
=
$base
/etc/upf.conf
UPF_CONFIG
=
$base
/etc/upf.conf
VPP_CONFIG
=
$base
/etc/vppe.conf
VPP_CONFIG
=
$base
/etc/vppe.conf
VPP_N4
=
$base
/etc/n4_config.yaml
VPP_N4
=
$base
/etc/n4_config.yaml
CPU_MIN_NUMS
=
8
#
CPU_MIN_NUMS=8
#vpp config
#vpp config
UPF_N3_NAME
=
""
UPF_N3_NAME
=
""
...
@@ -49,6 +50,7 @@ CPU_MASK=""
...
@@ -49,6 +50,7 @@ CPU_MASK=""
function
start_vppe
()
function
start_vppe
()
{
{
echo
""
$base
/bin/vpp
-c
$base
/etc/vppe.conf
>
/dev/null 2>&1
;
$base
/bin/vpp
-c
$base
/etc/vppe.conf
>
/dev/null 2>&1
;
sleep
1s
sleep
1s
...
@@ -62,6 +64,7 @@ function start_vppe()
...
@@ -62,6 +64,7 @@ function start_vppe()
function
start_n4
()
function
start_n4
()
{
{
echo
""
$base
/bin/main
-c
$base
/etc/n4_config.yaml &
>
/dev/null 2>&1
;
$base
/bin/main
-c
$base
/etc/n4_config.yaml &
>
/dev/null 2>&1
;
sleep
1s
sleep
1s
...
@@ -117,6 +120,21 @@ function close_n4()
...
@@ -117,6 +120,21 @@ function close_n4()
exit
0
exit
0
}
}
function
protect_system_dead
()
{
#sysctl -w vm.dirty_background_bytes=0
sysctl
-w
vm.dirty_background_ratio
=
10
#sysctl -w vm.dirty_bytes=0
sysctl
-w
vm.dirty_ratio
=
20
sysctl
-w
vm.dirty_writeback_centisecs
=
500
sysctl
-w
vm.dirty_expire_centisecs
=
3000
sysctl
-w
vm.dirtytime_expire_seconds
=
43200
sysctl
-p
return
0
}
function
check_system
()
function
check_system
()
{
{
CPUCORES
=
$(
echo
`
cat
/proc/cpuinfo|
grep
"processor"
|
wc
-l
`
)
CPUCORES
=
$(
echo
`
cat
/proc/cpuinfo|
grep
"processor"
|
wc
-l
`
)
...
@@ -221,7 +239,6 @@ function set_cpu_interrupt()
...
@@ -221,7 +239,6 @@ function set_cpu_interrupt()
while
[
$INTE_NUM
!=
0
]
while
[
$INTE_NUM
!=
0
]
do
do
INTE_NUM
=
$((
$INTE_NUM
-
1
))
INTE_NUM
=
$((
$INTE_NUM
-
1
))
tmp
=
${
CPU_MASK
}
"F"
tmp
=
${
CPU_MASK
}
"F"
CPU_MASK
=
${
tmp
}
CPU_MASK
=
${
tmp
}
...
@@ -436,8 +453,8 @@ function read_config() {
...
@@ -436,8 +453,8 @@ function read_config() {
function
chk_net
()
function
chk_net
()
{
{
echo
"
check net ...
"
echo
""
echo
"
"
echo
"
Check the network connection"
ping_gnb_n3
=
$(
echo
`
/usr/bin/vppctl
-s
/run/vpp/cli.sock ping
$UPF_N3_GW
source
if_n3 repeat 5
`
)
ping_gnb_n3
=
$(
echo
`
/usr/bin/vppctl
-s
/run/vpp/cli.sock ping
$UPF_N3_GW
source
if_n3 repeat 5
`
)
loss
=
"*100% packet loss*"
loss
=
"*100% packet loss*"
...
@@ -461,6 +478,7 @@ function chk_net()
...
@@ -461,6 +478,7 @@ function chk_net()
echo
"n6 ping:
$UPF_N6_IP
ping
$UPF_N6_GW
"
echo
"n6 ping:
$UPF_N6_IP
ping
$UPF_N6_GW
"
echo
${
ping_dn_n6
}
echo
${
ping_dn_n6
}
echo
""
echo
""
return
0
return
0
...
@@ -469,11 +487,13 @@ function chk_net()
...
@@ -469,11 +487,13 @@ function chk_net()
function
config_upf
()
function
config_upf
()
{
{
echo
""
install_driver
install_driver
net_bind_driver
net_bind_driver
read_config
read_config
generate_instance
generate_instance
net_bind_vfio_pci
net_bind_vfio_pci
protect_system_dead
}
}
function
clear_upf
()
function
clear_upf
()
{
{
...
@@ -497,7 +517,7 @@ function help()
...
@@ -497,7 +517,7 @@ function help()
function
main
()
function
main
()
{
{
check_system
#
check_system
if
[
$#
-eq
0
]
;
if
[
$#
-eq
0
]
;
then
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment