void dpdk_init(const struct smap *ovs_other_config) { static bool enabled = false; if (enabled || !ovs_other_config) { return; } if (smap_get_bool(ovs_other_config, "dpdk-init", false)) { static struct ovsthread_once once_enable = OVSTHREAD_ONCE_INITIALIZER; if (ovsthread_once_start(&once_enable)) { VLOG_INFO("DPDK Enabled - initializing..."); dpdk_init__(ovs_other_config); enabled = true; VLOG_INFO("DPDK Enabled - initialized"); ovsthread_once_done(&once_enable); } } else { static struct ovsthread_once once_disable = OVSTHREAD_ONCE_INITIALIZER; if (ovsthread_once_start(&once_disable)) { VLOG_INFO("DPDK Disabled - Use other_config:dpdk-init to enable"); ovsthread_once_done(&once_disable); } } }
void dpdk_init(const struct smap *ovs_other_config) { static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; if (ovs_other_config && ovsthread_once_start(&once)) { dpdk_init__(ovs_other_config); ovsthread_once_done(&once); } }