From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id 95E4AB3DB for ; Mon, 1 Sep 2014 12:20:43 +0200 (CEST) Received: by mail-wi0-f171.google.com with SMTP id hi2so12266644wib.10 for ; Mon, 01 Sep 2014 03:25:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=CwzjB0+Ce4N+H3krcg40IF6VKMMcvvXmTPwwSHqH3m4=; b=RAB7ec27Ua0q0y5AgI8B1tHUuyx+xVTBC3gd04ZqMGR2H6kbzfkwA4ugrYQOc0wvkx ixrYTecAN6fXjSj5+YQSUJEvjZrhkEGEixEGcRPJgeWIzxgua9N8wmX8kjoG4KnjWE+p xAc3K31zjjkHPLBvYGNwvo6l0mwtZW5ILqL9t/Ma5WSP516Zqh7gx/daMPX0Y+xMJvyd OsPVH/uzPv4cZnM1hHjVlXew9WGDCbWGYJ25IoGMTefaKYPqCdN1XQS4QZZKXPTPEqR1 g6AvaNoTxorQo6SypnBjAC+lgsa5yAC4XYsd76HmZxXEMT5L9BSFhrauv/AWL/QHHd0q y2RA== X-Gm-Message-State: ALoCoQkO+QrzHUphWr664syXQMBmsqjm5QVHVOEa500JqNBXcq2c5Zpg5XXXQhQ+hmisLmwub8vN X-Received: by 10.194.87.102 with SMTP id w6mr30722352wjz.24.1409567110493; Mon, 01 Sep 2014 03:25:10 -0700 (PDT) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id lm18sm24287018wic.22.2014.09.01.03.25.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Sep 2014 03:25:09 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Mon, 1 Sep 2014 12:24:35 +0200 Message-Id: <1409567080-27083-13-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1409567080-27083-1-git-send-email-david.marchand@6wind.com> References: <1409567080-27083-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v2 12/17] e1000: use the right debug macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 10:20:44 -0000 - We should not use DEBUGOUT* / DEBUGFUNC macros in non-shared code. These macros come as compat wrappers for shared code. - We should avoid calling RTE_LOG directly as pmd provides a wrapper for logs. Signed-off-by: David Marchand --- lib/librte_pmd_e1000/em_rxtx.c | 32 ++++++++++++++++++-------------- lib/librte_pmd_e1000/igb_ethdev.c | 9 +++++---- lib/librte_pmd_e1000/igb_pf.c | 5 +++-- lib/librte_pmd_e1000/igb_rxtx.c | 16 +++++++--------- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/lib/librte_pmd_e1000/em_rxtx.c b/lib/librte_pmd_e1000/em_rxtx.c index f254858..01efa50 100644 --- a/lib/librte_pmd_e1000/em_rxtx.c +++ b/lib/librte_pmd_e1000/em_rxtx.c @@ -1211,18 +1211,21 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev, DEFAULT_TX_RS_THRESH); if (tx_free_thresh >= (nb_desc - 3)) { - RTE_LOG(ERR, PMD, "tx_free_thresh must be less than the " - "number of TX descriptors minus 3. (tx_free_thresh=%u " - "port=%d queue=%d)\n", (unsigned int)tx_free_thresh, - (int)dev->data->port_id, (int)queue_idx); + PMD_INIT_LOG(ERR, "tx_free_thresh must be less than the " + "number of TX descriptors minus 3. " + "(tx_free_thresh=%u port=%d queue=%d)\n", + (unsigned int)tx_free_thresh, + (int)dev->data->port_id, (int)queue_idx); return -(EINVAL); } if (tx_rs_thresh > tx_free_thresh) { - RTE_LOG(ERR, PMD, "tx_rs_thresh must be less than or equal to " - "tx_free_thresh. (tx_free_thresh=%u tx_rs_thresh=%u " - "port=%d queue=%d)\n", (unsigned int)tx_free_thresh, - (unsigned int)tx_rs_thresh, (int)dev->data->port_id, - (int)queue_idx); + PMD_INIT_LOG(ERR, "tx_rs_thresh must be less than or equal to " + "tx_free_thresh. (tx_free_thresh=%u " + "tx_rs_thresh=%u port=%d queue=%d)\n", + (unsigned int)tx_free_thresh, + (unsigned int)tx_rs_thresh, + (int)dev->data->port_id, + (int)queue_idx); return -(EINVAL); } @@ -1233,10 +1236,10 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev, * accumulates WTHRESH descriptors. */ if (tx_conf->tx_thresh.wthresh != 0 && tx_rs_thresh != 1) { - RTE_LOG(ERR, PMD, "TX WTHRESH must be set to 0 if " - "tx_rs_thresh is greater than 1. (tx_rs_thresh=%u " - "port=%d queue=%d)\n", (unsigned int)tx_rs_thresh, - (int)dev->data->port_id, (int)queue_idx); + PMD_INIT_LOG(ERR, "TX WTHRESH must be set to 0 if " + "tx_rs_thresh is greater than 1. (tx_rs_thresh=%u " + "port=%d queue=%d)\n", (unsigned int)tx_rs_thresh, + (int)dev->data->port_id, (int)queue_idx); return -(EINVAL); } @@ -1366,7 +1369,8 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev, * EM devices don't support drop_en functionality */ if (rx_conf->rx_drop_en) { - RTE_LOG(ERR, PMD, "drop_en functionality not supported by device\n"); + PMD_INIT_LOG(ERR, "drop_en functionality not supported by " + "device\n"); return (-EINVAL); } diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index 3187d92..b45eb24 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -400,7 +400,7 @@ igb_reset_swfw_lock(struct e1000_hw *hw) * So force the release of the faulty lock. */ if (e1000_get_hw_semaphore_generic(hw) < 0) { - DEBUGOUT("SMBI lock released"); + PMD_DRV_LOG(DEBUG, "SMBI lock released"); } e1000_put_hw_semaphore_generic(hw); @@ -416,7 +416,8 @@ igb_reset_swfw_lock(struct e1000_hw *hw) if (hw->bus.func > E1000_FUNC_1) mask <<= 2; if (hw->mac.ops.acquire_swfw_sync(hw, mask) < 0) { - DEBUGOUT1("SWFW phy%d lock released", hw->bus.func); + PMD_DRV_LOG(DEBUG, "SWFW phy%d lock released", + hw->bus.func); } hw->mac.ops.release_swfw_sync(hw, mask); @@ -428,7 +429,7 @@ igb_reset_swfw_lock(struct e1000_hw *hw) */ mask = E1000_SWFW_EEP_SM; if (hw->mac.ops.acquire_swfw_sync(hw, mask) < 0) { - DEBUGOUT("SWFW common locks released"); + PMD_DRV_LOG(DEBUG, "SWFW common locks released"); } hw->mac.ops.release_swfw_sync(hw, mask); } @@ -707,7 +708,7 @@ igb_vmdq_vlan_hw_filter_enable(struct rte_eth_dev *dev) static int rte_igbvf_pmd_init(const char *name __rte_unused, const char *params __rte_unused) { - DEBUGFUNC("rte_igbvf_pmd_init"); + PMD_INIT_FUNC_TRACE(); rte_eth_driver_register(&rte_igbvf_pmd); return (0); diff --git a/lib/librte_pmd_e1000/igb_pf.c b/lib/librte_pmd_e1000/igb_pf.c index 3d405f0..76033ad 100644 --- a/lib/librte_pmd_e1000/igb_pf.c +++ b/lib/librte_pmd_e1000/igb_pf.c @@ -404,7 +404,7 @@ igb_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) retval = e1000_read_mbx(hw, msgbuf, mbx_size, vf); if (retval) { - RTE_LOG(ERR, PMD, "Error mbx recv msg from VF %d\n", vf); + PMD_INIT_LOG(ERR, "Error mbx recv msg from VF %d\n", vf); return retval; } @@ -432,7 +432,8 @@ igb_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) retval = igb_vf_set_vlan(dev, vf, msgbuf); break; default: - RTE_LOG(DEBUG, PMD, "Unhandled Msg %8.8x\n", (unsigned) msgbuf[0]); + PMD_INIT_LOG(DEBUG, "Unhandled Msg %8.8x\n", + (unsigned) msgbuf[0]); retval = E1000_ERR_MBX; break; } diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index 977c4a2..3aa9609 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -1210,17 +1210,15 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev, * driver. */ if (tx_conf->tx_free_thresh != 0) - RTE_LOG(WARNING, PMD, - "The tx_free_thresh parameter is not " - "used for the 1G driver.\n"); + PMD_INIT_LOG(WARNING, "The tx_free_thresh parameter is not " + "used for the 1G driver.\n"); if (tx_conf->tx_rs_thresh != 0) - RTE_LOG(WARNING, PMD, - "The tx_rs_thresh parameter is not " - "used for the 1G driver.\n"); + PMD_INIT_LOG(WARNING, "The tx_rs_thresh parameter is not " + "used for the 1G driver.\n"); if (tx_conf->tx_thresh.wthresh == 0) - RTE_LOG(WARNING, PMD, - "To improve 1G driver performance, consider setting " - "the TX WTHRESH value to 4, 8, or 16.\n"); + PMD_INIT_LOG(WARNING, "To improve 1G driver performance, " + "consider setting the TX WTHRESH value to 4, 8, " + "or 16.\n"); /* Free memory prior to re-allocation if needed */ if (dev->data->tx_queues[queue_idx] != NULL) { -- 1.7.10.4