[dpdk-dev] [PATCH v2] eal: don't call RTE_LOG before init

Stephen Hemminger stephen at networkplumber.org
Thu Sep 19 15:31:07 CEST 2019


rte_init_alert is called before rte_log is initialized.
Therefore RTE_LOG() should not be used (only stderr).

For VFIO, it is initialized after rte_log_init therefore,
use RTE_LOG.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/librte_eal/linux/eal/eal.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index 946222ccdb7a..6f54a8b2133f 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -950,7 +950,6 @@ static int rte_eal_vfio_setup(void)
 static void rte_eal_init_alert(const char *msg)
 {
 	fprintf(stderr, "EAL: FATAL: %s\n", msg);
-	RTE_LOG(ERR, EAL, "%s\n", msg);
 }
 
 /*
@@ -1175,7 +1174,7 @@ rte_eal_init(int argc, char **argv)
 
 #ifdef VFIO_PRESENT
 	if (rte_eal_vfio_setup() < 0) {
-		rte_eal_init_alert("Cannot init VFIO");
+		RTE_LOG(ERR, EAL, "Cannot init VFIO\n");
 		rte_errno = EAGAIN;
 		rte_atomic32_clear(&run_once);
 		return -1;
-- 
2.17.1



More information about the dev mailing list