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

[win-pv-devel] [PATCH 07/10] Write queue values under <frontend>/queue-<id> and "multi-queue-num-queues"



When multi-queues are used, queue event-channel and ring-refs are written under
"device/vif/<number>/queue-<id>". When the number of active queues is 1, write
the event-channel and ring-refs inder "device/vif/<number>" as before.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvif/frontend.c    | 34 ++++++++++++++++++++++++++++++++++
 src/xenvif/frontend.h    |  8 ++++++++
 src/xenvif/notifier.c    |  8 +++++++-
 src/xenvif/receiver.c    |  6 +++++-
 src/xenvif/transmitter.c |  6 +++++-
 5 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index 9a6cbde..846b051 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -156,6 +156,30 @@ FrontendGetPath(
     return __FrontendGetPath(Frontend);
 }
 
+PCHAR
+FrontendGetQueuePath(
+    IN  PXENVIF_FRONTEND    Frontend,
+    IN  ULONG               Index,
+    IN  PCHAR               Buffer,
+    IN  ULONG               Length
+    )
+{
+    if (Frontend->MultiQueueCount == 1) {
+        return __FrontendGetPath(Frontend);
+    } else {
+        NTSTATUS    status;
+
+        status = RtlStringCbPrintfA(Buffer,
+                                    Length,
+                                    "%s/queue-%u",
+                                    __FrontendGetPath(Frontend),
+                                    Index);
+        ASSERT(NT_SUCCESS(status));
+
+        return Buffer;
+    }
+}
+
 static FORCEINLINE PCHAR
 __FrontendGetPrefix(
     IN  PXENVIF_FRONTEND    Frontend
@@ -1380,6 +1404,16 @@ __FrontendConnect(
         if (!NT_SUCCESS(status))
             goto abort;
 
+        status = XENBUS_STORE(Printf,
+                              &Frontend->StoreInterface,
+                              Transaction,
+                              __FrontendGetPath(Frontend),
+                              "multi-queue-num-queues",
+                              "%u",
+                              __FrontendGetQueueCount(Frontend));
+        if (!NT_SUCCESS(status))
+            goto abort;
+
         status = XENBUS_STORE(TransactionEnd,
                               &Frontend->StoreInterface,
                               Transaction,
diff --git a/src/xenvif/frontend.h b/src/xenvif/frontend.h
index 20cd390..75cb4a0 100644
--- a/src/xenvif/frontend.h
+++ b/src/xenvif/frontend.h
@@ -103,6 +103,14 @@ FrontendGetPath(
     );
 
 extern PCHAR
+FrontendGetQueuePath(
+    IN  PXENVIF_FRONTEND    Frontend,
+    IN  ULONG               Index,
+    IN  PCHAR               Buffer,
+    IN  ULONG               Length
+    );
+
+extern PCHAR
 FrontendGetBackendPath(
     IN  PXENVIF_FRONTEND    Frontend
     );
diff --git a/src/xenvif/notifier.c b/src/xenvif/notifier.c
index 02a11d8..573ffaa 100644
--- a/src/xenvif/notifier.c
+++ b/src/xenvif/notifier.c
@@ -224,6 +224,8 @@ PKSERVICE_ROUTINE   NotifierQueueEvtchnCallback[] = {
 
 C_ASSERT(ARRAYSIZE(NotifierQueueEvtchnCallback) == 
XENVIF_NOTIFIER_EVTCHN_COUNT);
 
+#define MAX_BUFFER      128
+
 static VOID
 NotifierQueueDebugCallback(
     IN  PXENVIF_NOTIFIER_QUEUE  Queue
@@ -346,6 +348,7 @@ NotifierQueueStoreWrite(
     for (Index = 0; Index < XENVIF_NOTIFIER_EVTCHN_COUNT; Index++) {
         PCHAR   Node;
         ULONG   Port;
+        CHAR    Buffer[MAX_BUFFER];
 
         switch (Index) {
         case XENVIF_NOTIFIER_EVTCHN_COMBINED:
@@ -383,7 +386,10 @@ NotifierQueueStoreWrite(
         status = XENBUS_STORE(Printf,
                               &Notifier->StoreInterface,
                               Transaction,
-                              FrontendGetPath(Frontend),
+                              FrontendGetQueuePath(Frontend,
+                                                   Queue->Index,
+                                                   Buffer,
+                                                   sizeof(Buffer)),
                               Node,
                               "%u",
                               Port);
diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 4d7f19b..01ab248 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -2101,6 +2101,7 @@ __ReceiverRingStoreWrite(
 {
     PXENVIF_RECEIVER                Receiver;
     PXENVIF_FRONTEND                Frontend;
+    CHAR                            Buffer[MAXNAMELEN];
     NTSTATUS                        status;
 
     Receiver = Ring->Receiver;
@@ -2109,7 +2110,10 @@ __ReceiverRingStoreWrite(
     status = XENBUS_STORE(Printf,
                           &Receiver->StoreInterface,
                           Transaction,
-                          FrontendGetPath(Frontend),
+                          FrontendGetQueuePath(Frontend,
+                                               Ring->Index,
+                                               Buffer,
+                                               sizeof(Buffer)),
                           "rx-ring-ref",
                           "%u",
                           GranterGetReference(FrontendGetGranter(Frontend),
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index c5b05b3..f1a3e9e 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -2956,6 +2956,7 @@ __TransmitterRingStoreWrite(
 {
     PXENVIF_TRANSMITTER             Transmitter;
     PXENVIF_FRONTEND                Frontend;
+    CHAR                            Buffer[MAXNAMELEN];
     NTSTATUS                        status;
 
     Transmitter = Ring->Transmitter;
@@ -2964,7 +2965,10 @@ __TransmitterRingStoreWrite(
     status = XENBUS_STORE(Printf,
                           &Transmitter->StoreInterface,
                           Transaction,
-                          FrontendGetPath(Frontend),
+                          FrontendGetQueuePath(Frontend,
+                                               Ring->Index,
+                                               Buffer,
+                                               sizeof(Buffer)),
                           "tx-ring-ref",
                           "%u",
                           GranterGetReference(FrontendGetGranter(Frontend),
-- 
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®.