Enable SR-IOV support on server. Change-Id: I7dabe340abd398cc0422698112cbdd81804446b7 Epic: PROD-8956tags/2017.4
Note: not recommended to use both pagesizes in concurrently. | Note: not recommended to use both pagesizes in concurrently. | ||||
Intel SR-IOV | |||||
~~~~~~~~~~~~ | |||||
PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV) specification defines a standardized mechanism to virtualize PCIe devices. The mechanism can virtualize a single PCIe Ethernet controller to appear as multiple PCIe devices. | |||||
.. code-block:: yaml | |||||
linux: | |||||
system: | |||||
kernel: | |||||
sriov: True | |||||
unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround | |||||
rc: | |||||
local: | | |||||
#!/bin/sh -e | |||||
# Enable 7 VF on eth1 | |||||
echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a | |||||
exit 0 | |||||
Repositories | Repositories | ||||
~~~~~~~~~~~~ | ~~~~~~~~~~~~ |
grub_d_directory: | |||||
file.directory: | |||||
- name: /etc/default/grub.d | |||||
- user: root | |||||
- group: root | |||||
- mode: 755 | |||||
- makedirs: True | |||||
grub_update: | |||||
cmd.wait: | |||||
- name: update-grub |
{%- from "linux/map.jinja" import system with context %} | {%- from "linux/map.jinja" import system with context %} | ||||
include: | |||||
- linux.system.grub | |||||
{%- if "pse" in grains.cpu_flags or "pdpe1gb" in grains.cpu_flags %} | {%- if "pse" in grains.cpu_flags or "pdpe1gb" in grains.cpu_flags %} | ||||
/etc/default/grub.d/90-hugepages.cfg: | /etc/default/grub.d/90-hugepages.cfg: | ||||
file.managed: | file.managed: | ||||
- source: salt://linux/files/grub_hugepages | - source: salt://linux/files/grub_hugepages | ||||
- template: jinja | - template: jinja | ||||
- require: | |||||
- file: grub_d_directory | |||||
- watch_in: | |||||
- cmd: grub_update | |||||
{%- for hugepages_type, hugepages in system.kernel.hugepages.iteritems() %} | {%- for hugepages_type, hugepages in system.kernel.hugepages.iteritems() %} | ||||
{%- if system.kernel.hugepages is defined %} | {%- if system.kernel.hugepages is defined %} | ||||
- linux.system.hugepages | - linux.system.hugepages | ||||
{%- endif %} | {%- endif %} | ||||
{%- if system.kernel.sriov is defined %} | |||||
- linux.system.sriov | |||||
{%- endif %} | |||||
{%- endif %} | {%- endif %} | ||||
{%- if system.cpu is defined %} | {%- if system.cpu is defined %} | ||||
- linux.system.cpu | - linux.system.cpu |
{%- 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 | |||||
- watch_in: | |||||
- cmd: grub_update | |||||
/etc/modprobe.d/sriov.conf: | |||||
file.managed: | |||||
- contents: | | |||||
blacklist ixgbevf | |||||
blacklist igbvf | |||||
blacklist i40evf | |||||
{%- if system.kernel.get('unsafe_interrupts', false) %} | |||||
/etc/modprobe.d/iommu_unsafe_interrupts.conf: | |||||
file.managed: | |||||
- contents: options vfio_iommu_type1 allow_unsafe_interrupts=1 | |||||
{%- endif %} |