examples/l3fwd-power: exit on power lib init failure
authorAnatoly Burakov <anatoly.burakov@intel.com>
Mon, 20 Apr 2020 17:56:51 +0000 (17:56 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 26 Apr 2020 21:48:41 +0000 (23:48 +0200)
commita163130bd6b466fd72bae1e97134089a20a8b148
treeaeccdeba66b780fd7205b68cdb9978b7430d480e
parent97fbfe5a9526c6ef6e5583330161f1ea4add22bd
examples/l3fwd-power: exit on power lib init failure

Currently, if power library initialization fails, only a log message is
displayed. This is suboptimal for a number of reasons, but the main one
is that telemetry mode does not depend on the power library and can
therefore run in environments where l3fwd-power would normally not run
correctly (such as inside a VM). This will lead to attempts to
deinitialize the power library on exit, with a subsequent forced unclean
shutdown of DPDK.

Fix this by only initializing the power library in modes that actually
need it, and change a log message to a failure to initialize.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
examples/l3fwd-power/main.c