From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id A1A03B363 for ; Tue, 26 Aug 2014 16:05:41 +0200 (CEST) Received: by mail-wg0-f51.google.com with SMTP id b13so14525992wgh.10 for ; Tue, 26 Aug 2014 07:09:41 -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=weKf8HORxbrKpobM50aUjLyYYHygAu+gjkhdxL9Feoc=; b=VYqc7PYmYAwaJhxKoyNUD54P3L2N+gTLDm7zA6lTdhzJ1v3Il8Y9rXg2ywWpwWcY17 1Orr+cqGCj72quOcfzmKblKLLHGPZkXHELV6N4qj3Nlqz6eCebSLCG3pK+eB2xyyOcRz +YGeKlhVrH8vku7NR9sVaEDSKqYey5rY1/NsUOVRwVNFVcX6n6pC1k9N5yJju58zIdYJ k+iavhjJSkPzaUcIcfFYN/WeTHeguc9X+Q6455rDpZ7yq2tyrg6w6QuOcB9fQDWlD+d+ 3jI+4eRnQuEbsfdDfpAItmHL8C5XCFqIco/EaRTVtzAZ7QniphbnMFongM1IAmqCOWUN U3VA== X-Gm-Message-State: ALoCoQnD+YySMeu4WuOtX3hcKiXv+ScGwPFbAeA8kRgqUAxzlgECAQ9gHR6pb6Ar9cs5p2Y1zJft X-Received: by 10.180.80.225 with SMTP id u1mr21763123wix.69.1409062181676; Tue, 26 Aug 2014 07:09:41 -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 cy9sm12543569wib.18.2014.08.26.07.09.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Aug 2014 07:09:41 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Tue, 26 Aug 2014 16:09:18 +0200 Message-Id: <1409062162-19575-9-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1409062162-19575-1-git-send-email-david.marchand@6wind.com> References: <1409062162-19575-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 08/11] e1000: clean log messages 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: Tue, 26 Aug 2014 14:05:41 -0000 Clean log messages: - remove superfluous \n in log macros and add some \n where needed, - remove leading \n in some messages, - split multi lines messages, - introduce PMD_INIT_FUNC_TRACE and replace some PMD_INIT_LOG(DEBUG, "func\n"). Signed-off-by: David Marchand --- lib/librte_pmd_e1000/e1000_logs.h | 12 +++--- lib/librte_pmd_e1000/em_ethdev.c | 47 +++++++++++------------ lib/librte_pmd_e1000/em_rxtx.c | 35 ++++++++--------- lib/librte_pmd_e1000/igb_ethdev.c | 75 ++++++++++++++++++------------------- lib/librte_pmd_e1000/igb_rxtx.c | 9 +++-- 5 files changed, 85 insertions(+), 93 deletions(-) diff --git a/lib/librte_pmd_e1000/e1000_logs.h b/lib/librte_pmd_e1000/e1000_logs.h index b6b3bb7..02f5930 100644 --- a/lib/librte_pmd_e1000/e1000_logs.h +++ b/lib/librte_pmd_e1000/e1000_logs.h @@ -36,35 +36,37 @@ #ifdef RTE_LIBRTE_E1000_DEBUG_INIT #define PMD_INIT_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args) +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>\n") #else #define PMD_INIT_LOG(level, fmt, args...) do { } while(0) +#define PMD_INIT_FUNC_TRACE() do { } while(0) #endif #ifdef RTE_LIBRTE_E1000_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args) #else #define PMD_RX_LOG(level, fmt, args...) do { } while(0) #endif #ifdef RTE_LIBRTE_E1000_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args) #else #define PMD_TX_LOG(level, fmt, args...) do { } while(0) #endif #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE #define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args) #else #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0) #endif #ifdef RTE_LIBRTE_E1000_DEBUG_DRIVER #define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args) #else #define PMD_DRV_LOG(level, fmt, args...) do { } while(0) #endif diff --git a/lib/librte_pmd_e1000/em_ethdev.c b/lib/librte_pmd_e1000/em_ethdev.c index 4555294..f359774 100644 --- a/lib/librte_pmd_e1000/em_ethdev.c +++ b/lib/librte_pmd_e1000/em_ethdev.c @@ -249,9 +249,9 @@ eth_em_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, if (e1000_setup_init_funcs(hw, TRUE) != E1000_SUCCESS || em_hw_init(hw) != 0) { PMD_INIT_LOG(ERR, "port_id %d vendorID=0x%x deviceID=0x%x: " - "failed to init HW", - eth_dev->data->port_id, pci_dev->id.vendor_id, - pci_dev->id.device_id); + "failed to init HW\n", + eth_dev->data->port_id, pci_dev->id.vendor_id, + pci_dev->id.device_id); return -(ENODEV); } @@ -260,8 +260,8 @@ eth_em_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, hw->mac.rar_entry_count, 0); if (eth_dev->data->mac_addrs == NULL) { PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to " - "store MAC addresses", - ETHER_ADDR_LEN * hw->mac.rar_entry_count); + "store MAC addresses\n", + ETHER_ADDR_LEN * hw->mac.rar_entry_count); return -(ENOMEM); } @@ -350,7 +350,7 @@ em_hw_init(struct e1000_hw *hw) */ diag = e1000_validate_nvm_checksum(hw); if (diag < 0) { - PMD_INIT_LOG(ERR, "EEPROM checksum invalid"); + PMD_INIT_LOG(ERR, "EEPROM checksum invalid\n"); goto error; } } @@ -358,14 +358,14 @@ em_hw_init(struct e1000_hw *hw) /* Read the permanent MAC address out of the EEPROM */ diag = e1000_read_mac_addr(hw); if (diag != 0) { - PMD_INIT_LOG(ERR, "EEPROM error while reading MAC address"); + PMD_INIT_LOG(ERR, "EEPROM error while reading MAC address\n"); goto error; } /* Now initialize the hardware */ diag = em_hardware_init(hw); if (diag != 0) { - PMD_INIT_LOG(ERR, "Hardware initialization failed"); + PMD_INIT_LOG(ERR, "Hardware initialization failed\n"); goto error; } @@ -375,7 +375,7 @@ em_hw_init(struct e1000_hw *hw) diag = e1000_check_reset_block(hw); if (diag < 0) { PMD_INIT_LOG(ERR, "PHY reset is blocked due to " - "SOL/IDER session"); + "SOL/IDER session\n"); } return (0); @@ -390,11 +390,10 @@ eth_em_configure(struct rte_eth_dev *dev) struct e1000_interrupt *intr = E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private); - PMD_INIT_LOG(DEBUG, ">>"); - + PMD_INIT_FUNC_TRACE(); intr->flags |= E1000_FLAG_NEED_LINK_UPDATE; + PMD_INIT_FUNC_TRACE(); - PMD_INIT_LOG(DEBUG, "<<"); return (0); } @@ -453,7 +452,7 @@ eth_em_start(struct rte_eth_dev *dev) E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); int ret, mask; - PMD_INIT_LOG(DEBUG, ">>"); + PMD_INIT_FUNC_TRACE(); eth_em_stop(dev); @@ -478,7 +477,7 @@ eth_em_start(struct rte_eth_dev *dev) /* Initialize the hardware */ if (em_hardware_init(hw)) { - PMD_INIT_LOG(ERR, "Unable to initialize the hardware"); + PMD_INIT_LOG(ERR, "Unable to initialize the hardware\n"); return (-EIO); } @@ -491,7 +490,7 @@ eth_em_start(struct rte_eth_dev *dev) ret = eth_em_rx_init(dev); if (ret) { - PMD_INIT_LOG(ERR, "Unable to initialize RX hardware"); + PMD_INIT_LOG(ERR, "Unable to initialize RX hardware\n"); em_dev_clear_queues(dev); return ret; } @@ -562,7 +561,7 @@ eth_em_start(struct rte_eth_dev *dev) if (dev->data->dev_conf.intr_conf.lsc != 0) { ret = eth_em_interrupt_setup(dev); if (ret) { - PMD_INIT_LOG(ERR, "Unable to setup interrupts"); + PMD_INIT_LOG(ERR, "Unable to setup interrupts\n"); em_dev_clear_queues(dev); return ret; } @@ -1305,11 +1304,9 @@ eth_em_interrupt_action(struct rte_eth_dev *dev) PMD_INIT_LOG(INFO, " Port %d: Link Down\n", dev->data->port_id); } - PMD_INIT_LOG(INFO, "PCI Address: %04d:%02d:%02d:%d", - dev->pci_dev->addr.domain, - dev->pci_dev->addr.bus, - dev->pci_dev->addr.devid, - dev->pci_dev->addr.function); + PMD_INIT_LOG(INFO, "PCI Address: %04d:%02d:%02d:%d\n", + dev->pci_dev->addr.domain, dev->pci_dev->addr.bus, + dev->pci_dev->addr.devid, dev->pci_dev->addr.function); tctl = E1000_READ_REG(hw, E1000_TCTL); rctl = E1000_READ_REG(hw, E1000_RCTL); if (link.link_status) { @@ -1429,14 +1426,14 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) if (fc_conf->autoneg != hw->mac.autoneg) return -ENOTSUP; rx_buf_size = em_get_rx_buffer_size(hw); - PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x \n", rx_buf_size); + PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x\n", rx_buf_size); /* At least reserve one Ethernet frame for watermark */ max_high_water = rx_buf_size - ETHER_MAX_LEN; if ((fc_conf->high_water > max_high_water) || (fc_conf->high_water < fc_conf->low_water)) { - PMD_INIT_LOG(ERR, "e1000 incorrect high/low water value \n"); - PMD_INIT_LOG(ERR, "high water must <= 0x%x \n", max_high_water); + PMD_INIT_LOG(ERR, "e1000 incorrect high/low water value\n"); + PMD_INIT_LOG(ERR, "high water must <= 0x%x\n", max_high_water); return (-EINVAL); } @@ -1466,7 +1463,7 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) return 0; } - PMD_INIT_LOG(ERR, "e1000_setup_link_generic = 0x%x \n", err); + PMD_INIT_LOG(ERR, "e1000_setup_link_generic = 0x%x\n", err); return (-EIO); } diff --git a/lib/librte_pmd_e1000/em_rxtx.c b/lib/librte_pmd_e1000/em_rxtx.c index f254858..fd082f8 100644 --- a/lib/librte_pmd_e1000/em_rxtx.c +++ b/lib/librte_pmd_e1000/em_rxtx.c @@ -317,10 +317,8 @@ 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, + PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done" + "(port=%d queue=%d)\n", desc_to_clean_to, txq->port_id, txq->queue_id); /* Failed to clean any descriptors, better luck next time */ return -(1); @@ -334,11 +332,10 @@ 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_FREE_LOG(DEBUG, "Cleaning %4u TX descriptors: %4u to %4u " + "(port=%d queue=%d)\n", 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 @@ -464,10 +461,9 @@ 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 " + PMD_TX_FREE_LOG(DEBUG, "Not enough free TX descriptors " "nb_used=%4u nb_free=%4u " - "(port=%d queue=%d)", + "(port=%d queue=%d)\n", nb_used, txq->nb_tx_free, txq->port_id, txq->queue_id); @@ -588,9 +584,8 @@ 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)", + PMD_TX_FREE_LOG(DEBUG, "Setting RS bit on TXD id=%4u " + "(port=%d queue=%d)\n", tx_last, txq->port_id, txq->queue_id); cmd_type_len |= E1000_TXD_CMD_RS; @@ -606,9 +601,9 @@ end_of_tx: /* * Set the Transmit Descriptor Tail (TDT) */ - PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u", - (unsigned) txq->port_id, (unsigned) txq->queue_id, - (unsigned) tx_id, (unsigned) nb_tx); + PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u\n", + (unsigned) txq->port_id, (unsigned) txq->queue_id, + (unsigned) tx_id, (unsigned) nb_tx); E1000_PCI_REG_WRITE(txq->tdt_reg_addr, tx_id); txq->tx_tail = tx_id; @@ -712,7 +707,7 @@ eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, * to happen by sending specific "back-pressure" flow control * frames to its peer(s). */ - PMD_RX_LOG(DEBUG, "\nport_id=%u queue_id=%u rx_id=%u " + PMD_RX_LOG(DEBUG, "port_id=%u queue_id=%u rx_id=%u " "status=0x%x pkt_len=%u\n", (unsigned) rxq->port_id, (unsigned) rxq->queue_id, (unsigned) rx_id, (unsigned) status, @@ -892,7 +887,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, * to happen by sending specific "back-pressure" flow control * frames to its peer(s). */ - PMD_RX_LOG(DEBUG, "\nport_id=%u queue_id=%u rx_id=%u " + PMD_RX_LOG(DEBUG, "port_id=%u queue_id=%u rx_id=%u " "status=0x%x data_len=%u\n", (unsigned) rxq->port_id, (unsigned) rxq->queue_id, (unsigned) rx_id, (unsigned) status, diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index 3187d92..4d91aa7 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -509,7 +509,7 @@ eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, * if it fails a second time its a real issue. */ if (e1000_validate_nvm_checksum(hw) < 0) { - PMD_INIT_LOG(ERR, "EEPROM checksum invalid"); + PMD_INIT_LOG(ERR, "EEPROM checksum invalid\n"); error = -EIO; goto err_late; } @@ -517,7 +517,7 @@ eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, /* Read the permanent MAC address out of the EEPROM */ if (e1000_read_mac_addr(hw) != 0) { - PMD_INIT_LOG(ERR, "EEPROM error while reading MAC address"); + PMD_INIT_LOG(ERR, "EEPROM error while reading MAC address\n"); error = -EIO; goto err_late; } @@ -527,8 +527,8 @@ eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, ETHER_ADDR_LEN * hw->mac.rar_entry_count, 0); if (eth_dev->data->mac_addrs == NULL) { PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to " - "store MAC addresses", - ETHER_ADDR_LEN * hw->mac.rar_entry_count); + "store MAC addresses\n", + ETHER_ADDR_LEN * hw->mac.rar_entry_count); error = -ENOMEM; goto err_late; } @@ -541,7 +541,7 @@ eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, /* Now initialize the hardware */ if (igb_hardware_init(hw) != 0) { - PMD_INIT_LOG(ERR, "Hardware initialization failed"); + PMD_INIT_LOG(ERR, "Hardware initialization failed\n"); rte_free(eth_dev->data->mac_addrs); eth_dev->data->mac_addrs = NULL; error = -ENODEV; @@ -552,7 +552,7 @@ eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, /* Indicate SOL/IDER usage */ if (e1000_check_reset_block(hw) < 0) { PMD_INIT_LOG(ERR, "PHY reset is blocked due to" - "SOL/IDER session"); + "SOL/IDER session\n"); } /* initialize PF if max_vfs not zero */ @@ -597,7 +597,7 @@ eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, E1000_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); int diag; - PMD_INIT_LOG(DEBUG, "eth_igbvf_dev_init"); + PMD_INIT_FUNC_TRACE(); eth_dev->dev_ops = &igbvf_eth_dev_ops; eth_dev->rx_pkt_burst = ð_igb_recv_pkts; @@ -621,8 +621,8 @@ eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, /* Initialize the shared code (base driver) */ diag = e1000_setup_init_funcs(hw, TRUE); if (diag != 0) { - PMD_INIT_LOG(ERR, "Shared code init failed for igbvf: %d", - diag); + PMD_INIT_LOG(ERR, "Shared code init failed for igbvf: %d\n", + diag); return -EIO; } @@ -638,10 +638,9 @@ eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, eth_dev->data->mac_addrs = rte_zmalloc("igbvf", ETHER_ADDR_LEN * hw->mac.rar_entry_count, 0); if (eth_dev->data->mac_addrs == NULL) { - PMD_INIT_LOG(ERR, - "Failed to allocate %d bytes needed to store MAC " - "addresses", - ETHER_ADDR_LEN * hw->mac.rar_entry_count); + PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to " + "store MAC addresses\n", + ETHER_ADDR_LEN * hw->mac.rar_entry_count); return -ENOMEM; } @@ -649,7 +648,7 @@ eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, ether_addr_copy((struct ether_addr *) hw->mac.perm_addr, ð_dev->data->mac_addrs[0]); - PMD_INIT_LOG(DEBUG, "\nport %d vendorID=0x%x deviceID=0x%x " + PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x " "mac.type=%s\n", eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id, @@ -719,11 +718,9 @@ eth_igb_configure(struct rte_eth_dev *dev) struct e1000_interrupt *intr = E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private); - PMD_INIT_LOG(DEBUG, ">>"); - + PMD_INIT_FUNC_TRACE(); intr->flags |= E1000_FLAG_NEED_LINK_UPDATE; - - PMD_INIT_LOG(DEBUG, "<<"); + PMD_INIT_FUNC_TRACE(); return (0); } @@ -736,7 +733,7 @@ eth_igb_start(struct rte_eth_dev *dev) int ret, i, mask; uint32_t ctrl_ext; - PMD_INIT_LOG(DEBUG, ">>"); + PMD_INIT_FUNC_TRACE(); /* Power up the phy. Needed to make the link go Up */ e1000_power_up_phy(hw); @@ -758,7 +755,7 @@ eth_igb_start(struct rte_eth_dev *dev) /* Initialize the hardware */ if (igb_hardware_init(hw)) { - PMD_INIT_LOG(ERR, "Unable to initialize the hardware"); + PMD_INIT_LOG(ERR, "Unable to initialize the hardware\n"); return (-EIO); } @@ -781,7 +778,7 @@ eth_igb_start(struct rte_eth_dev *dev) /* This can fail when allocating mbufs for descriptor rings */ ret = eth_igb_rx_init(dev); if (ret) { - PMD_INIT_LOG(ERR, "Unable to initialize RX hardware"); + PMD_INIT_LOG(ERR, "Unable to initialize RX hardware\n"); igb_dev_clear_queues(dev); return ret; } @@ -1797,11 +1794,11 @@ eth_igb_interrupt_action(struct rte_eth_dev *dev) PMD_INIT_LOG(INFO, " Port %d: Link Down\n", dev->data->port_id); } - PMD_INIT_LOG(INFO, "PCI Address: %04d:%02d:%02d:%d", - dev->pci_dev->addr.domain, - dev->pci_dev->addr.bus, - dev->pci_dev->addr.devid, - dev->pci_dev->addr.function); + PMD_INIT_LOG(INFO, "PCI Address: %04d:%02d:%02d:%d\n", + dev->pci_dev->addr.domain, + dev->pci_dev->addr.bus, + dev->pci_dev->addr.devid, + dev->pci_dev->addr.function); tctl = E1000_READ_REG(hw, E1000_TCTL); rctl = E1000_READ_REG(hw, E1000_RCTL); if (link.link_status) { @@ -1922,14 +1919,14 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) if (fc_conf->autoneg != hw->mac.autoneg) return -ENOTSUP; rx_buf_size = igb_get_rx_buffer_size(hw); - PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x \n", rx_buf_size); + PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x\n", rx_buf_size); /* At least reserve one Ethernet frame for watermark */ max_high_water = rx_buf_size - ETHER_MAX_LEN; if ((fc_conf->high_water > max_high_water) || (fc_conf->high_water < fc_conf->low_water)) { - PMD_INIT_LOG(ERR, "e1000 incorrect high/low water value \n"); - PMD_INIT_LOG(ERR, "high water must <= 0x%x \n", max_high_water); + PMD_INIT_LOG(ERR, "e1000 incorrect high/low water value\n"); + PMD_INIT_LOG(ERR, "high water must <= 0x%x\n", max_high_water); return (-EINVAL); } @@ -1959,7 +1956,7 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) return 0; } - PMD_INIT_LOG(ERR, "e1000_setup_link_generic = 0x%x \n", err); + PMD_INIT_LOG(ERR, "e1000_setup_link_generic = 0x%x\n", err); return (-EIO); } @@ -1994,7 +1991,7 @@ eth_igb_rar_clear(struct rte_eth_dev *dev, uint32_t index) static void igbvf_intr_disable(struct e1000_hw *hw) { - PMD_INIT_LOG(DEBUG, "igbvf_intr_disable"); + PMD_INIT_FUNC_TRACE(); /* Clear interrupt mask to stop from interrupts being generated */ E1000_WRITE_REG(hw, E1000_EIMC, 0xFFFF); @@ -2076,7 +2073,7 @@ igbvf_dev_configure(struct rte_eth_dev *dev) { struct rte_eth_conf* conf = &dev->data->dev_conf; - PMD_INIT_LOG(DEBUG, "\nConfigured Virtual Function port id: %d\n", + PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d\n", dev->data->port_id); /* @@ -2105,7 +2102,7 @@ igbvf_dev_start(struct rte_eth_dev *dev) E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); int ret; - PMD_INIT_LOG(DEBUG, "igbvf_dev_start"); + PMD_INIT_FUNC_TRACE(); hw->mac.ops.reset_hw(hw); @@ -2117,7 +2114,7 @@ igbvf_dev_start(struct rte_eth_dev *dev) /* This can fail when allocating mbufs for descriptor rings */ ret = eth_igbvf_rx_init(dev); if (ret) { - PMD_INIT_LOG(ERR, "Unable to initialize RX hardware"); + PMD_INIT_LOG(ERR, "Unable to initialize RX hardware\n"); igb_dev_clear_queues(dev); return ret; } @@ -2128,7 +2125,7 @@ igbvf_dev_start(struct rte_eth_dev *dev) static void igbvf_dev_stop(struct rte_eth_dev *dev) { - PMD_INIT_LOG(DEBUG, "igbvf_dev_stop"); + PMD_INIT_FUNC_TRACE(); igbvf_stop_adapter(dev); @@ -2146,7 +2143,7 @@ igbvf_dev_close(struct rte_eth_dev *dev) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); - PMD_INIT_LOG(DEBUG, "igbvf_dev_close"); + PMD_INIT_FUNC_TRACE(); e1000_reset_hw(hw); @@ -2202,12 +2199,12 @@ igbvf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) uint32_t vid_bit = 0; int ret = 0; - PMD_INIT_LOG(DEBUG, "igbvf_vlan_filter_set"); + PMD_INIT_FUNC_TRACE(); /*vind is not used in VF driver, set to 0, check ixgbe_set_vfta_vf*/ ret = igbvf_set_vfta(hw, vlan_id, !!on); if(ret){ - PMD_INIT_LOG(ERR, "Unable to set VF vlan"); + PMD_INIT_LOG(ERR, "Unable to set VF vlan\n"); return ret; } vid_idx = (uint32_t) ((vlan_id >> 5) & 0x7F); @@ -2431,7 +2428,7 @@ eth_igb_add_ethertype_filter(struct rte_eth_dev *dev, uint16_t index, if (filter->priority_en) { PMD_INIT_LOG(ERR, "vlan and priority (%d) is not supported" - " in E1000.", filter->priority); + " in E1000.\n", filter->priority); return -EINVAL; } diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index 977c4a2..9a34710 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -555,7 +555,7 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, * Set the Transmit Descriptor Tail (TDT). */ E1000_PCI_REG_WRITE(txq->tdt_reg_addr, tx_id); - PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u", + PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u\n", (unsigned) txq->port_id, (unsigned) txq->queue_id, (unsigned) tx_id, (unsigned) nb_tx); txq->tx_tail = tx_id; @@ -697,7 +697,7 @@ eth_igb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, * to happen by sending specific "back-pressure" flow control * frames to its peer(s). */ - PMD_RX_LOG(DEBUG, "\nport_id=%u queue_id=%u rx_id=%u " + PMD_RX_LOG(DEBUG, "port_id=%u queue_id=%u rx_id=%u " "staterr=0x%x pkt_len=%u\n", (unsigned) rxq->port_id, (unsigned) rxq->queue_id, (unsigned) rx_id, (unsigned) staterr, @@ -881,7 +881,7 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, * to happen by sending specific "back-pressure" flow control * frames to its peer(s). */ - PMD_RX_LOG(DEBUG, "\nport_id=%u queue_id=%u rx_id=%u " + PMD_RX_LOG(DEBUG, "port_id=%u queue_id=%u rx_id=%u " "staterr=0x%x data_len=%u\n", (unsigned) rxq->port_id, (unsigned) rxq->queue_id, (unsigned) rx_id, (unsigned) staterr, @@ -1741,7 +1741,8 @@ igb_vmdq_rx_hw_configure(struct rte_eth_dev *dev) uint32_t mrqc, vt_ctl, vmolr, rctl; int i; - PMD_INIT_LOG(DEBUG, ">>"); + PMD_INIT_FUNC_TRACE(); + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); cfg = &dev->data->dev_conf.rx_adv_conf.vmdq_rx_conf; -- 1.7.10.4