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

[win-pv-devel] [PATCH 1/2] Make transmitter code the canonical place where multicast control...



...feature is handled

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenvif/mac.c         | 28 +++++++---------------------
 src/xenvif/transmitter.c | 18 +++++++++++++++++-
 src/xenvif/transmitter.h |  5 +++++
 3 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/src/xenvif/mac.c b/src/xenvif/mac.c
index 3d04670..3110dde 100644
--- a/src/xenvif/mac.c
+++ b/src/xenvif/mac.c
@@ -58,7 +58,6 @@ struct _XENVIF_MAC {
     ETHERNET_ADDRESS        BroadcastAddress;
     LIST_ENTRY              MulticastList;
     ULONG                   MulticastCount;
-    BOOLEAN                 MulticastControl;
     XENVIF_MAC_FILTER_LEVEL FilterLevel[ETHERNET_ADDRESS_TYPE_COUNT];
     XENBUS_DEBUG_INTERFACE  DebugInterface;
     PXENBUS_DEBUG_CALLBACK  DebugCallback;
@@ -391,22 +390,6 @@ MacConnect(
 
     Mac->MaximumFrameSize = (ULONG)Mtu + sizeof (ETHERNET_TAGGED_HEADER);
 
-    status = XENBUS_STORE(Read,
-                          &Mac->StoreInterface,
-                          NULL,
-                          FrontendGetBackendPath(Frontend),
-                          "feature-multicast-control",
-                          &Buffer);
-    if (!NT_SUCCESS(status)) {
-        Mac->MulticastControl = FALSE;
-    } else {
-        Mac->MulticastControl = (BOOLEAN)strtol(Buffer, NULL, 2);
-
-        XENBUS_STORE(Free,
-                     &Mac->StoreInterface,
-                     Buffer);
-    }
-
     status = XENBUS_DEBUG(Register,
                           &Mac->DebugInterface,
                           __MODULE__ "|MAC",
@@ -548,8 +531,6 @@ MacDisconnect(
                  Mac->DebugCallback);
     Mac->DebugCallback = NULL;
 
-    Mac->MulticastControl = FALSE;
-
     Mac->MaximumFrameSize = 0;
 
     RtlZeroMemory(&Mac->BroadcastAddress, sizeof (ETHERNET_ADDRESS));
@@ -971,9 +952,14 @@ MacApplyFilters(
             break;
 
         case XENVIF_MAC_FILTER_MATCHING: {
-            PLIST_ENTRY ListEntry;
+            PXENVIF_FRONTEND    Frontend;
+            PXENVIF_TRANSMITTER Transmitter;
+            PLIST_ENTRY         ListEntry;
+
+            Frontend = Mac->Frontend;
+            Transmitter = FrontendGetTransmitter(Frontend);
 
-            if (Mac->MulticastControl) {
+            if (TransmitterHasMulticastControl(Transmitter)) {
                 Allow = TRUE;
                 break;
             }
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 5a70bea..7165ecc 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -4019,6 +4019,22 @@ fail1:
     return status;
 }
 
+static FORCEINLINE BOOLEAN
+__TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    )
+{
+    return Transmitter->MulticastControl;
+}
+
+BOOLEAN
+TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    )
+{
+    return __TransmitterHasMulticastControl(Transmitter);
+}
+
 static FORCEINLINE NTSTATUS
 __TransmitterRingQueueMulticastControl(
     IN  PXENVIF_TRANSMITTER_RING    Ring,
@@ -4034,7 +4050,7 @@ __TransmitterRingQueueMulticastControl(
     Transmitter = Ring->Transmitter;
 
     status = STATUS_NOT_SUPPORTED;
-    if (!Transmitter->MulticastControl)
+    if (!__TransmitterHasMulticastControl(Transmitter))
         goto fail1;
 
     Frontend = Transmitter->Frontend;
diff --git a/src/xenvif/transmitter.h b/src/xenvif/transmitter.h
index 31198fb..3e72b74 100644
--- a/src/xenvif/transmitter.h
+++ b/src/xenvif/transmitter.h
@@ -141,4 +141,9 @@ TransmitterQueryLargePacketSize(
     OUT PULONG                  Size
     );
 
+BOOLEAN
+TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    );
+
 #endif  // _XENVIF_TRANSMITTER_H
-- 
2.1.1


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


 


Rackspace

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