DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/helloworld: add eal clean up to the example
@ 2021-04-08 10:17 Min Hu (Connor)
  2021-04-08 11:21 ` David Marchand
  0 siblings, 1 reply; 4+ messages in thread
From: Min Hu (Connor) @ 2021-04-08 10:17 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bruce.richardson

From: Chengchang Tang <tangchengchang@huawei.com>

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")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/helloworld/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/helloworld/main.c b/examples/helloworld/main.c
index 8a4cee6..6e403b6 100644
--- a/examples/helloworld/main.c
+++ b/examples/helloworld/main.c
@@ -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;
 }
-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/helloworld: add eal clean up to the example
  2021-04-08 10:17 [dpdk-dev] [PATCH] examples/helloworld: add eal clean up to the example Min Hu (Connor)
@ 2021-04-08 11:21 ` David Marchand
  2021-04-08 13:09   ` Min Hu (Connor)
  0 siblings, 1 reply; 4+ messages in thread
From: David Marchand @ 2021-04-08 11:21 UTC (permalink / raw)
  To: Min Hu (Connor); +Cc: dev, Yigit, Ferruh, Bruce Richardson, Thomas Monjalon

On Thu, Apr 8, 2021 at 12:17 PM Min Hu (Connor) <humin29@huawei.com> wrote:
>
> From: Chengchang Tang <tangchengchang@huawei.com>
>
> 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


-- 
David Marchand


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/helloworld: add eal clean up to the example
  2021-04-08 11:21 ` David Marchand
@ 2021-04-08 13:09   ` Min Hu (Connor)
  2021-04-14  2:12     ` Min Hu (Connor)
  0 siblings, 1 reply; 4+ messages in thread
From: Min Hu (Connor) @ 2021-04-08 13:09 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Yigit, Ferruh, Bruce Richardson, Thomas Monjalon



在 2021/4/8 19:21, David Marchand 写道:
> On Thu, Apr 8, 2021 at 12:17 PM Min Hu (Connor) <humin29@huawei.com> wrote:
>>
>> From: Chengchang Tang <tangchengchang@huawei.com>
>>
>> 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
> 
Thanks David,
	I will fix other examples in next patches.
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/helloworld: add eal clean up to the example
  2021-04-08 13:09   ` Min Hu (Connor)
@ 2021-04-14  2:12     ` Min Hu (Connor)
  0 siblings, 0 replies; 4+ messages in thread
From: Min Hu (Connor) @ 2021-04-14  2:12 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Yigit, Ferruh, Bruce Richardson, Thomas Monjalon



在 2021/4/8 21:09, Min Hu (Connor) 写道:
> 
> 
> 在 2021/4/8 19:21, David Marchand 写道:
>> On Thu, Apr 8, 2021 at 12:17 PM Min Hu (Connor) <humin29@huawei.com> 
>> wrote:
>>>
>>> From: Chengchang Tang <tangchengchang@huawei.com>
>>>
>>> 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
>>
> Thanks David,
>      I will fix other examples in next patches.
>>
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.
> .

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-14  2:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 10:17 [dpdk-dev] [PATCH] examples/helloworld: add eal clean up to the example Min Hu (Connor)
2021-04-08 11:21 ` David Marchand
2021-04-08 13:09   ` Min Hu (Connor)
2021-04-14  2:12     ` Min Hu (Connor)

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git