+static struct shash netdev_shash OVS_GUARDED_BY(netdev_mutex)
+ = SHASH_INITIALIZER(&netdev_shash);
+
+/* Protects 'netdev_classes' against insertions or deletions.
+ *
+ * This is not an rwlock for performance reasons but to allow recursive
+ * acquisition when calling into providers. For example, netdev_run() calls
+ * into provider 'run' functions, which might reasonably want to call one of
+ * the netdev functions that takes netdev_class_rwlock read-only. */
+static struct ovs_rwlock netdev_class_rwlock OVS_ACQ_BEFORE(netdev_mutex)
+ = OVS_RWLOCK_INITIALIZER;
+
+/* Contains 'struct netdev_registered_class'es. */
+static struct hmap netdev_classes OVS_GUARDED_BY(netdev_class_rwlock)
+ = HMAP_INITIALIZER(&netdev_classes);
+
+struct netdev_registered_class {
+ struct hmap_node hmap_node; /* In 'netdev_classes', by class->type. */
+ const struct netdev_class *class;
+ atomic_int ref_cnt; /* Number of 'struct netdev's of this class. */
+};