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]>
On 2012r2/Win8.1 there is additional pause-restart after
the adapter is bound. So the adapter may complete first DHCP
packets with error if we try send them when the VF is paused.
Signed-off-by: Yuri Benditovich <[email protected]>
For correct WPP macro expansion we need to place the first
parameter into parentheses or define it as local variable.
Signed-off-by: Yuri Benditovich <[email protected]>
If the device reports standby feature but the protocol is not
installed yet or VF not present suppress the link-up indication
until the VF comes first time. After that the link-up follows
link status of the device until the driver is disabled.
Set packet filter (effectively enable the RX from the VF) after
the link-up is indicated.
Signed-off-by: Yuri Benditovich <[email protected]>
https://bugzilla.redhat.com/show_bug.cgi?id=1925916
Currently the notify object prevents binding of vioprot
to virtio adapter only at installation time and only
due to the fact that virtio adapter is not in the list
of supported adapter. It is still possible to enable
this binding manually and this will cause infinite
recursion of oids or sent packets.
Add detection of such case and prevent the binding.
Signed-off-by: Yuri Benditovich <[email protected]>
https://bugzilla.redhat.com/show_bug.cgi?id=1924994
When the netkvm adapter is added it is possible that the
entry with the same MAC already exists.
It might be entry from another adapter that was removed
but still did not finish the removal flow. It might be even
another adapter with duplicated MAC address (which is wrong
but not fatal). So we need to create an entry for each
adapter and never notify the binding if one does not exist.
Signed-off-by: Yuri Benditovich <[email protected]>
https://bugzilla.redhat.com/show_bug.cgi?id=1830754
We need to filter out all the internal (announcement) packets
from the NBL chain returned by SRIOV adapter. We use
NBL->MiniportReserved[0] to hold the object to deallocate.
This is OK until we pass the packet to another adapter that
can override this field. So we maintain the list of all the
internal NBLs with their original MiniportReserved before
we pass them to SRIOV. On completion we recognize internal
NBLs and restore MiniportReserved field and then pass them to
the owner (CGuestAnnouncePackets).
Signed-off-by: Yuri Benditovich <[email protected]>
On offload status indication originated by VF miniport we
can improve our guess of VF miniport NDIS revision and use
it to configure RSC.
Signed-off-by: Yuri Benditovich <[email protected]>
Do it the same way as we do for RSS and encapsulation:
apply miniport settings to the VF after the respective
OID executed by NETKVM miniport.
Signed-off-by: Yuri Benditovich <[email protected]>
At binding time and on each change of current offloads
the VF indicates current state of offloads. This provides
a good visibility of current settings and also of NDIS
revision the VF driver supports.
Signed-off-by: Yuri Benditovich <[email protected]>
Send RSS set OID to the VF on any change of RSS settings
according to current settings of the miniport on adapter
attach (initially) and later on any change of RSS settings.
Signed-off-by: Yuri Benditovich <[email protected]>
The procedure configures VF RSS according to current RSS
settings of the miniport taking in account the capabilities
of the VF.
Signed-off-by: Yuri Benditovich <[email protected]>
Use macro that only bumps the miniport version.
Any feature from higher protocol bumps the version.
Signed-off-by: Yuri Benditovich <[email protected]>
Add parameter to ParaNdis_ProtocolUnregisterAdapter to make
optional the unregistration of protocol on removal of the
last adapter. In 'Halt' flow we need to unregister the protocol
when there are no more adapters. In future we'll add flow
when we need to keep the protocol registered.
Signed-off-by: Yuri Benditovich <[email protected]>
In case the teaming support is not relevant (which is
the case on most of setups), we'd like to minimize to
performance loss due to the fact that we need to check
presense of the teaming on each packet transmit or
packet return. For that we prepare two possibilities:
1) use indication that there is at least one adapter bound
to the protocol.
2) use acked 'standby' feature
Currently first option is used.
Signed-off-by: Yuri Benditovich <[email protected]>
When the adapter is found, OnAdapterFound checks the compatibility
of two adapters and if ok sets m_BoundAdapter.
If the VFIO adapter is in operational state, it also calls
OnAdapterAttached to start state machines and set m_Started.
Otherwise: later when the protocol binding receives state
indication that the VFIO adapter entered operational state
it spawns work item which finally calls OnAdapterAttached.
Signed-off-by: Yuri Benditovich <[email protected]>
This is preparation patch, this work item will be spawned
when VFIO adapter enters its operational state.
Signed-off-by: Yuri Benditovich <[email protected]>
OnAdapterAttach is splitted to:
OnAdapterFound sets m_BoundAdapter
OnAdapterAttached sets m_Started flag and starts state
machines of packets redirection.
Signed-off-by: Yuri Benditovich <[email protected]>