Commit d7efdbf8 authored by wangyongshou's avatar wangyongshou

replace vpp config

parent 8b205259
......@@ -45,26 +45,25 @@ dpdk {
dev default {
num-rx-queues 1
}
dev @PCI_ADDR_ID_ENTRY@
dev @N3_PCI@
{
name if_n3
num-rx-queues 2
num-tx-queues 1
num-rx-queues 2
num-tx-queues 1
ipaddr @N3_IP@
netmask 32
gateway @N3_GW@
ipaddr @N3_IP@
netmask 32
gateway @N3_GW@
}
dev @PCI_ADDR_ID_EXPORT@
dev @N6_PCI@
{
name if_n6
num-rx-queues 1
num-rx-queues 1
ipaddr @N6_IP@
netmask 32
gateway @VPPHOST_IP@
gateway @N6_GW@
}
uio-driver vfio-pci
......
......@@ -27,7 +27,7 @@ function pre_create(){
fi
if [ ! -d $UPFINSTALL/etc ] ; then
sudo mkdir -p $UPFINSTALL/etc
sudo mkdir -p $UPFINSTALL/etc
fi
if [ ! -d $UPFINSTALL/scripts ] ; then
......@@ -36,15 +36,23 @@ function pre_create(){
if [ ! -d $UPFINSTALL/tools ] ; then
sudo mkdir -p $UPFINSTALL/tools
cp -f /sbin/ethtool $UPFINSTALL/tools
fi
}
function config_file(){
cp $configure/template/* $UPFINSTALL/etc
#scripts
cp -f $current/config_upf.sh $UPFINSTALL/scripts
cp -f $current/install_upf.sh $UPFINSTALL/scripts
cp -f $current/run_upf.sh $UPFINSTALL/scripts
#etc
cp -f $configure/template/n4_config.yaml $UPFINSTALL/etc
cp -f $configure/template/upf.conf $UPFINSTALL/etc
#tools
cp -f /sbin/ethtool $UPFINSTALL/tools
}
function pre_install(){
......@@ -231,17 +239,19 @@ function main() {
;;
--vpp-dp | --vpp-debug-pkg)
pre_create
config_file
make_vpp_package debug
shift;
;;
--vpp-rp | --vpp-release-pkg)
pre_create
config_file
make_vpp_package release
shift;
;;
--n4-dp | --vpp-debug-pkg)
config_file
pre_create
config_file
make_n4_package
shift;
;;
......
#!/bin/bash
current="$PWD"
base=$(dirname "$PWD")
VPP_CONFIG=$base/etc
#vpp config
UPF_N3_NAME=""
UPF_N6_NAME=""
......@@ -34,9 +39,14 @@ function get_inter_pci() {
function generate_instance(){
echo "generate_instance"
#sed s/@N3_GW@/${N3_GW_IP}/ ./startup_debug.conf > /dev/null 2>&1;
sed -i s/@N3_PCI@/${UPF_N3_PCI}/ ./upf.conf > /dev/null 2>&1;
sed -i s/@N6_PCI@/${UPF_N6_PCI}/ ./upf.conf > /dev/null 2>&1;
sed -i s/@N3_IP@/${UPF_N3_IP}/ ./upf.conf > /dev/null 2>&1;
sed -i s/@N6_IP@/${UPF_N6_IP}/ ./upf.conf > /dev/null 2>&1;
sed -i s/@N3_GW@/${UPF_N3_GW}/ ./upf.conf > /dev/null 2>&1;
sed -i s/@N6_GW@/${UPF_N6_GW}/ ./upf.conf > /dev/null 2>&1;
}
......@@ -44,10 +54,11 @@ function generate_instance(){
function read_config() {
file_name=$1
while read line
do
eval "$line"
done < upf.txt
done < $file_name
echo "vpp config"
UPF_N3_NAME=$vpp_n3_name
......@@ -63,10 +74,10 @@ function read_config() {
echo "UPF_N6_IP:$UPF_N6_IP"
UPF_N3_GW=$vpp_n3_gw
echo "vpp_n6_gw:$UPF_N3_GW"
echo "UPF_N3_GW:$UPF_N3_GW"
UPF_N6_GW=$vpp_n6_gw
echo "vpp_n6_gw:$UPF_N6_GW"
echo "UPF_N6_GW:$UPF_N6_GW"
UPF_CPU=$vpp_cpu
echo "vpp_cpu:$UPF_CPU"
......@@ -94,7 +105,15 @@ function read_config() {
}
function main() {
read_config
filename=$1
if [ ! -f $filename ] ; then
echo "no exist $filename"
return
fi
read_config $filename
generate_instance
}
......
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