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
1d780628
Commit
1d780628
authored
Jul 21, 2021
by
wangyongshou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cal cpu mask
parent
7f008304
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
45 deletions
+89
-45
scripts/new_run_upf.sh
scripts/new_run_upf.sh
+89
-45
No files found.
scripts/new_run_upf.sh
View file @
1d780628
...
...
@@ -123,7 +123,6 @@ function install_driver()
echo
Y |
sudo tee
/sys/module/vfio/parameters/enable_unsafe_noiommu_mode
#$base/tools/interreput -i $CPUNUMBER
return
0
;
...
...
@@ -138,7 +137,32 @@ function exec_result()
echo
"insmod vfio-pci.ko success"
}
function
net_state
()
#when net is unbind driver and vfio-pci
function
net_bind_driver
()
{
if
[
!
-f
$base
/etc/netcard.conf
]
;
then
return
0
fi
while
read
line
do
eval
"
$line
"
done
<
$base
/etc/netcard.conf
N3_DRIVER
=
$(
echo
`
$base
/tools/ethtool
-i
$upf_n3_name
|
grep
"driver"
|
awk
'{print $1}'
`
)
if
[[
$N3_DRIVER
!=
"driver:"
*
]]
;
then
python3
$base
/scripts/dpdk-devbind.py
-b
$upf_n3_driver
$upf_n3_pci
ifconfig
$upf_n3_name
down
fi
N6_DRIVER
=
$(
echo
`
$base
/tools/ethtool
-i
$upf_n6_name
|
grep
"driver"
|
awk
'{print $1}'
`
)
if
[[
$N6_DRIVER
!=
"driver:"
*
]]
;
then
python3
$base
/scripts/dpdk-devbind.py
-b
$upf_n6_driver
$upf_n6_pci
ifconfig
$upf_n6_name
down
fi
}
function
net_bind_vfio_pci
()
{
if
[
!
-f
$base
/etc/netcard.conf
]
;
then
echo
"ERROR not exist
$/
base/etc/netcard.conf "
...
...
@@ -159,31 +183,11 @@ function net_state()
return
0
}
function
get_inter_ip
()
{
INTER_NAME
=
$1
UPF_INTER_IP
=
$(
echo
`
ifconfig
${
INTER_NAME
}
|
grep
inet |
sed
-n
'1p'
|
awk
'{print $2}'
`
)
}
function
get_inter_pci
()
{
INTER_NAME
=
$1
UPF_INTER_PCI
=
$(
echo
`
$base
/tools/ethtool
-i
${
INTER_NAME
}
|
grep
"bus-info"
|
awk
'{print $2}'
`
)
}
function
is_configured
(){
result
=
$(
echo
`
grep
-n
"@N3_GW@"
$base
/etc/vppe.conf |
grep
"@N3_GW@"
`
)
echo
$result
if
[[
$result
!=
""
]]
;
then
echo
"not config"
return
0
else
echo
"configured"
return
1
fi
}
function
generate_instance
()
{
cp
-f
$base
/etc/startup_debug.template
$base
/etc/vppe.conf
...
...
@@ -220,7 +224,8 @@ function get_driver()
{
UPF_N3_DRIVER
=
$(
echo
`
$base
/tools/ethtool
-i
$UPF_N3_NAME
|
grep
"driver"
|
awk
'{print $2}'
`
)
if
[[
$UPF_N3_DRIVER
==
""
]]
;
then
echo
"ERROR N3
$UPF_N3_NAME
cat not driver"
echo
"ERROR N3
$UPF_N3_NAME
cat not get driver
\n
"
echo
"advice reboot"
exit
0
else
echo
"
$UPF_N3_NAME
pci
$UPF_N3_DRIVER
"
...
...
@@ -228,18 +233,21 @@ function get_driver()
UPF_N6_DRIVER
=
$(
echo
`
$base
/tools/ethtool
-i
$UPF_N6_NAME
|
grep
"driver"
|
awk
'{print $2}'
`
)
if
[[
$UPF_N6_DRIVER
==
""
]]
;
then
echo
"ERROR N6
$UPF_N6_NAME
cat not driver"
echo
"ERROR N6
$UPF_N6_NAME
can not get driver
\n
"
echo
"advice reboot"
exit
0
else
echo
"
$UPF_N6_NAME
pci
$UPF_N6_DRIVER
"
fi
}
function
get_pci
()
{
UPF_N3_PCI
=
$(
echo
`
$base
/tools/ethtool
-i
$UPF_N3_NAME
|
grep
"bus-info"
|
awk
'{print $2}'
`
)
if
[[
$UPF_N3_PCI
==
""
]]
;
then
echo
"ERROR N3
$UPF_N3_NAME
cat not pci"
echo
"ERROR N3
$UPF_N3_NAME
can not get pci
\n
"
echo
"advice reboot"
exit
0
else
echo
"
$UPF_N3_NAME
pci
$UPF_N3_PCI
"
...
...
@@ -247,14 +255,14 @@ function get_pci()
UPF_N6_PCI
=
$(
echo
`
$base
/tools/ethtool
-i
$UPF_N6_NAME
|
grep
"bus-info"
|
awk
'{print $2}'
`
)
if
[[
$UPF_N6_PCI
==
""
]]
;
then
echo
"ERROR N6
$UPF_N6_NAME
cat not pci"
echo
"ERROR N6
$UPF_N6_NAME
can not get pci"
echo
"advice reboot"
exit
0
else
echo
"
$UPF_N6_NAME
pci
$UPF_N6_PCI
"
fi
}
function
get_inter_info_from_netcard
()
{
while
read
line
...
...
@@ -301,28 +309,28 @@ function check_inter_info()
{
if
[[
$UPF_N3_PCI
==
""
]]
;
then
echo
"ERROR N3
$UPF_N3_NAME
can not get pci"
echo
"reboot"
echo
"
\n
advice
reboot"
exit
0
else
echo
"
$UPF_N3_NAME
pci
$UPF_N3_PCI
"
fi
if
[[
$UPF_N6_PCI
==
""
]]
;
then
echo
"ERROR N6
$UPF_N6_NAME
can not get pci"
echo
"reboot"
echo
"
\n
advice
reboot"
exit
0
else
echo
"
$UPF_N6_NAME
pci
$UPF_N6_PCI
"
fi
if
[[
$UPF_N3_DRIVER
==
""
]]
;
then
echo
"ERROR N3
$UPF_N3_NAME
cat not get driver "
echo
"reboot"
echo
"
\n
advice
reboot"
exit
0
else
echo
"
$UPF_N3_NAME
pci
$UPF_N3_DRIVER
"
fi
if
[[
$UPF_N6_DRIVER
==
""
]]
;
then
echo
"ERROR N6
$UPF_N6_NAME
can not get driver "
echo
"reboot"
echo
"
\n
advice
reboot"
exit
0
else
echo
"
$UPF_N6_NAME
pci
$UPF_N6_DRIVER
"
...
...
@@ -392,22 +400,23 @@ function read_config() {
function
config_upf
()
{
install_driver
net_bind_driver
read_config
#is_configured
#result=$?
#if [ $result -eq 0 ] ; then
generate_instance
#fi
net_state
net_bind_vfio_pci
}
function
clear_upf
()
{
close_upf
rm
-rf
$/
base/
*
rm
-rf
$base
/
*
}
function
clear_conf
()
{
close_upf
rm
-f
$base
/etc/vppe.conf
rm
-f
$base
/etc/netcard.conf
}
function
help
()
{
echo
"help---"
...
...
@@ -418,6 +427,37 @@ function help()
function
main
()
{
num
=
15
((
tt
=
16#
$num
))
;
echo
$tt
a
=
13
t
=
$(
echo
"obase=16;
$a
"
|bc
)
echo
$t
((
b
=
$a
/4
))
;
((
c
=
$a
%4
))
;
echo
$b
echo
$c
gg
=
""
while
[
$b
!=
0
]
do
((
b
=
b-1
))
$gg
=
$gg
"F"
echo
"111"
echo
$b
echo
$gg
sleep
1
echo
"2222"
done
echo
$gg
return
if
[
$#
-eq
0
]
;
then
help
...
...
@@ -432,8 +472,8 @@ function main()
until
[
-z
"
$1
"
]
;
do
case
"
$1
"
in
--start-upf
)
config_upf
close_upf
config_upf
start_vppe
sleep
20s
start_n4
...
...
@@ -444,15 +484,19 @@ function main()
close_n4
shift
;;
--clear-upf
)
clear_upf
shift
;;
--clear-conf
)
clear_config
shift
;;
*
)
help
exit
0
shift
;;
--clear-upf
)
clear_upf
shift
;;
esac
done
return
0
...
...
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