Files
webgui/plugins/dynamix/SysDevs.page
tom mortensen 6bfd60c63a Merge pull request #598 from Skitals/master
SysDevs overhaul with vfio-pci.cfg binding
2020-05-08 21:59:32 -07:00

97 lines
4.1 KiB
Plaintext

Menu="UNRAID-OS"
Title="System Devices"
Icon="icon-hardware"
Tag="server"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<style>
table.pre{margin-top:0;background:transparent}
table.pre td:first-child{width:144px}
table tr td{padding:0 0 3px 0;margin:0}
table tr td.thin{line-height:8px;height:8px}
</style>
<script>
$(function(){
$('#t1').load('/webGui/include/SysDevs.php',{table:'t1'});
$('#t2').load('/webGui/include/SysDevs.php',{table:'t2'});
$('#t3').load('/webGui/include/SysDevs.php',{table:'t3'});
$('#t4').load('/webGui/include/SysDevs.php',{table:'t4'});
});
function applyCfg() {
var message = "System Devices: A reboot is required to apply changes";
var string = "BIND=";
var elements = document.getElementById("vfiopci").elements;
for (var i = 0, element; element = elements[i++];) {
if (element.type === "checkbox" && element.checked === true)
string = string + element.value + " ";
}
string = string.trim();
if (string === "BIND=") {
string = "";
}
$.get( "/plugins/dynamix/include/update.vfio-pci-cfg.php", { cfg: string } )
.done(function(d) {
if (d==1) {
addRebootNotice(message);
document.getElementById("warning").innerHTML = "<b>ALERT: Changes saved. Reboot to take effect.</b>";
} else {
removeRebootNotice(message);
document.getElementById("warning").innerHTML = "<b>No changes.</b>";
}
});
}
</script>
**PCI Devices and IOMMU Groups**
> This displays a list of IOMMU groups available on your system along with the output of the `lspci` command for each IOMMU group. The numeric identifiers are used to configure PCI pass-through.
>
> Devices you select will be bound to the vfio-pci driver at boot, which makes them available for assignment to a virtual machine, and also prevents the Linux kernel from automatically binding them to any present host driver.
>
> **Note that selecting a device will bind not only the specified device(s), but *all* other devices in the same IOMMU group as well.**
>
> &nbsp;<i class="fa fa-circle orb green-orb middle"></i>&nbsp;This symbol indicates the device is currently bound to the vfio-pci driver.
>
> &nbsp;<i class="fa fa-retweet grey-orb middle"></i>&nbsp;&nbsp;&nbsp;This symbol indicates the device supports FLR (Function Level Reset).
>
> <input type="checkbox" value="" disabled>&nbsp;&nbsp;If a checkbox is greyed out it means the device is in use by Unraid and can not be passed through.
<?if (strpos(file_get_contents('/proc/cmdline'), 'pcie_acs_override=') !== false):?>
<p class="notice" style="line-height:30px;height:auto">Warning: Your system has booted with the PCIe ACS Override setting enabled. The below list doesn't not reflect the way IOMMU would naturally group devices.<br>
To see natural IOMMU groups for your hardware, go to the <b><a href="/Settings/VMSettings">VM Manager</a></b> page and set the <b>PCIe ACS override</b> setting to <b>Disabled</b>.</p>
<?endif;?>
<pre><form id="vfiopci" onsubmit="return false"><table id='t1' class='pre'><tr><td><div class="spinner"></div></td></tr></table></form></pre><br>
**CPU Thread Pairings**
> This displays a list of CPU thread pairings.
<pre><table id='t2' class='pre'><tr><td><div class="spinner"></div></td></tr></table></pre><br>
**USB Devices**
> This displays the output of the `lsusb` command. The numeric identifiers are used to configure PCI pass-through.
<pre><table id='t3' class='pre'><tr><td><div class="spinner"></div></td></tr></table></pre><br>
**SCSI Devices**
> This displays the output of the `lsscsi` command. The numeric identifiers are used to configure PCI pass-through.
>
> Note that linux groups ATA, SATA and SAS devices with true SCSI devices.
<pre><table id='t4' class='pre'><tr><td><div class="spinner"></div></td></tr></table></pre>
<input type="button" value="_(Done)_" onclick="done()">