netkvm: add 100 ms delay before link up on VF attach
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.
@@ -323,6 +323,7 @@ public:
// when VFIO adapter enters operational state
void OnAdapterAttached()
{
+ ULONG waitTime = 100; //ms
TraceNoPrefix(0, "[%s] %p\n", __FUNCTION__, m_BoundAdapter);
if (m_BoundAdapter->MulticastData.nofMulticastEntries)
{
@@ -339,6 +340,10 @@ public:
m_TxStateMachine.Start();
m_RxStateMachine.Start();
+
+ TraceNoPrefix(0, "[%s] Wait %d ms until the adapter finally restarted\n", __FUNCTION__, waitTime);
+ NdisMSleep(waitTime * 1000);
+
m_BoundAdapter->bSuppressLinkUp = false;
ParaNdis_SynchronizeLinkState(m_BoundAdapter);
m_Started = true;
