ovs_mutex_unlock(&mutex);
}
+void
+bfd_init(void)
+{
+ unixctl_command_register("bfd/show", "[interface]", 0, 1,
+ bfd_unixctl_show, NULL);
+ unixctl_command_register("bfd/set-forwarding",
+ "[interface] normal|false|true", 1, 2,
+ bfd_unixctl_set_forwarding_override, NULL);
+}
+
/* Initializes, destroys, or reconfigures the BFD session 'bfd' (named 'name'),
* according to the database configuration contained in 'cfg'. Takes ownership
* of 'bfd', which may be NULL. Returns a BFD object which may be used as a
bfd_configure(struct bfd *bfd, const char *name, const struct smap *cfg,
struct netdev *netdev) OVS_EXCLUDED(mutex)
{
- static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
static atomic_count udp_src = ATOMIC_COUNT_INIT(0);
int decay_min_rx;
struct in_addr in_addr;
uint8_t ea[ETH_ADDR_LEN];
- if (ovsthread_once_start(&once)) {
- unixctl_command_register("bfd/show", "[interface]", 0, 1,
- bfd_unixctl_show, NULL);
- unixctl_command_register("bfd/set-forwarding",
- "[interface] normal|false|true", 1, 2,
- bfd_unixctl_set_forwarding_override, NULL);
- ovsthread_once_done(&once);
- }
-
if (!cfg || !smap_get_bool(cfg, "enable", false)) {
bfd_unref(bfd);
return NULL;
static atomic_bool enable_megaflows = ATOMIC_VAR_INIT(true);
static atomic_bool enable_ufid = ATOMIC_VAR_INIT(true);
-struct udpif *
-udpif_create(struct dpif_backer *backer, struct dpif *dpif)
+void
+udpif_init(void)
{
static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
- struct udpif *udpif = xzalloc(sizeof *udpif);
-
if (ovsthread_once_start(&once)) {
unixctl_command_register("upcall/show", "", 0, 0, upcall_unixctl_show,
NULL);
upcall_unixctl_purge, NULL);
ovsthread_once_done(&once);
}
+}
+
+struct udpif *
+udpif_create(struct dpif_backer *backer, struct dpif *dpif)
+{
+ struct udpif *udpif = xzalloc(sizeof *udpif);
udpif->dpif = dpif;
udpif->backer = backer;
shash_add(&init_ofp_ports, node->name, new_hint);
}
+
+ ofproto_unixctl_init();
+ udpif_init();
}
static void
guarded_list_init(&ofproto->pins);
- ofproto_unixctl_init();
-
hmap_init(&ofproto->vlandev_map);
hmap_init(&ofproto->realdev_vid_map);
for (i = 0; i < n_ofproto_classes; i++) {
ofproto_classes[i]->init(&init_ofp_ports);
}
+
+ ofproto_unixctl_init();
}
/* 'type' should be a normalized datapath type, as returned by
*ofprotop = NULL;
- ofproto_unixctl_init();
-
datapath_type = ofproto_normalize_type(datapath_type);
class = ofproto_class_find__(datapath_type);
if (!class) {