repository: C:/dev/kvm-guest-drivers-windows branch: master commit fac89bff95d612c656cdf6fce9f8e1597ae91f35 Author: Yan Vugenfirer <yvugenfi@xxxxxxxxxx> Date: Wed Jul 13 14:49:49 2011 +0300 [NetKVM] Number of handled RX packets handled during DPC are configured through INF file and advanced tab in device manager. diff --git a/NetKVM/Common/ParaNdis-Common.c b/NetKVM/Common/ParaNdis-Common.c index 1a51474..af66de1 100644 --- a/NetKVM/Common/ParaNdis-Common.c +++ b/NetKVM/Common/ParaNdis-Common.c @@ -111,6 +111,7 @@ typedef struct _tagConfigurationEntries tConfigurationEntry VlanId; tConfigurationEntry UseMergeableBuffers; tConfigurationEntry MTU; + tConfigurationEntry NumberOfHandledRXPackersInDPC; }tConfigurationEntries; static const tConfigurationEntries defaultConfiguration = @@ -149,6 +150,7 @@ static const tConfigurationEntries defaultConfiguration = { "VlanId", 0, 0, 4095}, { "MergeableBuf", 1, 0, 1}, { "MTU", 1500, 500, 65500}, + { "NumberOfHandledRXPackersInDPC", MAX_RX_LOOPS, 1, 10000}, }; static void ParaNdis_ResetVirtIONetDevice(PARANDIS_ADAPTER *pContext) @@ -278,6 +280,7 @@ static void ReadNicConfiguration(PARANDIS_ADAPTER *pContext, PUCHAR *ppNewMACAdd GetConfigurationEntry(cfg, &pConfiguration->VlanId); GetConfigurationEntry(cfg, &pConfiguration->UseMergeableBuffers); GetConfigurationEntry(cfg, &pConfiguration->MTU); + GetConfigurationEntry(cfg, &pConfiguration->NumberOfHandledRXPackersInDPC); #if !defined(WPP_EVENT_TRACING) bDebugPrint = pConfiguration->isLogEnabled.ulValue; @@ -290,6 +293,7 @@ static void ReadNicConfiguration(PARANDIS_ADAPTER *pContext, PUCHAR *ppNewMACAdd pContext->nEnableDPCChecker = pConfiguration->dpcChecker.ulValue; pContext->bDoInterruptRecovery = pConfiguration->InterruptRecovery.ulValue != 0; pContext->Limits.nPrintDiagnostic = pConfiguration->LogStatistics.ulValue; + pContext->uNumberOfHandledRXPacketsInDPC = pConfiguration->NumberOfHandledRXPackersInDPC.ulValue; pContext->bDoHardReset = pConfiguration->HardReset.ulValue != 0; pContext->bDoSupportPriority = pConfiguration->PrioritySupport.ulValue != 0; pContext->ulFormalLinkSpeed = pConfiguration->ConnectRate.ulValue * 1000000; @@ -1772,7 +1776,8 @@ ULONG ParaNdis_DPCWorkBody(PARANDIS_ADAPTER *pContext) } if (interruptSources & isReceive) { - int nRestartResult = 0, nLoop = 0; + int nRestartResult = 0; + UINT nLoop = 0; do { UINT n; @@ -1788,7 +1793,7 @@ ULONG ParaNdis_DPCWorkBody(PARANDIS_ADAPTER *pContext) NdisReleaseSpinLock(&pContext->ReceiveLock); DPrintf(nRestartResult ? 2 : 6, ("[%s] queue restarted%s", __FUNCTION__, nRestartResult ? "(Rerun)" : "(Done)")); ++nLoop; - if (nLoop > MAX_RX_LOOPS) + if (nLoop > pContext->uNumberOfHandledRXPacketsInDPC) { DPrintf(0, ("[%s] Breaking Rx loop on %d-th operation", __FUNCTION__, nLoop)); ParaNdis_DebugHistory(pContext, hopDPC, (PVOID)4, nRestartResult, 0, 0); diff --git a/NetKVM/wlh/netkvm.inf b/NetKVM/wlh/netkvm.inf index 8143375..752da16 100644 --- a/NetKVM/wlh/netkvm.inf +++ b/NetKVM/wlh/netkvm.inf @@ -191,6 +191,13 @@ HKR, Ndi\params\ConnectTimer, min, 0, "0" HKR, Ndi\params\ConnectTimer, max, 0, "300000" HKR, Ndi\params\ConnectTimer, step, 0, "50" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, ParamDesc, 0, %NumberOfHandledRXPackersInDPC% +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, type, 0, "long" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, default, 0, "1000" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, min, 0, "1" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, max, 0, "10000" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, step, 0, "1" + HKR, Ndi\Params\PacketFilter, ParamDesc, 0, %PacketFilter% HKR, Ndi\Params\PacketFilter, Default, 0, "1" HKR, Ndi\Params\PacketFilter, type, 0, "enum" @@ -309,3 +316,4 @@ VLan = "VLan" Priority_Vlan = "All" MergeableBuf = "Use mergeable buffers" MTU = "MTU size" +NumberOfHandledRXPackersInDPC = "Handled RX packers in DPC" diff --git a/NetKVM/wxp/netkvm.inf b/NetKVM/wxp/netkvm.inf index c7f1fca..8976b5f 100644 --- a/NetKVM/wxp/netkvm.inf +++ b/NetKVM/wxp/netkvm.inf @@ -195,6 +195,13 @@ HKR, Ndi\params\ConnectTimer, min, 0, "0" HKR, Ndi\params\ConnectTimer, max, 0, "300000" HKR, Ndi\params\ConnectTimer, step, 0, "50" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, ParamDesc, 0, %NumberOfHandledRXPackersInDPC% +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, type, 0, "long" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, default, 0, "1000" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, min, 0, "1" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, max, 0, "10000" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, step, 0, "1" + HKR, Ndi\Params\MergeableBuf, ParamDesc, 0, %MergeableBuf% HKR, Ndi\Params\MergeableBuf, Default, 0, "1" HKR, Ndi\Params\MergeableBuf, type, 0, "enum" @@ -276,3 +283,4 @@ VLan = "VLan" Priority_Vlan = "All" MergeableBuf = "Use mergeable buffers" MTU = "MTU size" +NumberOfHandledRXPackersInDPC = "Handled RX packers in DPC" diff --git a/NetKVM/wxp/netkvm2k.inf b/NetKVM/wxp/netkvm2k.inf index 7ca814e..6d03fe8 100644 --- a/NetKVM/wxp/netkvm2k.inf +++ b/NetKVM/wxp/netkvm2k.inf @@ -126,6 +126,14 @@ HKR, Ndi\params\ConnectTimer, min, 0, "0" HKR, Ndi\params\ConnectTimer, max, 0, "300000" HKR, Ndi\params\ConnectTimer, step, 0, "1000" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, ParamDesc, 0, %NumberOfHandledRXPackersInDPC% +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, type, 0, "long" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, default, 0, "1000" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, min, 0, "1" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, max, 0, "10000" +HKR, Ndi\params\NumberOfHandledRXPackersInDPC, step, 0, "1" + + HKR, Ndi\Params\MergeableBuf, ParamDesc, 0, %MergeableBuf% HKR, Ndi\Params\MergeableBuf, Default, 0, "1" HKR, Ndi\Params\MergeableBuf, type, 0, "enum" @@ -193,4 +201,4 @@ PacketFilter = "Enable Packet Filter" BatchReceive = "Batch Receive" MergeableBuf = "Use mergeable buffers" MTU = "MTU size" - +NumberOfHandledRXPackersInDPC = "Handled RX packers in DPC" -- To unsubscribe from this list: send the line "unsubscribe kvm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html