summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIntel <intel.com>2012-12-20 00:00:00 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-07-25 15:01:57 +0200
commit3fc5ca2f63529ec5ad7b1b75f517d61dc7613bd9 (patch)
treed4f86e1784131e8a39598f335245f43583c8b644 /tools
parent2656baa8b78caf115213b9c4abdc2e296c5ed227 (diff)
downloaddpdk-3fc5ca2f63529ec5ad7b1b75f517d61dc7613bd9.zip
dpdk-3fc5ca2f63529ec5ad7b1b75f517d61dc7613bd9.tar.gz
dpdk-3fc5ca2f63529ec5ad7b1b75f517d61dc7613bd9.tar.xz
kni: initial import
Signed-off-by: Intel
Diffstat (limited to 'tools')
-rwxr-xr-xtools/setup.sh56
1 files changed, 49 insertions, 7 deletions
diff --git a/tools/setup.sh b/tools/setup.sh
index 058bc86..e8f01f6 100755
--- a/tools/setup.sh
+++ b/tools/setup.sh
@@ -59,7 +59,7 @@ quit()
}
#
-# Sets up envronment variables for ICC.
+# Sets up environmental variables for ICC.
#
setup_icc()
{
@@ -188,6 +188,42 @@ load_igb_uio_module()
}
#
+# Unloads the rte_kni.ko module.
+#
+remove_kni_module()
+{
+ echo "Unloading any existing DPDK KNI module"
+ /sbin/lsmod | grep -s rte_kni > /dev/null
+ if [ $? -eq 0 ] ; then
+ sudo /sbin/rmmod rte_kni
+ fi
+}
+
+#
+# Loads the rte_kni.ko module.
+#
+load_kni_module()
+{
+ # Check that the KNI module is already built.
+ if [ ! -f $RTE_SDK/$RTE_TARGET/kmod/rte_kni.ko ];then
+ echo "## ERROR: Target does not have the DPDK KNI Module."
+ echo " To fix, please try to rebuild target."
+ return
+ fi
+
+ # Unload existing version if present.
+ remove_kni_module
+
+ # Now try load the KNI module.
+ echo "Loading DPDK KNI module"
+ sudo /sbin/insmod $RTE_SDK/$RTE_TARGET/kmod/rte_kni.ko
+ if [ $? -ne 0 ] ; then
+ echo "## ERROR: Could not load kmod/rte_kni.ko."
+ quit
+ fi
+}
+
+#
# Removes all reserved hugepages.
#
clear_huge_pages()
@@ -324,11 +360,14 @@ step2_func()
TEXT[1]="Insert IGB UIO module"
FUNC[1]="load_igb_uio_module"
- TEXT[2]="Setup hugepage mappings for non-NUMA systems"
- FUNC[2]="set_non_numa_pages"
+ TEXT[2]="Insert KNI module"
+ FUNC[2]="load_kni_module"
- TEXT[3]="Setup hugepage mappings for NUMA systems"
- FUNC[3]="set_numa_pages"
+ TEXT[3]="Setup hugepage mappings for non-NUMA systems"
+ FUNC[3]="set_non_numa_pages"
+
+ TEXT[4]="Setup hugepage mappings for NUMA systems"
+ FUNC[4]="set_numa_pages"
}
#
@@ -372,8 +411,11 @@ step5_func()
TEXT[2]="Remove IGB UIO module"
FUNC[2]="remove_igb_uio_module"
- TEXT[3]="Remove hugepage mappings"
- FUNC[3]="clear_huge_pages"
+ TEXT[3]="Remove KNI module"
+ FUNC[3]="remove_kni_module"
+
+ TEXT[4]="Remove hugepage mappings"
+ FUNC[4]="clear_huge_pages"
}
STEPS[1]="step1_func"