summaryrefslogtreecommitdiffstats
path: root/plugins/dpdk/roles/ins_dpdk/templates
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dpdk/roles/ins_dpdk/templates')
-rw-r--r--plugins/dpdk/roles/ins_dpdk/templates/dpdk_uio.sh.j29
-rw-r--r--plugins/dpdk/roles/ins_dpdk/templates/dpdk_vfio.sh.j26
2 files changed, 15 insertions, 0 deletions
diff --git a/plugins/dpdk/roles/ins_dpdk/templates/dpdk_uio.sh.j2 b/plugins/dpdk/roles/ins_dpdk/templates/dpdk_uio.sh.j2
new file mode 100644
index 00000000..560d30ca
--- /dev/null
+++ b/plugins/dpdk/roles/ins_dpdk/templates/dpdk_uio.sh.j2
@@ -0,0 +1,9 @@
+#!/bin/bash
+ifdown {{ item.device_name }}
+modprobe uio
+lsmod |grep igb_uio
+if [ $? == 0 ];then
+ rmmod igb_uio
+fi
+insmod {{ item.dpdk_build }}/kmod/igb_uio.ko
+{{ item.dpdk_dir }}/tools/dpdk-devbind.py --bind=igb_uio {{ item.device_name }}
diff --git a/plugins/dpdk/roles/ins_dpdk/templates/dpdk_vfio.sh.j2 b/plugins/dpdk/roles/ins_dpdk/templates/dpdk_vfio.sh.j2
new file mode 100644
index 00000000..58839342
--- /dev/null
+++ b/plugins/dpdk/roles/ins_dpdk/templates/dpdk_vfio.sh.j2
@@ -0,0 +1,6 @@
+#!/bin/bash
+ifdown {{ item.device_name }}
+modprobe vfio-pci
+chmod a+x /dev/vfio
+chmod 0666 /dev/vfio/*
+{{ item.dpdk_dir }}/tools/dpdk-devbind.py --bind=vfio-pci {{ item.device_name }}