DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH] examples/helloworld: add eal clean up to the example
Date: Thu, 8 Apr 2021 18:17:23 +0800
Message-ID: <1617877043-11025-1-git-send-email-humin29@huawei.com> (raw)

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


             reply	other threads:[~2021-04-08 10:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 10:17 Min Hu (Connor) [this message]
2021-04-08 11:21 ` David Marchand
2021-04-08 13:09   ` Min Hu (Connor)
2021-04-14  2:12     ` Min Hu (Connor)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1617877043-11025-1-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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