From patchwork Sat Oct 7 02:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 132375 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 07636426D6; Sat, 7 Oct 2023 04:34:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3CAB40A89; Sat, 7 Oct 2023 04:34:14 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2099.outbound.protection.outlook.com [40.107.94.99]) by mails.dpdk.org (Postfix) with ESMTP id 60A4C40DCE for ; Sat, 7 Oct 2023 04:34:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I2jTCd6NmVvMO5thiSIlLutlf2Sax6Ul1y/nU2ORASw4rahxzaaaX0PRbrBoSMRKBrhEC7rFhGo08fcfgk2F6alE00aPFlBXoaTr/lAPS/saWuQVhW/aOb64dIPuVRqJP9Oczhh8yuyv1qiak7RDwtoJbtIPHxjfb/yqN8A01loI3DabwFjxtaLeqi128b2ctphmZK0j0KED3dCEA6NEPxzkigv5IReyTHVgYkB7xw+xxu8+VHsYi+fnWZnYxjzJhUVlQJkNQ6WrLv6Y0i/YYMnwfsuC8a4fpse/OQUTOjjMJ4OyJRl1Gy2oGwK8HCxqoz1LYD9aMqRN5bKY5/ofnw== 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=mB6kUrQ1OXZ8TOHbDfJmK0HiVfyBdEDj/+/Y8J11JGc=; b=TwbDNThe7WvRHn5dnPHBBwBtFHr4fS/H9wK0bV7xxO7ZhHzma8ira+aVe6Ir5NwT4prxAXFpu/7Ly1cBHvGau1SWYh9b8EItbTjgOYm3S05HVk1Ns5d+s6uOzNH7gn7/V9CQCYgYXF4C50HAjn9HlvMGhQkHIBGCFDKpsh9qQTYe4FwuPCwR92JkEWIykwUnKwyu0qIqBWLLFsMiauNASoPk9ivrxExpAd3n/KylULwFRXxRkq6JIsPqeNFH+6w76qCwhRjeCFFttoTW4+gNwJoNFKTMTQgmhtBGMtgcPN8JnjjTpIVN2raDM7mWKuNm+CdYDYh8A4pBePRl/dISyQ== 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=mB6kUrQ1OXZ8TOHbDfJmK0HiVfyBdEDj/+/Y8J11JGc=; b=gc8GhuzCT35sIyqCfdtiM3DilywnlGDBVH5N9b1hFTMvtNs4+Z3fl3ig6iLsacmU1TZjoasU0xGBu9eh13hUAvw7fz1TJ3q+CaJhnGmomeaAIMdXqBnVeUDUvy7JFXtUnJjBayMJnx71sj7XLmSI1DAes/zUDVmDoYU1dpThrU0= 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 SA0PR13MB3936.namprd13.prod.outlook.com (2603:10b6:806:97::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.38; Sat, 7 Oct 2023 02:34:08 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314%4]) with mapi id 15.20.6813.027; Sat, 7 Oct 2023 02:34:08 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 05/11] net/nfp: adjust the log statement Date: Sat, 7 Oct 2023 10:33:33 +0800 Message-Id: <20231007023339.1546659-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231007023339.1546659-1-chaoyong.he@corigine.com> References: <20231007023339.1546659-1-chaoyong.he@corigine.com> X-ClientProxiedBy: SJ0PR03CA0212.namprd03.prod.outlook.com (2603:10b6:a03:39f::7) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SA0PR13MB3936:EE_ X-MS-Office365-Filtering-Correlation-Id: 64e632ea-7b00-47b9-7766-08dbc6dde188 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WEziXw9mdcneVWnAuj6lFuLBQ8KTYVHEt+PH9EUS8HEBJJKGbFiDVL71ahb9vIaUlo2IoP5Vp5jSKd76xuwEKTpsZx5WG7+v+2e8mn2KrwR9Fb1h7Uo2aV6Oz+Y+9TYqXk1RVQgdFdXyBAMdQAFhoTfsCWXw+qLKL3rLKWhTQEB3eKqrQNP++8To17pL8WNFNNVpUKc/GBb0uwLOs1v5pweq0Sjvs6A/1m2CmX6cuYWAncxQ2mSsASDlyMcaDpwabOecr8+pU7VYclnk/pw0rS77qea9lZ2jKCHH1eASUPol7X2M4UIq238cf4Wd49C+AeakXVFYTisWkBVnWrAH5d0YP+M9wY0ETpqkbVYM7ar0NHbnkN+qx7WmthxDwwidRSdQWAUviVfZ91KdW8DVtti9lHAq8o+u07WA2Zr1Zh6CVIkrNZPely/v/vjR+WPKBlKBzv+HN4aAL+NhcK5MrjjBtMu6tSVXkNtWvSE69jTjJpGFflLxBb9FDQjiOSdsSoQ1vg05oEqSWztyGgZwn43tadO4c/BuqDqUlmtQGn+rtjov1PyDfqSfxNmZ/vO5b0SrNjUX3lUtqa4xnZvq+ZbOhpMkhma4iqD63aasyQojqSe7PjgNDtoamn39wfTf7b8wrDnGM2SJIfd3XYfMvVohCThJjXyLxSIekPnwZZQ= 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)(366004)(376002)(346002)(396003)(39830400003)(136003)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(6666004)(6506007)(52116002)(6512007)(478600001)(6486002)(26005)(107886003)(1076003)(6916009)(316002)(30864003)(41300700001)(2906002)(44832011)(66476007)(8936002)(5660300002)(4326008)(54906003)(66556008)(66946007)(36756003)(8676002)(86362001)(38350700002)(38100700002)(2616005)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XDfG4GGguGt4ghnpH7KJiC8TSBpAMK8ZQFt+AppjoWu6ff5Qf3TBMbP46/Icj9Q3MTaCu/YmPzNICXIdRpls0JcyEOmIE92j/co+6ccN0rg6s5R6sVF49e/HUsN51MSmfkfEjoUgH4YIJfd6CSqE7qhnvO1/aiWVKMSoF6J9LHCcnTWxd/9UmJOnOMzHE3wrUhrTrAZwvd0u3fvz2lt1OZW2Dr/mliaYj5kF1nMtY75lWLW4wXLFdcyKO6YnPacGfGrt3vHlAi+1+ZauQWNRoO/DtYIr/wkcDQo72avZUuU4SmkanaxxHdKuql/mrE32QyA5hBqnu4jU6IeL+XNspAb76Xvcz7jxicWXcxDVBE61zR4MZlCjC+qExvgDqHHGevfpHSml1wVMd6aLtsLY0vNS3jOIk+XfyBnB93KHyeGxWLGv6KR/vRUkMFvqfd4bdl0q392Dok0WQaTz4lx+7YQNOpFVRmQhD1l23LTafD5ZfHtrgxDJWHEqSC4qFrlcyuxK2JBw2+ZysltDlRQ09TWREW+jrPy785LpY0YJcEnXgAaD3wT/lZ18eZWqhU8/vMgUX8HDvKaPk+lJHgGst7WvpcQQpdix2F6+fk2+Qzy2s/5Fp3mz1dn7UB0pOmbA8T8DENogv5lxM56U3sHXA9Vmu4Y6EcDlhuhiR72YxESx18wRL0Fnr3qWsvVLR+gDyyqj9O7c80AIpaYKQGlhEmiAsAAs4lo+DSILoMUhF+HyjPBfHne+IVGP0ujmYzg+4R8HweBHjj+vsSco+OYiQKFsZJy7VXSir2RTYyItRKbQZokEbQV51KHJq7oohqsHsshhPuKehOxXdD1xXrlEYvpdZib3TCnbsw0dabu1nr91+xx3klk2ZTgbGqu2WHs6+SAZ3USaSMTniqWrEdFEpBiRmElRmntIrpNBfh4lR7NwSWZ7VqgDhSve+s+wiERRoR6uy2Dd1mTER5yw/qKRq2haQrOKPkwpM3RUeUK/J9+SGoELy9FNN9VWPmRmirD2BzP87Qs50MvCxo/eCgMm2oBfKLCtHoDDO0cMB7AQZOic4JGJBi2O1r5iLjJOvqya+dSedk/u2kxlcJe4IvJE92vRDmVZTtuQy98+31NtPRd/h9Xy4D2r4ul2mH6yTVmO9UcZ0HnU9ODVXHc7tIVf67KATu8Ahjz0awJjMjWtTS4cMTN2Psov2Yn1uDwMOn4+2Jw1GZrtXMzSg31OqwhHzF9qksdpP+Rh64l7azNWZ+AQM/YeUv1ujnBirjXuXpdAJ+fhkCdy/x0+Gn2gWERIXCXiiHYfaPQdS8N+/7Qdql0bKxawhYDXF172I3XABM9NSmaN8L7n+ppiFkXjyZauLoOvNs0Mix93kWp2Tb6ouFMTiRdudXgYkZLby780BEUHNspKzY0c+hMIl9c1yAfMLLWCwxShCabgq9Q7e/Ep+kXlIoixQtjVj+yE3HyT3aXNZoyKfgNbfsBJQYgBAfAk4n7mnObHK/jjbOMqXJJa/8ErCKMxeVdOkGFxW8N4zEKw7FHNxQDwgUwjn2lDcvKxNtBLfPWYIF/gkKRa1hD4qQoKq70Zs/cyCG6a4IlLyg0mKt+pbkdO1CGjC6QaU87kwQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64e632ea-7b00-47b9-7766-08dbc6dde188 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2023 02:34:07.9892 (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: cKnX9ujSgqcPKhE/O5oh3N+4ymm62HU/KY2h/nRSXQ2C4zO80NAMr5W8phFZkz4Q1Xcg2o07XEUuoP57BDziv+9stfs5Qt//2RHO9MwHqNI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB3936 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 | 17 +++--- .../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 | 17 ++---- 10 files changed, 58 insertions(+), 110 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index 4967cc2375..1f4c5fd7f9 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -88,15 +88,14 @@ 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.\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); 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 01c2c5a517..be0dfb2890 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..5bfdfd28b3 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,12 +753,11 @@ 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" + 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", + " but the received packet is %hu bytes long", hw->rx_offset, rxq->mbuf_size - hw->rx_offset, mb->data_len); @@ -888,8 +886,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 +961,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;