[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 2/2] Add registry overrides for cache caps


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Mon, 8 Jul 2019 16:45:08 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=owen.smith@xxxxxxxxxx; spf=Pass smtp.mailfrom=owen.smith@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Mon, 08 Jul 2019 15:45:41 +0000
  • Ironport-sdr: E+sFb0MFx44Yz91JPasBDfr7mYab6Bk0B37qjAqsCd7a607yjTL/pmxCUiil1y6zprHVrMtB97 Dwn2Odd/rt5pkUuauTsmPmL+brjrqdoumowxdwC03Q1cCKW8t3sU+E/4oo10BW+QCcceLe7D2L 15MU0LLtjuaQZLjvFiEWm2NJ96A/oxAtNgvWKtFnfwCBEmeSo17Qm03M7ZCMNox2BCFxoqyd6p +IPPg4tn2tvTEPQQg12T7ez+muP05tKChfjdj+Z5NbejML0QiCvGcO98DBnrS2nWOJRJtr4EuH TGM=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

NDIS 6.0 Mini6Performance test can fail when the Reciever PacketCache is
unable to allocate a complete slab to handle more packets. The failure
is seen as RecieverPacketCtor failing either; due to being unable to
allocate a page, or being unable to map the page. The VIF is unable to
recover from this, locking the VM under test. Setting a
ReceiverPacketCacheCap to about 0x300 prevents the test reaching the
critical failure point.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvif/receiver.c    | 27 +++++++++++++++++--
 src/xenvif/transmitter.c | 68 ++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 88 insertions(+), 7 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 7125743..ea135ac 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -140,6 +140,8 @@ struct _XENVIF_RECEIVER {
     ULONG                           DisableIpVersion6Gso;
     ULONG                           IpAlignOffset;
     ULONG                           AlwaysPullup;
+    ULONG                           FragmentCacheCap;
+    ULONG                           PacketCacheCap;
     XENBUS_STORE_INTERFACE          StoreInterface;
     XENBUS_DEBUG_INTERFACE          DebugInterface;
     PXENBUS_DEBUG_CALLBACK          DebugCallback;
@@ -2454,7 +2456,7 @@ __ReceiverRingInitialize(
                           Name,
                           sizeof (XENVIF_RECEIVER_PACKET),
                           0,
-                          0,
+                          Receiver->PacketCacheCap,
                           ReceiverPacketCtor,
                           ReceiverPacketDtor,
                           ReceiverRingAcquireLock,
@@ -2480,7 +2482,7 @@ __ReceiverRingInitialize(
                           Name,
                           sizeof (XENVIF_RECEIVER_FRAGMENT),
                           0,
-                          0,
+                          Receiver->FragmentCacheCap,
                           ReceiverFragmentCtor,
                           ReceiverFragmentDtor,
                           ReceiverRingAcquireLock,
@@ -3040,6 +3042,9 @@ ReceiverInitialize(
     (*Receiver)->DisableIpVersion6Gso = 0;
     (*Receiver)->IpAlignOffset = 0;
     (*Receiver)->AlwaysPullup = 0;
+    (*Receiver)->FragmentCacheCap = 0;
+    (*Receiver)->PacketCacheCap = 0;
+
 
     if (ParametersKey != NULL) {
         ULONG   ReceiverCalculateChecksums;
@@ -3048,6 +3053,8 @@ ReceiverInitialize(
         ULONG   ReceiverDisableIpVersion6Gso;
         ULONG   ReceiverIpAlignOffset;
         ULONG   ReceiverAlwaysPullup;
+        ULONG   ReceiverFragmentCacheCap;
+        ULONG   ReceiverPacketCacheCap;
 
         status = RegistryQueryDwordValue(ParametersKey,
                                          "ReceiverCalculateChecksums",
@@ -3084,6 +3091,18 @@ ReceiverInitialize(
                                          &ReceiverAlwaysPullup);
         if (NT_SUCCESS(status))
             (*Receiver)->AlwaysPullup = ReceiverAlwaysPullup;
+
+        status = RegistryQueryDwordValue(ParametersKey,
+                                         "ReceiverFragmentCacheCap",
+                                         &ReceiverFragmentCacheCap);
+        if (NT_SUCCESS(status))
+            (*Receiver)->FragmentCacheCap = ReceiverFragmentCacheCap;
+
+        status = RegistryQueryDwordValue(ParametersKey,
+                                         "ReceiverPacketCacheCap",
+                                         &ReceiverPacketCacheCap);
+        if (NT_SUCCESS(status))
+            (*Receiver)->PacketCacheCap = ReceiverPacketCacheCap;
     }
 
     KeInitializeEvent(&(*Receiver)->Event, NotificationEvent, FALSE);
@@ -3178,6 +3197,8 @@ fail2:
     (*Receiver)->DisableIpVersion6Gso = 0;
     (*Receiver)->IpAlignOffset = 0;
     (*Receiver)->AlwaysPullup = 0;
+    (*Receiver)->FragmentCacheCap = 0;
+    (*Receiver)->PacketCacheCap = 0;
 
     ASSERT(IsZeroMemory(*Receiver, sizeof (XENVIF_RECEIVER)));
     __ReceiverFree(*Receiver);
@@ -3612,6 +3633,8 @@ ReceiverTeardown(
     Receiver->DisableIpVersion6Gso = 0;
     Receiver->IpAlignOffset = 0;
     Receiver->AlwaysPullup = 0;
+    Receiver->FragmentCacheCap = 0;
+    Receiver->PacketCacheCap = 0;
 
     ASSERT(IsZeroMemory(Receiver, sizeof (XENVIF_RECEIVER)));
     __ReceiverFree(Receiver);
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 6a4db1f..efac3e3 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -221,6 +221,11 @@ struct _XENVIF_TRANSMITTER {
     ULONG                       AlwaysCopy;
     ULONG                       ValidateChecksums;
     ULONG                       DisableMulticastControl;
+    ULONG                       BufferCacheCap;
+    ULONG                       MulticastControlCacheCap;
+    ULONG                       FragmentCacheCap;
+    ULONG                       RequestCacheCap;
+    ULONG                       PacketCacheCap;
     KSPIN_LOCK                  Lock;
     PXENBUS_CACHE               PacketCache;
     XENBUS_STORE_INTERFACE      StoreInterface;
@@ -3445,7 +3450,7 @@ __TransmitterRingInitialize(
                           Name,
                           sizeof (XENVIF_TRANSMITTER_BUFFER),
                           0,
-                          0,
+                          Transmitter->BufferCacheCap,
                           TransmitterBufferCtor,
                           TransmitterBufferDtor,
                           TransmitterRingAcquireLock,
@@ -3471,7 +3476,7 @@ __TransmitterRingInitialize(
                           Name,
                           sizeof (XENVIF_TRANSMITTER_MULTICAST_CONTROL),
                           0,
-                          0,
+                          Transmitter->MulticastControlCacheCap,
                           TransmitterMulticastControlCtor,
                           TransmitterMulticastControlDtor,
                           TransmitterRingAcquireLock,
@@ -3523,7 +3528,7 @@ __TransmitterRingInitialize(
                           Name,
                           sizeof (XENVIF_TRANSMITTER_FRAGMENT),
                           0,
-                          0,
+                          Transmitter->FragmentCacheCap,
                           TransmitterFragmentCtor,
                           TransmitterFragmentDtor,
                           TransmitterRingAcquireLock,
@@ -3549,7 +3554,7 @@ __TransmitterRingInitialize(
                           Name,
                           sizeof (XENVIF_TRANSMITTER_REQUEST),
                           0,
-                          0,
+                          Transmitter->RequestCacheCap,
                           TransmitterRequestCtor,
                           TransmitterRequestDtor,
                           TransmitterRingAcquireLock,
@@ -4456,6 +4461,11 @@ TransmitterInitialize(
     (*Transmitter)->AlwaysCopy = 0;
     (*Transmitter)->ValidateChecksums = 0;
     (*Transmitter)->DisableMulticastControl = 0;
+    (*Transmitter)->BufferCacheCap = 0;
+    (*Transmitter)->MulticastControlCacheCap = 0;
+    (*Transmitter)->FragmentCacheCap = 0;
+    (*Transmitter)->RequestCacheCap = 0;
+    (*Transmitter)->PacketCacheCap = 0;
 
     if (ParametersKey != NULL) {
         ULONG   TransmitterDisableIpVersion4Gso;
@@ -4463,6 +4473,11 @@ TransmitterInitialize(
         ULONG   TransmitterAlwaysCopy;
         ULONG   TransmitterValidateChecksums;
         ULONG   TransmitterDisableMulticastControl;
+        ULONG   TransmitterBufferCacheCap;
+        ULONG   TransmitterMulticastControlCacheCap;
+        ULONG   TransmitterFragmentCacheCap;
+        ULONG   TransmitterRequestCacheCap;
+        ULONG   TransmitterPacketCacheCap;
 
         status = RegistryQueryDwordValue(ParametersKey,
                                          "TransmitterDisableIpVersion4Gso",
@@ -4493,6 +4508,39 @@ TransmitterInitialize(
                                          &TransmitterDisableMulticastControl);
         if (NT_SUCCESS(status))
             (*Transmitter)->DisableMulticastControl = 
TransmitterDisableMulticastControl;
+
+        status = RegistryQueryDwordValue(ParametersKey,
+                                         "TransmitterBufferCacheCap",
+                                         &TransmitterBufferCacheCap);
+        if (NT_SUCCESS(status))
+            (*Transmitter)->BufferCacheCap = TransmitterBufferCacheCap;
+
+        status = RegistryQueryDwordValue(ParametersKey,
+                                         "TransmitterMulticastControlCacheCap",
+                                         &TransmitterMulticastControlCacheCap);
+        if (NT_SUCCESS(status))
+            (*Transmitter)->MulticastControlCacheCap = 
TransmitterMulticastControlCacheCap;
+
+        status = RegistryQueryDwordValue(ParametersKey,
+                                         "TransmitterFragmentCacheCap",
+                                         &TransmitterFragmentCacheCap);
+        if (NT_SUCCESS(status))
+            (*Transmitter)->FragmentCacheCap = TransmitterFragmentCacheCap;
+
+        status = RegistryQueryDwordValue(ParametersKey,
+                                         "TransmitterRequestCacheCap",
+                                         &TransmitterRequestCacheCap);
+        if (NT_SUCCESS(status))
+            (*Transmitter)->RequestCacheCap = TransmitterRequestCacheCap;
+
+        status = RegistryQueryDwordValue(ParametersKey,
+                                         "TransmitterPacketCacheCap",
+                                         &TransmitterPacketCacheCap);
+        if (NT_SUCCESS(status))
+            (*Transmitter)->PacketCacheCap = TransmitterPacketCacheCap;
+
+        if ((*Transmitter)->PacketCacheCap < XENVIF_PACKET_CACHE_RESERVATION)
+            (*Transmitter)->PacketCacheCap = 0;
     }
 
     FdoGetDebugInterface(PdoGetFdo(FrontendGetPdo(Frontend)),
@@ -4540,7 +4588,7 @@ TransmitterInitialize(
                           Name,
                           sizeof (XENVIF_TRANSMITTER_PACKET),
                           XENVIF_PACKET_CACHE_RESERVATION,
-                          0,
+                          (*Transmitter)->PacketCacheCap,
                           TransmitterPacketCtor,
                           TransmitterPacketDtor,
                           TransmitterPacketAcquireLock,
@@ -4634,6 +4682,11 @@ fail2:
     (*Transmitter)->AlwaysCopy = 0;
     (*Transmitter)->ValidateChecksums = 0;
     (*Transmitter)->DisableMulticastControl = 0;
+    (*Transmitter)->BufferCacheCap = 0;
+    (*Transmitter)->MulticastControlCacheCap = 0;
+    (*Transmitter)->FragmentCacheCap = 0;
+    (*Transmitter)->RequestCacheCap = 0;
+    (*Transmitter)->PacketCacheCap = 0;
     
     ASSERT(IsZeroMemory(*Transmitter, sizeof (XENVIF_TRANSMITTER)));
     __TransmitterFree(*Transmitter);
@@ -4994,6 +5047,11 @@ TransmitterTeardown(
     Transmitter->AlwaysCopy = 0;
     Transmitter->ValidateChecksums = 0;
     Transmitter->DisableMulticastControl = 0;
+    Transmitter->BufferCacheCap = 0;
+    Transmitter->MulticastControlCacheCap = 0;
+    Transmitter->FragmentCacheCap = 0;
+    Transmitter->RequestCacheCap = 0;
+    Transmitter->PacketCacheCap = 0;
 
     ASSERT(IsZeroMemory(Transmitter, sizeof (XENVIF_TRANSMITTER)));
     __TransmitterFree(Transmitter);
-- 
2.16.2.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.