From: Chengchang Tang <tangchengch...@huawei.com>

According to the programming guide, the rte_eal_init should be used pairs
with rte_eal_cleanup.

This patch add rte_eal_cleanup to this example to encourage new users of
DPDK to use it.

Fixes: aec9c13c5257 ("eal: add function to release internal resources")
Cc: sta...@dpdk.org

Signed-off-by: Chengchang Tang <tangchengch...@huawei.com>
Signed-off-by: Min Hu (Connor) <humi...@huawei.com>
---
 examples/server_node_efd/node/node.c   | 3 +++
 examples/server_node_efd/server/main.c | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/examples/server_node_efd/node/node.c 
b/examples/server_node_efd/node/node.c
index 67a5580..e68606e 100644
--- a/examples/server_node_efd/node/node.c
+++ b/examples/server_node_efd/node/node.c
@@ -383,4 +383,7 @@ main(int argc, char *argv[])
 
                need_flush = 1;
        }
+
+       /* clean up the EAL */
+       rte_eal_cleanup();
 }
diff --git a/examples/server_node_efd/server/main.c 
b/examples/server_node_efd/server/main.c
index 4728960..39b7b63 100644
--- a/examples/server_node_efd/server/main.c
+++ b/examples/server_node_efd/server/main.c
@@ -334,5 +334,9 @@ main(int argc, char *argv[])
        rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MAIN);
 
        do_packet_forwarding();
+
+       /* clean up the EAL */
+       rte_eal_cleanup();
+
        return 0;
 }
-- 
2.7.4

Reply via email to