DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08
@ 2019-08-02  2:51 Stephen Hemminger
  2019-08-02  2:51 ` [dpdk-dev] [PATCH 1/3] testpmd: allow configuring log level on command line Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Stephen Hemminger @ 2019-08-02  2:51 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Small fixes to testpmd, found while trying to get testpmd
to work correctly as secondary process. Fixing that goes deeper
and another set of patches to do that will come (for 19.11).

Stephen Hemminger (3):
  testpmd: allow configuring log level on command line
  testpmd: block secondary process
  testpmd: use exit instead of panic

 app/test-pmd/testpmd.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH 1/3] testpmd: allow configuring log level on command line
  2019-08-02  2:51 [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08 Stephen Hemminger
@ 2019-08-02  2:51 ` Stephen Hemminger
  2019-08-02  2:51 ` [dpdk-dev] [PATCH 2/3] testpmd: block secondary process Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2019-08-02  2:51 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Since testpmd registers log type after processing command
line arguments, it is not possible to do:
  # testpmd --log-level='testpmd:info' ...

Fix this by initializing logtype first.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/testpmd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 518865a7db25..159c2ef05b6c 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3234,15 +3234,15 @@ main(int argc, char** argv)
 	signal(SIGINT, signal_handler);
 	signal(SIGTERM, signal_handler);
 
-	diag = rte_eal_init(argc, argv);
-	if (diag < 0)
-		rte_panic("Cannot init EAL\n");
-
 	testpmd_logtype = rte_log_register("testpmd");
 	if (testpmd_logtype < 0)
 		rte_panic("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");
+
 	ret = register_eth_event_callback();
 	if (ret != 0)
 		rte_panic("Cannot register for ethdev events");
-- 
2.20.1


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

* [dpdk-dev] [PATCH 2/3] testpmd: block secondary process
  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 ` Stephen Hemminger
  2019-08-02  2:51 ` [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic Stephen Hemminger
  2019-08-05 13:48 ` [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08 Thomas Monjalon
  3 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2019-08-02  2:51 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Since testpmd has several issues which keep it from working correctly
as a secondary process; abort if user tries to do it, rather than
running into later problems.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 159c2ef05b6c..d0142cae68d7 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3243,6 +3243,9 @@ main(int argc, char** argv)
 	if (diag < 0)
 		rte_panic("Cannot init EAL\n");
 
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		rte_panic("Secondary process type not supported.\n");
+
 	ret = register_eth_event_callback();
 	if (ret != 0)
 		rte_panic("Cannot register for ethdev events");
-- 
2.20.1


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

* [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic
  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
  2019-08-02 16:08   ` Burakov, Anatoly
  2019-08-05 13:48 ` [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08 Thomas Monjalon
  3 siblings, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2019-08-02  2:51 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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


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

* Re: [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic
  2019-08-02  2:51 ` [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic Stephen Hemminger
@ 2019-08-02 16:08   ` Burakov, Anatoly
  2019-08-02 16:13     ` Stephen Hemminger
  0 siblings, 1 reply; 7+ messages in thread
From: Burakov, Anatoly @ 2019-08-02 16:08 UTC (permalink / raw)
  To: Stephen Hemminger, dev

On 02-Aug-19 3:51 AM, Stephen Hemminger wrote:
> 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>
> ---

Missed opportunity for a "keep calm" joke...

Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic
  2019-08-02 16:08   ` Burakov, Anatoly
@ 2019-08-02 16:13     ` Stephen Hemminger
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2019-08-02 16:13 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: dev

On Fri, 2 Aug 2019 17:08:26 +0100
"Burakov, Anatoly" <anatoly.burakov@intel.com> wrote:

> On 02-Aug-19 3:51 AM, Stephen Hemminger wrote:
> > 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>
> > ---  
> 
> Missed opportunity for a "keep calm" joke...

Great...

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

* Re: [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08
  2019-08-02  2:51 [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08 Stephen Hemminger
                   ` (2 preceding siblings ...)
  2019-08-02  2:51 ` [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic Stephen Hemminger
@ 2019-08-05 13:48 ` Thomas Monjalon
  3 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2019-08-05 13:48 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

> Stephen Hemminger (3):
>   testpmd: allow configuring log level on command line
>   testpmd: block secondary process
>   testpmd: use exit instead of panic

Applied, thanks




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

end of thread, other threads:[~2019-08-05 13:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic Stephen Hemminger
2019-08-02 16:08   ` 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

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).