1. Refactors the CustomBuildStep Command to manage DVL file creation.
We now create DVL files in the Project (driver) folder with version
numbers in the file name for DVL files created with legacy EWDKs,
and with the "latest" label for current EWDKs. These files are
then copied to the relevant .\Install folders and renamed for
extant WHCP submission operations. Makes use of the new batch file
build\makeLegacyDVLs.bat script (from PR #1210), which now creates
all legacy DVL files. Logging is also enabled to provide feedback
when read at the tail of root\buildAll.bat. Please see PR #1212 for
details on those changes.
2. Enables Win10_SDV for local (NetKVM) buildAll.bat script.
Signed-off-by: benyamin-codez <[email protected]>
a) Standardised cleaner routines
b) Introduced -quiet and -debug parameters when run from repo root
c) Moved from FOR loop to a shift loop to more reliably support a
wider variety of directory formats and characters
d) Created NetKVM/clean_inx.cmd to delete *.inx files in NetKVM
e) Updated NetKVM/clean_dvl_log.cmd to use standardised routines
f) Moved all other custom clean operations to build/clean.bat
g) Added missing cleaner to viocrypt
h) Added missing entries for viomem and viocrypt to list of
directories to clean
Signed-off-by: benyamin-codez <[email protected]>
Under driver verifier with low resources simulation the
attempt to access NIC configuration may fail, important
fields of the context are not initialized correctly
causing driver verifier BSOD on attempt to allocate
zero bytes from memory. Fail initialization if the NIC
configuration is not accessible.
Signed-off-by: Yuri Benditovich <[email protected]>
https://issues.redhat.com/browse/RHEL-68725
Simplify failure flow, remove redundant things from it and
ensure the pContext is always deleted. It's destructor does
complete cleanup, including interrupt deregistration. This
fixes BSOD under driver verifier with low resource simulation
NDIS_BUGCHECK_INIT_FAILED_WITHOUT_INTERRUPT_DEREGISTER.
Signed-off-by: Yuri Benditovich <[email protected]>
Read-write lock is created with MiniportContext=NULL because
this happens in the constructor when this field in adapter
context is not populated yet. Pass miniport context as parameter
to the constructor of adapter object and propagate it to the
RSSParameters member.
Signed-off-by: Yuri Benditovich <[email protected]>
Global value of max RX buffers, shared among queues, is
bad idea. It is especially bad when memory allocation
during queue initialization may fail, for example in case
of driver running under driver verifier. Changing the
global field to per-queue field.
Signed-off-by: Yuri Benditovich <[email protected]>
https://issues.redhat.com/browse/RHEL-68725
The problem can be reproduced under driver verifier with
low resource simulation. If the miniport is registered
but the protocol fail to register we need to deregister
the miniport. Otherwise in future attempts to load the driver
the NDIS enters erroneous state and may issue BSOD. Example of
BSOD: BUGCODE_NDIS_DRIVER/NDIS_BUGCHECK_REFCOUNT_IMBALANCE.
Signed-off-by: Yuri Benditovich <[email protected]>
Currently the driver always assume the maximim packet size
is ~64K as it is compiled with RSC support. The initial
reason was that if the RSC is disabled by admin (registry
value of the driver), it can be turned on by command, i.e.
without disable-enable. However this depends also on host
features. If the host does not support the GUEST_TSOx,
RSC will be reported to the OS as not supported but the
buffers are still huge without any reason.
(In such case the powershell reports IPv4 and IPv6 operational
state as Off even if the RSC keywords are enabled).
The commit moves the decision to initialization time - if the
RSC is not supported, the buffers are sized accoring to MTU.
The memory consumption is lower 16 times.
Signed-off-by: Yuri Benditovich <[email protected]>
https://issues.redhat.com/browse/RHEL-19814
Do not allocate redundant memory, use full 4K+ pages when
needed, tail of the data (usually small) allocate together
with header/indirect block and make this block smaller than
4K when possible. This reduces 10% of all the shared memory
allocated for RX buffers. For non-RSC configuration it is
possible to reduce much more (for future).
Signed-off-by: Yuri Benditovich <[email protected]>
Split the decisions about size of shared buffers for RXQ and
allocation of shared memories. Create optimal layout of RX shared
buffers before creation of queues; allocate the memories according
the layout. Initially optimized layout is desabled and we create
the "legacy" layout, fully compatible with what was done before.
This commit contains only creation of the layout, it is not yet
applied when allocating RX buffer's memories.
Signed-off-by: Yuri Benditovich <[email protected]>
Fixes: https://issues.redhat.com/browse/RHEL-32200
Supporting poll mode flows is very complicated in
case the driver acts as protocol driver above VF
device, so the driver will ignore the poll mode setting
in case it works in standby mode. If the VF driver does
not use the poll mode everything will work the same way
as in Win10. If the VF driver uses poll mode it reports
incoming packets from its poll mode handler already and
the NetKVM just indicates the packets up.
Signed-off-by: Yuri Benditovich <[email protected]>
In case the INF file is driver-isolation compatible the file
copied to directory other than %13% might be deleted on network
driver uninstall. In such case we should keep the protocol
running until other event happens, like protocol driver uninstall
or network driver installation.
Signed-off-by: Yuri Benditovich <[email protected]>
One of problems in HCK tests is that we often come to
state when poll handler is not called when this would
be expected and nothing happens that can trigger the polllng.
Issue 'request from self' to resume polling when RX or TX
needs service.
Signed-off-by: Yuri Benditovich <[email protected]>
Main thing is always understand what is the source of the
notification/trigger, this may be, for example TX, RX, RSS
Signed-off-by: Yuri Benditovich <[email protected]>
The packets might be stuck in send queue or in waiting list.
The recovery is simple - trigger TX processing of completed
and pending packets. Can be called from any external place,
for example from CheckForHang handler.
Signed-off-by: Yuri Benditovich <[email protected]>
This provides simple way to build the driver with minimal
modification and enable poll mode on any NDIS 6.85+,
for engineering testing purposes.
Signed-off-by: Yuri Benditovich <[email protected]>
This is temporary exception in NDIS revision negotiation
for driver built as 6.86, in order to satisfy HLK expectations
on Server 2025.
Signed-off-by: Yuri Benditovich <[email protected]>
NDIS 6.84 adds capabilities fields SubMssFinalSegmentSupported.
Set it to 'supported', allow UDP payload size that is not
multiple of MSS.
Signed-off-by: Yuri Benditovich <[email protected]>
There is no clear techical reason why the maximal size of
large UDP packet should be different from one of large TCP
packet. But currently (kernel mainstream, current kernel 6.9
and all earlier kernels) kernel defines UDP_MAX_SEGMENTS as 64.
Minimal MSS in Windows is 536, so we report maximal size of
UDP packet as 64 * 536, such a way we'll never get from OS
UDP packets that can't be transmitted.
Signed-off-by: Yuri Benditovich <[email protected]>
https://issues.redhat.com/browse/RHEL-31482
Before this commit: netkvmp.exe is installed by protocol INF
to system32 directory, INF also creates netkvmp service for
this binary. The netkvmp.exe works with netkvm driver using
IOCTLs and continues doing it in case the netkvm driver is
updated, so these binaries at some point might get out of sync.
In order to update the netkvmp.exe the protocol INF must be
reinstalled.
After this commit: netkvmp.exe is installed by netkvm INF to
system directory. When the netkvmp.exe is called to install
the protocol it first copies itself to system32\netkvmps.exe,
then it installs protocol INF, which creates netkvmp service
with existing netkvmps.exe file. The service from time to time
checks that the service binary (netkvmps.exe) is identical to
netkvmp.exe. When it detects they are out of sync, it starts
'netkvmp.exe restartservice' and stops. The netkvmp.exe
copies itself to netkvmps.exe and starts the service. Such a
way, the protocol service is always in sync with netkvm driver.
Signed-off-by: Yuri Benditovich <[email protected]>
Make service stop synchronous or asynchronous depending on
the state of running thread. Normally the service will complete
the stop asynchronously when the thread stops running. Also
in case the service thread will decide to finish (in later case of
self-update) it should indicate the stopped state correctly.
Signed-off-by: Yuri Benditovich <[email protected]>
- remove all the redundant files from the project
- change netkvmno.cpp to dummy driver file
- change project to be driver project (to sign INF)
- remove netkvmno.dll from INF file
Signed-off-by: Yuri Benditovich <[email protected]>
https://issues.redhat.com/browse/RHEL-17932
Win11 driver supports poll mode when runs on server 2025
(runtime NDIS version 6.89)
On earlier versions Win11 driver contains *NdisPoll keyword
but this keyword does not make any behavioral change.
Signed-off-by: Yuri Benditovich <[email protected]>
NDIS 6.86 vs 6.85 does not include any new features and we
use 6.86 to separate build that support poll mode (Win11).
Although poll mode is supported by 6.85 we can't use Win10
driver with poll mode compiled in as the driver will fail
to load on OS where NDIS Poll Mode API is not exported.
Signed-off-by: Yuri Benditovich <[email protected]>
Currently this does not cause any functional change in the driver
without PARANDIS_SUPPORT_POLL define.
Signed-off-by: Yuri Benditovich <[email protected]>