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 77FA4A05D3 for ; Fri, 24 May 2019 18:03:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B7511C0B; Fri, 24 May 2019 18:03:26 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 4F45514EC for ; Fri, 24 May 2019 18:03:25 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id w34so625570pga.12 for ; Fri, 24 May 2019 09:03:25 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=uFpONmxYPEWRRvtD/8wnmbPQP67dIhq7wgb+iEejxRg=; b=c5FxB7d2+3SOohGnlKi2fq8r8otrr6iyxehqP5UkWowIGcCdAJWdloSIFM7fPDR3z0 tVRiCg+71KczDXhq3t+O0GSFbWP0DVfa3OTjeGiT4Z6KISPh2oVtCir2VMWdbCo/8GVZ WZ9nU+NPId8+o1eDPPgyxW2niZdMoT3KrF4ELaEyYPOd4IhVmmbUhGlNXYcygYIkkWk9 W9Iz3785/GLYLsRGHkDT7iR9qj0Y4XYGPddjNzdoYo04vIzjUIohUfirNqGgepSIwMhW p9oAsGs9JcCvuszg94DSWEyqNOaMSInwsmuHJKZdml9i4UvjwDlVLBKEW0jTfnW38C8w Xs0w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=uFpONmxYPEWRRvtD/8wnmbPQP67dIhq7wgb+iEejxRg=; b=NbsF9iudwFI965jV1sObs0WoXNNwflkKBHvfRbXLrLHUrvBfN5u3uGaewjF/3WGZjR t+++DkNuofiTkgiAJEZpfNTpTb33LFLxh1rjboudV9eJBevuOZYIqFM9Rc3rwVRXQvt9 R2718+d+kM6lCyOdNoPiO395qbpPZ9fBFiT86ojgG6uZ/hHDBWUYh3A+OJ/lLzhpynS0 hNpZSJRsuWQ/bpjDTL3IFFgXGOCEVU4+KvhFqS566nDkUjYdO2HOi3V97ge7f5VvrmfJ HrKbiTRoJ8PAV2mKjGp2tfPhvgIXKXEesik6lDndssSYHAWJiX7dbdjwIX8aVaKf/ROH 8enQ== X-Gm-Message-State: APjAAAXi1c+eXEJNsr/VZ6tSC6ioFbuN6zycVGM0SI/7rqGY6mPajuMC jdovLbu6PMJZ9zVraVckdvr+5A== X-Google-Smtp-Source: APXvYqy7UEjGUEZBiraxSTEMTk/xaIs9RiTEQ9QGPi5bETcbXfvZAq3RcDhtVhAm2VYj219eB86xQA== X-Received: by 2002:a63:2cc9:: with SMTP id s192mr63308252pgs.24.1558713804269; Fri, 24 May 2019 09:03:24 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id j7sm1290525pfa.184.2019.05.24.09.03.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 May 2019 09:03:23 -0700 (PDT) From: Stephen Hemminger To: matan@mellanox.com, shahafs@mellanox.com Cc: dev@dpdk.org, Stephen Hemminger Date: Fri, 24 May 2019 09:03:16 -0700 Message-Id: <20190524160316.24922-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190521212712.29357-1-stephen@networkplumber.org> References: <20190521212712.29357-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] 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" From: Stephen Hemminger 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 --- v2 - use rte_log and fix debug logs 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..a49190252fe1 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(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(RTE_LOG_ ## level, mlx4_logtype, \ RTE_FMT(MLX4_DRIVER_NAME ": " \ RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ RTE_FMT_TAIL(__VA_ARGS__,))) -- 2.20.1