From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 88F85A05D3 for ; Tue, 21 May 2019 23:27:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E27874C9D; Tue, 21 May 2019 23:27:16 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 82DEA4C96 for ; Tue, 21 May 2019 23:27:15 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id v80so115914pfa.3 for ; Tue, 21 May 2019 14:27:15 -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:mime-version :content-transfer-encoding; bh=yG667BhGjztcj6Deq7/Ez6qgvlh3Ty4IsBBOp0s6kwU=; b=Lo77u2TlMOjdT7cl0zoVFewUV/pjlo4kBucmnFe3EATxHpsi+rHH9JBfmhO9B2RKBK V4pBM0B6ibSA3iWogJiP25jsnXKVC0s190+fn9mlr0wkA0snEHZN3FKpHpkgX1oFJOeo eS4peXw6K4PZcPZMZ0HI8rFBcOkVFPfr2sEWUn6ZQL/QLmwLkReG1orVeviqIn8YyRTW G2pgUA1o8ZFS+QOMEyJBdEFtMeCZaHWA62MRaIv9ZcAiEdxVTOkBHFVBcNcGrC05xdcr b1QGLtDGkCz4Ib+mynWKnJy11VleIpAyah889XNIriqVJFy1JqmRpOl0cCx5hLD0EPsx EPrw== 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:mime-version :content-transfer-encoding; bh=yG667BhGjztcj6Deq7/Ez6qgvlh3Ty4IsBBOp0s6kwU=; b=blMM23FWuJy0/M8ctSzC1vGZZUn5jRJ4FWEJw4UbbPDRndV1GQ3nqrPVbkLjm9E+DQ A8ycZ7aHE0RLb1KdTai/t/KOOODbzDRGvk7mMCceHDNwxOKddlvjaA4dfsyVYBhTeTg4 kpSyRMGLihHtL3O7eSN2M/SAqvwjfLgdP9MWnJnLUDg8GW8gyRE4jHxj33PZFqQDRZke vLtoid17kQvpv2Xn/v4bpXUs+2ceVwq79JG9YNqLbMOU2ciB6mNfWNa9Ve0BQJKTvUxK RcxbuErtM8r0MpYKJlJMeIcw9UI79jgflOg1Gv7jYTLSIF/Y1wZ0fG+PyxAMAmbNbNsW AepA== X-Gm-Message-State: APjAAAVjp4UnpoI74Vo2pGOH9uO5hkq277LRE+VU/aNW3L14RUVu8XTy YGG3lm9pYf5DGRAAnac5WQA6xA== X-Google-Smtp-Source: APXvYqywgQa4+RmtRz2EOScN4efahrTr6PVaKB01RlZwzuOC6fpDhgXTGXkETeOqpvbarDxmnXbveg== X-Received: by 2002:a63:1d05:: with SMTP id d5mr84705344pgd.157.1558474034551; Tue, 21 May 2019 14:27:14 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id w12sm33606399pfj.41.2019.05.21.14.27.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 14:27:14 -0700 (PDT) From: Stephen Hemminger To: matan@mellanox.com, shahafs@mellanox.com Cc: dev@dpdk.org, Stephen Hemminger , Stephen Hemminger Date: Tue, 21 May 2019 14:27:12 -0700 Message-Id: <20190521212712.29357-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/mlx4: use dynamic log type 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This driver should use dynamic log level not RTE_LOGTYPE_PMD. Other drivers were converted back in 18.02. This is really a bug, all other drivers use dynamic log levels by now. Signed-off-by: Stephen Hemminger --- drivers/net/mlx4/mlx4.c | 8 ++++++++ drivers/net/mlx4/mlx4_utils.h | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index fe559c040706..e532dc53738f 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -60,6 +60,9 @@ static rte_spinlock_t mlx4_shared_data_lock = RTE_SPINLOCK_INITIALIZER; /* Process local data for secondary processes. */ static struct mlx4_local_data mlx4_local_data; +/** Driver-specific log messages type. */ +int mlx4_logtype; + /** Configuration structure for device arguments. */ struct mlx4_conf { struct { @@ -1272,6 +1275,11 @@ mlx4_glue_init(void) */ RTE_INIT(rte_mlx4_pmd_init) { + /* Initialize driver log type. */ + mlx4_logtype = rte_log_register("pmd.net.mlx4"); + if (mlx4_logtype >= 0) + rte_log_set_level(mlx4_logtype, RTE_LOG_NOTICE); + /* * MLX4_DEVICE_FATAL_CLEANUP tells ibv_destroy functions we * want to get success errno value in case of calling them diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h index 86abb3b7e376..9d3d2a4e32a1 100644 --- a/drivers/net/mlx4/mlx4_utils.h +++ b/drivers/net/mlx4/mlx4_utils.h @@ -15,6 +15,8 @@ #include "mlx4.h" +extern int mlx4_logtype; + #ifndef NDEBUG /* @@ -35,7 +37,7 @@ pmd_drv_log_basename(const char *s) } #define PMD_DRV_LOG(level, ...) \ - RTE_LOG(level, PMD, \ + RTE_LOG(level, mlx4_logtype, \ RTE_FMT("%s:%u: %s(): " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ pmd_drv_log_basename(__FILE__), \ __LINE__, \ @@ -52,7 +54,7 @@ pmd_drv_log_basename(const char *s) */ #define PMD_DRV_LOG(level, ...) \ - RTE_LOG(level, PMD, \ + RTE_LOG(level, mlx4_logtype, \ RTE_FMT(MLX4_DRIVER_NAME ": " \ RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ RTE_FMT_TAIL(__VA_ARGS__,))) -- 2.20.1