From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by dpdk.org (Postfix) with ESMTP id 0C7531F006 for ; Wed, 13 Jun 2018 20:46:31 +0200 (CEST) Received: by mail-pg0-f68.google.com with SMTP id c9-v6so1698900pgf.5 for ; Wed, 13 Jun 2018 11:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=eDmjv04LWqGyDvx4OMVUyeRAtFAthLcVOeDCFOJMcc4=; b=ddmWKwvIh7yuKQahwDPrGhUv8Tbf7sGPOs6ea7jRspdog4FXmZsNrCj2foGSF5z/6c u5KemPn7Ahjlrg1zdNGka9FOZ+W5RBM+yQniqom5xnjRS+OjFyhIPtLNmotCIW972P0M a63TUU9c8L8j47Oqsd5STzhrfRLWOlu0e/5QNOiZLpuf0u0AQJul4RnUMECtsJkXj1uJ 8sN/7mkR3dWo4cfOKEQeG7TSSbfVjI0rhmj4SHrLrc1went2UGMu405MPOSmVzu8pCkK aCNQgAFwTOvfS7EXQJ87O4oGu6VyVCDCpA1GV8xdovjNcvWxeK16PprPDw4rU6dKDNbe MBpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eDmjv04LWqGyDvx4OMVUyeRAtFAthLcVOeDCFOJMcc4=; b=DpIHY5qCAU+mhzVOXxbqOrLmNWnZHQrgnJGyq7deuqn4DCLqDG89S0iUGub2o389Uv 0HGUdd7zlsOU5e/0moDnPNvVTsk1GYdLKkI5sn8VUuSbuOrZ2a4Gg2ZdhrcIykNV6fKj e5jElEaVMl+6S+s1l8z2ZDuGoyF1yJnKJG5H39w0/RWx6LFDWD5BJpOsjOQmDNeQ55BN 8yYdYCcY/pUPn6t6TbWKU4kKnCwLCDRs19Ms2kdK+H6x8QzzALmRCIh2N6V+0Ihz+J+c F+1d75WSYu6RIuSLc2evyoFv3P9z3VjRmzDcI9642g/hwHeJAf3Wqt3/XXJO2wqLiSxz 75Cw== X-Gm-Message-State: APt69E2G92ZdU+4cE67BnjNZHnl8S5cGsoC1upn+gMQQo6E8AKtWC3ds KUfEgevvG2uvFECag0iFchpDuKEBrQY= X-Google-Smtp-Source: ADUXVKIkJwvMQy9QJRNEQAH4YA5uB0UR5LaZcVNDOG43yf2zmp32RxIE+XWVkRmWZ4QyRvS2t137DQ== X-Received: by 2002:a62:1f45:: with SMTP id f66-v6mr6010327pff.253.1528915589969; Wed, 13 Jun 2018 11:46:29 -0700 (PDT) Received: from xeon-e3.lan (204-195-35-107.wavecable.com. [204.195.35.107]) by smtp.gmail.com with ESMTPSA id q200-v6sm4388964pgq.9.2018.06.13.11.46.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 11:46:29 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 13 Jun 2018 11:46:26 -0700 Message-Id: <20180613184626.13458-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] mlx5: fix log initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 18:46:31 -0000 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") Signed-off-by: Stephen Hemminger --- drivers/net/mlx5/mlx5.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index c933e274fe32..6ec4f3178b6b 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1439,6 +1439,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(); @@ -1480,11 +1485,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); -} -- 2.17.1