Signed-off-by: Roi Dayan <[email protected]>
---
 lib/dpif-netdev.c   | 1 +
 lib/dpif-netlink.c  | 1 +
 lib/dpif-provider.h | 9 +++++++++
 3 files changed, 11 insertions(+)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index de6aa49a5feb..eace324bde35 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -9996,6 +9996,7 @@ dpif_netdev_is_userspace(void)
 
 const struct dpif_class dpif_netdev_class = {
     "netdev",
+    dpif_class_version,
     true,                       /* cleanup_required */
     true,                       /* synced_dp_layers */
     dpif_netdev_init,
diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
index 3434796177aa..c94d65af4994 100644
--- a/lib/dpif-netlink.c
+++ b/lib/dpif-netlink.c
@@ -4502,6 +4502,7 @@ dpif_netlink_cache_set_size(struct dpif *dpif_, uint32_t 
level, uint32_t size)
 
 const struct dpif_class dpif_netlink_class = {
     "system",
+    dpif_class_version,
     false,                      /* cleanup_required */
     false,                      /* synced_dp_layers */
     NULL,                       /* init */
diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
index 6bc4e0c229ad..10f43dfaf156 100644
--- a/lib/dpif-provider.h
+++ b/lib/dpif-provider.h
@@ -108,6 +108,10 @@ struct dpif_ipf_status {
    unsigned int nfrag_max;
 };
 
+/* The version should be increased for any change to the
+ * datapath interface class structure. */
+static const unsigned int dpif_class_version = 1234;
+
 /* Datapath interface class structure, to be defined by each implementation of
  * a datapath interface.
  *
@@ -125,6 +129,11 @@ struct dpif_class {
      * the type assumed if no type is specified when opening a dpif. */
     const char *type;
 
+    /* Should match dpif_class_version.
+     * External dpif classed compiled elsewhere expected to set a version
+     * matching the implemented class. */
+    unsigned int class_version;
+
     /* If 'true', datapath ports should be destroyed on ofproto destruction.
      *
      * This is used by the vswitch at exit, so that it can clean any
-- 
2.46.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to