-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vadim Rozenfeld <[email protected]>
- Loading branch information
Showing
277 changed files
with
7,037 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# NETKVM: Windows driver for virtio-net network adapter | ||
|
||
This README file covers specific features of NETKVM driver package. | ||
|
||
- **[NETKVM configuration tool (netkvmco.dll)](#netkvmco)** | ||
- provides means to enumerate, read and change values of NetKVM driver parameters. | ||
NetKVMConfig also provides easy to use interface for scripting that allows product maintenance and testing automation. | ||
- **[FAILOVER with SR-IOV virtual function](#netkvmp)** | ||
- provides support for virtio-net device in *standby* mode (see [qemu manual](https://www.qemu.org/docs/master/system/virtio-net-failover.html) for details) | ||
|
||
## NETKVM configuration tool (netkvmco.dll) <a name="netkvmco"/> | ||
|
||
### NetKVMConfig general description | ||
|
||
NetKVMConfig is implemented as Windows Netsh extension module. | ||
It provides Netsh-like standard command line interface and uses Netsh infrastructure to provide both interactive and batch modes of operation. | ||
NetKVMConfig works with Windows standard parameters database (driver parameters key in registry created by INF file, | ||
see [documentation](http://msdn.microsoft.com/en-us/library/ff570842%28v=VS.85%29.aspx) for details) | ||
for network drivers thus securing NetKVM driver parameters set and values are synchronized all over the network adapter configuration tools included into original Windows distribution. | ||
|
||
### NetKVMConfig usage manual | ||
|
||
Following operations are supported: | ||
- Registration in NetSH (installation) | ||
- `rundll32 netkvmco.dll,RegisterNetKVMNetShHelper` | ||
- Note: run the command from the administrator command line, netkvmco.dll must be in the current directory | ||
- Unregistration (removal) | ||
- `rundll32 netkvmco.dll,UnregisterNetKVMNetShHelper` | ||
- List NetKVM devices | ||
- `netsh netkvm show devices` | ||
- lists currently installed network. Unique index is assigned to each device. This index is to be used to identify the device for other operations. | ||
- Restart given NetKVM device | ||
- `netsh netkvm restart [idx=]0-N` | ||
- Parameters: IDX - device index from "show devices" output | ||
- restarts device specified by the index | ||
- examples: | ||
- `netsh netkvm restart idx=0` or `netsh netkvm restart 2` | ||
- Show NetKVM device parameters | ||
- `netsh netkvm show parameters [idx=]0-N` | ||
- Parameters: IDX - device index from "show devices" output | ||
- shows parameters for device specified by index. | ||
- examples: | ||
- `netsh netkvm show parameters idx=0` or `netsh netkvm show parameters 2` | ||
- Show detailed information about specified NetKVM device parameter | ||
- `netsh netkvm show paraminfo [idx=]0-N [param=]name` | ||
- Parameters: | ||
- IDX - device index from "show devices" output. | ||
- PARAM - name of parameter. | ||
- shows detailed information about given parameter. | ||
- examples: | ||
- `netsh netkvm show paraminfo idx=0 param=window` | ||
- `netsh netkvm show paraminfo 2 rx_buffers` | ||
- Read network device parameter value | ||
- `netsh netkvm getparam [idx=]0-N [param=]name` | ||
- Parameters: | ||
- IDX - device index from "show devices" output. | ||
- PARAM - name of parameter. | ||
- retrieves given parameter value. | ||
- examples: | ||
- `netsh netkvm getparam idx=0 param=window` | ||
- `netsh netkvm getparam 2 rx_buffers` | ||
- Change NetKVM device parameter value | ||
- `netsh netkvm setparam [idx=]0-N [param=]name [value=]value` | ||
- Parameters: | ||
- IDX - device index from "show devices" output. | ||
- PARAM - name of parameter. | ||
- VALUE - value of the parameter. | ||
- sets given parameter value. | ||
- examples: | ||
- `netsh netkvm setparam idx=0 param=window value=10` | ||
- `netsh netkvm setparam 2 rx_buffers 64` | ||
- Getting help for particular command: | ||
- `<command name> ?` | ||
- example: `netsh netkvm setparam ?` | ||
- Working in interactive mode | ||
- The same commands are supported in netsh interactive mode using standard netsh invocation syntax and shortcuts. | ||
For more information see [NetSh documentation](https://learn.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh-contexts) | ||
|
||
## FAILOVER with SR-IOV virtual function <a name="netkvmp"/> | ||
|
||
If the virtio-net-pci device is configured with 'failover=on' | ||
in the command line the virtio-net is not expected to be used | ||
as a standalone device but in combination with Virtual function | ||
(VF) of a SRIOV-capable host adapter. In this case the virtio-net | ||
and the VF must have identical MAC addresses. | ||
Unlike implementation of virtio-net failover feature in Linux | ||
failover virtio-net device in Windows starts function only after | ||
the VIOPROT protocol driver is installed: | ||
1. System start without VIOPROT installed: | ||
NETKVM driver **does not indicate link-up** until it recognizes | ||
presence of respective VF with the same MAC address (for that | ||
the VIOPROT is required) | ||
2. Upon VIOPROT installation the NETKVM adapter **indicates link-up** | ||
and starts working using VF data channel to its respective | ||
SRIOV physical function (PF) | ||
3. When the migration process is started the QEMU hides the VF | ||
device on the PCI bus, VF adapter on the source VM disappears | ||
and the NETKVM continues transferring data via TAP adapter | ||
on the host it is configured to use (typically this TAP | ||
adapter is attached to the same bridge as the PF. | ||
4. Until the migration is completed the virtio-net/NETKVM is | ||
the **fallback network adapter on the guest OS** (similar to Linux). | ||
Note that on this stage of the migration the VF is not used | ||
by the VM anymore. But because the VF is present and has the same | ||
MAC address as the virtio-net device it is possible that the PF | ||
will drop the traffic that comes from the virtio-net via its TAP | ||
as the network patckets usually have the same source MAC address | ||
as the VF. So, it is highly recommended to change the MAC address | ||
of the VF as soon as it is hidden on the VM PCI bus. | ||
5. When the migration is done QEMU attaches a new VF to the PCI bus | ||
of the VM on the destination system. NETKVM recognizes it and switches | ||
to the datapath of the new VF. | ||
|
||
## Protocol installation | ||
|
||
(by admin, from the directory where **vioprot.inf** and **netkvmp.exe** are located) | ||
|
||
`netkvmp install` or `netkvmp i` | ||
|
||
## Protocol uninstallation | ||
|
||
`netkvmp uninstall` or `netkvmp u` (by admin) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
;/*++ | ||
; | ||
;Copyright (c) 2009-2022 Red Hat Inc. | ||
; | ||
; | ||
;Module Name: | ||
; BALLOON.INF | ||
; | ||
;Abstract: | ||
; | ||
;Installation Notes: | ||
; Using Devcon: Type "devcon install BALLOON.inf PCI\VEN_1AF4&DEV_1002&SUBSYS_00051AF4&REV_00" or | ||
; "devcon install BALLOON.inf PCI\VEN_1AF4&DEV_1045&SUBSYS_11001AF4&REV_01" to install | ||
; | ||
;--*/ | ||
|
||
[Version] | ||
Signature="$WINDOWS NT$" | ||
Class=System | ||
ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318} | ||
Provider=%VENDOR% | ||
DriverVer = 07/21/2023,63.93.104.24000 | ||
CatalogFile=Balloon.cat | ||
DriverPackageType = PlugAndPlay | ||
DriverPackageDisplayName = %BALLOON.DeviceDesc% | ||
PnpLockdown = 1 | ||
|
||
[DestinationDirs] | ||
DefaultDestDir = 12 | ||
BALLOON_Device_CoInstaller_CopyFiles = 11 | ||
|
||
[SourceDisksNames] | ||
1 = %DiskId1%,,,"" | ||
|
||
[SourceDisksFiles] | ||
balloon.sys = 1,, | ||
; | ||
|
||
|
||
;***************************************** | ||
; BALLOON Install Section | ||
;***************************************** | ||
|
||
[Manufacturer] | ||
%VENDOR%=Standard,NTamd64.6.3 | ||
|
||
[Standard.NTamd64.6.3] | ||
%BALLOON.DeviceDesc%=BALLOON_Device, PCI\VEN_1AF4&DEV_1002&SUBSYS_00051AF4&REV_00, PCI\VEN_1AF4&DEV_1002 | ||
%BALLOON.DeviceDesc%=BALLOON_Device, PCI\VEN_1AF4&DEV_1045&SUBSYS_11001AF4&REV_01, PCI\VEN_1AF4&DEV_1045 | ||
|
||
[BALLOON_Device.NT] | ||
CopyFiles=Drivers_Dir | ||
|
||
[Drivers_Dir] | ||
balloon.sys | ||
|
||
[BALLOON_Device.NT.HW] | ||
AddReg=BALLOON_SD | ||
|
||
[BALLOON_SD] | ||
HKR,,Security,,"D:P(A;;GA;;;SY)" | ||
|
||
;-------------- Service installation | ||
[BALLOON_Device.NT.Services] | ||
AddService = BALLOON,%SPSVCINST_ASSOCSERVICE%, BALLOON_Service_Inst, BALLOON_Logging_Inst | ||
|
||
; -------------- BALLOON driver install sections | ||
[BALLOON_Service_Inst] | ||
DisplayName = %BALLOON.SVCDESC% | ||
ServiceType = 1 ; SERVICE_KERNEL_DRIVER | ||
StartType = 3 ; SERVICE_DEMAND_START | ||
ErrorControl = 1 ; SERVICE_ERROR_NORMAL | ||
ServiceBinary = %12%\balloon.sys | ||
|
||
; -------------- BALLOON driver eventlog install sections | ||
[BALLOON_Logging_Inst] | ||
AddReg = BALLOON_Logging_Inst_AddReg | ||
|
||
[BALLOON_Logging_Inst_AddReg] | ||
HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\drivers\balloon.sys" | ||
HKR,,TypesSupported,0x00010001,7 | ||
|
||
;--- BALLOON_Device Coinstaller installation ------ | ||
; | ||
|
||
[BALLOON_Device.NT.CoInstallers] | ||
AddReg=BALLOON_Device_CoInstaller_AddReg | ||
CopyFiles=BALLOON_Device_CoInstaller_CopyFiles | ||
|
||
[BALLOON_Device_CoInstaller_AddReg] | ||
; | ||
|
||
|
||
[BALLOON_Device_CoInstaller_CopyFiles] | ||
; | ||
|
||
|
||
[BALLOON_Device.NT.Wdf] | ||
KmdfService = BALLOON, BALLOON_wdfsect | ||
[BALLOON_wdfsect] | ||
KmdfLibraryVersion = 1.13 | ||
|
||
|
||
[Strings] | ||
SPSVCINST_ASSOCSERVICE= 0x00000002 | ||
VENDOR = "Red Hat, Inc." | ||
DiskId1 = "VirtIO Balloon Installation Disk #1" | ||
BALLOON.DeviceDesc = "VirtIO Balloon Driver" | ||
BALLOON.SVCDESC = "VirtIO Balloon Service" | ||
ClassName = "VirtIO Balloon Device" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
;/*++ | ||
; | ||
;Copyright (c) 2018-2022 Red Hat Inc. | ||
; | ||
; | ||
;Module Name: | ||
; fwcfg.inf | ||
; | ||
;Abstract: | ||
; | ||
;Installation Notes: | ||
; Using Devcon: Type "devcon install fwcfg.inf ACPI\QEMU0002" to install | ||
; | ||
;--*/ | ||
|
||
[Version] | ||
Signature="$WINDOWS NT$" | ||
Class=System | ||
ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318} | ||
Provider=%VENDOR% | ||
DriverVer = 07/21/2023,63.93.104.24000 | ||
CatalogFile=fwcfg.cat | ||
DriverPackageType = PlugAndPlay | ||
DriverPackageDisplayName = %FwCfg.DeviceDesc% | ||
PnpLockdown = 1 | ||
|
||
[DestinationDirs] | ||
DefaultDestDir = 12 | ||
FwCfg_Device_CoInstaller_CopyFiles = 11 | ||
|
||
; ================= Class section ===================== | ||
|
||
[SourceDisksNames] | ||
1 = %DiskName%,,,"" | ||
|
||
[SourceDisksFiles] | ||
fwcfg.sys = 1,, | ||
; | ||
|
||
|
||
;***************************************** | ||
; Install Section | ||
;***************************************** | ||
|
||
[Manufacturer] | ||
%VENDOR%=FwCfg,NTamd64.6.3 | ||
|
||
[FwCfg.NTamd64.6.3] | ||
%FwCfg.DeviceDesc%=FwCfg_Device, ACPI\QEMU0002 | ||
|
||
[FwCfg_Device.NT] | ||
CopyFiles=Drivers_Dir | ||
|
||
[Drivers_Dir] | ||
fwcfg.sys | ||
|
||
;-------------- Service installation | ||
[FwCfg_Device.NT.Services] | ||
AddService = FwCfg,%SPSVCINST_ASSOCSERVICE%, FwCfg_Service_Inst | ||
|
||
; -------------- FwCfg driver install sections | ||
[FwCfg_Service_Inst] | ||
DisplayName = %FwCfg.SVCDESC% | ||
ServiceType = 1 ; SERVICE_KERNEL_DRIVER | ||
StartType = 3 ; SERVICE_DEMAND_START | ||
ErrorControl = 1 ; SERVICE_ERROR_NORMAL | ||
ServiceBinary = %12%\fwcfg.sys | ||
|
||
; | ||
;--- FwCfg_Device Coinstaller installation ------ | ||
; | ||
|
||
[FwCfg_Device.NT.CoInstallers] | ||
AddReg=FwCfg_Device_CoInstaller_AddReg | ||
CopyFiles=FwCfg_Device_CoInstaller_CopyFiles | ||
|
||
[FwCfg_Device_CoInstaller_AddReg] | ||
; | ||
|
||
|
||
[FwCfg_Device_CoInstaller_CopyFiles] | ||
; | ||
|
||
|
||
[FwCfg_Device.NT.Wdf] | ||
KmdfService = FwCfg, FwCfg_wdfsect | ||
[FwCfg_wdfsect] | ||
KmdfLibraryVersion = 1.13 | ||
|
||
[Strings] | ||
SPSVCINST_ASSOCSERVICE= 0x00000002 | ||
VENDOR="Red Hat, Inc." | ||
DiskName = "QEMU FwCfg Installation Disk" | ||
FwCfg.DeviceDesc = "QEMU FwCfg Device" | ||
FwCfg.SVCDESC = "QEMU FwCfg Service" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.