testpmd: fixes for 19.08
cover testpmd: fixes for 19.08
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(-)
Signature · 1 line
2.20.1
PATCH 1/3 testpmd: allow configuring log level on command line
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.
--- app/test-pmd/testpmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
app/test-pmd/testpmd.c +4 -4
@@ -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" );
Signature · 1 line
2.20.1
PATCH 2/3 testpmd: block secondary process
In reply to Stephen HemmingerSince 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.
--- app/test-pmd/testpmd.c | 3 +++ 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c +3 -0
@@ -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" );
Signature · 1 line
2.20.1
PATCH 3/3 testpmd: use exit instead of panic
In reply to Stephen Hemmingerrte_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.
--- app/test-pmd/testpmd.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
app/test-pmd/testpmd.c +8 -6
@@ -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
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic
Quoted 6 lines · Stephen Hemminger
rte_paniccauses a backtrace (which is uniformative since all these calls are in main). Instead userte_exitand try and make the messages informative.Signed-off-by Stephen Hemminger <[email protected]>---
Missed opportunity for a "keep calm" joke...
Signature · 2 lines
Thanks, Anatoly
Re: [dpdk-dev] [PATCH 3/3] testpmd: use exit instead of panic
Quoted 9 lines · Anatoly
Quoted 6 lines · Stephen Hemminger
rte_paniccauses a backtrace (which is uniformative since all these calls are in main). Instead userte_exitand try and make the messages informative.Signed-off-by Stephen Hemminger <[email protected]>---
Missed opportunity for a "keep calm" joke...
Great...
Thomas Monjalon
AppliedQuoted 4 lines
Stephen Hemminger (3):
testpmd: allow configuring log level on command line
testpmd: block secondary process
testpmd: use exit instead of panic
Applied, thanks