From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 32B84A0471 for ; Tue, 16 Jul 2019 17:40:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4C9651B9AA; Tue, 16 Jul 2019 17:40:33 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 0755B1B964 for ; Tue, 16 Jul 2019 17:40:29 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id m9so10262635pls.8 for ; Tue, 16 Jul 2019 08:40:29 -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=UA4Cle0m0GWuH0sR5xi4HB1jiid4oFAG7LgHMgt3Avs=; b=N8lqBHQknRf2DpoiRGfdD/9BXphFjwJ/ZUGTCIM2yfuv2/aNGtfaNHs4ODQYACvk9a PV4d6HyGNZc6gV87hLnBfn7PWmSmUpwjQMHhjSFLE4TLtc1vUIZIjs52Uv8mSRjQ0QX9 NcnOXsu+iF/Go2AQZixYx+Ud0y/tlm8e2mrgOMvYzh8KUhCtRknrUpTNbHT8j9Sz8D6s 4Qi0ISXO6ebP3nINaqCitktNM5zZM2O2q44C7u0G3F6JT5rs9Z5swa818lSaIQ4i7Io8 kZBHeL4P7CDrgMmzzLjHHK8BgQ8xAtqwfOt/g9gFZPpXEreGbg6/JeKOd8/Ib9rTPQP9 nKDA== 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=UA4Cle0m0GWuH0sR5xi4HB1jiid4oFAG7LgHMgt3Avs=; b=GjoUdNpCbw8UQTbYv/TSXzRp4qZwgCbwh+j+1h2aQx5p7aWjIAgpsr+N7jm+JvwurA Hjhst5CeQRHXJUAGnvpAUCXKIxM9UtH3hEfiGrCU4nfRexVZoC8F4XDKgzuBCVMPnOw6 5ptmm2tnzxzZP/4IP78D0AeRblBGdpWUBkYdEdc1h7uILDL/RhjXGk08Gd9OuAQdDoNx /13j4jF58jR4UO6d/ByUEIbCaw3ARU35Z+f7M23w8McqHXDaL5TdojsEnYQb1Xfk/Ssw 9bUZQweqX6INp3pLKgQPseutjtN/+G/pee/uJBgbfgxBJF8nhDvBpK7kpo4o66PTtQCY C/4w== X-Gm-Message-State: APjAAAVRttQRGrVty3NLE7zC1VxlzXYUdoLlPFLxc9lNKHXbAx4isuvV BTxjknUJiIWplh/OFU0HshE= X-Google-Smtp-Source: APXvYqyjID2lo+/22DP5BsK3TGLjf+420cb4BbNg8URuIx2SFxf8URUM5Ngbcrpue8ifa+l1jOL1pQ== X-Received: by 2002:a17:902:9a85:: with SMTP id w5mr36543778plp.221.1563291628488; Tue, 16 Jul 2019 08:40:28 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b19sm20700833pgh.57.2019.07.16.08.40.27 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 08:40:27 -0700 (PDT) From: Stephen Hemminger To: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com, xiao.w.wang@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org, Stephen Hemminger Date: Tue, 16 Jul 2019 08:40:09 -0700 Message-Id: <20190716154013.6974-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190716154013.6974-1-stephen@networkplumber.org> References: <20190716154013.6974-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/6] net/fm10k: use dynamic log type for tx/rx debug 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" The generic RTE_LOGTYPE_PMD is a historical relic and should not be used. Every driver must dynamic log types. Signed-off-by: Stephen Hemminger --- drivers/net/fm10k/fm10k_ethdev.c | 28 ++++++++++++++++++++++++++++ drivers/net/fm10k/fm10k_logs.h | 18 ++++++++++++------ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index a1e3836cb449..1f0a6286a57b 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -43,6 +43,16 @@ int fm10k_logtype_init; int fm10k_logtype_driver; +#ifdef RTE_LIBRTE_FM10K_DEBUG_RX +int fm10k_logtype_rx; +#endif +#ifdef RTE_LIBRTE_FM10K_DEBUG_TX +int fm10k_logtype_tx; +#endif +#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE +int fm10k_logtype_tx_free; +#endif + 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); @@ -3286,4 +3296,22 @@ RTE_INIT(fm10k_init_log) fm10k_logtype_driver = rte_log_register("pmd.net.fm10k.driver"); if (fm10k_logtype_driver >= 0) rte_log_set_level(fm10k_logtype_driver, RTE_LOG_NOTICE); + +#ifdef RTE_LIBRTE_FM10K_DEBUG_RX + fm10k_logtype_rx = rte_log_register("pmd.net.fm10k.rx"); + if (fm10k_logtype_rx >= 0) + rte_log_set_level(fm10k_logtype_rx, RTE_LOG_NOTICE); +#endif + +#ifdef RTE_LIBRTE_FM10K_DEBUG_TX + fm10k_logtype_tx = rte_log_register("pmd.net.fm10k.tx"); + if (fm10k_logtype_tx >= 0) + rte_log_set_level(fm10k_logtype_tx, RTE_LOG_NOTICE); +#endif + +#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE + fm10k_logtype_tx_free = rte_log_register("pmd.net.fm10k.tx_free"); + if (fm10k_logtype_tx_free >= 0) + rte_log_set_level(fm10k_logtype_tx_free, RTE_LOG_NOTICE); +#endif } diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h index df56a51cac48..9ae743d80678 100644 --- a/drivers/net/fm10k/fm10k_logs.h +++ b/drivers/net/fm10k/fm10k_logs.h @@ -15,22 +15,28 @@ extern int fm10k_logtype_init; #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") #ifdef RTE_LIBRTE_FM10K_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int fm10k_logtype_rx; +#define PMD_RX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, fm10k_logtype_rx, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_RX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_LIBRTE_FM10K_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int fm10k_logtype_tx; +#define PMD_TX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, fm10k_logtype_tx, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE -#define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int fm10k_logtype_tx_free; +#define PMD_TX_FREE_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, fm10k_logtype_tx_free, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0) #endif -- 2.20.1