Commit Graph
41 Commits
Author SHA1 Message Date
Yuri Benditovich 52508c0d79 netkvm: Make virtio_net header in TX buffer to be aligned on 8 bytes
Virtio-net header in TX direction is at (pages start)+ 4 bytes.
This causes misaligment exception when preparing the packet.
Even this is probably bug of ARM64 code generation, the simplest
solution is to make the virtio-net header to be always at +8 bytes.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-04-23 16:40:12 +03:00
Yuri Benditovich 9e803146bf netkvm: introduce 'kill' flow of TX queue
Upon surprise removal all the packets in use must be
collected and completed and further regular releases
disallowed even if the procedure will be called by
misunderstanding. Current commit adds the queue interface
that allows collecting used TX descriptors without using
GetBuf as these packets are not completed by the device.

Signed-off-by: Yuri Benditovich <[email protected]>
2018-11-01 17:27:34 +02:00
Yuri Benditovich 104495627e netkvm: split ReleaseTransmitBuffers code to allow code reuse
The code moved to separate procedure, later it will be reused

Signed-off-by: Yuri Benditovich <[email protected]>
2018-11-01 17:27:34 +02:00
Sameeh Jubran 2ed9415487 NetKVM: Virtqueue: Don't touch hardware upon suprise removal
Currently when we recieve a suprise remove IRP from Windows we touch
the hardware of the device which is an invalid memory. This doesn't
cause BSOD in HCK/HLK tests as the device is still in qemu and memory is
still valid.

However, when performing hibernate on a given client and
then - while the client is off - we remove the virtio-net from the
command line and boot the client, a BSOD occurs as a result of this
illegal access to memory.

This commit solves this issue by registering the paths for notifications from
the state machine and preventing the driver from touching hardware upon a
suprise removal notification from the state machine.

Signed-off-by: Sameeh Jubran <[email protected]>
2018-04-26 10:32:20 +03:00
Sameeh Jubran 30bec9cfd1 NetKVM: Clean variables after calling Dtor
Clearing the variables is important as calling the Dotr twice on the
same object will cause BSODs as a result of a double free for example.

Signed-off-by: Sameeh Jubran <[email protected]>
2018-04-16 13:12:51 +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 6f40e43999 NetKVM: DPrintf: Match number of arguments to modifiers
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
Yuri Benditovich 2da0ca2033 netkvm: Optimization of TX path synchronization
Move freeing of NB and NBL resources out of locked area.
Protect operations on waiting list by its own spinlock,
rather than spinlock of TX path instance.

Signed-off-by: Yuri Benditovich <[email protected]>
2016-11-01 12:30:17 +11:00
Yuri Benditovich 1c97f85b9f netkvm: Proper order of NB and NBL completion
Preparation for further improvements: in case NB completion
and NBL completion are not executed under the same spinlock,
CNB object always must be destroyed first, only then signal
its completion to parent CNBL object.

Signed-off-by: Yuri Benditovich <[email protected]>
2016-11-01 12:29:50 +11:00
Yuri Benditovich e5d07e1cda netkvm: CNB allocated via CNBL and CParaNdisTX pool
When CNBL object creates new CNB objects, it provides
itself as allocator for first CNB and external
allocator (CNB-dedicated pool of CParaNdisTX) for all following CNB.

Signed-off-by: Yuri Benditovich <[email protected]>
2016-11-01 12:29:44 +11:00
Yuri Benditovich f6dfc6a813 netkvm: Preparation for performance improvements
No functional changes. We just swap definitions of CNB and CNBL
to make further  tracking of changes easier for review.
Due to swap we can't use inline CNB::SendComplete and we
change it to GetParentNBL()->NBComplete()

Signed-off-by: Yuri Benditovich <[email protected]>
2016-11-01 12:28:28 +11:00
Ladi Prosek cdbb56717b netkvm: Delete virtqueues on shutdown
Virtqueues are completely reinitialized on power-on so they should
also be completely shutdown/deleted on power-off. We still reuse
the same page-contiguous memory (CVirtQueue::m_SharedMemory) but
pool allocations (virtio 1.0) are freed and then reallocated.
2016-08-09 17:28:11 +10:00
Vadim Rozenfeld dd9718e000 sync with stable 2016-07-18 16:51:48 +10:00
Ladi Prosek cbc3ea8537 virtiolib: Normalize driver API names
This commit makes all driver API function follow the same
naming pattern:
* virtio_ prefix
* _get_ for getters without side-effects
* _set_ for idempotent setters
2016-07-17 20:57:04 +10:00
Ladi Prosek a318b9670b virtiolib: Rename query_vq_alloc parameter
pRingSize / ring_size is a more apt name for the parameter /
argument indicating the page-contiguous allocation required
by the virtqueue.
2016-07-17 20:55:27 +10:00
Ladi Prosek 154a351661 virtiolib: Rename, reorder, and tweak legacy implementation
Legacy implementation of virtio_device_ops callbacks is renamed
(all functions now have the vio_legacy_ prefix) and reordered to
reflect virtio_device_ops. A few functions are moved to other
files.
2016-07-17 20:55:20 +10:00
Ladi Prosek 80cc66f5c9 virtiolib: Drop run-time queue name support
It is hard to imagine a situation when seeing the queue name as
a string in the debugger would be of any particular use. There is
a simple and unique mapping from queue indices to queue names for
each virtio device.

This commit deletes the name field from queue data structures
along with all the supporting code.
2016-07-17 20:51:12 +10:00
Ladi Prosek 9b0395d52b virtiolib: Move all fn ptrs to virtio_config_ops
This commit cleans up struct virtio_device by moving its
function pointers to virtio_config_ops (which is likely
not be the final name of the structure).
2016-07-17 20:50:26 +10:00
Ladi Prosek c3440bc925 virtiolib: Stop including virtio_config.h
There's no reason why some of the functionality should be declared
in a separate header that all drivers need to include. This commit
adds a few virtio_ wrappers to completely abstract away the config
callbacks.
2016-07-17 20:50:13 +10:00
Ladi Prosek 07c5aecf91 virtiolib: Convert error codes to NTSTATUS
Switching to NTSTATUS, the most commonly used Windows driver
error codes.
2016-07-17 20:49:34 +10: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
Ladi Prosek beac72bc5a netkvm: Call set_msi_vector
This commit makes NetKVM call the set_msi_vector API instead of
directly writing to device registers.
2016-07-17 20:35:12 +10:00
Ladi Prosek 5cef45c79b netkvm: Fix typo "bAnyLaypout" and add flags
This commit fixes a typo and adds a few more feature flags
to DumpVirtIOFeatures.
2016-07-17 20:31:20 +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 978bdca459 NetKVM: Make ASSERT macros produce BSOD in debug builds
Signed-off-by: Dmitry Fleytman <[email protected]>
2016-05-30 19:17:08 +10:00
Yan Vugenfirer 1f8448bf7f BZ#1013336: NetKVM: cleanup CheckForHangHandlerEx
* We are not using the statistics from this handler any more
* On other hand the access to internal information in the queues caused
unnecessary locking

Signed-off-by: Yan Vugenfirer <[email protected]>
2015-10-22 14:39:24 +11: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 9de4c7cafe NetKVM: BZ#954183: Superflous SAL include removed
Signed-off-by: Joseph Hindin <[email protected]>
2015-05-04 12:45:18 +10:00
Joseph Hindin 0ad8002ec3 NetKVM: BZ#954183: fallthrough annotation
Static driver verifier can benefit from __fallthrough annotations in case
statement without 'break', passing control to the next case statement.

Signed-off-by: Joseph Hindin <[email protected]>
2015-04-07 15:25:45 +10:00
Joseph Hindin cf82eac16c NetKVM: BZ#1096505: Debug printouts
Signed-off-by: Joseph Hindin <[email protected]>
2014-09-02 09:17:16 +10:00
Joseph Hindin 4b94368460 NetKVM: BZ#1096505: DEBUG_EXIT_STATUS raises print level to 0 on error
Signed-off-by: Joseph Hindin <[email protected]>
2014-09-02 09:17:16 +10:00
Joseph Hindin d164a970c1 NetKVM: BZ#1096505: Introducing AbstractPath, common superclass for all NetKBM pathes
Signed-off-by: Joseph Hindin <[email protected]>
2014-09-02 09:17:16 +10:00
Yan Vugenfirer de07868402 NetKVM: BZ#1121933 - check for VIRTIO_F_ANY_LAYOUT feature before using optimized layour for data transfer.
From 94dbe9c0c3a4d68c2efd35392e3b7dea21b2f7db Mon Sep 17 00:00:00 2001
From: Yan Vugenfirer <[email protected]>
Date: Wed, 13 Aug 2014 15:14:41 +0300
Subject: [PATCH] NetKVM: BZ#1121933 - check for VIRTIO_F_ANY_LAYOUT feature
 before using optimized layour for data transfer.
2014-08-14 20:37:51 +10:00
Julius Rus 464e45b7fd Cosmetic changes - untabify and indent. 2014-07-30 12:37:28 -07:00
Julius Rus ff4e486ad1 Update NetKvm to use the linux virtio api. 2014-07-30 12:35:21 -07:00
Yan Vugenfirer 3444045b24 NetKVM: BZ#1112712 - Initialize CVirtQueue first before making internal calculations in CTXVirtQueue constructor
Signed-off-by: Yan Vugenfirer <[email protected]>
2014-06-30 23:16:10 +10:00
Joseph Hindin 9edcd1ad8f NetKVM : BZ#1096505 Separating object creation into the default constructor and Create function, sort of two-phase creation
Signed-off-by: Joseph Hindin <[email protected]>
2014-06-30 19:19:03 +10:00
Dmitry Fleytman fbafe1f630 NetKVM: BZ1096505 packet submission refactoring
This patch changes TX packets submission logic
and offloads as required for mqueue implementation.

Signed-off-by: Dmitry Fleytman <[email protected]>
2014-05-28 19:03:26 +10:00
Dmitry Fleytman 53b6380af4 NetKVM: BZ1096505 Separate transmit path data from device context
This commit is a preparation for multiqueue implementation.
It itroduces changes driver's TX code structure the way
needed to allow creation of multiple independent transmit pathes.

Signed-off-by: Dmitry Fleytman <[email protected]>
2014-05-12 18:20:53 +10:00