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 E8B7EA0471 for ; Tue, 16 Jul 2019 17:41:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF87E1BD62; Tue, 16 Jul 2019 17:40:44 +0200 (CEST) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id BF1221B9B5 for ; Tue, 16 Jul 2019 17:40:34 +0200 (CEST) Received: by mail-pl1-f195.google.com with SMTP id a93so10298571pla.7 for ; Tue, 16 Jul 2019 08:40:34 -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=m57TkkJRUha/gcY2GGTqEdIPNieueH5Gbvxg0IHeSWQ=; b=cApj3yHpXlB1mFsHYybWq15nZwloCHEaJCsAnZcR2cZCSNiSErez6jEG+yVrb2BBSJ 7vtYQpALPRz1Fp/z5Gt0F3xilQ4b8TDxZMHklyEkpRC2lRMNrQyqKYojRlW8nAYhigod w9Z7AHn45I/fR0aaVa/9cqkFJrCmyGs4OJbvEtCfVdi8sWNceG88WnXUHTGxIIR/7JOF ae0hFT6QbYAOXmOU36Xp/4h6Nhuv2K29UzfRH3yLvSqZDo/xugiebWnAeLjJRheHIW+P pTzjsuoweBgQT+xJZtTW+bkhApLOco6djKCZoZlvSkCGt8e3qVCQNGMdWMywkaYLuojI glHA== 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=m57TkkJRUha/gcY2GGTqEdIPNieueH5Gbvxg0IHeSWQ=; b=RKJRKMPk82VYTg0RBZYVdM5BWUnAq1sk+ZaPOW/znK890SRsRUBxlzYC7HnI8MNU0G FkQUVN3I3kbuSbUJeoXXLcJf1C21rcNP26lZln0NwR7g+ojMzVHxZ9xuPwMMrk1qEgoS wcf+TmijcKQMaQ1uM6ZGYFVRJVxYiiebXFmwUcLVGaN0GniiuiW075FAMc9ZAgse8Wna Jum1TAUXlZWykEQ7PzH0NNQ8CfbUN/nUDcFibBTOzrtXxnLiMZHS3kzz6e+71foXxf+g tLg2mNJ1QnuBYNdMzZpihW4Fi5+J2Ea0tDWiu/587wvp5GA6w3re/ek5FJyw4+2r5hsn h3Uw== X-Gm-Message-State: APjAAAWeaiUhsKx800hcbmv0wwbK15GPWup7TANwcVHNMaqTvOTX5xMb JcDXiRDGzsqrXv2Xuy8wrzE= X-Google-Smtp-Source: APXvYqzSnd4ule+kSlF8TblrooYzhVSYYzAOyANR5xAWRq9JeiLYXaSAkQDaXdFkMK2FpADU50PZeQ== X-Received: by 2002:a17:902:2d01:: with SMTP id o1mr37254916plb.105.1563291633988; Tue, 16 Jul 2019 08:40:33 -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.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 08:40:33 -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:13 -0700 Message-Id: <20190716154013.6974-7-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 6/6] net/iavf: 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/iavf/iavf_ethdev.c | 28 ++++++++++++++++++++++++++++ drivers/net/iavf/iavf_log.h | 19 +++++++++++++------ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 53dc05c78d1c..d019e6ad57cb 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -76,6 +76,16 @@ static int iavf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, int iavf_logtype_init; int iavf_logtype_driver; +#ifdef RTE_LIBRTE_IAVF_DEBUG_RX +int iavf_logtype_rx; +#endif +#ifdef RTE_LIBRTE_IAVF_DEBUG_TX +int iavf_logtype_tx; +#endif +#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE +int iavf_logtype_tx_free; +#endif + static const struct rte_pci_id pci_id_iavf_map[] = { { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_ADAPTIVE_VF) }, { .vendor_id = 0, /* sentinel */ }, @@ -1419,6 +1429,24 @@ RTE_INIT(iavf_init_log) iavf_logtype_driver = rte_log_register("pmd.net.iavf.driver"); if (iavf_logtype_driver >= 0) rte_log_set_level(iavf_logtype_driver, RTE_LOG_NOTICE); + +#ifdef RTE_LIBRTE_IAVF_DEBUG_RX + iavf_logtype_rx = rte_log_register("pmd.net.iavf.rx"); + if (iavf_logtype_rx >= 0) + rte_log_set_level(iavf_logtype_rx, RTE_LOG_NOTICE); +#endif + +#ifdef RTE_LIBRTE_IAVF_DEBUG_TX + iavf_logtype_tx = rte_log_register("pmd.net.iavf.tx"); + if (iavf_logtype_tx >= 0) + rte_log_set_level(iavf_logtype_tx, RTE_LOG_NOTICE); +#endif + +#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE + iavf_logtype_tx_free = rte_log_register("pmd.net.iavf.tx_free"); + if (iavf_logtype_tx_free >= 0) + rte_log_set_level(iavf_logtype_tx_free, RTE_LOG_NOTICE); +#endif } /* memory func for base code */ diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h index f66c37041439..1088ec75f55b 100644 --- a/drivers/net/iavf/iavf_log.h +++ b/drivers/net/iavf/iavf_log.h @@ -20,23 +20,30 @@ extern int iavf_logtype_driver; PMD_DRV_LOG_RAW(level, fmt "\n", ## args) #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>") + #ifdef RTE_LIBRTE_IAVF_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int iavf_logtype_rx; +#define PMD_RX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, iavf_logtype_rx, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_RX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_LIBRTE_IAVF_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int iavf_logtype_tx; +#define PMD_TX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, iavf_logtype_tx, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE -#define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) +extern int iavf_logtype_tx_free; +#define PMD_TX_FREE_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, iavf_logtype_tx_free, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0) #endif -- 2.20.1