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

[win-pv-devel] [PATCH 06/10] Dont call through to inactive queues



Queues where Index >= QueueCount are inactive, and should not
Connect, Disconnect, Enable, Disable or write to the store.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 include/vif_interface.h  |  2 ++
 src/xenvif/receiver.c    | 22 ++++++++++++++++++++++
 src/xenvif/transmitter.c | 26 ++++++++++++++++++++++++++
 3 files changed, 50 insertions(+)

diff --git a/include/vif_interface.h b/include/vif_interface.h
index 4ce61c4..83e3846 100644
--- a/include/vif_interface.h
+++ b/include/vif_interface.h
@@ -280,6 +280,8 @@ struct _XENVIF_TRANSMITTER_PACKET_V2 {
     ULONG                                       Length;
     /*! Opaque cookie used to store context information for packet return */
     PVOID                                       Cookie;
+    /*! Hash value calculated from packet's headers */
+    ULONGLONG                                   HashValue;
     /*! Packet information passed down to subscriber */
     XENVIF_TRANSMITTER_PACKET_SEND_INFO         Send;
     /*! Information passed up from subscriber for packet completion */
diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 85ebcf9..4d7f19b 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -2477,6 +2477,8 @@ ReceiverConnect(
         PXENVIF_RECEIVER_RING   Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_RING, ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         status = __ReceiverRingConnect(Ring);
         if (!NT_SUCCESS(status))
@@ -2509,6 +2511,8 @@ fail3:
         PXENVIF_RECEIVER_RING   Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_RING, ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __ReceiverRingDisconnect(Ring);
 
@@ -2668,6 +2672,8 @@ ReceiverStoreWrite(
         PXENVIF_RECEIVER_RING   Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_RING, ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         status = __ReceiverRingStoreWrite(Ring, Transaction);
         if (!NT_SUCCESS(status))
@@ -2714,6 +2720,8 @@ ReceiverEnable(
         PXENVIF_RECEIVER_RING   Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_RING, ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         status = __ReceiverRingEnable(Ring);
         if (!NT_SUCCESS(status))
@@ -2731,6 +2739,8 @@ fail1:
         PXENVIF_RECEIVER_RING   Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_RING, ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __ReceiverRingDisable(Ring);
     }
@@ -2744,6 +2754,9 @@ ReceiverDisable(
     )
 {
     PLIST_ENTRY             ListEntry;
+    PXENVIF_FRONTEND        Frontend;
+
+    Frontend = Receiver->Frontend;
 
     for (ListEntry = Receiver->List.Blink;
          ListEntry != &Receiver->List;
@@ -2751,6 +2764,8 @@ ReceiverDisable(
         PXENVIF_RECEIVER_RING   Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_RING, ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __ReceiverRingDisable(Ring);
     }
@@ -2777,6 +2792,8 @@ ReceiverDisconnect(
         PXENVIF_RECEIVER_RING   Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_RING, ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __ReceiverRingDisconnect(Ring);
     }
@@ -2842,6 +2859,9 @@ ReceiverSetOffloadOptions(
     )
 {
     PLIST_ENTRY                     ListEntry;
+    PXENVIF_FRONTEND                Frontend;
+
+    Frontend = Receiver->Frontend;
 
     if (Receiver->AllowGsoPackets == 0) {
         Warning("RECEIVER GSO DISALLOWED\n");
@@ -2855,6 +2875,8 @@ ReceiverSetOffloadOptions(
         PXENVIF_RECEIVER_RING   Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_RING, ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __ReceiverRingSetOffloadOptions(Ring, Options);
     }    
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 477fecc..c5b05b3 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -3494,6 +3494,8 @@ TransmitterConnect(
         PXENVIF_TRANSMITTER_RING    Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_TRANSMITTER_RING, 
ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         status = __TransmitterRingConnect(Ring);
         if (!NT_SUCCESS(status))
@@ -3526,6 +3528,8 @@ fail3:
         PXENVIF_TRANSMITTER_RING    Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_TRANSMITTER_RING, 
ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __TransmitterRingDisconnect(Ring);
 
@@ -3553,6 +3557,9 @@ TransmitterStoreWrite(
 {
     PLIST_ENTRY                     ListEntry;
     NTSTATUS                        status;
+    PXENVIF_FRONTEND                Frontend;
+
+    Frontend = Transmitter->Frontend;
 
     for (ListEntry = Transmitter->List.Flink;
          ListEntry != &Transmitter->List;
@@ -3560,6 +3567,8 @@ TransmitterStoreWrite(
         PXENVIF_TRANSMITTER_RING    Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_TRANSMITTER_RING, 
ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         status = __TransmitterRingStoreWrite(Ring, Transaction);
         if (!NT_SUCCESS(status))
@@ -3580,6 +3589,9 @@ TransmitterEnable(
     )
 {
     PLIST_ENTRY             ListEntry;
+    PXENVIF_FRONTEND        Frontend;
+
+    Frontend = Transmitter->Frontend;
 
     for (ListEntry = Transmitter->List.Flink;
          ListEntry != &Transmitter->List;
@@ -3587,6 +3599,8 @@ TransmitterEnable(
         PXENVIF_TRANSMITTER_RING    Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_TRANSMITTER_RING, 
ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __TransmitterRingEnable(Ring);
     }    
@@ -3600,6 +3614,9 @@ TransmitterDisable(
     )
 {
     PLIST_ENTRY             ListEntry;
+    PXENVIF_FRONTEND        Frontend;
+
+    Frontend = Transmitter->Frontend;
 
     for (ListEntry = Transmitter->List.Blink;
          ListEntry != &Transmitter->List;
@@ -3607,6 +3624,8 @@ TransmitterDisable(
         PXENVIF_TRANSMITTER_RING    Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_TRANSMITTER_RING, 
ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __TransmitterRingDisable(Ring);
     }
@@ -3633,6 +3652,8 @@ TransmitterDisconnect(
         PXENVIF_TRANSMITTER_RING    Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_TRANSMITTER_RING, 
ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __TransmitterRingDisconnect(Ring);
     }
@@ -3943,6 +3964,9 @@ TransmitterAbortPackets(
 {
     PLIST_ENTRY             ListEntry;
     KIRQL                   Irql;
+    PXENVIF_FRONTEND        Frontend;
+
+    Frontend = Transmitter->Frontend;
 
     KeRaiseIrql(DISPATCH_LEVEL, &Irql);
 
@@ -3952,6 +3976,8 @@ TransmitterAbortPackets(
         PXENVIF_TRANSMITTER_RING    Ring;
 
         Ring = CONTAINING_RECORD(ListEntry, XENVIF_TRANSMITTER_RING, 
ListEntry);
+        if (Ring->Index >= FrontendGetQueueCount(Frontend))
+            continue;
 
         __TransmitterRingAbortPackets(Ring);
     }    
-- 
1.9.4.msysgit.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®.