summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 32ee504)
raw | patch | inline | side by side (parent: 32ee504)
author | Krzysztof Matczak <krzysztofx.matczak@intel.com> | |
Wed, 5 Apr 2017 15:57:25 +0000 (16:57 +0100) | ||
committer | Tahhan, Maryam <maryam.tahhan@intel.com> | |
Thu, 6 Jul 2017 15:15:33 +0000 (16:15 +0100) |
This patch removes impact of keep_alive init failure on
link_status processing. Also changed default behaviour in configless
mode, where no <Plugin/> stanza is defined. Now both keep_alive
and link_status are enabled by default. On the other hand if
<Plugin/> stanza is present, both features are disabled by default
and user is responsible for specifying which one is active or not.
Change-Id: I03f7ab88e89404e03532677d00a966ddb80d1552
Signed-off-by: Krzysztof Matczak <krzysztofx.matczak@intel.com>
link_status processing. Also changed default behaviour in configless
mode, where no <Plugin/> stanza is defined. Now both keep_alive
and link_status are enabled by default. On the other hand if
<Plugin/> stanza is present, both features are disabled by default
and user is responsible for specifying which one is active or not.
Change-Id: I03f7ab88e89404e03532677d00a966ddb80d1552
Signed-off-by: Krzysztof Matczak <krzysztofx.matczak@intel.com>
src/dpdkevents.c | patch | blob | history |
diff --git a/src/dpdkevents.c b/src/dpdkevents.c
index cba35c33bfeddff3a2575f65b114ba8c94992f22..e9f01078492d9c5f9faf80e526032048f01b5685 100644 (file)
--- a/src/dpdkevents.c
+++ b/src/dpdkevents.c
ec->config.interval = plugin_get_interval();
+ /* In configless mode when no <Plugin/> section is defined in config file
+ * both link_status and keep_alive should be enabled */
+
/* Link Status */
- ec->config.link_status.enabled = 0;
+ ec->config.link_status.enabled = 1;
ec->config.link_status.enabled_port_mask = ~0;
ec->config.link_status.send_updated = 1;
ec->config.link_status.notify = 0;
}
/* Keep Alive */
- ec->config.keep_alive.enabled = 0;
+ ec->config.keep_alive.enabled = 1;
ec->config.keep_alive.send_updated = 1;
ec->config.keep_alive.notify = 0;
- memset(&ec->config.keep_alive.lcore_mask, 0,
+ /* by default enable 128 cores */
+ memset(&ec->config.keep_alive.lcore_mask, 1,
sizeof(ec->config.keep_alive.lcore_mask));
memset(&ec->config.keep_alive.shm_name, 0,
sizeof(ec->config.keep_alive.shm_name));
static int dpdk_events_config(oconfig_item_t *ci) {
DPDK_EVENTS_TRACE();
-
int ret = dpdk_events_preinit();
if (ret)
return ret;
dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(g_hc);
+ /* Disabling link_status and keep_alive since <Plugin/> config section
+ * specifies if those should be enabled */
+ ec->config.keep_alive.enabled = ec->config.link_status.enabled = 0;
+ memset(&ec->config.keep_alive.lcore_mask, 0,
+ sizeof(ec->config.keep_alive.lcore_mask));
+
for (int i = 0; i < ci->children_num; i++) {
oconfig_item_t *child = ci->children + i;
if (strcasecmp("EAL", child->key) == 0) {
}
dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(g_hc);
+ int ls_ret = -1, ka_ret = -1;
+ int cmd_res = 0;
if (ec->config.link_status.enabled) {
- int cmd_res = 0;
- int ret = dpdk_helper_command(g_hc, DPDK_CMD_GET_EVENTS, &cmd_res,
- ec->config.interval);
- if (cmd_res == 0 && ret == 0) {
+ ls_ret = dpdk_helper_command(g_hc, DPDK_CMD_GET_EVENTS, &cmd_res,
+ ec->config.interval);
+ if (cmd_res == 0 && ls_ret == 0) {
dpdk_events_link_status_dispatch(g_hc);
}
}
if (ec->config.keep_alive.enabled) {
- int ret = dpdk_event_keep_alive_shm_open();
- if (ret) {
+ ka_ret = dpdk_event_keep_alive_shm_open();
+ if (ka_ret) {
ERROR(DPDK_EVENTS_PLUGIN
": %s : error %d in dpdk_event_keep_alive_shm_open()",
- __FUNCTION__, ret);
- return ret;
- }
- dpdk_events_keep_alive_dispatch(g_hc);
+ __FUNCTION__, ka_ret);
+ } else
+ dpdk_events_keep_alive_dispatch(g_hc);
+ }
+
+ if (!((cmd_res || ls_ret) == 0 || ka_ret == 0)) {
+ ERROR(DPDK_EVENTS_PLUGIN ": Read failure for all enabled event types");
+ return -1;
}
return 0;