From patchwork Wed Mar 10 12:16:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 88838 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5219AA0567; Wed, 10 Mar 2021 13:13:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9921C22A55F; Wed, 10 Mar 2021 13:13:17 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 4B54B22A54A for ; Wed, 10 Mar 2021 13:13:14 +0100 (CET) IronPort-SDR: YuxZ/ZsuiR1tmO8Qb1NCkk/OJL9fdlnDaShwdT7itQnBzUJ5BW8pF4CqzMTXHmOB8oFTejE3Ws htNzJb8fRkeQ== X-IronPort-AV: E=McAfee;i="6000,8403,9917"; a="187812418" X-IronPort-AV: E=Sophos;i="5.81,237,1610438400"; d="scan'208";a="187812418" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2021 04:12:57 -0800 IronPort-SDR: D1YveuaMzi306YLCTcRs4Oek3lrQyv30DH6vGIURn95z3ocMazQuazfQyXYNXHJ1aipDSJBVLv eEgz08OyVULw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,237,1610438400"; d="scan'208";a="603065477" Received: from dpdk51.sh.intel.com ([10.67.111.142]) by fmsmga005.fm.intel.com with ESMTP; 10 Mar 2021 04:12:55 -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.comi, Qi Zhang Date: Wed, 10 Mar 2021 20:16:25 +0800 Message-Id: <20210310121626.2019863-8-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210310121626.2019863-1-qi.z.zhang@intel.com> References: <20210310121626.2019863-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 7/8] net/ixgbe: 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_IXGBE_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX. 2. replace RTE_LIBRTE_IXGBE_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX. 3. merge RTE_LIBRTE_IXGBE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG into RTE_LIBRTE_ETHDEV_DEBUG_TX signed-off-by: Qi Zhang --- drivers/net/ixgbe/ixgbe_ethdev.c | 7 +--- drivers/net/ixgbe/ixgbe_logs.h | 13 +------ drivers/net/ixgbe/ixgbe_rxtx.c | 64 ++++++++++++++++---------------- 3 files changed, 36 insertions(+), 48 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 761a0f26bb..f48db42c0d 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -8455,12 +8455,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf, RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE); RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE); -#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX RTE_LOG_REGISTER(ixgbe_logtype_rx, pmd.net.ixgbe.rx, DEBUG); #endif -#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX RTE_LOG_REGISTER(ixgbe_logtype_tx, pmd.net.ixgbe.tx, DEBUG); #endif -#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE -RTE_LOG_REGISTER(ixgbe_logtype_tx_free, pmd.net.ixgbe.tx_free, DEBUG); -#endif diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h index 2a279d1098..983adeffe0 100644 --- a/drivers/net/ixgbe/ixgbe_logs.h +++ b/drivers/net/ixgbe/ixgbe_logs.h @@ -12,7 +12,7 @@ extern int ixgbe_logtype_init; #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") -#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX extern int ixgbe_logtype_rx; #define PMD_RX_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx, \ @@ -21,7 +21,7 @@ extern int ixgbe_logtype_rx; #define PMD_RX_LOG(level, fmt, args...) do { } while (0) #endif -#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX +#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX extern int ixgbe_logtype_tx; #define PMD_TX_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx, \ @@ -30,15 +30,6 @@ extern int ixgbe_logtype_tx; #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif -#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE -extern int ixgbe_logtype_tx_free; -#define PMD_TX_FREE_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx_free, \ - "%s(): " fmt "\n", __func__, ## args) -#else -#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0) -#endif - extern int ixgbe_logtype_driver; #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \ diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 7d23bab290..9ba62af04b 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -583,11 +583,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq) desc_to_clean_to = sw_ring[desc_to_clean_to].last_id; status = txr[desc_to_clean_to].wb.status; if (!(status & rte_cpu_to_le_32(IXGBE_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); } @@ -600,11 +600,11 @@ ixgbe_xmit_cleanup(struct ixgbe_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 @@ -750,12 +750,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, * nb_used better be less than or equal to txq->tx_rs_thresh */ if (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 (ixgbe_xmit_cleanup(txq) != 0) { /* Could not clean any descriptors */ @@ -766,17 +766,17 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, /* nb_used better be <= txq->tx_rs_thresh */ if (unlikely(nb_used > txq->tx_rs_thresh)) { - PMD_TX_FREE_LOG(DEBUG, - "The number of descriptors needed to " - "transmit the packet exceeds the " - "RS bit threshold. This will impact " - "performance." - "nb_used=%4u nb_free=%4u " - "tx_rs_thresh=%4u. " - "(port=%d queue=%d)", - nb_used, txq->nb_tx_free, - txq->tx_rs_thresh, - txq->port_id, txq->queue_id); + PMD_TX_LOG(DEBUG, + "The number of descriptors needed to " + "transmit the packet exceeds the " + "RS bit threshold. This will impact " + "performance." + "nb_used=%4u nb_free=%4u " + "tx_rs_thresh=%4u. " + "(port=%d queue=%d)", + nb_used, txq->nb_tx_free, + txq->tx_rs_thresh, + txq->port_id, txq->queue_id); /* * Loop here until there are enough TX * descriptors or until the ring cannot be @@ -920,10 +920,10 @@ ixgbe_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 |= IXGBE_TXD_CMD_RS; @@ -995,7 +995,7 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_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;