From patchwork Fri Oct 13 06:06:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 132595 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 9C46342354; Fri, 13 Oct 2023 08:08:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61AF0406FF; Fri, 13 Oct 2023 08:07:38 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2127.outbound.protection.outlook.com [40.107.220.127]) by mails.dpdk.org (Postfix) with ESMTP id 6389640A6F for ; Fri, 13 Oct 2023 08:07:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P7IqGgRMheNuTF4n3SThx6+hQWwtJnjqgcBpn87MWTF5Tmj5q/MIibGFdDBq6/po4JTsYtyTXbREYTjYL0cf5M4oPzkxbGhMgIjCvZjcYHaHBpukQqEZUqYa7C8QIT6TqQ1+36rce4fuAnRcBS6ZFMtiLaaZjhMz28+7iA3mzFA3sbaycRP6WAdc7wqtLv7R5CjNGzIwilsYMIr6QewwbyTjNRvbAD13+wO9dqYj5NPbBW+rtgGEE2y+sq+jWkEnmMzZad6++4sTwFq0eAPuq2vH/vIJOOiEFlGbfdKvxA4ez9D5vFyyipptoUQ2RIZ27YECbcCy0mWRv3KgzDqghQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2bQZwOGY4tPJBOH325Pq23OJXEMxL1fceWLmaaxr34k=; b=lSSbr475k/txZEvfz8MDfSMeXTJZDMyDiRw3KKtUDci+/Zl5YelappjnDsywSbmqAzmK1ZqflTZBzGMOblFmdb87bE9LhRWVGSPdxwPPLr54X7K/kx6xWO+pxCgsWTClRIOKXEXEyENQwgI833ZxfNlHPKWIItiq49fgm+6Hgbv2HD7B2KGrYXkGtTk0N/Kw1VH1V83k7Bap+wSlN/hKuGrSkYaC4u3Lj6+TPDGWDhgDLmx1oEjpcZfJBIRGhppCVdYA3y1oo89vxVHTc5rlbbq8/LlUIgCGviPWE1UTKTqp0r4mcb4/zOprVFTxnV1hRX5mQ9JLJHZna77lzhbF5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2bQZwOGY4tPJBOH325Pq23OJXEMxL1fceWLmaaxr34k=; b=MQezkvLIS/1QzPJFSyx+QJRIA8wsNw1vU1cxCml/iLa6UpG4q4OArFNuYVwxDwOIRiNkWuAwKq6iSJN9DynBkLxnbA5wRRT9+MbIs3MO/v6M63tmcSXwHoCa+7okbJ8XUAHPE3vXKuUplivr8ZI57ctsjI6cq1Z3YGm6/Ugu8UE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB6296.namprd13.prod.outlook.com (2603:10b6:510:237::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Fri, 13 Oct 2023 06:07:34 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::2d5:f7d6:ecde:c93a]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::2d5:f7d6:ecde:c93a%4]) with mapi id 15.20.6863.032; Fri, 13 Oct 2023 06:07:34 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH v3 05/11] net/nfp: adjust the log statement Date: Fri, 13 Oct 2023 14:06:47 +0800 Message-Id: <20231013060653.1006410-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231013060653.1006410-1-chaoyong.he@corigine.com> References: <20231012012704.483828-1-chaoyong.he@corigine.com> <20231013060653.1006410-1-chaoyong.he@corigine.com> X-ClientProxiedBy: SI2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:4:186::23) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6296:EE_ X-MS-Office365-Filtering-Correlation-Id: e509c6ef-03e1-4a48-4174-08dbcbb2b100 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n5Ksh/I/NB3A7+F9WW37RdWYyJkIC5zbeE/bwN8eDt6plhBBetrrCrgZnNuDq1FbB7awPHKAn+rZORSt0p9u77eop1HziMkAZYdbV3zCXQiITEVemoFjUJJxLmQFZsQ29lfhXZlNXomzQ6OUa6a0cp2/OOA9xwvEgSUOiuG46gwSFze6FEFnG/v2CHTNf7sTSBtN63v2dOyNJsy1YSbZRyEcATOSUtr8B3AHBuNtms021ksYukbikb9npj6D8W6Reemx8UvajmvjQmMaEBiwzqjdyZ2YHNzsOk+UZRfB4eLI5bZ51wvFM6c6TcFkvUfyB9x+CicY5b7lw3FAvQjUYb5pzWNEHk05SWeh3SVvCHcg+5LjlZQO9fpnYJ3l/Q1MgokVq6pa8UOwP5/AidoNBDvkhntwhbV9SYk6Ldb/8AlbEAgiel/InUKyYr6/yCsThJ00vRjqcfZY5zI0XYVTfeAW6XfiTRO5SjxXy48kg+89vQiGY9xsHPPmm0BEfdn/DeFBhporRyGgvEMn0FwD2jOm+a/zczuMLiPGFF2GQZM20O5kV6eu7vbsswu+A8b1TwMGGNoXU45C4DJelVvLYsyZHyhkt9UYiu6B3tgXtmkT3aTivPyuq0WhzDx0VsSnzqKh/fdPVb3boZjKQdqOBekLPDTa2Rli21tRUWloY70= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(346002)(39830400003)(376002)(136003)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(30864003)(86362001)(36756003)(83380400001)(2906002)(38350700002)(38100700002)(44832011)(5660300002)(8676002)(8936002)(4326008)(6666004)(316002)(66556008)(54906003)(66946007)(66476007)(52116002)(6512007)(6916009)(6506007)(41300700001)(6486002)(107886003)(1076003)(26005)(478600001)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NbUkLTcUJOQFiOe7KeTtV4AHoixa6zwCykqLlJi6SFPFrmkBxTCYoQzeoWIJo4AU/snlGY0R59tkzSEcrdrQlP82HtotyFniTBC2B0cL8Nk1Kd9HE/elVZ1hZB91OBzH5a5b136AVPS2Vxk5VXdDBmzWHhGOR8NY+j8fiaVSH81I91rKGOfyAmkVNWRtNyWARSaEpprWPDo3g/qj4jiQJXe3lbfz6TYeCYeyzqAaftyv633xtLsfWjTsW0CO4P6S52L8994FrCr5UR7J2LZ6HpdXOphBVcTSMvpFT+HFUWN+eerIMOGkf/59qEPjQzBrkF3F9AvQhcHivFCQewAaOaR15pVOIvb5k8nx4NtFat4Oh/XV3KtWNbdw5K6N1AWbwVgYfjZPvWXpzX5kVWAiYOlgLNf7N/xVY/IxGUGqmbwzTBj4HrNIwbS8RR3MoVm4byLOwZYftYwvhSSEbNezlz861B/FouKOpIRGimYdoYUp4MIOX+756TPMKj8yHn8B6tQBzrEzMQ2yATX0Nfj8oDtriF20H2sywSDb/d7EoX8xwUZy0gtmkv+cur9hYG8TAsIBdfCB8zEyIXdYI0pdQFpWW+5gfEoGa5LpOf5O/MDWphURjSws+Iz/0UMtzXU1Ru+ocwm7hR32XC2KCCsTT3GW9OxIroChTrjtk01n3MNmT+jo6VcNcGEulV2SIPIo6+9OKkW/zIZhiSgRuVuCi884mtAB/vveTtRqSa9twsz0UXP5eYbNINwJ1f+PNGiroEVt6/phkjejnfckaxTKP59MA5cr07Yh1xuHUpeadZcrrh2OG+eO9h13f7TjRKo2LmXjfi+TPg5Gf68Gk5UhT+GnY7ynhK7cWC2V8R0JBNxaeHbeCkXtJRNkPGIGERvmCQUDgVtYieMKLwswta5W23pj7U1hO9ABL68clHSGToTUd3E1l0rSxeuNw9I8AOYMDI02G8hW+kSOVsnfIriF8NgrxezUtm5+yEsiAmmDPxyRcXDEbteyy+PsAqcQkseNK9oK1DQfYBwstaj2CEFrQ4OTzmcX/4xtTGmdI/UYHmvsG0W1976p9OUMM9bGsKg/QNWoLUwBAqFzcnpwS6a8zqigTPYj0Qttm9m+dPCsGQh6fdC7JbQI1Rl96MukwafIJqISWde4rtcehoUrBTTB4jjUczHT5BJ0ObTzk4gOTlHE2NAylKWskCHlKYZcK/dByBhvraFgqpeIcdr+TBCZryawvl6556dCsirQ+1isgaxmLKFxNnFe41oXTqa6E1oaLs0ONbnnq54xeTs9CGf+L0f8SvKhuxmUO4uTQTZASbsnnoYqUVsOWtWVa8x3FlSk107g1foMOxMQYQ4mdWCU6xbsXVH936KNWrD4QigsVfNJOocH0Eh9Rs0sMshzfYZWlc81WxVXLESMYuUItExsA0TMZrCyIoWsV0yYs60arOy7xVbFFLcp6nUxzLsPGc4FihqxKEokHAXayImgIHHHjBLKq5hd1uXv37iflJ8Jto7H3JAAGYXtaJu5B95nXaADXi6vuFUh4rUVJgA1WFnyt2UkiwC6BqlY/jwVmaI8iGohQfmrXoiWG7l8RACLig0DareJuZgmiJXxdP1RmtNjvQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: e509c6ef-03e1-4a48-4174-08dbcbb2b100 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2023 06:07:34.0478 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ea0i1QR4RpGv00TOB4ABxoyVm1GRTDJMhqhxuZXp6E9uNqYZan76d5k+R/TP7PGHlRDhkGyJPc3pEBRFkgoGzF8uM38+X6MTJIhRZakCe7Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6296 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 Add log statement to the important control logic, and remove verbose info log statement. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_flower_ctrl.c | 10 +--- .../net/nfp/flower/nfp_flower_representor.c | 4 +- drivers/net/nfp/nfd3/nfp_nfd3_dp.c | 2 - drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 2 - drivers/net/nfp/nfp_common.c | 59 ++++++++----------- drivers/net/nfp/nfp_cpp_bridge.c | 28 ++++----- drivers/net/nfp/nfp_ethdev.c | 21 +------ drivers/net/nfp/nfp_ethdev_vf.c | 17 +----- drivers/net/nfp/nfp_logs.h | 1 - drivers/net/nfp/nfp_rxtx.c | 22 ++----- 10 files changed, 50 insertions(+), 116 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index 4967cc2375..d1c350ae93 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -88,15 +88,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue, * responsibility of avoiding it. But we have * to give some info about the error */ - PMD_RX_LOG(ERR, - "mbuf overflow likely due to the RX offset.\n" - "\t\tYour mbuf size should have extra space for" - " RX offset=%u bytes.\n" - "\t\tCurrently you just have %u bytes available" - " but the received packet is %u bytes long", - hw->rx_offset, - rxq->mbuf_size - hw->rx_offset, - mb->data_len); + PMD_RX_LOG(ERR, "mbuf overflow likely due to the RX offset."); rte_pktmbuf_free(mb); break; } diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 013ecbc998..bf794a1d70 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -464,7 +464,7 @@ nfp_flower_repr_rx_burst(void *rx_queue, total_dequeue = rte_ring_dequeue_burst(repr->ring, (void *)rx_pkts, nb_pkts, &available); if (total_dequeue != 0) { - PMD_RX_LOG(DEBUG, "Representor Rx burst for %s, port_id: 0x%x, " + PMD_RX_LOG(DEBUG, "Representor Rx burst for %s, port_id: %#x, " "received: %u, available: %u", repr->name, repr->port_id, total_dequeue, available); @@ -510,7 +510,7 @@ nfp_flower_repr_tx_burst(void *tx_queue, pf_tx_queue = dev->data->tx_queues[0]; sent = nfp_flower_pf_xmit_pkts(pf_tx_queue, tx_pkts, nb_pkts); if (sent != 0) { - PMD_TX_LOG(DEBUG, "Representor Tx burst for %s, port_id: 0x%x transmitted: %u", + PMD_TX_LOG(DEBUG, "Representor Tx burst for %s, port_id: %#x transmitted: %hu", repr->name, repr->port_id, sent); repr->repr_stats.opackets += sent; } diff --git a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c index 699f65ebef..51755f4324 100644 --- a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c +++ b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c @@ -381,8 +381,6 @@ nfp_net_nfd3_tx_queue_setup(struct rte_eth_dev *dev, hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); - PMD_INIT_FUNC_TRACE(); - nfp_net_tx_desc_limits(hw, &min_tx_desc, &max_tx_desc); /* Validating number of descriptors */ diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c index 2426ffb261..dae87ac6df 100644 --- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c +++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c @@ -455,8 +455,6 @@ nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev, hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); - PMD_INIT_FUNC_TRACE(); - nfp_net_tx_desc_limits(hw, &min_tx_desc, &max_tx_desc); /* Validating number of descriptors */ diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 18291a1cde..f48e1930dc 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -207,7 +207,7 @@ __nfp_net_reconfig(struct nfp_net_hw *hw, hw->qcp_cfg); if (hw->qcp_cfg == NULL) { - PMD_INIT_LOG(ERR, "Bad configuration queue pointer"); + PMD_DRV_LOG(ERR, "Bad configuration queue pointer"); return -ENXIO; } @@ -224,15 +224,15 @@ __nfp_net_reconfig(struct nfp_net_hw *hw, if (new == 0) break; if ((new & NFP_NET_CFG_UPDATE_ERR) != 0) { - PMD_INIT_LOG(ERR, "Reconfig error: 0x%08x", new); + PMD_DRV_LOG(ERR, "Reconfig error: %#08x", new); return -1; } if (cnt >= NFP_NET_POLL_TIMEOUT) { - PMD_INIT_LOG(ERR, "Reconfig timeout for 0x%08x after" - " %ums", update, cnt); + PMD_DRV_LOG(ERR, "Reconfig timeout for %#08x after %u ms", + update, cnt); return -EIO; } - nanosleep(&wait, 0); /* waiting for a 1ms */ + nanosleep(&wait, 0); /* Waiting for a 1ms */ } PMD_DRV_LOG(DEBUG, "Ack DONE"); return 0; @@ -390,8 +390,6 @@ nfp_net_configure(struct rte_eth_dev *dev) * called after that internal process */ - PMD_INIT_LOG(DEBUG, "Configure"); - dev_conf = &dev->data->dev_conf; rxmode = &dev_conf->rxmode; txmode = &dev_conf->txmode; @@ -401,20 +399,20 @@ nfp_net_configure(struct rte_eth_dev *dev) /* Checking TX mode */ if (txmode->mq_mode != RTE_ETH_MQ_TX_NONE) { - PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported"); + PMD_DRV_LOG(ERR, "TX mq_mode DCB and VMDq not supported"); return -EINVAL; } /* Checking RX mode */ if ((rxmode->mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) != 0 && (hw->cap & NFP_NET_CFG_CTRL_RSS_ANY) == 0) { - PMD_INIT_LOG(INFO, "RSS not supported"); + PMD_DRV_LOG(ERR, "RSS not supported"); return -EINVAL; } /* Checking MTU set */ if (rxmode->mtu > NFP_FRAME_SIZE_MAX) { - PMD_INIT_LOG(ERR, "MTU (%u) larger than NFP_FRAME_SIZE_MAX (%u) not supported", + PMD_DRV_LOG(ERR, "MTU (%u) larger than NFP_FRAME_SIZE_MAX (%u)", rxmode->mtu, NFP_FRAME_SIZE_MAX); return -ERANGE; } @@ -552,8 +550,7 @@ nfp_net_set_mac_addr(struct rte_eth_dev *dev, hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); if ((hw->ctrl & NFP_NET_CFG_CTRL_ENABLE) != 0 && (hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR) == 0) { - PMD_INIT_LOG(INFO, "MAC address unable to change when" - " port enabled"); + PMD_DRV_LOG(ERR, "MAC address unable to change when port enabled"); return -EBUSY; } @@ -567,7 +564,7 @@ nfp_net_set_mac_addr(struct rte_eth_dev *dev, (hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR) != 0) ctrl |= NFP_NET_CFG_CTRL_LIVE_ADDR; if (nfp_net_reconfig(hw, ctrl, update) != 0) { - PMD_INIT_LOG(INFO, "MAC address update failed"); + PMD_DRV_LOG(ERR, "MAC address update failed"); return -EIO; } return 0; @@ -582,21 +579,21 @@ nfp_configure_rx_interrupt(struct rte_eth_dev *dev, if (rte_intr_vec_list_alloc(intr_handle, "intr_vec", dev->data->nb_rx_queues) != 0) { - PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" - " intr_vec", dev->data->nb_rx_queues); + PMD_DRV_LOG(ERR, "Failed to allocate %d rx_queues intr_vec", + dev->data->nb_rx_queues); return -ENOMEM; } hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_UIO) { - PMD_INIT_LOG(INFO, "VF: enabling RX interrupt with UIO"); + PMD_DRV_LOG(INFO, "VF: enabling RX interrupt with UIO"); /* UIO just supports one queue and no LSC*/ nn_cfg_writeb(hw, NFP_NET_CFG_RXR_VEC(0), 0); if (rte_intr_vec_list_index_set(intr_handle, 0, 0) != 0) return -1; } else { - PMD_INIT_LOG(INFO, "VF: enabling RX interrupt with VFIO"); + PMD_DRV_LOG(INFO, "VF: enabling RX interrupt with VFIO"); for (i = 0; i < dev->data->nb_rx_queues; i++) { /* * The first msix vector is reserved for non @@ -605,8 +602,6 @@ nfp_configure_rx_interrupt(struct rte_eth_dev *dev, nn_cfg_writeb(hw, NFP_NET_CFG_RXR_VEC(i), i + 1); if (rte_intr_vec_list_index_set(intr_handle, i, i + 1) != 0) return -1; - PMD_INIT_LOG(DEBUG, "intr_vec[%d]= %d", i, - rte_intr_vec_list_index_get(intr_handle, i)); } } @@ -691,8 +686,6 @@ nfp_net_promisc_enable(struct rte_eth_dev *dev) struct nfp_net_hw *hw; struct nfp_flower_representor *repr; - PMD_DRV_LOG(DEBUG, "Promiscuous mode enable"); - if ((dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) != 0) { repr = dev->data->dev_private; hw = repr->app_fw_flower->pf_hw; @@ -701,7 +694,7 @@ nfp_net_promisc_enable(struct rte_eth_dev *dev) } if ((hw->cap & NFP_NET_CFG_CTRL_PROMISC) == 0) { - PMD_INIT_LOG(INFO, "Promiscuous mode not supported"); + PMD_DRV_LOG(ERR, "Promiscuous mode not supported"); return -ENOTSUP; } @@ -774,9 +767,6 @@ nfp_net_link_update(struct rte_eth_dev *dev, struct rte_eth_link link; struct nfp_eth_table *nfp_eth_table; - - PMD_DRV_LOG(DEBUG, "Link update"); - hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); /* Read link status */ @@ -1636,9 +1626,9 @@ nfp_net_rss_reta_write(struct rte_eth_dev *dev, hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (reta_size != NFP_NET_CFG_RSS_ITBL_SZ) { - PMD_DRV_LOG(ERR, "The size of hash lookup table configured " - "(%d) doesn't match the number hardware can supported " - "(%d)", reta_size, NFP_NET_CFG_RSS_ITBL_SZ); + PMD_DRV_LOG(ERR, "The size of hash lookup table configured (%hu)" + " doesn't match hardware can supported (%d)", + reta_size, NFP_NET_CFG_RSS_ITBL_SZ); return -EINVAL; } @@ -1719,9 +1709,9 @@ nfp_net_reta_query(struct rte_eth_dev *dev, return -EINVAL; if (reta_size != NFP_NET_CFG_RSS_ITBL_SZ) { - PMD_DRV_LOG(ERR, "The size of hash lookup table configured " - "(%d) doesn't match the number hardware can supported " - "(%d)", reta_size, NFP_NET_CFG_RSS_ITBL_SZ); + PMD_DRV_LOG(ERR, "The size of hash lookup table configured (%d)" + " doesn't match hardware can supported (%d)", + reta_size, NFP_NET_CFG_RSS_ITBL_SZ); return -EINVAL; } @@ -1827,7 +1817,7 @@ nfp_net_rss_hash_update(struct rte_eth_dev *dev, } if (rss_conf->rss_key_len > NFP_NET_CFG_RSS_KEY_SZ) { - PMD_DRV_LOG(ERR, "hash key too long"); + PMD_DRV_LOG(ERR, "RSS hash key too long"); return -EINVAL; } @@ -1910,9 +1900,6 @@ nfp_net_rss_config_default(struct rte_eth_dev *dev) uint16_t rx_queues = dev->data->nb_rx_queues; struct rte_eth_rss_reta_entry64 nfp_reta_conf[2]; - PMD_DRV_LOG(INFO, "setting default RSS conf for %u queues", - rx_queues); - nfp_reta_conf[0].mask = ~0x0; nfp_reta_conf[1].mask = ~0x0; @@ -1929,7 +1916,7 @@ nfp_net_rss_config_default(struct rte_eth_dev *dev) dev_conf = &dev->data->dev_conf; if (dev_conf == NULL) { - PMD_DRV_LOG(INFO, "wrong rss conf"); + PMD_DRV_LOG(ERR, "Wrong rss conf"); return -EINVAL; } rss_conf = dev_conf->rx_adv_conf.rss_conf; diff --git a/drivers/net/nfp/nfp_cpp_bridge.c b/drivers/net/nfp/nfp_cpp_bridge.c index 727ec7a7b2..222cfdcbc3 100644 --- a/drivers/net/nfp/nfp_cpp_bridge.c +++ b/drivers/net/nfp/nfp_cpp_bridge.c @@ -130,7 +130,7 @@ nfp_cpp_bridge_serve_write(int sockfd, uint32_t tmpbuf[16]; struct nfp_cpp_area *area; - PMD_CPP_LOG(DEBUG, "%s: offset size %zu, count_size: %zu\n", __func__, + PMD_CPP_LOG(DEBUG, "%s: offset size %zu, count_size: %zu", __func__, sizeof(off_t), sizeof(size_t)); /* Reading the count param */ @@ -149,9 +149,9 @@ nfp_cpp_bridge_serve_write(int sockfd, cpp_id = (offset >> 40) << 8; nfp_offset = offset & ((1ull << 40) - 1); - PMD_CPP_LOG(DEBUG, "%s: count %zu and offset %jd\n", __func__, count, + PMD_CPP_LOG(DEBUG, "%s: count %zu and offset %jd", __func__, count, offset); - PMD_CPP_LOG(DEBUG, "%s: cpp_id %08x and nfp_offset %jd\n", __func__, + PMD_CPP_LOG(DEBUG, "%s: cpp_id %08x and nfp_offset %jd", __func__, cpp_id, nfp_offset); /* Adjust length if not aligned */ @@ -162,7 +162,7 @@ nfp_cpp_bridge_serve_write(int sockfd, } while (count > 0) { - /* configure a CPP PCIe2CPP BAR for mapping the CPP target */ + /* Configure a CPP PCIe2CPP BAR for mapping the CPP target */ area = nfp_cpp_area_alloc_with_name(cpp, cpp_id, "nfp.cdev", nfp_offset, curlen); if (area == NULL) { @@ -170,7 +170,7 @@ nfp_cpp_bridge_serve_write(int sockfd, return -EIO; } - /* mapping the target */ + /* Mapping the target */ err = nfp_cpp_area_acquire(area); if (err < 0) { PMD_CPP_LOG(ERR, "area acquire failed"); @@ -183,7 +183,7 @@ nfp_cpp_bridge_serve_write(int sockfd, if (len > sizeof(tmpbuf)) len = sizeof(tmpbuf); - PMD_CPP_LOG(DEBUG, "%s: Receive %u of %zu\n", __func__, + PMD_CPP_LOG(DEBUG, "%s: Receive %u of %zu", __func__, len, count); err = recv(sockfd, tmpbuf, len, MSG_WAITALL); if (err != (int)len) { @@ -235,7 +235,7 @@ nfp_cpp_bridge_serve_read(int sockfd, uint32_t tmpbuf[16]; struct nfp_cpp_area *area; - PMD_CPP_LOG(DEBUG, "%s: offset size %zu, count_size: %zu\n", __func__, + PMD_CPP_LOG(DEBUG, "%s: offset size %zu, count_size: %zu", __func__, sizeof(off_t), sizeof(size_t)); /* Reading the count param */ @@ -254,9 +254,9 @@ nfp_cpp_bridge_serve_read(int sockfd, cpp_id = (offset >> 40) << 8; nfp_offset = offset & ((1ull << 40) - 1); - PMD_CPP_LOG(DEBUG, "%s: count %zu and offset %jd\n", __func__, count, + PMD_CPP_LOG(DEBUG, "%s: count %zu and offset %jd", __func__, count, offset); - PMD_CPP_LOG(DEBUG, "%s: cpp_id %08x and nfp_offset %jd\n", __func__, + PMD_CPP_LOG(DEBUG, "%s: cpp_id %08x and nfp_offset %jd", __func__, cpp_id, nfp_offset); /* Adjust length if not aligned */ @@ -293,7 +293,7 @@ nfp_cpp_bridge_serve_read(int sockfd, nfp_cpp_area_free(area); return -EIO; } - PMD_CPP_LOG(DEBUG, "%s: sending %u of %zu\n", __func__, + PMD_CPP_LOG(DEBUG, "%s: sending %u of %zu", __func__, len, count); err = send(sockfd, tmpbuf, len, 0); @@ -353,7 +353,7 @@ nfp_cpp_bridge_serve_ioctl(int sockfd, tmp = nfp_cpp_model(cpp); - PMD_CPP_LOG(DEBUG, "%s: sending NFP model %08x\n", __func__, tmp); + PMD_CPP_LOG(DEBUG, "%s: sending NFP model %08x", __func__, tmp); err = send(sockfd, &tmp, 4, 0); if (err != 4) { @@ -363,7 +363,7 @@ nfp_cpp_bridge_serve_ioctl(int sockfd, tmp = nfp_cpp_interface(cpp); - PMD_CPP_LOG(DEBUG, "%s: sending NFP interface %08x\n", __func__, tmp); + PMD_CPP_LOG(DEBUG, "%s: sending NFP interface %08x", __func__, tmp); err = send(sockfd, &tmp, 4, 0); if (err != 4) { @@ -440,11 +440,11 @@ nfp_cpp_bridge_service_func(void *args) while (1) { ret = recv(datafd, &op, 4, 0); if (ret <= 0) { - PMD_CPP_LOG(DEBUG, "%s: socket close\n", __func__); + PMD_CPP_LOG(DEBUG, "%s: socket close", __func__); break; } - PMD_CPP_LOG(DEBUG, "%s: getting op %u\n", __func__, op); + PMD_CPP_LOG(DEBUG, "%s: getting op %u", __func__, op); if (op == NFP_BRIDGE_OP_READ) nfp_cpp_bridge_serve_read(datafd, cpp); diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 7d149decfb..72abc4c16e 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -60,8 +60,6 @@ nfp_net_start(struct rte_eth_dev *dev) pf_dev = NFP_NET_DEV_PRIVATE_TO_PF(dev->data->dev_private); app_fw_nic = NFP_PRIV_TO_APP_FW_NIC(pf_dev->app_fw_priv); - PMD_INIT_LOG(DEBUG, "Start"); - /* Disabling queues just in case... */ nfp_net_disable_queues(dev); @@ -194,8 +192,6 @@ nfp_net_stop(struct rte_eth_dev *dev) { struct nfp_net_hw *hw; - PMD_INIT_LOG(DEBUG, "Stop"); - hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); nfp_net_disable_queues(dev); @@ -220,8 +216,6 @@ nfp_net_set_link_up(struct rte_eth_dev *dev) { struct nfp_net_hw *hw; - PMD_DRV_LOG(DEBUG, "Set link up"); - hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (rte_eal_process_type() == RTE_PROC_PRIMARY) @@ -237,8 +231,6 @@ nfp_net_set_link_down(struct rte_eth_dev *dev) { struct nfp_net_hw *hw; - PMD_DRV_LOG(DEBUG, "Set link down"); - hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (rte_eal_process_type() == RTE_PROC_PRIMARY) @@ -261,8 +253,6 @@ nfp_net_close(struct rte_eth_dev *dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - PMD_INIT_LOG(DEBUG, "Close"); - pf_dev = NFP_NET_DEV_PRIVATE_TO_PF(dev->data->dev_private); hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); pci_dev = RTE_ETH_DEV_TO_PCI(dev); @@ -491,8 +481,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev) struct nfp_app_fw_nic *app_fw_nic; struct rte_ether_addr *tmp_ether_addr; - PMD_INIT_FUNC_TRACE(); - pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); /* Use backpointer here to the PF of this eth_dev */ @@ -513,7 +501,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) */ hw = app_fw_nic->ports[port]; - PMD_INIT_LOG(DEBUG, "Working with physical port number: %d, " + PMD_INIT_LOG(DEBUG, "Working with physical port number: %hu, " "NFP internal port number: %d", port, hw->nfp_idx); rte_eth_copy_pci_info(eth_dev, pci_dev); @@ -579,9 +567,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev) tx_base = nn_cfg_readl(hw, NFP_NET_CFG_START_TXQ); rx_base = nn_cfg_readl(hw, NFP_NET_CFG_START_RXQ); - PMD_INIT_LOG(DEBUG, "tx_base: 0x%" PRIx64 "", tx_base); - PMD_INIT_LOG(DEBUG, "rx_base: 0x%" PRIx64 "", rx_base); - hw->tx_bar = pf_dev->qc_bar + tx_base * NFP_QCP_QUEUE_ADDR_SZ; hw->rx_bar = pf_dev->qc_bar + rx_base * NFP_QCP_QUEUE_ADDR_SZ; eth_dev->data->dev_private = hw; @@ -627,7 +612,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; - PMD_INIT_LOG(INFO, "port %d VendorID=0x%x DeviceID=0x%x " + PMD_INIT_LOG(INFO, "port %d VendorID=%#x DeviceID=%#x " "mac=" RTE_ETHER_ADDR_PRT_FMT, eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id, @@ -997,7 +982,7 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto pf_cleanup; } - PMD_INIT_LOG(DEBUG, "qc_bar address: 0x%p", pf_dev->qc_bar); + PMD_INIT_LOG(DEBUG, "qc_bar address: %p", pf_dev->qc_bar); /* * PF initialization has been done at this point. Call app specific diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index aaef6ea91a..d3c3c9e953 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -41,8 +41,6 @@ nfp_netvf_start(struct rte_eth_dev *dev) hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); - PMD_INIT_LOG(DEBUG, "Start"); - /* Disabling queues just in case... */ nfp_net_disable_queues(dev); @@ -136,8 +134,6 @@ nfp_netvf_start(struct rte_eth_dev *dev) static int nfp_netvf_stop(struct rte_eth_dev *dev) { - PMD_INIT_LOG(DEBUG, "Stop"); - nfp_net_disable_queues(dev); /* Clear queues */ @@ -170,8 +166,6 @@ nfp_netvf_close(struct rte_eth_dev *dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - PMD_INIT_LOG(DEBUG, "Close"); - pci_dev = RTE_ETH_DEV_TO_PCI(dev); /* @@ -265,8 +259,6 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) const struct nfp_dev_info *dev_info; struct rte_ether_addr *tmp_ether_addr; - PMD_INIT_FUNC_TRACE(); - pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); dev_info = nfp_dev_info_get(pci_dev->id.device_id); @@ -301,7 +293,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) hw->eth_xstats_base = rte_malloc("rte_eth_xstat", sizeof(struct rte_eth_xstat) * nfp_net_xstats_size(eth_dev), 0); if (hw->eth_xstats_base == NULL) { - PMD_INIT_LOG(ERR, "no memory for xstats base values on device %s!", + PMD_INIT_LOG(ERR, "No memory for xstats base values on device %s!", pci_dev->device.name); return -ENOMEM; } @@ -312,9 +304,6 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_RXQ); rx_bar_off = nfp_qcp_queue_offset(dev_info, start_q); - PMD_INIT_LOG(DEBUG, "tx_bar_off: 0x%" PRIx64 "", tx_bar_off); - PMD_INIT_LOG(DEBUG, "rx_bar_off: 0x%" PRIx64 "", rx_bar_off); - hw->tx_bar = (uint8_t *)pci_dev->mem_resource[2].addr + tx_bar_off; hw->rx_bar = (uint8_t *)pci_dev->mem_resource[2].addr + rx_bar_off; @@ -345,7 +334,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) tmp_ether_addr = &hw->mac_addr; if (rte_is_valid_assigned_ether_addr(tmp_ether_addr) == 0) { - PMD_INIT_LOG(INFO, "Using random mac address for port %d", port); + PMD_INIT_LOG(INFO, "Using random mac address for port %hu", port); /* Using random mac addresses for VFs */ rte_eth_random_addr(&hw->mac_addr.addr_bytes[0]); nfp_net_write_mac(hw, &hw->mac_addr.addr_bytes[0]); @@ -359,7 +348,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; - PMD_INIT_LOG(INFO, "port %d VendorID=0x%x DeviceID=0x%x " + PMD_INIT_LOG(INFO, "port %hu VendorID=%#x DeviceID=%#x " "mac=" RTE_ETHER_ADDR_PRT_FMT, eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id, diff --git a/drivers/net/nfp/nfp_logs.h b/drivers/net/nfp/nfp_logs.h index 315a57811c..16ff61700b 100644 --- a/drivers/net/nfp/nfp_logs.h +++ b/drivers/net/nfp/nfp_logs.h @@ -12,7 +12,6 @@ extern int nfp_logtype_init; #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, nfp_logtype_init, \ "%s(): " fmt "\n", __func__, ## args) -#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") #ifdef RTE_ETHDEV_DEBUG_RX extern int nfp_logtype_rx; diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index db6122eac3..b37a338b2f 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -192,7 +192,7 @@ nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq) uint64_t dma_addr; struct nfp_net_dp_buf *rxe = rxq->rxbufs; - PMD_RX_LOG(DEBUG, "Fill Rx Freelist for %u descriptors", + PMD_RX_LOG(DEBUG, "Fill Rx Freelist for %hu descriptors", rxq->rx_count); for (i = 0; i < rxq->rx_count; i++) { @@ -212,14 +212,13 @@ nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq) rxd->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff; rxd->fld.dma_addr_lo = dma_addr & 0xffffffff; rxe[i].mbuf = mbuf; - PMD_RX_LOG(DEBUG, "[%d]: %" PRIx64, i, dma_addr); } /* Make sure all writes are flushed before telling the hardware */ rte_wmb(); /* Not advertising the whole ring as the firmware gets confused if so */ - PMD_RX_LOG(DEBUG, "Increment FL write pointer in %u", rxq->rx_count - 1); + PMD_RX_LOG(DEBUG, "Increment FL write pointer in %hu", rxq->rx_count - 1); nfp_qcp_ptr_add(rxq->qcp_fl, NFP_QCP_WRITE_PTR, rxq->rx_count - 1); @@ -432,7 +431,7 @@ nfp_net_parse_meta_qinq(const struct nfp_meta_parsed *meta, if (meta->vlan[0].offload == 0) mb->vlan_tci = rte_cpu_to_le_16(meta->vlan[0].tci); mb->vlan_tci_outer = rte_cpu_to_le_16(meta->vlan[1].tci); - PMD_RX_LOG(DEBUG, "Received outer vlan is %u inter vlan is %u", + PMD_RX_LOG(DEBUG, "Received outer vlan TCI is %u inner vlan TCI is %u", mb->vlan_tci_outer, mb->vlan_tci); mb->ol_flags |= RTE_MBUF_F_RX_QINQ | RTE_MBUF_F_RX_QINQ_STRIPPED; } @@ -754,15 +753,7 @@ nfp_net_recv_pkts(void *rx_queue, * responsibility of avoiding it. But we have * to give some info about the error */ - PMD_RX_LOG(ERR, - "mbuf overflow likely due to the RX offset.\n" - "\t\tYour mbuf size should have extra space for" - " RX offset=%u bytes.\n" - "\t\tCurrently you just have %u bytes available" - " but the received packet is %u bytes long", - hw->rx_offset, - rxq->mbuf_size - hw->rx_offset, - mb->data_len); + PMD_RX_LOG(ERR, "mbuf overflow likely due to the RX offset."); rte_pktmbuf_free(mb); break; } @@ -888,8 +879,6 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); - PMD_INIT_FUNC_TRACE(); - nfp_net_rx_desc_limits(hw, &min_rx_desc, &max_rx_desc); /* Validating number of descriptors */ @@ -965,9 +954,6 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, return -ENOMEM; } - PMD_RX_LOG(DEBUG, "rxbufs=%p hw_ring=%p dma_addr=0x%" PRIx64, - rxq->rxbufs, rxq->rxds, (unsigned long)rxq->dma); - nfp_net_reset_rx_queue(rxq); rxq->hw = hw;