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

[win-pv-devel] [RFC PATCH 3/6] Query for "multi-queue-max-queues"



Value is limited to the number of vCPUs

Signed-off-by: owensm <owen.smith@xxxxxxxxxx>
---
 src/xenvbd/driver.c   |  3 ++-
 src/xenvbd/driver.h   |  1 +
 src/xenvbd/frontend.c | 16 ++++++++++++++++
 src/xenvbd/frontend.h |  1 +
 4 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/xenvbd/driver.c b/src/xenvbd/driver.c
index 59b380c..2e9ba54 100644
--- a/src/xenvbd/driver.c
+++ b/src/xenvbd/driver.c
@@ -267,7 +267,8 @@ __DriverInitializeOverrides(
               { "discard-secure", FeatureDiscardSecure },
               { "discard-alignment", FeatureDiscardAlignment },
               { "discard-granularity", FeatureDiscardGranularity },
-              { "max-ring-page-order", FeatureMaxRingPageOrder }
+              { "max-ring-page-order", FeatureMaxRingPageOrder },
+              { "multi-queue-max-queues", FeatureMultiQueueMaxQueues }
           };
 
     for (Index = 0; Index < ARRAYSIZE(Mapping); Index++) {
diff --git a/src/xenvbd/driver.h b/src/xenvbd/driver.h
index d99c09a..5a24c4a 100644
--- a/src/xenvbd/driver.h
+++ b/src/xenvbd/driver.h
@@ -80,6 +80,7 @@ typedef enum _XENVBD_FEATURE {
     FeatureDiscardAlignment,
     FeatureDiscardGranularity,
     FeatureMaxRingPageOrder,
+    FeatureMultiQueueMaxQueues,
 
     // Add any new features before this enum
     NumberOfFeatures
diff --git a/src/xenvbd/frontend.c b/src/xenvbd/frontend.c
index f8e903e..40fdbca 100644
--- a/src/xenvbd/frontend.c
+++ b/src/xenvbd/frontend.c
@@ -74,6 +74,7 @@ struct _XENVBD_FRONTEND {
     XENVBD_DISKINFO             DiskInfo;
     XENVBD_PAGE                 Page80;
     XENVBD_PAGE                 Page83;
+    ULONG                       MultiQueueMaxQueues;
 
     // Interfaces to XenBus
     XENBUS_STORE_INTERFACE      StoreInterface;
@@ -784,6 +785,7 @@ FrontendReadFeatures(
     IN  PXENVBD_FRONTEND    Frontend
     )
 {
+    ULONG                   ProcessorCount;
     BOOLEAN                 Changed;
 
     Changed = FrontendReadFeature(Frontend,
@@ -796,6 +798,14 @@ FrontendReadFeatures(
     Changed |= FrontendReadFeature(Frontend,
                                    FeaturePersistent,
                                    &Frontend->Features.Persistent);
+    Changed |= FrontendReadValue32(Frontend,
+                                   FeatureMultiQueueMaxQueues,
+                                   TRUE,
+                                   &Frontend->MultiQueueMaxQueues);
+
+    ProcessorCount = KeQueryActiveProcessorCount(NULL);
+    if (ProcessorCount < Frontend->MultiQueueMaxQueues)
+        Frontend->MultiQueueMaxQueues = ProcessorCount;
 
     if (!Changed)
         return;
@@ -811,6 +821,10 @@ FrontendReadFeatures(
                     Frontend->TargetId,
                     Frontend->Features.Indirect);
     }
+
+    Verbose("Target[%d] : MultiQueueMaxQueues %u\n",
+            Frontend->TargetId,
+            Frontend->MultiQueueMaxQueues);
 }
 
 static FORCEINLINE VOID
@@ -1929,5 +1943,7 @@ FrontendGetBarrier(
 {
     return Frontend->DiskInfo.Barrier;
 }
+FRONTEND_GET_PROPERTY(MultiQueueMaxQueues, ULONG)
+
 
 #undef FRONTEND_GET_PROPERTY
diff --git a/src/xenvbd/frontend.h b/src/xenvbd/frontend.h
index dfd72b4..0ffb261 100644
--- a/src/xenvbd/frontend.h
+++ b/src/xenvbd/frontend.h
@@ -167,6 +167,7 @@ FRONTEND_GET_PROPERTY(ReadOnly, BOOLEAN)
 FRONTEND_GET_PROPERTY(Discard, BOOLEAN)
 FRONTEND_GET_PROPERTY(FlushCache, BOOLEAN)
 FRONTEND_GET_PROPERTY(Barrier, BOOLEAN)
+FRONTEND_GET_PROPERTY(MultiQueueMaxQueues, ULONG)
 
 #undef FRONTEND_GET_PROPERTY
 
-- 
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®.