[DPDK] Enable VT-d in kernel via grub in case vfio-pci PMD driver
This is required in order to use vfio-pci driver.
More info: http://docs.openvswitch.org/en/latest/intro/install/dpdk/
Change-Id: I1c936ffd4a903b9c6d67cdde6c612019a85f9b9e
diff --git a/README.rst b/README.rst
index 6170e0b..f46fc27 100644
--- a/README.rst
+++ b/README.rst
@@ -1043,7 +1043,7 @@
bridge: openvswitch
dpdk:
enabled: true
- driver: uio/vfio-pci
+ driver: uio/vfio
openvswitch:
pmd_cpu_mask: "0x6"
dpdk_socket_mem: "1024,1024"
@@ -1053,7 +1053,7 @@
dpkd0:
name: ${_param:dpdk_nic}
pci: 0000:06:00.0
- driver: igb_uio/vfio
+ driver: igb_uio/vfio-pci
enabled: true
type: dpdk_ovs_port
n_rxq: 2
@@ -1073,7 +1073,7 @@
bridge: openvswitch
dpdk:
enabled: true
- driver: uio/vfio-pci
+ driver: uio/vfio
openvswitch:
pmd_cpu_mask: "0x6"
dpdk_socket_mem: "1024,1024"
@@ -1083,7 +1083,7 @@
dpdk_second_nic:
name: ${_param:primary_second_nic}
pci: 0000:06:00.0
- driver: igb_uio/vfio
+ driver: igb_uio/vfio-pci
bond: dpdkbond0
enabled: true
type: dpdk_ovs_port
@@ -1093,7 +1093,7 @@
dpdk_first_nic:
name: ${_param:primary_first_nic}
pci: 0000:05:00.0
- driver: igb_uio/vfio
+ driver: igb_uio/vfio-pci
bond: dpdkbond0
enabled: true
type: dpdk_ovs_port
diff --git a/linux/system/dpdk.sls b/linux/system/dpdk.sls
new file mode 100644
index 0000000..9f29132
--- /dev/null
+++ b/linux/system/dpdk.sls
@@ -0,0 +1,6 @@
+{%- from "linux/map.jinja" import network with context %}
+
+{%- if network.dpdk.enabled and network.dpdk.driver == "vfio" %}
+include:
+ - linux.system.iommu
+{%- endif %}
\ No newline at end of file
diff --git a/linux/system/init.sls b/linux/system/init.sls
index 13f1565..fe54147 100644
--- a/linux/system/init.sls
+++ b/linux/system/init.sls
@@ -1,4 +1,5 @@
{%- from "linux/map.jinja" import system with context %}
+{%- from "linux/map.jinja" import network with context %}
include:
- linux.system.env
- linux.system.profile
@@ -19,6 +20,9 @@
{%- if system.kernel.hugepages is defined %}
- linux.system.hugepages
{%- endif %}
+{%- if network.dpdk is defined %}
+- linux.system.dpdk
+{%- endif %}
{%- if system.kernel.sriov is defined %}
- linux.system.sriov
{%- endif %}
diff --git a/linux/system/iommu.sls b/linux/system/iommu.sls
new file mode 100644
index 0000000..d9e1b80
--- /dev/null
+++ b/linux/system/iommu.sls
@@ -0,0 +1,12 @@
+include:
+ - linux.system.grub
+
+/etc/default/grub.d/90-iommu.cfg:
+ file.managed:
+ - contents: 'GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT intel_iommu=on iommu=pt"'
+ - require:
+ - file: grub_d_directory
+{%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %}
+ - watch_in:
+ - cmd: grub_update
+{%- endif %}
diff --git a/linux/system/sriov.sls b/linux/system/sriov.sls
index 2093e06..4c4743f 100644
--- a/linux/system/sriov.sls
+++ b/linux/system/sriov.sls
@@ -1,17 +1,7 @@
{%- from "linux/map.jinja" import system with context %}
include:
- - linux.system.grub
-
-/etc/default/grub.d/90-sriov.cfg:
- file.managed:
- - contents: 'GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT intel_iommu=on iommu=pt"'
- - require:
- - file: grub_d_directory
-{%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %}
- - watch_in:
- - cmd: grub_update
-{%- endif %}
+ - linux.system.iommu
/etc/modprobe.d/sriov.conf:
file.managed: