From: Stephen Hemminger Date: Wed, 13 Jun 2018 18:46:26 +0000 (-0700) Subject: net/mlx5: fix log initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3d96644aa3af431ed881b900971b8228e93889a9;p=dpdk.git net/mlx5: fix log initialization The mlx5 driver had two init functions, but this could cause log initialization to be done after the other initialization. Also, the name of the function does not match convention (cut/paste error?). Fix by initializing log type first at start of the pmd_init. This also gets rid of having two constructor functions. Fixes: a170a30d22a8 ("net/mlx5: use dynamic logging") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Nelio Laranjeiro --- diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 3e0a1b1869..49b400503c 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1388,6 +1388,11 @@ RTE_INIT(rte_mlx5_pmd_init); static void rte_mlx5_pmd_init(void) { + /* Initialize driver log type. */ + mlx5_logtype = rte_log_register("pmd.net.mlx5"); + if (mlx5_logtype >= 0) + rte_log_set_level(mlx5_logtype, RTE_LOG_NOTICE); + /* Build the static tables for Verbs conversion. */ mlx5_set_ptype_table(); mlx5_set_cksum_table(); @@ -1429,11 +1434,3 @@ rte_mlx5_pmd_init(void) RTE_PMD_EXPORT_NAME(net_mlx5, __COUNTER__); RTE_PMD_REGISTER_PCI_TABLE(net_mlx5, mlx5_pci_id_map); RTE_PMD_REGISTER_KMOD_DEP(net_mlx5, "* ib_uverbs & mlx5_core & mlx5_ib"); - -/** Initialize driver log type. */ -RTE_INIT(vdev_netvsc_init_log) -{ - mlx5_logtype = rte_log_register("pmd.net.mlx5"); - if (mlx5_logtype >= 0) - rte_log_set_level(mlx5_logtype, RTE_LOG_NOTICE); -}