From: Zhimin Date: Thu, 19 Mar 2020 07:50:43 +0000 (+0800) Subject: provide follow features implementation: X-Git-Tag: oran_release_bronze_v1.0~17 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=commitdiff_plain;h=d0fb1c6fee9f4bd737ab346380f27d0f5ab5ca3c provide follow features implementation: 1) fix the format issue of script, it was convert to dos format by mistake xran root refers to the o-du/phy/fhi_lib folder   Issue-Id: ODULOW-8 ODULOW-9 ODULOW-10 Change-Id: I2a1673edfd6f540ed2e499c0a12fe0cf35a9fa42 Signed-off-by: Zhimin --- diff --git a/fhi_lib/app/dpdk.sh b/fhi_lib/app/dpdk.sh old mode 100644 new mode 100755 index 1e4c8f4..2f5aa8a --- a/fhi_lib/app/dpdk.sh +++ b/fhi_lib/app/dpdk.sh @@ -1,148 +1,148 @@ -#! /bin/bash - -#/****************************************************************************** -#* -#* Copyright (c) 2019 Intel. -#* -#* Licensed under the Apache License, Version 2.0 (the "License"); -#* you may not use this file except in compliance with the License. -#* You may obtain a copy of the License at -#* -#* http://www.apache.org/licenses/LICENSE-2.0 -#* -#* Unless required by applicable law or agreed to in writing, software -#* distributed under the License is distributed on an "AS IS" BASIS, -#* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#* See the License for the specific language governing permissions and -#* limitations under the License. -#* -#*******************************************************************************/ - - -export RTE_SDK=/home/turner/dpdk -export RTE_TARGET=x86_64-native-linuxapp-icc - -# -# Unloads igb_uio.ko. -# -remove_igb_uio_module() -{ - echo "Unloading any existing DPDK UIO module" - /sbin/lsmod | grep -s igb_uio > /dev/null - if [ $? -eq 0 ] ; then - sudo /sbin/rmmod igb_uio - fi -} - -# -# Loads new igb_uio.ko (and uio module if needed). -# -load_igb_uio_module() -{ - if [ ! -f $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko ];then - echo "## ERROR: Target does not have the DPDK UIO Kernel Module." - echo " To fix, please try to rebuild target." - return - fi - - remove_igb_uio_module - - /sbin/lsmod | grep -s uio > /dev/null - if [ $? -ne 0 ] ; then - if [ -f /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko ] ; then - echo "Loading uio module" - sudo /sbin/modprobe uio - fi - fi - - # UIO may be compiled into kernel, so it may not be an error if it can't - # be loaded. - - echo "Loading DPDK UIO module" - sudo /sbin/insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko - if [ $? -ne 0 ] ; then - echo "## ERROR: Could not load kmod/igb_uio.ko." - quit - fi -} - -# -# Unloads VFIO modules. -# -remove_vfio_module() -{ - echo "Unloading any existing VFIO module" - /sbin/lsmod | grep -s vfio > /dev/null - if [ $? -eq 0 ] ; then - sudo /sbin/rmmod vfio-pci - sudo /sbin/rmmod vfio_iommu_type1 - sudo /sbin/rmmod vfio - fi -} - -# -# Loads new vfio-pci (and vfio module if needed). -# -load_vfio_module() -{ - remove_vfio_module - - VFIO_PATH="kernel/drivers/vfio/pci/vfio-pci.ko" - - echo "Loading VFIO module" - /sbin/lsmod | grep -s vfio_pci > /dev/null - if [ $? -ne 0 ] ; then - if [ -f /lib/modules/$(uname -r)/$VFIO_PATH ] ; then - sudo /sbin/modprobe vfio-pci - fi - fi - - # make sure regular users can read /dev/vfio - echo "chmod /dev/vfio" - sudo chmod a+x /dev/vfio - if [ $? -ne 0 ] ; then - echo "FAIL" - quit - fi - echo "OK" - - # check if /dev/vfio/vfio exists - that way we - # know we either loaded the module, or it was - # compiled into the kernel - if [ ! -e /dev/vfio/vfio ] ; then - echo "## ERROR: VFIO not found!" - fi -} - - -load_igb_uio_module -load_vfio_module - -CPU_FEATURES_DETECT=`cat /proc/cpuinfo |grep hypervisor | wc -l` - -if [ "$CPU_FEATURES_DETECT" -eq "0" ] -then -VM_DETECT='HOST' -echo ${VM_DETECT} -else -VM_DETECT='VM' -echo ${VM_DETECT} -fi - -$RTE_SDK/usertools/dpdk-devbind.py --status -if [ ${VM_DETECT} == 'HOST' ]; then - #HOST - $RTE_SDK/usertools/dpdk-devbind.py --bind=vfio-pci 0000:22:02.0 - $RTE_SDK/usertools/dpdk-devbind.py --bind=vfio-pci 0000:22:02.1 - $RTE_SDK/usertools/dpdk-devbind.py --bind=vfio-pci 0000:22:0a.0 - $RTE_SDK/usertools/dpdk-devbind.py --bind=vfio-pci 0000:22:0a.1 -else - #VM - $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:04.0 - $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:05.0 - $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:06.0 - $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:07.0 -fi - -$RTE_SDK/usertools/dpdk-devbind.py --status - +#! /bin/bash + +#/****************************************************************************** +#* +#* Copyright (c) 2019 Intel. +#* +#* Licensed under the Apache License, Version 2.0 (the "License"); +#* you may not use this file except in compliance with the License. +#* You may obtain a copy of the License at +#* +#* http://www.apache.org/licenses/LICENSE-2.0 +#* +#* Unless required by applicable law or agreed to in writing, software +#* distributed under the License is distributed on an "AS IS" BASIS, +#* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +#* See the License for the specific language governing permissions and +#* limitations under the License. +#* +#*******************************************************************************/ + + +export RTE_SDK=/home/turner/dpdk +export RTE_TARGET=x86_64-native-linuxapp-icc + +# +# Unloads igb_uio.ko. +# +remove_igb_uio_module() +{ + echo "Unloading any existing DPDK UIO module" + /sbin/lsmod | grep -s igb_uio > /dev/null + if [ $? -eq 0 ] ; then + sudo /sbin/rmmod igb_uio + fi +} + +# +# Loads new igb_uio.ko (and uio module if needed). +# +load_igb_uio_module() +{ + if [ ! -f $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko ];then + echo "## ERROR: Target does not have the DPDK UIO Kernel Module." + echo " To fix, please try to rebuild target." + return + fi + + remove_igb_uio_module + + /sbin/lsmod | grep -s uio > /dev/null + if [ $? -ne 0 ] ; then + if [ -f /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko ] ; then + echo "Loading uio module" + sudo /sbin/modprobe uio + fi + fi + + # UIO may be compiled into kernel, so it may not be an error if it can't + # be loaded. + + echo "Loading DPDK UIO module" + sudo /sbin/insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko + if [ $? -ne 0 ] ; then + echo "## ERROR: Could not load kmod/igb_uio.ko." + quit + fi +} + +# +# Unloads VFIO modules. +# +remove_vfio_module() +{ + echo "Unloading any existing VFIO module" + /sbin/lsmod | grep -s vfio > /dev/null + if [ $? -eq 0 ] ; then + sudo /sbin/rmmod vfio-pci + sudo /sbin/rmmod vfio_iommu_type1 + sudo /sbin/rmmod vfio + fi +} + +# +# Loads new vfio-pci (and vfio module if needed). +# +load_vfio_module() +{ + remove_vfio_module + + VFIO_PATH="kernel/drivers/vfio/pci/vfio-pci.ko" + + echo "Loading VFIO module" + /sbin/lsmod | grep -s vfio_pci > /dev/null + if [ $? -ne 0 ] ; then + if [ -f /lib/modules/$(uname -r)/$VFIO_PATH ] ; then + sudo /sbin/modprobe vfio-pci + fi + fi + + # make sure regular users can read /dev/vfio + echo "chmod /dev/vfio" + sudo chmod a+x /dev/vfio + if [ $? -ne 0 ] ; then + echo "FAIL" + quit + fi + echo "OK" + + # check if /dev/vfio/vfio exists - that way we + # know we either loaded the module, or it was + # compiled into the kernel + if [ ! -e /dev/vfio/vfio ] ; then + echo "## ERROR: VFIO not found!" + fi +} + + +load_igb_uio_module +load_vfio_module + +CPU_FEATURES_DETECT=`cat /proc/cpuinfo |grep hypervisor | wc -l` + +if [ "$CPU_FEATURES_DETECT" -eq "0" ] +then +VM_DETECT='HOST' +echo ${VM_DETECT} +else +VM_DETECT='VM' +echo ${VM_DETECT} +fi + +$RTE_SDK/usertools/dpdk-devbind.py --status +if [ ${VM_DETECT} == 'HOST' ]; then + #HOST + $RTE_SDK/usertools/dpdk-devbind.py --bind=vfio-pci 0000:22:02.0 + $RTE_SDK/usertools/dpdk-devbind.py --bind=vfio-pci 0000:22:02.1 + $RTE_SDK/usertools/dpdk-devbind.py --bind=vfio-pci 0000:22:0a.0 + $RTE_SDK/usertools/dpdk-devbind.py --bind=vfio-pci 0000:22:0a.1 +else + #VM + $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:04.0 + $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:05.0 + $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:06.0 + $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:07.0 +fi + +$RTE_SDK/usertools/dpdk-devbind.py --status + diff --git a/fhi_lib/app/run_o_du.sh b/fhi_lib/app/run_o_du.sh old mode 100644 new mode 100755 index fccf846..4a1202e --- a/fhi_lib/app/run_o_du.sh +++ b/fhi_lib/app/run_o_du.sh @@ -1,31 +1,32 @@ -#! /bin/bash - -#****************************************************************************** -# -# Copyright (c) 2019 Intel. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -#******************************************************************************/ - - -ulimit -c unlimited -echo 1 > /proc/sys/kernel/core_uses_pid - - -#40G -#./build/sample-app ./usecase/mu3_100mhz/config_file_o_du.dat 0000:d8:02.0 0000:d8:02.1 - -#25G -./build/sample-app ./usecase/mu0_5mhz/config_file_o_du.dat 0000:22:02.0 0000:22:02.1 -#./build/sample-app ./usecase/mu1_100mhz/config_file_o_du.dat 0000:18:02.0 0000:18:02.1 +#! /bin/bash + +#****************************************************************************** +# +# Copyright (c) 2019 Intel. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#******************************************************************************/ + +ulimit -c unlimited +echo 1 > /proc/sys/kernel/core_uses_pid + + +#40G +./build/sample-app ./usecase/mu3_100mhz/config_file_o_du.dat 0000:18:02.0 0000:18:02.1 + +#25G + + +#./build/sample-app ./usecase/cat_b/mu1_100mhz/config_file_o_du.dat 0000:21:02.0 0000:21:02.1 +#./build/sample-app ./usecase/mu1_100mhz/config_file_o_du.dat 0000:86:02.0 0000:86:02.1 diff --git a/fhi_lib/app/run_o_ru.sh b/fhi_lib/app/run_o_ru.sh old mode 100644 new mode 100755 index c7341f7..02f3393 --- a/fhi_lib/app/run_o_ru.sh +++ b/fhi_lib/app/run_o_ru.sh @@ -1,30 +1,30 @@ -#! /bin/bash - -#****************************************************************************** -# -# Copyright (c) 2019 Intel. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -#******************************************************************************/ - - -ulimit -c unlimited -echo 1 > /proc/sys/kernel/core_uses_pid - -#40G -#./build/sample-app ./usecase/mu3_100mhz/config_file_o_du.dat 0000:d8:02.0 0000:d8:02.1 - -#25G -./build/sample-app ./usecase/mu0_5mhz/config_file_o_ru.dat 0000:22:0a.0 0000:22:0a.1 -#./build/sample-app ./usecase/mu1_100mhz/config_file_o_ru.dat 0000:18:0a.0 0000:18:0a.1 +#! /bin/bash + +#****************************************************************************** +# +# Copyright (c) 2019 Intel. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#******************************************************************************/ + + +ulimit -c unlimited +echo 1 > /proc/sys/kernel/core_uses_pid + +#40G +#./build/sample-app ./usecase/mu3_100mhz/config_file_o_du.dat 0000:d8:02.0 0000:d8:02.1 + +#25G +./build/sample-app ./usecase/mu0_5mhz/config_file_o_ru.dat 0000:22:0a.0 0000:22:0a.1 +#./build/sample-app ./usecase/mu1_100mhz/config_file_o_ru.dat 0000:18:0a.0 0000:18:0a.1 diff --git a/fhi_lib/build.sh b/fhi_lib/build.sh old mode 100644 new mode 100755