3 #/******************************************************************************
5 #* Copyright (c) 2019 Intel.
7 #* Licensed under the Apache License, Version 2.0 (the "License");
8 #* you may not use this file except in compliance with the License.
9 #* You may obtain a copy of the License at
11 #* http://www.apache.org/licenses/LICENSE-2.0
13 #* Unless required by applicable law or agreed to in writing, software
14 #* distributed under the License is distributed on an "AS IS" BASIS,
15 #* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #* See the License for the specific language governing permissions and
17 #* limitations under the License.
19 #*******************************************************************************/
21 export RTE_SDK=/home/turner/dpdk
22 export RTE_TARGET=x86_64-native-linuxapp-icc
27 remove_igb_uio_module()
29 echo "Unloading any existing DPDK UIO module"
30 /sbin/lsmod | grep -s igb_uio > /dev/null
31 if [ $? -eq 0 ] ; then
32 sudo /sbin/rmmod igb_uio
37 # Loads new igb_uio.ko (and uio module if needed).
41 if [ ! -f $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko ];then
42 echo "## ERROR: Target does not have the DPDK UIO Kernel Module."
43 echo " To fix, please try to rebuild target."
49 /sbin/lsmod | grep -s uio > /dev/null
50 if [ $? -ne 0 ] ; then
51 if [ -f /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko ] ; then
52 echo "Loading uio module"
53 sudo /sbin/modprobe uio
57 # UIO may be compiled into kernel, so it may not be an error if it can't
60 echo "Loading DPDK UIO module"
61 sudo /sbin/insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko
62 if [ $? -ne 0 ] ; then
63 echo "## ERROR: Could not load kmod/igb_uio.ko."
70 CPU_FEATURES_DETECT=`cat /proc/cpuinfo |grep hypervisor | wc -l`
72 if [ "$CPU_FEATURES_DETECT" -eq "0" ]
81 $RTE_SDK/usertools/dpdk-devbind.py --status
82 if [ ${VM_DETECT} == 'HOST' ]; then
84 $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:d8:02.0
85 $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:d8:02.1
86 $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:07:02.0
87 $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:07:02.1
90 $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:04.0
91 $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:05.0
92 $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:06.0
93 $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio 0000:00:07.0
96 $RTE_SDK/usertools/dpdk-devbind.py --status