From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by dpdk.org (Postfix) with ESMTP id 643CE1B022 for ; Tue, 19 Dec 2017 07:38:56 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id y89so10778624pfk.0 for ; Mon, 18 Dec 2017 22:38:56 -0800 (PST) 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; bh=uRoBt1gFDTY4oeeQJvTgjOSUlRGg4UME9+wzwLPn/VE=; b=Byrzv4/UJRChKVGulqbC6/Dw50P9n8v34xyUWe+LdDt19Np0mUqFcAuuGx9Qa7pqdB wcJb7fzzA01b4yO2IWUYrJpJBhCCZxJks+kBRB7penLS+QO6Ki4uQ8S0Fbqd+P0DgJKS iWaaK3bcvY0OIH32zdDD8PjgdRz/z3/9Byuekr3uBG096FsryvLpdtWbW/1Cf5MAUGcG OABZdcUFCLwiH/qVq63/4nLzqOkv2/a6G8TI1MSqlQ57oByw0myBEirJmKZ44iaP513+ W2dUkGG7lxY/B8VUxPuI60X7WHxfpi4yXAK9Yrxey2OZBuIumdFY0XekSzIf54uvy3mM abhg== 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; bh=uRoBt1gFDTY4oeeQJvTgjOSUlRGg4UME9+wzwLPn/VE=; b=e4WRscmpe22HujqoRs6aJTEZuN1UGaxjXsx0kLBmR7WlNWfIpp3n1unqB+shWIQZrx YY1/x7jlDPpZnM/sjs/osJXu+jDdU3Cqk/D+p8rZRuNS/IPVLrovwVAe6oJ7srogR9VJ N9qxReM9P/Bm1Z3gpuU1O6W1Cfgw7p3mybA+mn6CfsQMy39xzj5+sMbv8XXqus5E+Vq4 VloMkgMEF3avp1GGw3RFoEld6RZYl/T9uNTqzKo+fxcwsaYL+3Kqzod+aFegICr4ghqi PDS2sOdpxe8NbfRXJZBSKKpJ6GJm7/iPGj0jjFmxS9FoseLfhBuENeHGrt4UYSN5n4R4 7npg== X-Gm-Message-State: AKGB3mLSxPfXi7ogj7akemTYAbzVXqwFDQBdxPuzTVBXvsV4xbjSN+oE vVWQtFQ7+VpIo/V4odqDpAbSGC/E9hU= X-Google-Smtp-Source: ACJfBov+WWMaWMc+NTO4Mrq9LWzUj9wx25uaueSIAfkdqqtx5fmw6Bcug+k5ikWcFSeZsTnvN/Oh5w== X-Received: by 10.99.106.67 with SMTP id f64mr2062262pgc.453.1513665535251; Mon, 18 Dec 2017 22:38:55 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id d9sm31288842pfk.117.2017.12.18.22.38.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 22:38:54 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 18 Dec 2017 22:38:37 -0800 Message-Id: <20171219063840.18981-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171219063840.18981-1-stephen@networkplumber.org> References: <20171219063840.18981-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 08/11] fm10k: implement dynamic logging 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: Tue, 19 Dec 2017 06:38:57 -0000 Signed-off-by: Stephen Hemminger --- config/common_base | 2 -- drivers/net/fm10k/fm10k_ethdev.c | 15 +++++++++++++++ drivers/net/fm10k/fm10k_logs.h | 16 ++++++---------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/config/common_base b/config/common_base index 8d18b3c81db8..69004d1578ae 100644 --- a/config/common_base +++ b/config/common_base @@ -213,11 +213,9 @@ CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 # Compile burst-oriented FM10K PMD # CONFIG_RTE_LIBRTE_FM10K_PMD=y -CONFIG_RTE_LIBRTE_FM10K_DEBUG_INIT=n CONFIG_RTE_LIBRTE_FM10K_DEBUG_RX=n CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX=n CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX_FREE=n -CONFIG_RTE_LIBRTE_FM10K_DEBUG_DRIVER=n CONFIG_RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=y CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR=y diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 2d05a466965b..7236173f8207 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -69,6 +69,9 @@ #define GLORT_FD_MASK GLORT_PF_MASK #define GLORT_FD_INDEX GLORT_FD_Q_BASE +int fm10k_logtype_init; +int fm10k_logtype_driver; + static void fm10k_close_mbx_service(struct fm10k_hw *hw); static void fm10k_dev_promiscuous_enable(struct rte_eth_dev *dev); static void fm10k_dev_promiscuous_disable(struct rte_eth_dev *dev); @@ -3263,3 +3266,15 @@ static struct rte_pci_driver rte_pmd_fm10k = { RTE_PMD_REGISTER_PCI(net_fm10k, rte_pmd_fm10k); RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map); RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci"); + +RTE_INIT(fm10k_init_log); +static void +fm10k_init_log(void) +{ + fm10k_logtype_init = rte_log_register("pmd.fm10k.init"); + if (fm10k_logtype_init >= 0) + rte_log_set_level(fm10k_logtype_init, RTE_LOG_NOTICE); + fm10k_logtype_driver = rte_log_register("pmd.fm10k.driver"); + if (fm10k_logtype_driver >= 0) + rte_log_set_level(fm10k_logtype_driver, RTE_LOG_NOTICE); +} diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h index 31384c9e2b69..2a9e1c609d8b 100644 --- a/drivers/net/fm10k/fm10k_logs.h +++ b/drivers/net/fm10k/fm10k_logs.h @@ -36,14 +36,12 @@ #include +extern int fm10k_logtype_init; #define PMD_INIT_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ##args) + rte_log(RTE_LOG_ ## level, fm10k_logtype_init, \ + "%s(): " fmt "\n", __func__, ##args) -#ifdef RTE_LIBRTE_FM10K_DEBUG_INIT #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") -#else -#define PMD_INIT_FUNC_TRACE() do { } while (0) -#endif #ifdef RTE_LIBRTE_FM10K_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ @@ -66,12 +64,10 @@ #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0) #endif -#ifdef RTE_LIBRTE_FM10K_DEBUG_DRIVER +extern int fm10k_logtype_driver; #define PMD_DRV_LOG_RAW(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args) -#else -#define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0) -#endif + rte_log(RTE_LOG_ ## level, fm10k_logtype_driver, "%s(): " fmt, \ + __func__, ## args) #define PMD_DRV_LOG(level, fmt, args...) \ PMD_DRV_LOG_RAW(level, fmt "\n", ## args) -- 2.11.0