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

[win-pv-devel] [PATCH] Reduce xenstore churn


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Wed, 13 Nov 2019 15:43:54 +0000
  • Authentication-results: esa2.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: Wed, 13 Nov 2019 15:44:45 +0000
  • Ironport-sdr: jxIV1iF3pWhjmf6EYrG2aeaz3bxDm2+CmAOJYJKThPBWSjrdfhG83DB1ybIU7E6tbYB0n8T5sm Jblqj7PAQ+tJjdvffp3bjByL4HxhXhQ78KV7PzQjAESfvh3WZn89rF6vkUbqt+R45Vjh6gETJi 6Ja+isCsLXFDpPZgpX8xuqQgscqemiLY0e3V1Jvt74Ua91UGjt7CSAzLjTh+Qtkkc6vZVyomd/ WGI4OJ8aptxoEeDp2TPhzkSaxHxGQ4quGN7hKpdMhVY4YyOIHs4iN4R/4vJkxo2/dqfxGDdz+2 MuM=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Only write the complete changes to the xenstore MAC address table. There
is no need to write the complete table for each addition or removal,
when additions and removals are processed in a single update.

Pushes the responsibility for writing the MAC table to
FrontendSetMulticastAddresses() once all changes are made, instead of
for each call to MacAddMulticastAddress() or MacRemoveMulticastAddress()

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvif/frontend.c | 7 +++++++
 src/xenvif/mac.c      | 6 +-----
 src/xenvif/mac.h      | 5 +++++
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index 3e31654..0ed68df 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -989,6 +989,7 @@ FrontendSetMulticastAddresses(
     ULONG                   MulticastCount;
     ULONG                   MulticastIndex;
     ULONG                   Index;
+    BOOLEAN                 Change;
     NTSTATUS                status;
 
     Transmitter = FrontendGetTransmitter(Frontend);
@@ -1015,6 +1016,7 @@ FrontendSetMulticastAddresses(
     } else
         MulticastAddress = NULL;
 
+    Change = FALSE;
     for (Index = 0; Index < Count; Index++) {
         BOOLEAN Found;
 
@@ -1042,6 +1044,7 @@ FrontendSetMulticastAddresses(
             (VOID) TransmitterQueueMulticastControl(Transmitter,
                                                     &Address[Index],
                                                     TRUE);
+            Change = TRUE;
         }
     }
 
@@ -1058,11 +1061,15 @@ FrontendSetMulticastAddresses(
                                                 FALSE);
         (VOID) MacRemoveMulticastAddress(Mac,
                                          &MulticastAddress[MulticastIndex]);
+        Change = TRUE;
     }
 
     if (MulticastAddress != NULL)
         __FrontendFree(MulticastAddress);
 
+    if (Change)
+        (VOID) MacDumpAddressTable(Mac);
+
     KeLowerIrql(Irql);
 
     return STATUS_SUCCESS;
diff --git a/src/xenvif/mac.c b/src/xenvif/mac.c
index 0b17a54..19666fe 100644
--- a/src/xenvif/mac.c
+++ b/src/xenvif/mac.c
@@ -295,7 +295,7 @@ __MacReleaseLockShared(
     ExReleaseSpinLockSharedFromDpcLevel(&Mac->Lock);
 }
 
-static NTSTATUS
+NTSTATUS
 MacDumpAddressTable(
     IN  PXENVIF_MAC     Mac
     )
@@ -852,8 +852,6 @@ MacAddMulticastAddress(
     __MacReleaseLockExclusive(Mac);
     KeLowerIrql(Irql);
 
-    (VOID) MacDumpAddressTable(Mac);
-
     Trace("%s: %02X:%02X:%02X:%02X:%02X:%02X\n",
           FrontendGetPrefix(Frontend),
           Address->Byte[0],
@@ -914,8 +912,6 @@ found:
     __MacReleaseLockExclusive(Mac);
     KeLowerIrql(Irql);
 
-    (VOID) MacDumpAddressTable(Mac);
-
     Trace("%s: %02X:%02X:%02X:%02X:%02X:%02X\n",
           FrontendGetPrefix(Frontend),
           Address->Byte[0],
diff --git a/src/xenvif/mac.h b/src/xenvif/mac.h
index 83ce5b8..9340f01 100644
--- a/src/xenvif/mac.h
+++ b/src/xenvif/mac.h
@@ -95,6 +95,11 @@ MacQueryBroadcastAddress(
     OUT PETHERNET_ADDRESS   Address                   
     );
 
+extern NTSTATUS
+MacDumpAddressTable(
+    IN  PXENVIF_MAC     Mac
+    );
+
 extern NTSTATUS
 MacAddMulticastAddress(
     IN      PXENVIF_MAC         Mac,
-- 
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®.