From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 021D4A0547; Fri, 12 Mar 2021 13:08:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBC261608AC; Fri, 12 Mar 2021 13:08:47 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 6A7F01608AC for ; Fri, 12 Mar 2021 13:08:45 +0100 (CET) IronPort-SDR: yI3ScyHrlsMoNzsnYQ9B1iMxLu/ZQvlWEn3dYTptvxkbFboU966JiZSo+j1R89CoEamuoqG+mp /UqMNr35nv6g== X-IronPort-AV: E=McAfee;i="6000,8403,9920"; a="208662811" X-IronPort-AV: E=Sophos;i="5.81,243,1610438400"; d="scan'208";a="208662811" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 04:08:45 -0800 IronPort-SDR: wuDjuTR+dMO2isnJIlEZOKBiC74akBnqZQnvwyg5QzFjS5aK3ZqQC1+ZsFNzKlPPjFSAdSt642 CN35Q72SDyAg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,243,1610438400"; d="scan'208";a="521408210" Received: from dpdk51.sh.intel.com ([10.67.111.142]) by orsmga004.jf.intel.com with ESMTP; 12 Mar 2021 04:08:42 -0800 From: Qi Zhang To: ferruh.yigit@intel.com Cc: dev@dpdk.org, xiao.w.wang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, jia.guo@intel.com, qiming.yang@intel.com, haiyue.wang@intel.com, Qi Zhang Date: Fri, 12 Mar 2021 20:12:18 +0800 Message-Id: <20210312121223.2028029-4-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210312121223.2028029-1-qi.z.zhang@intel.com> References: <20210310121626.2019863-1-qi.z.zhang@intel.com> <20210312121223.2028029-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 3/8] net/e1000: refine debug compile option X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" 1. replace RTE_LIBRTE_E1000_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX. 2. replace RTE_LIBRTE_E1000_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX. 3. merge RTE_LIBRTE_E1000_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG into RTE_LIBRTE_ETHDEV_DEBUG_TX Signed-off-by: Qi Zhang --- drivers/net/e1000/e1000_logs.c | 17 ++++----------- drivers/net/e1000/e1000_logs.h | 13 ++---------- drivers/net/e1000/em_rxtx.c | 38 +++++++++++++++++----------------- drivers/net/e1000/igb_rxtx.c | 2 +- 4 files changed, 26 insertions(+), 44 deletions(-) diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c index 231f5c03ef..f4b5a545f6 100644 --- a/drivers/net/e1000/e1000_logs.c +++ b/drivers/net/e1000/e1000_logs.c @@ -8,15 +8,12 @@ int e1000_logtype_init; int e1000_logtype_driver; -#ifdef RTE_LIBRTE_E1000_DEBUG_RX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX int e1000_logtype_rx; #endif -#ifdef RTE_LIBRTE_E1000_DEBUG_TX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX int e1000_logtype_tx; #endif -#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE -int e1000_logtype_tx_free; -#endif /* avoids double registering of logs if EM and IGB drivers are in use */ static int e1000_log_initialized; @@ -34,23 +31,17 @@ e1000_igb_init_log(void) if (e1000_logtype_driver >= 0) rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE); -#ifdef RTE_LIBRTE_E1000_DEBUG_RX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx"); if (e1000_logtype_rx >= 0) rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG); #endif -#ifdef RTE_LIBRTE_E1000_DEBUG_TX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx"); if (e1000_logtype_tx >= 0) rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG); #endif -#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE - e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free"); - if (e1000_logtype_tx_free >= 0) - rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG); -#endif - e1000_log_initialized = 1; } diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h index 2612134f38..c989033392 100644 --- a/drivers/net/e1000/e1000_logs.h +++ b/drivers/net/e1000/e1000_logs.h @@ -15,7 +15,7 @@ extern int e1000_logtype_init; #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") -#ifdef RTE_LIBRTE_E1000_DEBUG_RX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX extern int e1000_logtype_rx; #define PMD_RX_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, e1000_logtype_rx, \ @@ -24,7 +24,7 @@ extern int e1000_logtype_rx; #define PMD_RX_LOG(level, fmt, args...) do { } while (0) #endif -#ifdef RTE_LIBRTE_E1000_DEBUG_TX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX extern int e1000_logtype_tx; #define PMD_TX_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, e1000_logtype_tx, \ @@ -33,15 +33,6 @@ extern int e1000_logtype_tx; #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif -#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE -extern int e1000_logtype_tx_free; -#define PMD_TX_FREE_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, e1000_logtype_tx_free, \ - "%s(): " fmt "\n", __func__, ## args) -#else -#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0) -#endif - extern int e1000_logtype_driver; #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, e1000_logtype_driver, "%s(): " fmt, \ diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index db5d1222ce..47a02b6cf4 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -311,10 +311,10 @@ em_xmit_cleanup(struct em_tx_queue *txq) desc_to_clean_to = sw_ring[desc_to_clean_to].last_id; if (! (txr[desc_to_clean_to].upper.fields.status & E1000_TXD_STAT_DD)) { - PMD_TX_FREE_LOG(DEBUG, - "TX descriptor %4u is not done" - "(port=%d queue=%d)", desc_to_clean_to, - txq->port_id, txq->queue_id); + PMD_TX_LOG(DEBUG, + "TX descriptor %4u is not done" + "(port=%d queue=%d)", desc_to_clean_to, + txq->port_id, txq->queue_id); /* Failed to clean any descriptors, better luck next time */ return -(1); } @@ -327,11 +327,11 @@ em_xmit_cleanup(struct em_tx_queue *txq) nb_tx_to_clean = (uint16_t)(desc_to_clean_to - last_desc_cleaned); - PMD_TX_FREE_LOG(DEBUG, - "Cleaning %4u TX descriptors: %4u to %4u " - "(port=%d queue=%d)", nb_tx_to_clean, - last_desc_cleaned, desc_to_clean_to, txq->port_id, - txq->queue_id); + PMD_TX_LOG(DEBUG, + "Cleaning %4u TX descriptors: %4u to %4u " + "(port=%d queue=%d)", nb_tx_to_clean, + last_desc_cleaned, desc_to_clean_to, txq->port_id, + txq->queue_id); /* * The last descriptor to clean is done, so that means all the @@ -457,11 +457,11 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, * nb_used better be less than or equal to txq->tx_rs_thresh */ while (unlikely (nb_used > txq->nb_tx_free)) { - PMD_TX_FREE_LOG(DEBUG, "Not enough free TX descriptors " - "nb_used=%4u nb_free=%4u " - "(port=%d queue=%d)", - nb_used, txq->nb_tx_free, - txq->port_id, txq->queue_id); + PMD_TX_LOG(DEBUG, "Not enough free TX descriptors " + "nb_used=%4u nb_free=%4u " + "(port=%d queue=%d)", + nb_used, txq->nb_tx_free, + txq->port_id, txq->queue_id); if (em_xmit_cleanup(txq) != 0) { /* Could not clean any descriptors */ @@ -579,10 +579,10 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, /* Set RS bit only on threshold packets' last descriptor */ if (txq->nb_tx_used >= txq->tx_rs_thresh) { - PMD_TX_FREE_LOG(DEBUG, - "Setting RS bit on TXD id=%4u " - "(port=%d queue=%d)", - tx_last, txq->port_id, txq->queue_id); + PMD_TX_LOG(DEBUG, + "Setting RS bit on TXD id=%4u " + "(port=%d queue=%d)", + tx_last, txq->port_id, txq->queue_id); cmd_type_len |= E1000_TXD_CMD_RS; @@ -626,7 +626,7 @@ eth_em_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, return i; } -#ifdef RTE_LIBRTE_ETHDEV_DEBUG +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX ret = rte_validate_tx_offload(m); if (ret != 0) { rte_errno = -ret; diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 1500d2ffff..5749650f95 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -641,7 +641,7 @@ eth_igb_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, return i; } -#ifdef RTE_LIBRTE_ETHDEV_DEBUG +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX ret = rte_validate_tx_offload(m); if (ret != 0) { rte_errno = -ret; -- 2.26.2