Commit Graph
9 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
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 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
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 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 483395fcbe NetKVM: Use 'enum class' instead of 'enum' (CA warning 26812)
Update _tagSubmitTxPacketResult enum.

Signed-off-by: Kostiantyn Kostiuk <[email protected]>
2021-09-19 09:40:30 +03:00
Yuri Benditovich 954753b4d8 netkvm: renaming *-*.cpp to *_*.cpp
SDV is modern mode fails without any information if there
are source files with '-' sign in the name. This is
preparation change for further work with modern SDV.

Signed-off-by: Yuri Benditovich <[email protected]>
2020-05-09 23:48:03 +03:00