examples/l3fw-power: do not exit on power lib init failure

Message ID 1531921784-10578-1-git-send-email-radu.nicolau@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series examples/l3fw-power: do not exit on power lib init failure |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Radu Nicolau July 18, 2018, 1:49 p.m. UTC
  Do not exit the application if power library fails to initialize
or high performance cores configuration cannot be used.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 examples/l3fwd-power/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

De Lara Guarch, Pablo July 26, 2018, 5:39 p.m. UTC | #1
Hi Radu,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Radu Nicolau
> Sent: Wednesday, July 18, 2018 2:50 PM
> To: dev@dpdk.org
> Cc: Hunt, David <david.hunt@intel.com>; Yao, Lei A <lei.a.yao@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>
> Subject: [dpdk-dev] [PATCH] examples/l3fw-power: do not exit on power lib init
> failure
> 
> Do not exit the application if power library fails to initialize or high performance
> cores configuration cannot be used.

I would say this deserves more explanation. It doesn't look correct to me to keep log an error that
the power library couldn't be initialized and still the sample application keeps running.

Actually, the way init_power_library is coded, it returns the output of the call of rte_power_init on the last core
(ret is overwritten for each core), which looks wrong to me.

Thanks,
Pablo
> 
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
  
Radu Nicolau July 27, 2018, 9:56 a.m. UTC | #2
On 7/26/2018 6:39 PM, De Lara Guarch, Pablo wrote:
> Hi Radu,
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Radu Nicolau
>> Sent: Wednesday, July 18, 2018 2:50 PM
>> To: dev@dpdk.org
>> Cc: Hunt, David <david.hunt@intel.com>; Yao, Lei A <lei.a.yao@intel.com>;
>> Nicolau, Radu <radu.nicolau@intel.com>
>> Subject: [dpdk-dev] [PATCH] examples/l3fw-power: do not exit on power lib init
>> failure
>>
>> Do not exit the application if power library fails to initialize or high performance
>> cores configuration cannot be used.
> I would say this deserves more explanation. It doesn't look correct to me to keep log an error that
> the power library couldn't be initialized and still the sample application keeps running.
The application can also be used without the power library features, and 
this was also the previous behavior, before high/regular performance 
core feature was added.
>
> Actually, the way init_power_library is coded, it returns the output of the call of rte_power_init on the last core
> (ret is overwritten for each core), which looks wrong to me.
I will update init_power_library to return -1 if rte_power_init fails 
for at least one core.
>
> Thanks,
> Pablo
>> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
>> ---
  

Patch

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index d15cd52..42518fe 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1683,10 +1683,10 @@  main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Invalid L3FWD parameters\n");
 
 	if (init_power_library())
-		rte_exit(EXIT_FAILURE, "init_power_library failed\n");
+		RTE_LOG(ERR, POWER, "init_power_library failed\n");
 
 	if (update_lcore_params() < 0)
-		rte_exit(EXIT_FAILURE, "update_lcore_params failed\n");
+		RTE_LOG(ERR, POWER, "update_lcore_params failed\n");
 
 	if (check_lcore_params() < 0)
 		rte_exit(EXIT_FAILURE, "check_lcore_params failed\n");