Skip to contentSkip to conversation

examples/helloworld: add eal clean up to the example

PATCH In review Min Hu (Connor) 2 participants 4 messages Apr 8, 2021 – Apr 14, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/helloworld: add eal clean up to the example

From: Chengchang Tang <[email protected]>

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

So, we should add the use of clean up to the hello world example to encourage new users of DPDK to use it.

Fixes af75078fece3 ("first public release")
---
 examples/helloworld/main.c | 3 +++
 1 file changed, 3 insertions(+)
examples/helloworld/main.c +3 -0
index 8a4cee6..6e403b6 100644
@@ -43,5 +43,8 @@ main(int argc, char **argv)
 	lcore_hello(NULL);
 
 	rte_eal_mp_wait_lcore();
+
+	/* clean up the EAL */
+	rte_eal_cleanup();
 	return 0;
 }
Signature · 1 line
2.7.4
#1 lore raw
Quoted 10 lines · Min Hu (Connor)

From: Chengchang Tang <[email protected]>

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

So, we should add the use of clean up to the hello world example to encourage new users of DPDK to use it.

Fixes af75078fece3 ("first public release")

rte_eal_cleanup() was introduced with aec9c13c5257 ("eal: add function to release internal resources") from v18.02.

Other examples probably need fixes too.

$ git grep -l rte_eal_init examples/ |xargs grep -L rte_eal_cleanup |wc
     52      52    1623
Signature · 1 line
David Marchand
#2 lore raw
Quoted 10 lines · David Marchand
Quoted 9 lines · Min Hu (Connor)

From: Chengchang Tang <[email protected]>

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

So, we should add the use of clean up to the hello world example to encourage new users of DPDK to use it.

Quoted 9 lines
Quoted 1 line
Fixes af75078fece3 ("first public release")

rte_eal_cleanup() was introduced with aec9c13c5257 ("eal: add function to release internal resources") from v18.02.

Other examples probably need fixes too.

$ git grep -l rte_eal_init examples/ |xargs grep -L rte_eal_cleanup |wc
      52      52    1623

Thanks David,
I will fix other examples in next patches.

Quoted 1 line
#3 lore raw
Quoted 18 lines · Min Hu (Connor)
Quoted 15 lines · David Marchand
Quoted 10 lines · Min Hu (Connor)

From: Chengchang Tang <[email protected]>

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

So, we should add the use of clean up to the hello world example to encourage new users of DPDK to use it.

Fixes af75078fece3 ("first public release")

rte_eal_cleanup() was introduced with aec9c13c5257 ("eal: add function to release internal resources") from v18.02.

Quoted 7 lines
Quoted 4 lines

Other examples probably need fixes too.

$ git grep -l rte_eal_init examples/ |xargs grep -L rte_eal_cleanup |wc
      52      52    1623

Thanks David,
    I will fix other examples in next patches.

Quoted 1 line

Hi, David and all,
I have sent one set of patches to fix it, the headline is "[PATCH 00/45] add eal clean up to the example" Please review it, thanks.

Quoted 1 line

.