2 * collectd - src/dpdkevents.c
5 * Copyright(c) 2017 Intel Corporation. All rights reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * Maryam Tahhan <maryam.tahhan@intel.com>
27 * Harry van Haaren <harry.van.haaren@intel.com>
28 * Serhiy Pshyk <serhiyx.pshyk@intel.com>
29 * Kim-Marie Jones <kim-marie.jones@intel.com>
30 * Krzysztof Matczak <krzysztofx@intel.com>
38 #include "semaphore.h"
40 #include "utils_dpdk.h"
41 #include "utils_time.h"
43 #include <rte_config.h>
45 #include <rte_ethdev.h>
46 #include <rte_keepalive.h>
48 #define DPDK_EVENTS_PLUGIN "dpdkevents"
49 #define DPDK_EVENTS_NAME "dpdk_collectd_events"
50 #define ETH_LINK_NA 0xFF
52 #define INT64_BIT_SIZE 64
53 #define KEEPALIVE_PLUGIN_INSTANCE "keepalive"
54 #define RTE_KEEPALIVE_SHM_NAME "/dpdk_keepalive_shm_name"
56 typedef struct dpdk_keepalive_shm_s {
58 enum rte_keepalive_state core_state[RTE_KEEPALIVE_MAXCORES];
59 uint64_t core_last_seen_times[RTE_KEEPALIVE_MAXCORES];
60 } dpdk_keepalive_shm_t;
62 typedef struct dpdk_ka_monitor_s {
67 typedef struct dpdk_link_status_config_s {
70 uint32_t enabled_port_mask;
71 char port_name[RTE_MAX_ETHPORTS][DATA_MAX_NAME_LEN];
73 } dpdk_link_status_config_t;
75 typedef struct dpdk_keep_alive_config_s {
79 dpdk_keepalive_shm_t *shm;
80 char shm_name[DATA_MAX_NAME_LEN];
83 } dpdk_keep_alive_config_t;
85 typedef struct dpdk_events_config_s {
87 dpdk_link_status_config_t link_status;
88 dpdk_keep_alive_config_t keep_alive;
89 } dpdk_events_config_t;
91 typedef struct dpdk_link_info_s {
97 typedef struct dpdk_events_ctx_s {
98 dpdk_events_config_t config;
100 dpdk_link_info_t link_info[RTE_MAX_ETHPORTS];
101 dpdk_ka_monitor_t core_info[RTE_KEEPALIVE_MAXCORES];
105 DPDK_EVENTS_STATE_CFG_ERR = 1 << 0,
106 DPDK_EVENTS_STATE_KA_CFG_ERR = 1 << 1,
107 DPDK_EVENTS_STATE_LS_CFG_ERR = 1 << 2,
109 } dpdk_events_cfg_status;
111 #define DPDK_EVENTS_CTX_GET(a) ((dpdk_events_ctx_t *)dpdk_helper_priv_get(a))
113 #define DPDK_EVENTS_TRACE() \
114 DEBUG("%s:%s:%d pid=%u", DPDK_EVENTS_PLUGIN, __FUNCTION__, __LINE__, getpid())
116 static dpdk_helper_ctx_t *g_hc;
117 static dpdk_events_cfg_status g_state;
119 static int dpdk_event_keep_alive_shm_open(void) {
120 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(g_hc);
123 if (strlen(ec->config.keep_alive.shm_name)) {
124 shm_name = ec->config.keep_alive.shm_name;
126 shm_name = RTE_KEEPALIVE_SHM_NAME;
127 WARNING(DPDK_EVENTS_PLUGIN ": Keep alive shared memory identifier is not "
128 "specified, using default one: %s",
132 int fd = shm_open(shm_name, O_RDONLY, 0);
134 ERROR(DPDK_EVENTS_PLUGIN ": Failed to open %s as SHM:%s. Is DPDK KA "
135 "primary application running?",
140 if (ec->config.keep_alive.fd != -1) {
141 struct stat stat_old, stat_new;
143 if (fstat(ec->config.keep_alive.fd, &stat_old) || fstat(fd, &stat_new)) {
144 ERROR(DPDK_EVENTS_PLUGIN ": failed to get information about a file");
149 /* Check if inode number has changed. If yes, then create a new mapping */
150 if (stat_old.st_ino == stat_new.st_ino) {
155 if (munmap(ec->config.keep_alive.shm, sizeof(dpdk_keepalive_shm_t)) != 0) {
156 ERROR(DPDK_EVENTS_PLUGIN ": munmap KA monitor failed");
161 close(ec->config.keep_alive.fd);
162 ec->config.keep_alive.fd = -1;
165 ec->config.keep_alive.shm = (dpdk_keepalive_shm_t *)mmap(
166 0, sizeof(*(ec->config.keep_alive.shm)), PROT_READ, MAP_SHARED, fd, 0);
167 if (ec->config.keep_alive.shm == MAP_FAILED) {
168 ERROR(DPDK_EVENTS_PLUGIN ": Failed to mmap KA SHM:%s", STRERRNO);
172 ec->config.keep_alive.fd = fd;
177 static void dpdk_events_default_config(void) {
178 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(g_hc);
180 ec->config.interval = plugin_get_interval();
182 /* In configless mode when no <Plugin/> section is defined in config file
183 * both link_status and keep_alive should be enabled */
186 ec->config.link_status.enabled = 1;
187 ec->config.link_status.enabled_port_mask = ~0;
188 ec->config.link_status.send_updated = 1;
189 ec->config.link_status.notify = 0;
191 for (int i = 0; i < RTE_MAX_ETHPORTS; i++) {
192 ec->config.link_status.port_name[i][0] = 0;
196 ec->config.keep_alive.enabled = 1;
197 ec->config.keep_alive.send_updated = 1;
198 ec->config.keep_alive.notify = 0;
199 /* by default enable 128 cores */
200 memset(&ec->config.keep_alive.lcore_mask, 1,
201 sizeof(ec->config.keep_alive.lcore_mask));
202 memset(&ec->config.keep_alive.shm_name, 0,
203 sizeof(ec->config.keep_alive.shm_name));
204 ec->config.keep_alive.shm = MAP_FAILED;
205 ec->config.keep_alive.fd = -1;
208 static int dpdk_events_preinit(void) {
212 /* already initialized if config callback was called before init callback */
213 DEBUG("dpdk_events_preinit: helper already initialized.");
218 dpdk_helper_init(DPDK_EVENTS_NAME, sizeof(dpdk_events_ctx_t), &g_hc);
220 ERROR(DPDK_EVENTS_PLUGIN ": failed to initialize %s helper(error: %s)",
221 DPDK_EVENTS_NAME, strerror(ret));
225 dpdk_events_default_config();
227 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(g_hc);
228 for (int i = 0; i < RTE_MAX_ETHPORTS; i++) {
229 ec->link_info[i].link_status = ETH_LINK_NA;
232 for (int i = 0; i < RTE_KEEPALIVE_MAXCORES; i++) {
233 ec->core_info[i].lcore_state = ETH_LINK_NA;
239 static int dpdk_events_link_status_config(dpdk_events_ctx_t *ec,
240 oconfig_item_t *ci) {
241 ec->config.link_status.enabled = 1;
243 DEBUG(DPDK_EVENTS_PLUGIN ": Subscribed for Link Status Events.");
245 for (int i = 0; i < ci->children_num; i++) {
246 oconfig_item_t *child = ci->children + i;
248 if (strcasecmp("EnabledPortMask", child->key) == 0) {
249 if (cf_util_get_int(child,
250 (int *)&ec->config.link_status.enabled_port_mask))
252 DEBUG(DPDK_EVENTS_PLUGIN ": LinkStatus:Enabled Port Mask 0x%X",
253 ec->config.link_status.enabled_port_mask);
254 } else if (strcasecmp("SendEventsOnUpdate", child->key) == 0) {
255 if (cf_util_get_boolean(child, &ec->config.link_status.send_updated))
257 DEBUG(DPDK_EVENTS_PLUGIN ": LinkStatus:SendEventsOnUpdate %d",
258 ec->config.link_status.send_updated);
259 } else if (strcasecmp("SendNotification", child->key) == 0) {
260 if (cf_util_get_boolean(child, &ec->config.link_status.notify))
263 DEBUG(DPDK_EVENTS_PLUGIN ": LinkStatus:SendNotification %d",
264 ec->config.link_status.notify);
265 } else if (strcasecmp("PortName", child->key) != 0) {
266 ERROR(DPDK_EVENTS_PLUGIN ": unrecognized configuration option %s.",
274 /* parse port names after EnabledPortMask was parsed */
275 for (int i = 0; i < ci->children_num; i++) {
276 oconfig_item_t *child = ci->children + i;
277 if (strcasecmp("PortName", child->key) == 0) {
278 while (!(ec->config.link_status.enabled_port_mask & (1 << port_num)))
281 if (cf_util_get_string_buffer(
282 child, ec->config.link_status.port_name[port_num],
283 sizeof(ec->config.link_status.port_name[port_num]))) {
286 DEBUG(DPDK_EVENTS_PLUGIN ": LinkStatus:Port %d Name: %s", port_num,
287 ec->config.link_status.port_name[port_num]);
295 static int dpdk_events_keep_alive_config(dpdk_events_ctx_t *ec,
296 oconfig_item_t *ci) {
297 ec->config.keep_alive.enabled = 1;
298 DEBUG(DPDK_EVENTS_PLUGIN ": Subscribed for Keep Alive Events.");
300 for (int i = 0; i < ci->children_num; i++) {
301 oconfig_item_t *child = ci->children + i;
303 if (strcasecmp("SendEventsOnUpdate", child->key) == 0) {
304 if (cf_util_get_boolean(child, &ec->config.keep_alive.send_updated))
307 DEBUG(DPDK_EVENTS_PLUGIN ": KeepAlive:SendEventsOnUpdate %d",
308 ec->config.keep_alive.send_updated);
309 } else if (strcasecmp("LCoreMask", child->key) == 0) {
310 char lcore_mask[DATA_MAX_NAME_LEN];
312 if (cf_util_get_string_buffer(child, lcore_mask, sizeof(lcore_mask)))
314 ec->config.keep_alive.lcore_mask =
315 str_to_uint128(lcore_mask, strlen(lcore_mask));
316 DEBUG(DPDK_EVENTS_PLUGIN ": KeepAlive:LCoreMask 0x%" PRIX64 "%" PRIX64 "",
317 ec->config.keep_alive.lcore_mask.high,
318 ec->config.keep_alive.lcore_mask.low);
319 } else if (strcasecmp("KeepAliveShmName", child->key) == 0) {
320 if (cf_util_get_string_buffer(child, ec->config.keep_alive.shm_name,
321 sizeof(ec->config.keep_alive.shm_name)))
324 DEBUG(DPDK_EVENTS_PLUGIN ": KeepAlive:KeepAliveShmName %s",
325 ec->config.keep_alive.shm_name);
326 } else if (strcasecmp("SendNotification", child->key) == 0) {
327 if (cf_util_get_boolean(child, &ec->config.keep_alive.notify))
330 DEBUG(DPDK_EVENTS_PLUGIN ": KeepAlive:SendNotification %d",
331 ec->config.keep_alive.notify);
333 ERROR(DPDK_EVENTS_PLUGIN ": unrecognized configuration option %s.",
342 static int dpdk_events_config(oconfig_item_t *ci) {
344 int ret = dpdk_events_preinit();
346 g_state |= DPDK_EVENTS_STATE_CFG_ERR;
350 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(g_hc);
352 /* Disabling link_status and keep_alive since <Plugin/> config section
353 * specifies if those should be enabled */
354 ec->config.keep_alive.enabled = ec->config.link_status.enabled = 0;
355 memset(&ec->config.keep_alive.lcore_mask, 0,
356 sizeof(ec->config.keep_alive.lcore_mask));
358 for (int i = 0; i < ci->children_num; i++) {
359 oconfig_item_t *child = ci->children + i;
361 if (strcasecmp("EAL", child->key) == 0)
362 ret = dpdk_helper_eal_config_parse(g_hc, child);
363 else if (strcasecmp("Event", child->key) == 0) {
364 char event_type[DATA_MAX_NAME_LEN];
366 if (cf_util_get_string_buffer(child, event_type, sizeof(event_type)))
368 else if (strcasecmp(event_type, "link_status") == 0) {
369 ret = dpdk_events_link_status_config(ec, child);
371 g_state |= DPDK_EVENTS_STATE_LS_CFG_ERR;
374 } else if (strcasecmp(event_type, "keep_alive") == 0) {
375 ret = dpdk_events_keep_alive_config(ec, child);
377 g_state |= DPDK_EVENTS_STATE_KA_CFG_ERR;
381 ERROR(DPDK_EVENTS_PLUGIN ": The selected event \"%s\" is unknown.",
386 ERROR(DPDK_EVENTS_PLUGIN ": unrecognized configuration option %s.",
392 g_state |= DPDK_EVENTS_STATE_CFG_ERR;
397 if (g_state & DPDK_EVENTS_STATE_KA_CFG_ERR) {
398 ERROR(DPDK_EVENTS_PLUGIN
399 ": Invalid keep alive configuration. Event disabled.");
400 ec->config.keep_alive.enabled = 0;
403 if (g_state & DPDK_EVENTS_STATE_LS_CFG_ERR) {
404 ERROR(DPDK_EVENTS_PLUGIN
405 ": Invalid link status configuration. Event disabled.");
406 ec->config.link_status.enabled = 0;
409 if (!ec->config.keep_alive.enabled && !ec->config.link_status.enabled) {
410 ERROR(DPDK_EVENTS_PLUGIN ": At least one type of events should be "
411 "configured for collecting. Plugin misconfigured");
412 g_state |= DPDK_EVENTS_STATE_CFG_ERR;
419 static int dpdk_helper_link_status_get(dpdk_helper_ctx_t *phc) {
420 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(phc);
422 /* get Link Status values from DPDK */
423 #if RTE_VERSION < RTE_VERSION_NUM(18, 05, 0, 0)
424 uint8_t nb_ports = rte_eth_dev_count();
426 uint8_t nb_ports = rte_eth_dev_count_avail();
429 DPDK_CHILD_LOG("dpdkevent-helper: No DPDK ports available. "
430 "Check bound devices to DPDK driver.\n");
433 ec->nb_ports = nb_ports > RTE_MAX_ETHPORTS ? RTE_MAX_ETHPORTS : nb_ports;
435 for (int i = 0; i < ec->nb_ports; i++) {
436 if (ec->config.link_status.enabled_port_mask & (1 << i)) {
437 struct rte_eth_link link;
438 ec->link_info[i].read_time = cdtime();
439 rte_eth_link_get_nowait(i, &link);
440 if ((link.link_status == ETH_LINK_NA) ||
441 (link.link_status != ec->link_info[i].link_status)) {
442 ec->link_info[i].link_status = link.link_status;
443 ec->link_info[i].status_updated = 1;
444 DPDK_CHILD_LOG(" === PORT %d Link Status: %s\n", i,
445 link.link_status ? "UP" : "DOWN");
453 /* this function is called from helper context */
454 int dpdk_helper_command_handler(dpdk_helper_ctx_t *phc, enum DPDK_CMD cmd) {
456 DPDK_CHILD_LOG(DPDK_EVENTS_PLUGIN ": Invalid argument(phc)\n");
460 if (cmd != DPDK_CMD_GET_EVENTS) {
461 DPDK_CHILD_LOG(DPDK_EVENTS_PLUGIN ": Unknown command (cmd=%d)\n", cmd);
465 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(phc);
467 if (ec->config.link_status.enabled)
468 ret = dpdk_helper_link_status_get(phc);
473 static void dpdk_events_notification_dispatch(int severity,
474 const char *plugin_instance,
475 cdtime_t time, const char *msg) {
477 .severity = severity, .time = time, .plugin = DPDK_EVENTS_PLUGIN};
478 sstrncpy(n.host, hostname_g, sizeof(n.host));
479 sstrncpy(n.plugin_instance, plugin_instance, sizeof(n.plugin_instance));
480 sstrncpy(n.message, msg, sizeof(n.message));
481 plugin_dispatch_notification(&n);
484 static void dpdk_events_gauge_submit(const char *plugin_instance,
485 const char *type_instance, gauge_t value,
487 value_list_t vl = {.values = &(value_t){.gauge = value},
490 .plugin = DPDK_EVENTS_PLUGIN,
493 sstrncpy(vl.plugin_instance, plugin_instance, sizeof(vl.plugin_instance));
494 sstrncpy(vl.type_instance, type_instance, sizeof(vl.type_instance));
495 plugin_dispatch_values(&vl);
498 static int dpdk_events_link_status_dispatch(dpdk_helper_ctx_t *phc) {
499 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(phc);
500 DEBUG(DPDK_EVENTS_PLUGIN ": %s:%d ports=%u", __FUNCTION__, __LINE__,
503 /* dispatch Link Status values to collectd */
504 for (int i = 0; i < ec->nb_ports; i++) {
505 if (ec->config.link_status.enabled_port_mask & (1 << i)) {
506 if (!ec->config.link_status.send_updated ||
507 ec->link_info[i].status_updated) {
509 DEBUG(DPDK_EVENTS_PLUGIN ": Dispatch PORT %d Link Status: %s", i,
510 ec->link_info[i].link_status ? "UP" : "DOWN");
512 char dev_name[DATA_MAX_NAME_LEN];
513 if (ec->config.link_status.port_name[i][0] != 0) {
514 snprintf(dev_name, sizeof(dev_name), "%s",
515 ec->config.link_status.port_name[i]);
517 snprintf(dev_name, sizeof(dev_name), "port.%d", i);
520 if (ec->config.link_status.notify) {
521 int sev = ec->link_info[i].link_status ? NOTIF_OKAY : NOTIF_WARNING;
522 char msg[DATA_MAX_NAME_LEN];
523 snprintf(msg, sizeof(msg), "Link Status: %s",
524 ec->link_info[i].link_status ? "UP" : "DOWN");
525 dpdk_events_notification_dispatch(sev, dev_name,
526 ec->link_info[i].read_time, msg);
528 dpdk_events_gauge_submit(dev_name, "link_status",
529 (gauge_t)ec->link_info[i].link_status,
530 ec->link_info[i].read_time);
532 ec->link_info[i].status_updated = 0;
540 static void dpdk_events_keep_alive_dispatch(dpdk_helper_ctx_t *phc) {
541 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(phc);
543 /* dispatch Keep Alive values to collectd */
544 for (int i = 0; i < RTE_KEEPALIVE_MAXCORES; i++) {
545 if (i < INT64_BIT_SIZE) {
546 if (!(ec->config.keep_alive.lcore_mask.low & ((uint64_t)1 << i)))
548 } else if (i >= INT64_BIT_SIZE && i < INT64_BIT_SIZE * 2) {
549 if (!(ec->config.keep_alive.lcore_mask.high &
550 ((uint64_t)1 << (i - INT64_BIT_SIZE))))
553 WARNING(DPDK_EVENTS_PLUGIN
554 ": %s:%d Core id %u is out of 0 to %u range, skipping",
555 __FUNCTION__, __LINE__, i, INT64_BIT_SIZE * 2);
559 char core_name[DATA_MAX_NAME_LEN];
560 snprintf(core_name, sizeof(core_name), "lcore%u", i);
562 if (!ec->config.keep_alive.send_updated ||
563 (ec->core_info[i].lcore_state !=
564 ec->config.keep_alive.shm->core_state[i])) {
565 ec->core_info[i].lcore_state = ec->config.keep_alive.shm->core_state[i];
566 ec->core_info[i].read_time = cdtime();
568 if (ec->config.keep_alive.notify) {
569 char msg[DATA_MAX_NAME_LEN];
572 switch (ec->config.keep_alive.shm->core_state[i]) {
573 case RTE_KA_STATE_ALIVE:
575 snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: ALIVE", i);
577 case RTE_KA_STATE_MISSING:
578 snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: MISSING", i);
581 case RTE_KA_STATE_DEAD:
582 snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: DEAD", i);
585 case RTE_KA_STATE_UNUSED:
586 snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: UNUSED", i);
589 case RTE_KA_STATE_GONE:
590 snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: GONE", i);
593 case RTE_KA_STATE_DOZING:
594 snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: DOZING", i);
597 case RTE_KA_STATE_SLEEP:
598 snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: SLEEP", i);
602 snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: UNKNOWN", i);
606 dpdk_events_notification_dispatch(sev, KEEPALIVE_PLUGIN_INSTANCE,
607 ec->core_info[i].read_time, msg);
609 dpdk_events_gauge_submit(KEEPALIVE_PLUGIN_INSTANCE, core_name,
610 ec->config.keep_alive.shm->core_state[i],
611 ec->core_info[i].read_time);
617 static int dpdk_events_read(user_data_t *ud) {
621 ERROR(DPDK_EVENTS_PLUGIN ": plugin not initialized.");
625 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(g_hc);
626 int ls_ret = -1, ka_ret = -1;
629 if (ec->config.link_status.enabled) {
630 ls_ret = dpdk_helper_command(g_hc, DPDK_CMD_GET_EVENTS, &cmd_res,
631 ec->config.interval);
632 if (cmd_res == 0 && ls_ret == 0) {
633 dpdk_events_link_status_dispatch(g_hc);
637 if (ec->config.keep_alive.enabled) {
638 ka_ret = dpdk_event_keep_alive_shm_open();
640 ERROR(DPDK_EVENTS_PLUGIN
641 ": %s : error %d in dpdk_event_keep_alive_shm_open()",
642 __FUNCTION__, ka_ret);
644 dpdk_events_keep_alive_dispatch(g_hc);
647 if (!((cmd_res || ls_ret) == 0 || ka_ret == 0)) {
648 ERROR(DPDK_EVENTS_PLUGIN ": Read failure for all enabled event types");
655 static int dpdk_events_shutdown(void) {
661 dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(g_hc);
662 if (ec->config.keep_alive.enabled) {
663 if (ec->config.keep_alive.fd != -1) {
664 close(ec->config.keep_alive.fd);
665 ec->config.keep_alive.fd = -1;
668 if (ec->config.keep_alive.shm != MAP_FAILED) {
669 if (munmap(ec->config.keep_alive.shm, sizeof(dpdk_keepalive_shm_t))) {
670 ERROR(DPDK_EVENTS_PLUGIN ": munmap KA monitor failed");
673 ec->config.keep_alive.shm = MAP_FAILED;
677 dpdk_helper_shutdown(g_hc);
683 static int dpdk_events_init(void) {
686 if (g_state & DPDK_EVENTS_STATE_CFG_ERR) {
687 dpdk_events_shutdown();
691 int ret = dpdk_events_preinit();
698 void module_register(void) {
699 plugin_register_init(DPDK_EVENTS_PLUGIN, dpdk_events_init);
700 plugin_register_complex_config(DPDK_EVENTS_PLUGIN, dpdk_events_config);
701 plugin_register_complex_read(NULL, DPDK_EVENTS_PLUGIN, dpdk_events_read, 0,
703 plugin_register_shutdown(DPDK_EVENTS_PLUGIN, dpdk_events_shutdown);