Commit Graph
56 Commits
Author SHA1 Message Date
Yuri Benditovich c9300fca7b netkvm: include UDP to log of redirected packets
Signed-off-by: Yuri Benditovich <[email protected]>
2020-05-04 16:41:00 +03:00
Yuri Benditovich 2315a45fa5 netkvm: add optional detailed report of RSS misses
When a packed is received on wrong CPU, add an ability to
print packet details (under compile-time define) for
diagnostic purposes.

Signed-off-by: Yuri Benditovich <[email protected]>
2020-05-04 16:41:00 +03:00
Yuri Benditovich 9a2f1b70f2 netkvm: maintain device RSS statistics
The driver calculates the hash even if device supports RSS
(to report the hash and hash type), so it is able to
check whether the packet was received on proper CPU.
In current commit we add RSS statistics (hits, misses and
unclassified packets).

Signed-off-by: Yuri Benditovich <[email protected]>
2020-05-04 16:41:00 +03:00
Sergey Bykov 2198f59176 netkvm: Set m_nReusedRxBuffersLimit after all RX buffers are allocated
If allocation of all RX buffers fails then NetMaxReceiveBuffers will be decreased accordingly, however m_nReusedRxBuffersLimit will remain set as it is configured in NetKVM device settings.

For example, if Init.MaxRxBuffers is configured to 1024 and rx_queue_size is set 256, it may cause a VM to lose connectivity when all RX buffers are exhausted.

Signed-off-by: Sergey Bykov <[email protected]>
2020-01-21 14:19:45 +02:00
Yuri Benditovich e941c70b75 netkvm: make ParaNdis_PerformPacketAnalysis static inline
The procedure was in glocal scope without a reason. Moving
it to RX area and making static inline.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-23 09:57:33 +02:00
Yuri Benditovich c69786e3c2 netkvm: make ParaNdis_GetScalingDataForPacket inline
The procedure was in global scope, but used only with RX/RSS.
Making it static inline.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-23 09:57:33 +02:00
Yuri Benditovich e16e6e6e8e netkvm: make ParaNdis_QueueRSSDpc static inline
This procedure was placed in global scope without a reason.
Making it static and inline. It is required and used only
with RSS, so removing the body if no RSS.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-23 09:57:33 +02:00
Yuri Benditovich dc06366b32 netkvm: move ParaNdis_ReceiveQueueAddBuffer to RX area
The procedure is used only inside RX, making it static inline.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-23 09:57:33 +02:00
Yuri Benditovich fc16d5878e netkvm: move ParaNdis_ResetRxClassification to RX area
Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-23 09:57:33 +02:00
Yuri Benditovich 9364ac6f24 netkvm: make ParaNdis_UnbindRxBufferFromPacket static
The procedure is used only inside RX, no reason to publish.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-23 09:57:33 +02:00
Yuri Benditovich 7150e2b380 netkvm: make ParaNdis_BindRxBufferToPacket static
The procedure is used only inside RX, no reason to publish.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-23 09:57:33 +02:00
Yuri Benditovich 465161ca3b netkvm: make ParaNdis_FreeRxBufferDescriptor static
The procedure is used only inside RX, no reason to publish.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-23 09:57:33 +02:00
Yuri Benditovich 241cab0b48 netkvm: align indirect area of RX ring to 8 bytes
Prevent ARM64 misalignment exception

Signed-off-by: Yuri Benditovich <[email protected]>
2019-04-23 16:40:12 +03:00
Sameeh Jubran ce2fac65f3 NetKVM: SM: Register paths for notifications
Signed-off-by: Sameeh Jubran <[email protected]>
2018-04-26 10:32:20 +03:00
Sameeh Jubran 2cc38bac81 NetKVM: Integrate WPP Tracing
This commit integrates wpp tracing into builds higher than Vista as
Windows Vista requires much more configuration for wpp integration,
however, this integration may be introduced in the future.

The old style of Dprintf is still preserved by this commit and can be
enabled by disabling WPP tracing. This can be accomplished by commenting
the following line in WPPTrace.h:

Signed-off-by: Sameeh Jubran <[email protected]>
2017-12-12 21:53:43 +02:00
Sameeh Jubran 699a3c6d1c NetKVM: DPrintf: Use variadic arguments and fmt
This should be the appropriate for handling variadic arguments in a
MACRO.

Signed-off-by: Sameeh Jubran <[email protected]>
2017-12-12 21:53:43 +02:00
Ladi Prosek b90465a268 netkvm/NDIS6: Remove all uses of virtio_set_queue_event_suppression()
The function has no effect and will be removed.

Also deleting the defunct "PublishIndices" config entry.

Signed-off-by: Ladi Prosek <[email protected]>
2017-12-04 09:56:59 +01:00
Sameeh Jubran 6976f63c92 NetKVM: Use Ndis DPC level spinlock functions
The NdisDprAcquireSpinLock and NdisDprReleaseSpinLock are an optimized
version of the Ndis Acquire and Release functions that should be called
only at Dispatch level.

Signed-off-by: Sameeh Jubran <[email protected]>
2017-12-03 10:30:44 +02:00
Ladi Prosek fe0314a33b netkvm: Spelling fixes 2017-01-20 21:08:17 +11:00
Sameeh Jubran a49c33a255 Fix RX kick timing
According to the virtio spec the RX ring should not be kicked before DRIVER_OK
status is set.

Signed-off-by: Sameeh Jubran <[email protected]>
2017-01-15 14:17:11 +11:00
Ladi Prosek 12956368b5 netkvm: Use fewer virtio receive SG descriptors
NdisMAllocateSharedMemory allocates physically contiguous memory
so it is not necessary to create the receive scatter-gather list
from single-page blocks.

With this fix, the typical number of SG descriptors is reduced from
~18 to 2, speeding up recive processing both on the guest and host
side.
2016-12-15 14:08:28 +11:00
Ladi Prosek 1a8181ed5f netkvm: Tweak physical memory allocation routines
ParaNdis_InitialAllocatePhysicalMemory gets a new ulSize parameter
which makes pAddresses pure output now. Also, references to a non-existent
ParaNdis_RuntimeRequestToAllocatePhysicalMemory are removed.
2016-12-15 14:08:28 +11:00
Ladi Prosek a2e7045330 netkvm: Switch NDIS6 over to virtio 1.0 API
This commit switches the NDIS6 driver over to the new VirtioLib
API which enables virtio 1.0 support.
2016-07-17 20:35:29 +10:00
Dmitry Fleytman 2d2df86803 NetKVM: Fix unclassified packets out of order on RX
When working with 1 queue MQ or without MQ RX path
may be processed by a few CPUs running DPC routine
in parallel.

In this case only one of those should do the real
processing.

Signed-off-by: Dmitry Fleytman <[email protected]>
2016-06-21 22:00:20 +10:00
Dmitry Fleytman d765266971 NetKVM: Clean up synchronize with interrupt logic
Signed-off-by: Dmitry Fleytman <[email protected]>
2016-06-21 21:06:33 +10:00
Dmitry Fleytman e1de11fd36 NetKVM: Restore CVirtQueue encapsulation and clean code duplication
This patch is cleanup and does not change code behaviour.

Signed-off-by: Dmitry Fleytman <[email protected]>
2016-06-21 21:06:33 +10:00
Dmitry Fleytman bf139f40f2 NetKVM: Drop old receive state tracking and logic
Signed-off-by: Dmitry Fleytman <[email protected]>
2016-05-30 19:17:08 +10:00
Yan Vugenfirer 675ff81327 NetKVM: Refactoring ndis56common.h
Removing debug history and debug initialization functions from
ndis56common.h

Signed-off-by: Yan Vugenfirer <[email protected]>
2015-06-23 20:51:42 +10:00
Yan Vugenfirer eb06694f9e NetKVM: Refactoring ndis56common.h: to enable removal of kdebugprint.h dependency
Part of the effort to simplify ndis56common.h. This is the first step in
removing kdebugprint.h from ndis56common.h, adding include where needed and
moving some functions implementation from class definitions files.

Signed-off-by: Yan Vugenfirer <[email protected]>
2015-06-23 20:51:42 +10:00
Joseph Hindin d328395de0 NetKVM: BZ#1190960: Vista compilation fix
The logic of dispatching the packet toward different ReceiveQueues
depending on scaling data, was placed under #ifdef. In case
of no RSS support, all packets goes to the same receive queue.

In order to avoid #ifdef duplication, declarations of variables
used only for RSS-related computations, were moved under same
 ifdef - with varaibels not ifdef'd, compiler complains
on unreferenced variables.

Also, parameter 'nCurrCpuReceiveQueue' is used only for RSS
computation, so in the absence of RSS, 'unused parameter' warning
was disabled with UNREFERENCED_PARAMETER macro.

Signed-off-by: Joseph Hindin <[email protected]>
2015-05-03 12:34:55 +10:00
Joseph Hindin 51375abb69 NetKVM: BZ#1190960: Global receive queue eliminated
Before the patch 'Routing unclassified packets through RX path's receive
queue', unclassified packets were routed through per-context receive queue,
placed into ReceiveQueues array at index 0. The patch 'Routing
unclassified packets through RX path's receive queue' changes
unclassified packets routing so that they are placed into a dedicated
receive queue, one per virtqueue/CParaNdisRX instance. This patch
completes the change by removing per-context receive queue; first
element in ReceiveQueues array has not special meaning and the
constant 'PARANDIS_RECEIVE_QUEUE_UNCLASSIFIED'  was split
into 'PARANDIS_RECEIVE_UNCLASSIFIED_PACKET' and
'PARANDIS_RECEIVE_NO_QUEUE', depending on context.

Signed-off-by: Joseph Hindin <[email protected]>
2015-04-30 11:12:41 +10:00
Joseph Hindin ff01baa9f2 NetKVM: BZ#1190960: Routing unclassified packets through RX path's receive queue; processing RX paths's receive queue on release and RSS reclassification
Signed-off-by: Joseph Hindin <[email protected]>
2015-04-30 11:12:41 +10:00
Joseph Hindin b4d62b00e5 NetKVM: BZ#1190960: ReceiveQueue per virtqueue for unclassified packets
Signed-off-by: Joseph Hindin <[email protected]>
2015-04-30 11:12:41 +10:00
Joseph Hindin 396aeff3a2 NetKVM: BZ#1190968: comment on receive packet counter
Signed-off-by: Joseph Hindin <[email protected]>
2015-03-20 10:06:05 +11:00
Joseph Hindin 3f6805e7b7 NetKVM: BZ#1190968: counter renamed in more concise way
Signed-off-by: Joseph Hindin <[email protected]>
2015-03-20 10:06:05 +11:00
Joseph Hindin a3b30138b5 NetKVM: BZ#1190968: superfluos test removed
Signed-off-by: Joseph Hindin <[email protected]>
2015-03-20 10:06:05 +11:00
Joseph Hindin 371c68ed14 NetKVM: BZ#1188790: Removing/inserting buffer in list depending of the RX path state
Signed-off-by: Joseph Hindin <[email protected]>
2015-02-24 10:15:54 +11:00
Joseph Hindin 1c882c9f6b NetKVM: BZ#1188790: Removing ReuseRegular flag from the context
Signed-off-by: Joseph Hindin <[email protected]>
2015-02-24 10:15:54 +11:00
Joseph Hindin 0f738a9c0c NetKVM: BZ#1188790: Pausing state changes to be reverted
The refactoring considered too deep, instead code is stabilized with
incremental changes and refactoring postponed

Signed-off-by: Joseph Hindin <[email protected]>
2015-02-24 10:15:54 +11:00
Joseph Hindin 42622a9cd4 NetKVM: BZ#1188790: Reusing buffer streamlined
Signed-off-by: Joseph Hindin <[email protected]>
2015-02-09 18:13:14 +11:00
Joseph Hindin efe5607f11 NetKVM: BZ#1188790: pending packet manipulations on entry and return
Signed-off-by: Joseph Hindin <[email protected]>
2015-02-09 18:13:14 +11:00
Joseph Hindin 5f0fbd7608 NetKVM: BZ#1188790: Rename pending packets counter
Signed-off-by: Joseph Hindin <[email protected]>
2015-02-09 18:13:14 +11:00
Joseph Hindin 6072abdc4b NetKVM: BZ#1147239: Testing the pause state in explicit function, outside of lock
Signed-off-by: Joseph Hindin <[email protected]>
2014-12-11 22:35:17 +11:00
Joseph Hindin 1e4c959e34 NetKVM: BZ#1147239: Indicating outside of ProcessReceiveQueue function
Signed-off-by: Joseph Hindin <[email protected]>
2014-12-11 22:35:08 +11:00
Joseph Hindin 021a9142f4 NetKVM: BZ#1147202: Avoid deadlock in RXQueue operations upon error
Signed-off-by: Joseph Hindin <[email protected]>
2014-10-08 20:38:48 +11:00
Joseph Hindin 878eb55e2c NetKVM: BZ#1096505: IO device allocated and reallocated depending on pathes's number
Signed-off-by: Joseph Hindin <[email protected]>
2014-09-02 09:17:17 +10:00
Joseph Hindin d6f960efc7 NetKVM: BZ#1096505: Interrupp handling prepared for multiqueue
Signed-off-by: Joseph Hindin <[email protected]>
2014-09-02 09:17:16 +10:00
Joseph Hindin 1b35b80966 NetKVM: BZ#1096505: Message indices removed from context, stored only in path's instances
Signed-off-by: Joseph Hindin <[email protected]>
2014-09-02 09:17:16 +10:00
Joseph Hindin 3c9df083a9 NetKVM: BZ#1096505: Queue amd message indices field in AbstractPath
Signed-off-by: Joseph Hindin <[email protected]>
2014-09-02 09:17:16 +10:00
Joseph Hindin 5179505b76 NetKVM: BZ#1096505: RXPath and TXPath allocated as array of size 1
Signed-off-by: Joseph Hindin <[email protected]>
2014-09-02 09:17:16 +10:00