Commit Graph
1075 Commits
Author SHA1 Message Date
Yuri Benditovich 0a6c5fc482 netkvm: remove spaces at the beginning of the line
Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-22 14:18:30 +02:00
Yuri Benditovich 39a198bc91 netkvm: update netkvm-wmi.cmd script
Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-22 14:18:30 +02:00
Yuri Benditovich c21e0accd4 netkvm: report correct TX queue size via WMI
Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-22 14:18:30 +02:00
Yuri Benditovich f25ede16eb netkvm: add metrics for allocated shared memory for RX
Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-22 14:18:30 +02:00
Yuri Benditovich 641cc937e0 netkvm: add metrics for copied Tx packets
Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-22 14:18:30 +02:00
Yuri Benditovich 634e6b4670 netkvm: rework vendor specific WMI properties
Split tx,rx and rss statistics
Add property for [initial] configuration data
Make reset of statistics selective and explicit
Add metrics for:
- minimal number of rx buffers
- indications with 'resource' flag
- amount of allocated shared memory

Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-22 14:18:30 +02:00
Yuri Benditovich 6ca618ae03 netkvm: hide vendor-specific OIDs from 'supported' list
They are not mandatory in the list of supported OIDs,
OID_GEN_SUPPORTED_GUIDS is enough.

Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-22 14:18:30 +02:00
junjiehua 00d2037945 [netkvm] add a workaround for rx packet loss
Implemented a workaround for rx packet loss encountered with TCP_NODELAY. By default,
this feature is turned off to minimize the impact on CPU performance and network bandwidth.

To activate the feature, go to the network card properties and set the MinRxBufferPercent
to a value above 0. A good starting point is to set MinRxBufferPercent to 25% and then monitor
for any packet loss. If packet loss continues, incrementally adjust the value to 50%, then 75%,
and if necessary, up to the maximum of 100%.

In extreme cases, it may be required to not only adjust the  MinRxBufferPercent but also to increase
the number of queues and the size of each queue (queue_size).

It is important to note that this feature is only applicable to rx packet loss.

For more details, see [this thread](https://github.com/virtio-win/kvm-guest-drivers-windows/issues/1012).

Signed-off-by: junjiehua <[email protected]>
2024-01-18 11:21:17 +02:00
Yuri Benditovich d89185c6be netkvmco: (minor) remove unneded lines causing warning
Removal of redundant/unneded lines from the .vcxproj
They also caused by IDE warning on loading of any project
including netkvmco.

Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-17 15:01:17 +02:00
Yuri Benditovich c81ff1fa55 netkvm: (minor) define IsPowerOfTwo in common header
And remove the same definition from various files.

Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-17 15:01:17 +02:00
Yuri Benditovich 1ea1b12a5c netkvm: change limit of RX buffers per queue 256=>1024
https://issues.redhat.com/browse/RHEL-19430

The number of buffers is always limited by queue size,
so with the default QEMU setting (256) the driver will do
the same. If QEMU is configured in command-line to have
bigger queue (it allows up to 1024), the previous driver
required to change also driver property to really use
full size of QEMU RX queue. Now this will not be required
(up to 1024 buffers).

Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-17 15:01:17 +02:00
zhangjianminng c408c18940 netkvm: add the feature of copy mapping
for the problem description
please visit #942

Signed-off-by:  Zhang JianMing <[email protected]>
2024-01-16 15:31:03 +02:00
zhangjianminng 6c2f08a4d9 netkvm: refactor BindToDescriptor return type to use NBMappingStatus enum
This commit updates the CNB::BindToDescriptor method signature, changing
the return type from a boolean to the newly introduced NBMappingStatus
enum. The updated method now returns one of the following statuses:

    NBMappingStatus::SUCCESS
    NBMappingStatus::NO_RESOURCE
    NBMappingStatus::FAILURE

This change allows for more detailed reporting of the binding operation
outcome, enabling the caller to distinguish between different failure
reasons beyond the previous binary success/failure indication. The
NBMappingStatus enum provides a clearer, more expressive way to handle
the results of the binding process.

Signed-off-by:  Zhang JianMing <[email protected]>
2024-01-16 15:31:03 +02:00
zhangjianminng 6d23a8260b netkvm: add CopyFromMdlChain function to CNB class
This commit introduces the CopyFromMdlChain function to the CNB class. The function is responsible for copying data from a Memory Descriptor List (MDL) chain to a specified destination buffer. A special focus has been given to ensuring the function handles the traversal of the MDL chain correctly, updating the Source MDL pointer and the Offset within the current MDL as it progresses through the chain.

Signed-off-by:  Zhang JianMing <[email protected]>
2024-01-16 15:31:03 +02:00
zhangjianminng a9d3c71d03 netkvm: define MAX_FRAGMENTS_IN_ONE_NB macro to cap SGTableCapacity
This commit introduces the MAX_FRAGMENTS_IN_ONE_NB macro, which
defines the maximum number of fragments in a single NET_BUFFER. It
is used to constrain the SGTableCapacity value, ensuring it does
not exceed the meaningful limit set by MAX_FRAGMENTS_IN_ONE_NB.

Signed-off-by:  Zhang JianMing <[email protected]>
2024-01-16 15:31:03 +02:00
zhangjianminng 19ee48c26f netkvm: add additional pages to TXManager for upcoming copy mechanism
This commit introduces extra pages within the TXManager module,
which are intended to support the copy mechanism that will be
implemented in subsequent updates. The addition of these pages lays
the groundwork for the new functionality and ensures that the
TXManager is prepared for the enhancements.

Signed-off-by:  Zhang JianMing <[email protected]>
2024-01-16 15:31:03 +02:00
Yuri Benditovich 359f42c102 netkvm: filter RX packets as early as possible
https://issues.redhat.com/browse/RHEL-20575

Currently the driver get RX descriptor from the rx virtQ,
analyses it (L2/L3), calculates hash and delivers to the
proper RSS queue. Later it extract the packet from the RSS
queue and checks whether it passes RX filters.
Now we move the filtering to the earliest stage - just after
basic analysis.
Note that in case of vhost there are no receive filters
configured by the host and typically the host does not work
in promiscuous mode, so it is redundant to calculate the hash
and trigger the RSS queue for packets that should be dropped.

Signed-off-by: Yuri Benditovich <[email protected]>
2024-01-16 10:17:40 +02:00
Yuri Benditovich 1af7dfdb9d netkvm: add comments for CLockFreeDynamicQueue
Notes about procedures and synchronization

Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-31 13:25:11 +02:00
Yuri Benditovich 96d0d03b40 netkvm: delete unused functions
Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-31 13:25:11 +02:00
Yuri Benditovich da89ff8406 netkvm: remove erroneous CParaNdisTX::BuildCancelList
https://issues.redhat.com/browse/RHEL-19833

Commit e8f319fdc0 in part of NBL cancellation was wrong.
NBLs not matching the CancelId are lost, they will not be
neither sent nor completed. Leave the cancellation path
not implemented (as it is optional).

Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-31 13:25:11 +02:00
zhangjianminng cb95035874 [netkvm] add surprise remove attribute
Signed-off-by:  Zhang JianMing <[email protected]>

for the problem description
please visit virtio-win#1002
2023-12-31 13:24:19 +02:00
Yuri Benditovich 3743aa9df0 netkvm: remove query for OID_GEN_TRANSMIT_QUEUE_LENGTH
https://issues.redhat.com/browse/RHEL-19441
The response to the query is calculated incorrectly.
We can make it correct but I think that support for this
OID is not required, it is not in the list of mandatory
OIDs. In general the NDIS has the same knowledge about
how many packets are queued by the miniport.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-19 15:57:52 +02:00
Kostiantyn Kostiuk 4c4d1812a8 Add Windows 11 target
Update build scripts to use EWDK 11 21H2 for Win10 target
and EWDK 11 22H2 for Win11 target

Signed-off-by: Kostiantyn Kostiuk <[email protected]>
2023-12-19 15:55:31 +02:00
Yuri Benditovich d68cf27e4a netkvm: minor fixes in netkvm-wmi.cmd
Better output formatting, removed obsolete command.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-18 13:38:13 +02:00
Yuri Benditovich 93015d29c4 netkvm: add statistics for TX events of interest
Adding statistics for failed TX packets
(ones that can't be mapped using available indirect area) and
minimal available TX descriptors (if one or more TX virtqueues
were completely filled by packets this field will be read as 0)
These statistics fields are printed on disable and also available
at run-time via WMI.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-18 13:38:13 +02:00
Yuri Benditovich b0468b1b22 netkvm: fix assignment of TX m_FreeHWBuffers
The assignment of m_FreeHWBuffers etc is wrong. If one of
TX descriptors is not allocated we need to take this in
account.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-18 13:38:13 +02:00
Yuri Benditovich 08e5ae94b4 netkvm: remove the code that never runs
https://github.com/virtio-win/kvm-guest-drivers-windows/issues/1006
If (hashTypes & NDIS_HASH_IPV6) if was processed above.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-18 13:38:13 +02:00
Yuri Benditovich 14b4ce09a0 netkvm: limit indirect area usage when needed
https://issues.redhat.com/browse/RHEL-19317

Virtio spec 1.2 says in
"2.7.5.3.1 Driver Requirements: Indirect Descriptors":
"A driver MUST NOT create a descriptor chain longer than the Queue Size
of the device."
In case the device reports TX queue size shorter than 256 the driver
still can create a chain of up to 256 descriptors in the _indirect_
area. This commit limits the usage of indirect area by the actual
number of the TX descriptors created for the queue.
Note that QEMU of the day is able to retrieve up to 1024 descriptors
regardless the TX queue size and also does not allow to configure
the TX queue size to less than 256, but not required to do so.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-12-18 13:38:13 +02:00
Kostiantyn Kostiuk c165bd5498 Remove Win8.1 targets and build scripts
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
2023-11-07 13:11:11 +01:00
Kostiantyn Kostiuk d39a39ca74 Remove Win8 targets and build scripts
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
2023-11-07 13:11:11 +01:00
Kostiantyn Kostiuk f83561e272 Update installation notes part of INF
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
2023-11-01 16:47:16 +01:00
Yuri Benditovich 47c111e958 netkvmco: fix exception when the value is DWORD
The library reads all the network adapter enums as strings.
If due to some reason the value is DWORD (Intel Wi-Fi), the
application gets exception and does not report anything at
all. Re-read the value is such case and avoid fatal error.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-09-26 09:21:39 +02:00
Yuri Benditovich c649e5efdc netkvmco: remove redundant things
We remove the code related to registration of netsh helper
and helper DLL

Signed-off-by: Yuri Benditovich <[email protected]>
2023-09-26 09:21:39 +02:00
Yuri Benditovich af78b83bad netkvmko: replace netsh.h includes with own ones
netkvmco.h becomes interface file between static lib and the
application that uses it. The application should call start
and stop procedures of the helper and resolve missing
procedures that previously were in netsh.lib

Signed-off-by: Yuri Benditovich <[email protected]>
2023-09-26 09:21:39 +02:00
Yuri Benditovich 85c2d9d5d6 netkvm: discard netkvmco.dll and copy netkvmco.exe
Signed-off-by: Yuri Benditovich <[email protected]>
2023-09-26 09:21:39 +02:00
Yuri Benditovich 6bebef340f netkvmco: Transform netkvmco.dll to application
Signed-off-by: Yuri Benditovich <[email protected]>
2023-09-26 09:21:39 +02:00
Yuri Benditovich 97c645322d netkvmco: add simulator of netsh plugin runner
Signed-off-by: Yuri Benditovich <[email protected]>
2023-09-26 09:21:39 +02:00
Kostiantyn Kostiuk 214242e777 Add ARM64 build in drivers build.bat
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
2023-08-17 17:02:10 +03:00
Yuri Benditovich a3739eee82 netkvm-prot: rework processing of app parameters
Make it exactly as described in the decumentation:
'i' or 'install', 'u' or 'uninstall'
add usage for not recognized parameters.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 3ae46f9c9b netkvm-prot: split large function CNetCfg::EnableComponents
Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 88ae2b988c netkvm: replace readme.doc with readme.md
Populate readme.md in the installation package instead if
readme.doc.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich f9bdc55a06 netkvm: create readme.md
DOC file format is hardly readable without specially installed tools.
The Logo requirement to have network adapter configuration utility
manual in DOC file is gone.
We move the text from the DOC file to readme.md and add to the MD
also documentation regarding failover feature.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 84609ae0de netkvm: support of VF statistics
Currently in the statistics reported by the netkvm adapter does
not include the packets transmitted via VF and received from VF.
The commit fixes it: it maintains the VF statistics and on each call
adds the difference of first call it saves the statistics of VF,
on further calls if updates netkvm statistics.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich a07e035294 netkvm-prot: require admin privileges
Running the application without admin priviliges is meaningless.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 97400cde06 netkvm-prot: fixes in protocol teardown flow
Now the protocol service works correctly in both uninstall
and temporary service stop flows.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 56aa0f26e3 netkvm-prot: discard old unneeded uninstall option
Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich c5135401c0 netkvm-prot: remove explicit "norestore" flag
This flag was used to determine whether we need to restore
functional state of adapters on service stop. The proper way
to do that is to check whether the VIOPROT is installed.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 2cfd4a4207 netkvmp-prot: add device notification to trigger working thread
When network devices come to enabled/disabled state or
added/removed - process the change immediately and not only
via periodical polling

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich b5548aeab9 netkvm-prot: refactor CInterfaceTable for flexibility
Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 235e6e7f20 netkvm-prot: add ability to dump existing network adapters
"netkvmp e" - for internal purposes

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00