From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic
Date: Thu, 1 Aug 2019 19:51:54 -0700 [thread overview]
Message-ID: <20190802025154.328-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20190802025154.328-1-stephen@networkplumber.org>
rte_panic causes a backtrace (which is uniformative since all
these calls are in main). Instead use rte_exit and try and make the
messages informative.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/testpmd.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index d0142cae68d7..a461cef188e3 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3236,19 +3236,21 @@ main(int argc, char** argv)
testpmd_logtype = rte_log_register("testpmd");
if (testpmd_logtype < 0)
- rte_panic("Cannot register log type");
+ rte_exit(EXIT_FAILURE, "Cannot register log type");
rte_log_set_level(testpmd_logtype, RTE_LOG_DEBUG);
diag = rte_eal_init(argc, argv);
if (diag < 0)
- rte_panic("Cannot init EAL\n");
+ rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n",
+ rte_strerror(rte_errno));
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
- rte_panic("Secondary process type not supported.\n");
+ rte_exit(EXIT_FAILURE,
+ "Secondary process type not supported.\n");
ret = register_eth_event_callback();
if (ret != 0)
- rte_panic("Cannot register for ethdev events");
+ rte_exit(EXIT_FAILURE, "Cannot register for ethdev events");
#ifdef RTE_LIBRTE_PDUMP
/* initialize packet capture framework */
@@ -3269,8 +3271,8 @@ main(int argc, char** argv)
set_def_fwd_config();
if (nb_lcores == 0)
- rte_panic("Empty set of forwarding logical cores - check the "
- "core mask supplied in the command parameters\n");
+ rte_exit(EXIT_FAILURE, "No cores defined for forwarding\n"
+ "Check the core mask argument\n");
/* Bitrate/latency stats disabled by default */
#ifdef RTE_LIBRTE_BITRATE
--
2.20.1
next prev parent reply other threads:[~2019-08-02 2:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 2:51 [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08 Stephen Hemminger
2019-08-02 2:51 ` [dpdk-dev] [PATCH 1/3] testpmd: allow configuring log level on command line Stephen Hemminger
2019-08-02 2:51 ` [dpdk-dev] [PATCH 2/3] testpmd: block secondary process Stephen Hemminger
2019-08-02 2:51 ` Stephen Hemminger [this message]
2019-08-02 16:08 ` [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic Burakov, Anatoly
2019-08-02 16:13 ` Stephen Hemminger
2019-08-05 13:48 ` [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08 Thomas Monjalon
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=20190802025154.328-4-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).