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 F4191A0471 for ; Tue, 16 Jul 2019 17:41:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A94C1B9FA; Tue, 16 Jul 2019 17:40:38 +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 676E81B993 for ; Tue, 16 Jul 2019 17:40:32 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id m9so10262705pls.8 for ; Tue, 16 Jul 2019 08:40:32 -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=FXNLOxCE2/VEowrEtxzrj9lKo/FQMAR3CQpfGnOuEN8=; b=fwLhWP8fYt9IASQtulgp06Qg7HryKffE+c3hI4zP+bGv6YpSZJnOIOLVmCYW/R/JAN ikKtnMhDBJPyJENTQ2FJATuELErkiXsVp915yFaDIJsFGjl/I4xFQaInCYno9vsqdVlS muhThMvWEOp1z7Zpb+7mNeTKMPE/06mmmddAHQt+J/RuI/6IjZaXgVf906sofzKTgpjw KT+07g+9PnDC1ApTT0R0SrE691fX0GgDHuhdGCPoxESDs+epCkJFgL2Vm4b+plDiBKqP T1RVl3uCsRuY1JgJRhvO0kweGDlngAl8rM6Rp+/EPjKPlb+m1UNBP82jRdolSpPUfwTm Kidw== 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=FXNLOxCE2/VEowrEtxzrj9lKo/FQMAR3CQpfGnOuEN8=; b=qS9tgHOMd76gttOjfaSuWKaQ01bHa8Uho8urxT2K3GHmB4XdXrApRIsofKqZY+QSIz 00TmAJfzfmMvxoOULOjtIsd6mWnAFvt/JkiLf+4h9vjJlzXSx94qgalyn8+AhhCbylWB qycC9gCZl359Da/l1ddUz6xnjh9GSr1s3Auv5yN1yZDZgxrGuywbcigeFC4Mst6DZc3v 0uE6T51pxO3l65nDdOO1YmM03/sO36nMCxOhLmEvIz4u8wXesAMubPGr/jJTgfL8TMDp zCCRMCTSdG52rBE6NIrM1rc7oXZzqpuLWZt5gHdb/KPyFcZqawGvJ2ffjQvrul7dgvHp GTBw== X-Gm-Message-State: APjAAAWo2aUwWZvc+MCGbeYDZVSFYSLLpldQ+7MyH0PQzgYwBRRAJIIS L3+RYXRf2YaZJrhw/v+Gl68= X-Google-Smtp-Source: APXvYqzPHzg5sd+4dhB2YAwJdATkQ8mCAFZQfAWEbWjul7Q4D04uSE/8Cn0zto1T8wPIB8rzfHTsOA== X-Received: by 2002:a17:902:684:: with SMTP id 4mr36684378plh.138.1563291631664; Tue, 16 Jul 2019 08:40:31 -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.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 08:40:30 -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:11 -0700 Message-Id: <20190716154013.6974-5-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 4/6] net/ice: 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/ice/ice_ethdev.c | 27 +++++++++++++++++++++++++++ drivers/net/ice/ice_logs.h | 18 ++++++++++++------ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 9ce730cd4412..37cc59bc7060 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -23,6 +23,15 @@ int ice_logtype_init; int ice_logtype_driver; +#ifdef RTE_LIBRTE_ICE_DEBUG_RX +int ice_logtype_rx; +#endif +#ifdef RTE_LIBRTE_ICE_DEBUG_TX +int ice_logtype_tx; +#endif +#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE +int ice_logtype_tx_free; +#endif static int ice_dev_configure(struct rte_eth_dev *dev); static int ice_dev_start(struct rte_eth_dev *dev); @@ -3762,4 +3771,22 @@ RTE_INIT(ice_init_log) ice_logtype_driver = rte_log_register("pmd.net.ice.driver"); if (ice_logtype_driver >= 0) rte_log_set_level(ice_logtype_driver, RTE_LOG_NOTICE); + +#ifdef RTE_LIBRTE_ICE_DEBUG_RX + ice_logtype_rx = rte_log_register("pmd.net.ice.rx"); + if (ice_logtype_rx >= 0) + rte_log_set_level(ice_logtype_rx, RTE_LOG_NOTICE); +#endif + +#ifdef RTE_LIBRTE_ICE_DEBUG_TX + ice_logtype_tx = rte_log_register("pmd.net.ice.tx"); + if (ice_logtype_tx >= 0) + rte_log_set_level(ice_logtype_tx, RTE_LOG_NOTICE); +#endif + +#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE + ice_logtype_tx_free = rte_log_register("pmd.net.ice.tx_free"); + if (ice_logtype_tx_free >= 0) + rte_log_set_level(ice_logtype_tx_free, RTE_LOG_NOTICE); +#endif } diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h index de2d573d440a..aab7da5f7b37 100644 --- a/drivers/net/ice/ice_logs.h +++ b/drivers/net/ice/ice_logs.h @@ -15,22 +15,28 @@ extern int ice_logtype_driver; #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") #ifdef RTE_LIBRTE_ICE_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int ice_logtype_rx; +#define PMD_RX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, ice_logtype_rx, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_RX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_LIBRTE_ICE_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int ice_logtype_tx; +#define PMD_TX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, ice_logtype_tx, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE -#define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int ice_logtype_tx_free; +#define PMD_TX_FREE_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, ice_logtype_tx_free, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0) #endif -- 2.20.1