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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
The protocol part (VF binding) is changed to change it's state
when required to do so by the protocol service.
Only VF removal changes the state of binding/netkvm adapter
without external request.
Signed-off-by: Yuri Benditovich <[email protected]>
If the bound VF adapter reports a packet with RESOURCES flag
the protocol handler must never return it and also NDIS never
returns it, the VF driver retains the ownership. Fix the
counting for such packets. We can see sometimes such packets
at least with I350 VF.
Signed-off-by: Yuri Benditovich <[email protected]>
When the OS tries to bind the netkvm adapter to VIOPROT
the driver rejects the binding, but a memory leak happens.
Current commit solves it.
Signed-off-by: Yuri Benditovich <[email protected]>
Control device lifecycle follows one of failover protocol, i.e.
created with first virtio-net device and deleted with the
removal of the last one. User-mode component can use device
IO controls to access it.
Signed-off-by: Yuri Benditovich <[email protected]>
resolve:https://github.com/virtio-win/kvm-guest-drivers-windows/issues/830
The problem, RxCapacity of value 16 is in the inf file. But the minimum
of defaultConfiguration is 32, meaning that setting RxCapacity to 16 in
the device manager doesn't take effect.
Fix: change the minimum of defaultConfiguration to 16
Signed-off-by: Kfir Manor <[email protected]>
https://bugzilla.redhat.com/show_bug.cgi?id=1972487
Complete packets (i.e. get buffers from TX queue and
process waiting list) only when called from DPC (on
TX completion DPC or RX DPC). According to the tests
thos solves assertion "pCurrentNetBufferList" in the
NDPROT630 driver.
Signed-off-by: Yuri Benditovich <[email protected]>
Explicitly treat IPv6 ESP packet as usual packet (TCP, UDP, etc.).
ESP header should not be treated like other extension headers.
Because it does not start with 'Next Header' and 'Hdr Ext Len' fields and next header is encrypted.
Signed-off-by: yach-yf <[email protected]>