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

[PATCH 1/3] Define UNPLUG interface revisions



Adds the UNPLUG version requirements to the revision list, as XenVif uses the
UNPLUG interface in PdoUnplugRequest() and PdoUnplugRequested().
Extends the output in PdoDumpRevisions() and always ASSERTs on STORE and
SUSPEND interface versions.
Also defines revision 0x09000004 which requires UPLUG v2, as its required for
PdoUnplugRequested().

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>
---
 include/revision.h | 14 ++++++++------
 src/xenvif/pdo.c   | 36 ++++++++++++++++++++----------------
 2 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/include/revision.h b/include/revision.h
index efad212..2f4ac80 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -38,12 +38,14 @@
 // V  - XENVIF_VIF_INTERFACE
 // ST - XENBUS_STORE_INTERFACE
 // SU - XENBUS_SUSPEND_INTERFACE
+// U  - XENBUS_UNPLUG_INTERFACE
 
-//                    REVISION   C   V    ST  SU
-#define DEFINE_REVISION_TABLE                       \
-    DEFINE_REVISION(0x09000000,  1,  8,   2,  1),   \
-    DEFINE_REVISION(0x09000001,  2,  8,   2,  1),   \
-    DEFINE_REVISION(0x09000002,  2,  9,   2,  1),   \
-    DEFINE_REVISION(0x09000003,  2,  10,  2,  1)
+//                    REVISION   C   V    ST  SU   U
+#define DEFINE_REVISION_TABLE                           \
+    DEFINE_REVISION(0x09000000,  1,  8,   2,  1,   1),  \
+    DEFINE_REVISION(0x09000001,  2,  8,   2,  1,   1),  \
+    DEFINE_REVISION(0x09000002,  2,  9,   2,  1,   1),  \
+    DEFINE_REVISION(0x09000003,  2,  10,  2,  1,   1),  \
+    DEFINE_REVISION(0x09000004,  2,  10,  2,  1,   2)
 
 #endif  // _REVISION_H
diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index 5c951d9..29d4bdd 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -540,10 +540,11 @@ typedef struct _XENVIF_PDO_REVISION {
     ULONG   VifInterfaceVersion;
     ULONG   StoreInterfaceVersion;
     ULONG   SuspendInterfaceVersion;
+    ULONG   UnplugInterfaceVersion;
 } XENVIF_PDO_REVISION, *PXENVIF_PDO_REVISION;
 
-#define DEFINE_REVISION(_N, _C, _V, _ST, _SU) \
-    { (_N), (_C), (_V), (_ST), (_SU) }
+#define DEFINE_REVISION(_N, _C, _V, _ST, _SU, _U) \
+    { (_N), (_C), (_V), (_ST), (_SU), (_U) }
 
 static XENVIF_PDO_REVISION PdoRevision[] = {
     DEFINE_REVISION_TABLE
@@ -573,30 +574,33 @@ PdoDumpRevisions(
         ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
                      Revision->VifInterfaceVersion == 
XENVIF_VIF_INTERFACE_VERSION_MAX));
 
-        if (Revision->StoreInterfaceVersion != 0) {
-            ASSERT3U(Revision->StoreInterfaceVersion, >=, 
XENBUS_STORE_INTERFACE_VERSION_MIN);
-            ASSERT3U(Revision->StoreInterfaceVersion, <=, 
XENBUS_STORE_INTERFACE_VERSION_MAX);
-            ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
-                         Revision->StoreInterfaceVersion == 
XENBUS_STORE_INTERFACE_VERSION_MAX));
-        }
+        ASSERT3U(Revision->StoreInterfaceVersion, >=, 
XENBUS_STORE_INTERFACE_VERSION_MIN);
+        ASSERT3U(Revision->StoreInterfaceVersion, <=, 
XENBUS_STORE_INTERFACE_VERSION_MAX);
+        ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
+                     Revision->StoreInterfaceVersion == 
XENBUS_STORE_INTERFACE_VERSION_MAX));
 
-        if (Revision->SuspendInterfaceVersion != 0) {
-            ASSERT3U(Revision->SuspendInterfaceVersion, >=, 
XENBUS_SUSPEND_INTERFACE_VERSION_MIN);
-            ASSERT3U(Revision->SuspendInterfaceVersion, <=, 
XENBUS_SUSPEND_INTERFACE_VERSION_MAX);
-            ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
-                         Revision->SuspendInterfaceVersion == 
XENBUS_SUSPEND_INTERFACE_VERSION_MAX));
-        }
+        ASSERT3U(Revision->SuspendInterfaceVersion, >=, 
XENBUS_SUSPEND_INTERFACE_VERSION_MIN);
+        ASSERT3U(Revision->SuspendInterfaceVersion, <=, 
XENBUS_SUSPEND_INTERFACE_VERSION_MAX);
+        ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
+                     Revision->SuspendInterfaceVersion == 
XENBUS_SUSPEND_INTERFACE_VERSION_MAX));
+
+        ASSERT3U(Revision->UnplugInterfaceVersion, >=, 
XENBUS_UNPLUG_INTERFACE_VERSION_MIN);
+        ASSERT3U(Revision->UnplugInterfaceVersion, <=, 
XENBUS_UNPLUG_INTERFACE_VERSION_MAX);
+        ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
+                     Revision->UnplugInterfaceVersion == 
XENBUS_UNPLUG_INTERFACE_VERSION_MAX));
 
         Info("%08X -> "
              "CACHE v%u "
              "VIF v%u "
              "STORE v%u "
-             "SUSPEND v%u\n",
+             "SUSPEND v%u"
+             "UNPLUG v%u\n",
              Revision->Number,
              Revision->CacheInterfaceVersion,
              Revision->VifInterfaceVersion,
              Revision->StoreInterfaceVersion,
-             Revision->SuspendInterfaceVersion);
+             Revision->SuspendInterfaceVersion,
+             Revision->UnplugInterfaceVersion);
     }
 }
 
-- 
2.41.0.windows.3




 


Rackspace

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