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 1029CA0471 for ; Tue, 16 Jul 2019 17:41:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 594D81BCB8; Tue, 16 Jul 2019 17:40:41 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 7E1A41B965 for ; Tue, 16 Jul 2019 17:40:33 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id f25so9623971pgv.10 for ; Tue, 16 Jul 2019 08:40:33 -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=mY0BtOrHH0mMkayclX1hB3mO/yRpPWthJPirvCx7vG8=; b=FUpWd9gZDZwdPr00t0fIn0KBpYu9yeV+RGdfedhMhF3JMRriu3pl3a04nzAb18nR6Y TqzQ0OLHfgx+KvmgoC5/5r/CaAs/6/1/HqiL3JGIPfRFsSi1yRa3Bb+79bU668cmhT8T uzbVUpXqGSlerU8LkYd5u8gdeUowzrKxeFcFCYoNo3VBQp1364H5nvSgJ6FvkxMgItkl JuqdjOgcXojRE48kwst0Ny4yj/zVUseKvP34cHx+otQHs0/2ERnanKaCvJWCmmYyU4IS Ym3QMBD1SJ+9SBy2Os2GKsYH5xgJN4Kk832aZW5yQIKGDu3hnA1WW/FArna/wNzHHEm6 fw2w== 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=mY0BtOrHH0mMkayclX1hB3mO/yRpPWthJPirvCx7vG8=; b=nvUr0EM6tlmhu3YticYkGzoV7eDtLpU4CNggCZ6fp+v9e7YGXA/NAEJx3JrSX24geT eWvbwpQEhSS0hM6GVahqTLuftN4BQhwG5gldSkwiNJ9omH2ucm08TPHy5ltt4SgtXs7k UimUOWlejpp7wO2LsEF2eJ7cQpOF7oxCunR7FhlpCw3n4IrFLZNAYoxAMjMQ2WI5yX7o zZvT7Mn64LHWen9qA8PvVrb3CkCaW/VpgrkZ83Q3tZQFiLYMnvh7W3JAk6kYQAIxfUhj qjgQW0tilABD7FFWP7D8QXuO8Tua2TKwHF5BwXUCX/l9QiziRWim2u8y8TCq4lL7GHVZ Zj0Q== X-Gm-Message-State: APjAAAUeQQM3kx5BMyeBBOzor2D+fMYBBIhwLpdlNuBEKB7S9CP4vwfm jHcT+h13KIL+wIdoEjRlxBU= X-Google-Smtp-Source: APXvYqytLtEcZQV6j4S7cbOihtvJr3FqnhreOuZejId7NDb3phFFA3N/WDieM1jTqBEjzyQ0ISVyRQ== X-Received: by 2002:a17:90a:1b0c:: with SMTP id q12mr37785382pjq.76.1563291632743; Tue, 16 Jul 2019 08:40:32 -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.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 08:40:31 -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:12 -0700 Message-Id: <20190716154013.6974-6-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 5/6] net/i40e: 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/i40e/i40e_ethdev.c | 27 +++++++++++++++++++++++++++ drivers/net/i40e/i40e_logs.h | 24 +++++++++++++++--------- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 2b9fc4572290..1e168c6253d8 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -399,6 +399,15 @@ static void i40e_notify_all_vfs_link_status(struct rte_eth_dev *dev); int i40e_logtype_init; int i40e_logtype_driver; +#ifdef RTE_LIBRTE_I40E_DEBUG_RX +int i40e_logtype_rx; +#endif +#ifdef RTE_LIBRTE_I40E_DEBUG_TX +int i40e_logtype_tx; +#endif +#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE +int i40e_logtype_tx_free; +#endif static const char *const valid_keys[] = { ETH_I40E_FLOATING_VEB_ARG, @@ -12766,6 +12775,24 @@ RTE_INIT(i40e_init_log) i40e_logtype_driver = rte_log_register("pmd.net.i40e.driver"); if (i40e_logtype_driver >= 0) rte_log_set_level(i40e_logtype_driver, RTE_LOG_NOTICE); + +#ifdef RTE_LIBRTE_I40E_DEBUG_RX + i40e_logtype_rx = rte_log_register("pmd.net.i40e.rx"); + if (i40e_logtype_rx >= 0) + rte_log_set_level(i40e_logtype_rx, RTE_LOG_NOTICE); +#endif + +#ifdef RTE_LIBRTE_I40E_DEBUG_TX + i40e_logtype_tx = rte_log_register("pmd.net.i40e.tx"); + if (i40e_logtype_tx >= 0) + rte_log_set_level(i40e_logtype_tx, RTE_LOG_NOTICE); +#endif + +#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE + i40e_logtype_tx_free = rte_log_register("pmd.net.i40e.tx_free"); + if (i40e_logtype_tx_free >= 0) + rte_log_set_level(i40e_logtype_tx_free, RTE_LOG_NOTICE); +#endif } RTE_PMD_REGISTER_PARAM_STRING(net_i40e, diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h index b1049699352f..dac3267eb4e2 100644 --- a/drivers/net/i40e/i40e_logs.h +++ b/drivers/net/i40e/i40e_logs.h @@ -12,24 +12,30 @@ extern int i40e_logtype_init; #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") #ifdef RTE_LIBRTE_I40E_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int i40e_logtype_rx; +#define PMD_RX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, i40e_logtype_rx, \ + "%s(): " fmt "\n", __func__, ## args) #else -#define PMD_RX_LOG(level, fmt, args...) do { } while(0) +#define PMD_RX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_LIBRTE_I40E_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int i40e_logtype_tx; +#define PMD_TX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, i40e_logtype_tx, \ + "%s(): " fmt "\n", __func__, ## args) #else -#define PMD_TX_LOG(level, fmt, args...) do { } while(0) +#define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE -#define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int i40e_logtype_tx_free; +#define PMD_TX_FREE_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, i40e_logtype_tx_free, \ + "%s(): " fmt "\n", __func__, ## args) #else -#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0) +#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0) #endif extern int i40e_logtype_driver; -- 2.20.1