From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 353AA45B04; Thu, 10 Oct 2024 16:15:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9B7340A8B; Thu, 10 Oct 2024 16:14:47 +0200 (CEST) Received: from egress-ip11b.ess.de.barracuda.com (egress-ip11b.ess.de.barracuda.com [18.185.115.215]) by mails.dpdk.org (Postfix) with ESMTP id 791A74066F for ; Thu, 10 Oct 2024 16:14:37 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2110.outbound.protection.outlook.com [104.47.18.110]) by mx-outbound20-48.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Oct 2024 14:14:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UKbDluoFUwNE4iR6NzJR62nlmKi8n1zXvkbQj8gYWM7KOGDtmCMmxaVT0ylyUWJIL9ePiT6/YdwlQhW1rw/Sv0blqp3qGaDOSjkRna+G5ctaryGlhlFydEughOJ/zQr+tBxtBSc+fKH9T6233QxEALwc4RrXkViV/lrwFNmKwRmVPjja0Sekxl8lDZ2G0Fwa5Mia04dUYc0X3KiAebSk3sNfti1MJdyZbCJGhavPX2PThxfToUgWcyURoRqnEGF1aKjISS5WlqeBhtjvOXULfPSEGiPOSPrfkSJdfMRe1Sg6ai3Y4MECLb6KdGM+oy+SlllYDp0nxWGwA/A/Zw9z4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=PiX50ecI8zOpoWAuhHe5ZbsQecAMeTcgXQcrzQiMegs=; b=GRMauKth0XF3O/YDlCaY3XQKrF6QpBUFLFzuf5KzjZeuA9ZrOCkEEmrSEEkUU68OCFRtbVydF2f4WlXvezWNMpynHb7sJr2pclJCS/zgDeuEuZ3r5x05jdh5+mJ8O9au8r36wiIzChKrezNcO/A5R69ASHQ4m2G0zUbdHOpWDrO+fvggx2kWYDOhGkxNTeUAXiDhq6XlgFmjmPl0L+DlLaZ5fso2RyhdhBB6rmZsb4pBEkY/+5FXDVD1MesO2VVC2SqsrlO6MxFj2NjJ+2MLm1b4j+4fml8Nd81MiyLRFypYyKoAt+vtXeblv3d8pXFdwWo6REWc6omdZGOsT1mguA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PiX50ecI8zOpoWAuhHe5ZbsQecAMeTcgXQcrzQiMegs=; b=AJf4w9ThavIWu8QoKUSEUkKxjcTbhbFFxF/UeFmQ14xMoe/zekYkRGe3ir3NfZScImQm6vyKJGcvRktGFdZvCjsQxcpH2d6V59NmkOcZIOPg+zUcTTJex8KXalTyNT3H4Qot1bIM0HVaAUTT5Dys6jXPl/S9/IlqC3vUad3iHAU= Received: from DU2PR04CA0079.eurprd04.prod.outlook.com (2603:10a6:10:232::24) by AM9P190MB1234.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:261::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 14:14:27 +0000 Received: from DU6PEPF0000B61B.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::f8) by DU2PR04CA0079.outlook.office365.com (2603:10a6:10:232::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.17 via Frontend Transport; Thu, 10 Oct 2024 14:14:27 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by DU6PEPF0000B61B.mail.protection.outlook.com (10.167.8.132) with Microsoft SMTP Server id 15.20.8048.13 via Frontend Transport; Thu, 10 Oct 2024 14:14:26 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@amd.com, Danylo Vodopianov , Oleksandr Kolomeiets Subject: [PATCH v3 05/50] net/ntnic: extend and fix logging implementation Date: Thu, 10 Oct 2024 16:13:20 +0200 Message-ID: <20241010141416.4063591-6-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241010141416.4063591-1-sil-plv@napatech.com> References: <20241006203728.330792-2-sil-plv@napatech.com> <20241010141416.4063591-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B61B:EE_|AM9P190MB1234:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 61bb63cc-1963-4409-ac89-08dce935d993 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?X/V7XF4bIXiYwnY29oEWF5j27GYtiX0AzYkd2dzvENI5HB/rJWjRMJXIIkcK?= =?us-ascii?Q?omox7kRviHIju5QxfPNRob6erV/uVeYAxTGvzpAhN6GR6ReHAnZmRor3tJH0?= =?us-ascii?Q?jLgqHGRdRtsxa8OYhmTxmtK9DERHw7gfYyeONl7EWFsULTWLG8aEquQr4mZu?= =?us-ascii?Q?TN1ozl8pm/XZNdLCYuw93Kl09v2nQjgTUcTwmaQTxq+XZGOqAIXEuZqs5ZeE?= =?us-ascii?Q?/5IFkOTfcQu0WeqxKKJ3daSuUpAf/vuYq/kkx8AsUjtM5zctYKLyET4I10ZX?= =?us-ascii?Q?GXo9/xlocKCmURabZ1ngwD3vMNfoReXOdD5/F6JQyvAa+QFI+F+Ss9SGLMlz?= =?us-ascii?Q?N8EqbUspO4cNy4esx/KB1Cf2k5Q3Jh2s1ZzB+CRW1nM2uNm2vQUXTKP4CTB+?= =?us-ascii?Q?FNTve/5b5VNdqQCKo8nxsm9xAueKVdARL74zgSGGKwnnaxI3g5CjQcNlZChA?= =?us-ascii?Q?+UIBSQJpGXStcSJxvBSpEe0kxL+u9gqs00qIzEpthXRjcVu5j/Ixl377Ahhc?= =?us-ascii?Q?RNl997A7q7lmTrfDKw+y4OlQLzinR99nsguu2JAApO8rStzjDeJ7iGGcu6RU?= =?us-ascii?Q?8Z319AdQbAyRz5sAB/nBKgQ4m3IZ64GBga5l8zwD0YDoTxLeLeXy00is+E5Q?= =?us-ascii?Q?uYd5+0r60wnclZGDtfspNILEkqz5KhOeovU05MRtGGJjy9AE1y3la5uWFG2f?= =?us-ascii?Q?C/GKe7GoZ7fXJMEbH+XizTCILptVhaYmkfl1hNed+QhI/yVnS8P8iqoADWQA?= =?us-ascii?Q?WTKTSQQZmGg4ubMp10zVJJ/Vagq/VzxiD9oe3dA1pXKsdyK36aTkrrInw/dd?= =?us-ascii?Q?4Mm63jhQ2wEYtG8kwD+FqKy79+ruhx9/nQyFaJlBmQR2FAUNdfE75+sos+v5?= =?us-ascii?Q?WXuAyoSO1Pk/hd2FotDcuwne9bl348PGsRHjDs6coDgzkxUcNmsnHKr4Jovq?= =?us-ascii?Q?5ywMaY+3pXXmU3kdCR2pDYzDQS8uZ24xb6HcrDcnI6wpeDl5rcZB9C0ifeb6?= =?us-ascii?Q?VJOjEKswV20o75IQvEUaljPLjTRiWplaxYO5pJQzqKrizc6Ov/nbtHOanXM7?= =?us-ascii?Q?QXok5SlQG4x87rDiGpj7LBxW9ge3DKKGKMoFu1aM90thc0uF50QV+eRXxjT1?= =?us-ascii?Q?dWVJi9IFnqS0ubXjQEYQ0REtBVkNie4uojAZpnQZBolb0Wv6ycVfcmvw+DUb?= =?us-ascii?Q?IGGC0PwKmha41eriu0cPemEwPJ/RUuLjQIrbsvA0Gn6twEdXC38eM1HNrZt8?= =?us-ascii?Q?dUpDZqyJdB+Q4PHGic1jRa08VAia2DxYXs44o6G4/uH79n4YobvbxMOlmkqA?= =?us-ascii?Q?Z0djirk/Rt+kFb/OLe5FMAxM/qC7jU/CNFWpsML0ZS3I2ZsattMgojQM6VgI?= =?us-ascii?Q?ATfI9QCF9vgaBGi1E1oCbf8b9EGt?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +WTlgrSql9wMIKK89cGE2IvLs7qyY2ZWiQpJn9Ui65qHz5Ft0AfmFp8laO55oyCs5Sy3F18zmf52+SKwzEh4z1W5Ij+yHq9QGatRkSkcSfDP+0N6QXfwCxLs64U9fFdTTfloLuY84vuzM3PWIaKa9ry/bp5MDVp1b5TFoecxX1k8ve2i420JHm7DU1GdYxqVIch2UbYgG11bDZSgKdK3PVwlRYdkjHzJK7RjOwLaL5lZIq/OWmYN2MvDdEodh+QPBfZAhKOFxy/qam4RF6KrOlTo8AVO5CZPUXzTKG5LTtJkX8HBeDNX72nfpEthBu0QSOtBLrJ3XVt3irj7svDaDpIlo8r7lWi7QteCLRnelGaSKdgGFYThOW7EfNj7865u93g+spGbT6zlOja8YfNwgLRXX1ICh46nbukPXTZ+XvUN7hS/3HEAukB0iWT+AeFUGdOdzFTtvaY707QrMarQi8/ail++dDyBAk+gEzqFXirS/mAq3RpxgZ9OmCGj445b02rxSfn/mK9qRE8xhACKd7VmtJ3M77KJ7CxbVHMmcR/nhcR358Df60SGi7RV2Qk/Fwq3QnPWpcBS6cx6LmPc5iqnO9+jbi/Iqu8eLZtwJELveQoe+oJdJPoDyArA6rHgmz/PnokM176SEkCSMYJxzSJ3jLhqNtX2+pDHe5KoKuQ= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:14:26.9515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61bb63cc-1963-4409-ac89-08dce935d993 X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000B61B.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1234 X-BESS-ID: 1728569670-305168-12640-25851-1 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.18.110 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoYGhuaWhkB2BlDYIsnI0sgsxS wp2TLRzNzMMDk1ycDMzCLNICnVPNXMwlKpNhYAsJFvEUMAAAA= X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259630 [from cloudscan17-87.eu-central-1b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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 From: Danylo Vodopianov Add suffixes logging Fix the issue with the configuration log level for a specific module Fix extended debug logging 3-letter abbreviation for log type Update documentation new log modules were added Log level in functions that initialize feature operations was updated from INFO to DEBUG to avoid noisy traces during driver startup. log level for ops init was changed nim and PMD modules was replaced with NTNIC NIM module was replaced with NTNIC according to the ntnic log convention. Signed-off-by: Oleksandr Kolomeiets Signed-off-by: Danylo Vodopianov --- v2 * Update release notes * Modify logging with RTE_LOG_LINE v3 * Remove new line character from logs --- doc/guides/nics/ntnic.rst | 29 +++++ doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/adapter/nt4ga_adapter.c | 12 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 68 +++++----- drivers/net/ntnic/nim/i2c_nim.c | 24 ++-- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 12 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 30 ++--- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 120 +++++++++--------- drivers/net/ntnic/nthw/core/nthw_fpga.c | 36 +++--- drivers/net/ntnic/nthw/core/nthw_gpio_phy.c | 2 +- drivers/net/ntnic/nthw/core/nthw_hif.c | 6 +- drivers/net/ntnic/nthw/core/nthw_iic.c | 28 ++-- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 16 +-- drivers/net/ntnic/nthw/core/nthw_pcie3.c | 4 +- drivers/net/ntnic/nthw/core/nthw_sdc.c | 2 +- drivers/net/ntnic/nthw/core/nthw_si5340.c | 10 +- .../net/ntnic/nthw/model/nthw_fpga_model.c | 22 ++-- drivers/net/ntnic/nthw/nthw_rac.c | 48 +++---- drivers/net/ntnic/ntlog/ntlog.c | 2 - drivers/net/ntnic/ntlog/ntlog.h | 61 ++++++--- drivers/net/ntnic/ntnic_ethdev.c | 93 +++++++------- drivers/net/ntnic/ntnic_vfio.c | 28 ++-- drivers/net/ntnic/ntutil/nt_util.c | 12 +- 23 files changed, 361 insertions(+), 305 deletions(-) diff --git a/doc/guides/nics/ntnic.rst b/doc/guides/nics/ntnic.rst index 88d95832e5..7ac92c891c 100644 --- a/doc/guides/nics/ntnic.rst +++ b/doc/guides/nics/ntnic.rst @@ -49,3 +49,32 @@ which is required for the PMD to use vfio-pci on the PF. This support has been back-ported to older Linux distributions and they are also supported. If vfio-pci is not required, kernel version 4.18 is supported. + + +Logging and Debugging +--------------------- + +NTNIC supports several groups of logging that can be enabled with ``--log-level`` +parameter: + +- NTNIC. + + Logging info from the main PMD code. i.e. code that is related to DPDK:: + + --log-level=pmd.net.ntnic.ntnic,8 + +- NTHW. + + Logging info from NTHW. i.e. code that is related to the FPGA and the Adapter:: + + --log-level=pmd.net.ntnic.nthw,8 + +- FILTER. + + Logging info from filter. i.e. code that is related to the binary filter:: + + --log-level=pmd.net.ntnic.filter,8 + +To enable logging on all levels use wildcard in the following way:: + + --log-level=pmd.net.ntnic.*,8 diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index c808639ee9..a126dcfcb9 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -103,6 +103,7 @@ New Features * Update supported version of the FPGA to 9563.55.49 * Fix Coverity issues * Fix issues related to release 24.07 + * Extended and fixed the implementation of the logging Removed Items ------------- diff --git a/drivers/net/ntnic/adapter/nt4ga_adapter.c b/drivers/net/ntnic/adapter/nt4ga_adapter.c index b704a256c6..b6043d9f0f 100644 --- a/drivers/net/ntnic/adapter/nt4ga_adapter.c +++ b/drivers/net/ntnic/adapter/nt4ga_adapter.c @@ -107,7 +107,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) PCIIDENT_TO_BUSNR(p_adapter_info->fpga_info.pciident), PCIIDENT_TO_DEVNR(p_adapter_info->fpga_info.pciident), PCIIDENT_TO_FUNCNR(p_adapter_info->fpga_info.pciident)); - NT_LOG(DBG, NTNIC, "%s: (0x%08X)\n", p_dev_name, + NT_LOG(DBG, NTNIC, "%s: (0x%08X)", p_dev_name, p_adapter_info->fpga_info.pciident); } @@ -121,7 +121,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) PCIIDENT_TO_BUSNR(p_adapter_info->fpga_info.pciident), PCIIDENT_TO_DEVNR(p_adapter_info->fpga_info.pciident), PCIIDENT_TO_FUNCNR(p_adapter_info->fpga_info.pciident)); - NT_LOG(DBG, NTNIC, "%s: %s\n", p_adapter_id_str, p_dev_name); + NT_LOG(DBG, NTNIC, "%s: %s", p_adapter_id_str, p_dev_name); } { @@ -142,7 +142,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) res = nthw_fpga_init(&p_adapter_info->fpga_info); if (res) { - NT_LOG_DBGX(ERR, NTNIC, "%s: %s: FPGA=%04d res=x%08X\n", p_adapter_id_str, + NT_LOG_DBGX(ERR, NTNIC, "%s: %s: FPGA=%04d res=x%08X", p_adapter_id_str, p_dev_name, fpga_info->n_fpga_prod_id, res); return res; } @@ -171,7 +171,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) link_ops = get_100g_link_ops(); if (link_ops == NULL) { - NT_LOG(ERR, NTNIC, "NT200A02 100G link module uninitialized\n"); + NT_LOG(ERR, NTNIC, "NT200A02 100G link module uninitialized"); res = -1; break; } @@ -180,14 +180,14 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) break; default: - NT_LOG(ERR, NTNIC, "Unsupported FPGA product: %04d\n", + NT_LOG(ERR, NTNIC, "Unsupported FPGA product: %04d", fpga_info->n_fpga_prod_id); res = -1; break; } if (res) { - NT_LOG_DBGX(ERR, NTNIC, "%s: %s: FPGA=%04d res=x%08X\n", + NT_LOG_DBGX(ERR, NTNIC, "%s: %s: FPGA=%04d res=x%08X", p_adapter_id_str, p_dev_name, fpga_info->n_fpga_prod_id, res); return res; diff --git a/drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c b/drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c index 8f0afa1f60..8964458b47 100644 --- a/drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +++ b/drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c @@ -66,7 +66,7 @@ static void _set_loopback(struct adapter_info_s *p_adapter_info, switch (mode) { case 1: - NT_LOG(INF, NTNIC, "%s: Applying host loopback\n", + NT_LOG(INF, NTNIC, "%s: Applying host loopback", p_adapter_info->mp_port_id_str[intf_no]); nthw_mac_pcs_set_fec(mac_pcs, true); nthw_mac_pcs_set_host_loopback(mac_pcs, true); @@ -74,7 +74,7 @@ static void _set_loopback(struct adapter_info_s *p_adapter_info, break; case 2: - NT_LOG(INF, NTNIC, "%s: Applying line loopback\n", + NT_LOG(INF, NTNIC, "%s: Applying line loopback", p_adapter_info->mp_port_id_str[intf_no]); nthw_mac_pcs_set_line_loopback(mac_pcs, true); break; @@ -82,13 +82,13 @@ static void _set_loopback(struct adapter_info_s *p_adapter_info, default: switch (last_mode) { case 1: - NT_LOG(INF, NTNIC, "%s: Removing host loopback\n", + NT_LOG(INF, NTNIC, "%s: Removing host loopback", p_adapter_info->mp_port_id_str[intf_no]); nthw_mac_pcs_set_host_loopback(mac_pcs, false); break; case 2: - NT_LOG(INF, NTNIC, "%s: Removing line loopback\n", + NT_LOG(INF, NTNIC, "%s: Removing line loopback", p_adapter_info->mp_port_id_str[intf_no]); nthw_mac_pcs_set_line_loopback(mac_pcs, false); break; @@ -166,7 +166,7 @@ static int _link_state_build(adapter_info_t *drv, nthw_mac_pcs_t *mac_pcs, snprintf(lsbuf[adapter_no][port], sizeof(lsbuf[adapter_no][port]), "%s", buf); lsbuf[adapter_no][port][sizeof(lsbuf[adapter_no][port]) - 1U] = '\0'; - NT_LOG(DBG, NTNIC, "%s\n", lsbuf[adapter_no][port]); + NT_LOG(DBG, NTNIC, "%s", lsbuf[adapter_no][port]); } } return 0; @@ -268,7 +268,7 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable) * Check NIM is present before doing GPIO PHY reset. */ if (!_nim_is_present(gpio_phy, (uint8_t)port)) { - NT_LOG(INF, NTNIC, "%s: NIM module is absent\n", drv->mp_port_id_str[port]); + NT_LOG(INF, NTNIC, "%s: NIM module is absent", drv->mp_port_id_str[port]); return 0; } @@ -281,7 +281,7 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable) /* * Perform PHY reset. */ - NT_LOG(DBG, NTNIC, "%s: Performing NIM reset\n", drv->mp_port_id_str[port]); + NT_LOG(DBG, NTNIC, "%s: Performing NIM reset", drv->mp_port_id_str[port]); nthw_gpio_phy_set_reset(gpio_phy, (uint8_t)port, true); nt_os_wait_usec(100000);/* pause 0.1s */ nthw_gpio_phy_set_reset(gpio_phy, (uint8_t)port, false); @@ -293,13 +293,13 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable) nt_os_wait_usec(1000000); /* pause 1.0s */ if (!_nim_is_present(gpio_phy, (uint8_t)port)) { - NT_LOG(DBG, NTNIC, "%s: NIM module is no longer absent!\n", + NT_LOG(DBG, NTNIC, "%s: NIM module is no longer absent!", drv->mp_port_id_str[port]); return -1; } if (!_nim_is_present(gpio_phy, (uint8_t)port)) { - NT_LOG(DBG, NTNIC, "%s: NIM module is no longer absent!\n", + NT_LOG(DBG, NTNIC, "%s: NIM module is no longer absent!", drv->mp_port_id_str[port]); return -1; } @@ -314,7 +314,7 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable) if (res) return res; - NT_LOG(DBG, NTHW, "%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'\n", + NT_LOG(DBG, NTHW, "%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'", drv->mp_port_id_str[port], nim_ctx->nim_id, nim_id_to_text(nim_ctx->nim_id), nim.br, nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no); @@ -322,19 +322,19 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable) * Does the driver support the NIM module type? */ if (nim_ctx->nim_id != valid_nim_id) { - NT_LOG(ERR, NTHW, "%s: The driver does not support the NIM module type %s\n", + NT_LOG(ERR, NTHW, "%s: The driver does not support the NIM module type %s", drv->mp_port_id_str[port], nim_id_to_text(nim_ctx->nim_id)); - NT_LOG(DBG, NTHW, "%s: The driver supports the NIM module type %s\n", + NT_LOG(DBG, NTHW, "%s: The driver supports the NIM module type %s", drv->mp_port_id_str[port], nim_id_to_text(valid_nim_id)); return -1; } if (enable) { - NT_LOG(DBG, NTNIC, "%s: De-asserting low power\n", drv->mp_port_id_str[port]); + NT_LOG(DBG, NTNIC, "%s: De-asserting low power", drv->mp_port_id_str[port]); nthw_gpio_phy_set_low_power(gpio_phy, (uint8_t)port, false); } else { - NT_LOG(DBG, NTNIC, "%s: Asserting low power\n", drv->mp_port_id_str[port]); + NT_LOG(DBG, NTNIC, "%s: Asserting low power", drv->mp_port_id_str[port]); nthw_gpio_phy_set_low_power(gpio_phy, (uint8_t)port, true); } @@ -398,9 +398,9 @@ static int _port_init(adapter_info_t *drv, nthw_fpga_t *fpga, int port) /* Phase 2. Pre-state machine (`setup` functions) */ /* 2.1) nt200a0x.cpp:Myport::setup() */ - NT_LOG(DBG, NTNIC, "%s: Setting up port %d\n", drv->mp_port_id_str[port], port); + NT_LOG(DBG, NTNIC, "%s: Setting up port %d", drv->mp_port_id_str[port], port); - NT_LOG(DBG, NTNIC, "%s: Port %d: PHY TX enable\n", drv->mp_port_id_str[port], port); + NT_LOG(DBG, NTNIC, "%s: Port %d: PHY TX enable", drv->mp_port_id_str[port], port); _enable_tx(drv, mac_pcs); _reset_rx(drv, mac_pcs); @@ -410,11 +410,11 @@ static int _port_init(adapter_info_t *drv, nthw_fpga_t *fpga, int port) res = _create_nim(drv, port, true); if (res) { - NT_LOG(WRN, NTNIC, "%s: NIM initialization failed\n", drv->mp_port_id_str[port]); + NT_LOG(WRN, NTNIC, "%s: NIM initialization failed", drv->mp_port_id_str[port]); return res; } - NT_LOG(DBG, NTNIC, "%s: NIM initialized\n", drv->mp_port_id_str[port]); + NT_LOG(DBG, NTNIC, "%s: NIM initialized", drv->mp_port_id_str[port]); /* 3.2) MyPort::nimReady() */ @@ -422,7 +422,7 @@ static int _port_init(adapter_info_t *drv, nthw_fpga_t *fpga, int port) /* Setting FEC resets the lane counter in one half of the GMF */ nthw_mac_pcs_set_fec(mac_pcs, true); - NT_LOG(DBG, NTNIC, "%s: Port %d: HOST FEC enabled\n", drv->mp_port_id_str[port], port); + NT_LOG(DBG, NTNIC, "%s: Port %d: HOST FEC enabled", drv->mp_port_id_str[port], port); if (adapter_id == NT_HW_ADAPTER_ID_NT200A02 || hw_id == 2) { const uint8_t pre = 5; @@ -435,7 +435,7 @@ static int _port_init(adapter_info_t *drv, nthw_fpga_t *fpga, int port) nthw_mac_pcs_set_gty_tx_tuning(mac_pcs, lane, pre, diff, post); } else { - NT_LOG(ERR, NTNIC, "Unhandled AdapterId/HwId: %02x_hwid%d\n", adapter_id, hw_id); + NT_LOG(ERR, NTNIC, "Unhandled AdapterId/HwId: %02x_hwid%d", adapter_id, hw_id); assert(0); } @@ -482,7 +482,7 @@ static int _common_ptp_nim_state_machine(void *data) nthw_gpio_phy_t *gpio_phy; if (!fpga) { - NT_LOG(ERR, NTNIC, "%s: fpga is NULL\n", drv->mp_adapter_id_str); + NT_LOG(ERR, NTNIC, "%s: fpga is NULL", drv->mp_adapter_id_str); goto NT4GA_LINK_100G_MON_EXIT; } @@ -496,7 +496,7 @@ static int _common_ptp_nim_state_machine(void *data) memset(last_lpbk_mode, 0, sizeof(last_lpbk_mode)); if (monitor_task_is_running[adapter_no]) - NT_LOG(DBG, NTNIC, "%s: link state machine running...\n", drv->mp_adapter_id_str); + NT_LOG(DBG, NTNIC, "%s: link state machine running...", drv->mp_adapter_id_str); while (monitor_task_is_running[adapter_no]) { int i; @@ -522,14 +522,14 @@ static int _common_ptp_nim_state_machine(void *data) reported_link[i] = false; /* Turn off laser and LED, etc. */ (void)_create_nim(drv, i, false); - NT_LOG(DBG, NTNIC, "%s: Port %i is disabled\n", + NT_LOG(DBG, NTNIC, "%s: Port %i is disabled", drv->mp_port_id_str[i], i); continue; } if (enable_port) { link_state[i].link_disabled = false; - NT_LOG(DBG, NTNIC, "%s: Port %i is enabled\n", + NT_LOG(DBG, NTNIC, "%s: Port %i is enabled", drv->mp_port_id_str[i], i); } @@ -546,7 +546,7 @@ static int _common_ptp_nim_state_machine(void *data) _port_init(drv, fpga, i); } - NT_LOG(INF, NTNIC, "%s: Loopback mode changed=%u\n", + NT_LOG(INF, NTNIC, "%s: Loopback mode changed=%u", drv->mp_port_id_str[i], link_info->port_action[i].port_lpbk_mode); _set_loopback(drv, @@ -567,7 +567,7 @@ static int _common_ptp_nim_state_machine(void *data) if (!new_link_state.nim_present) { if (link_state[i].nim_present) { - NT_LOG(INF, NTNIC, "%s: NIM module removed\n", + NT_LOG(INF, NTNIC, "%s: NIM module removed", drv->mp_port_id_str[i]); } @@ -579,25 +579,25 @@ static int _common_ptp_nim_state_machine(void *data) if (new_link_state.lh_nim_absent || !link_state[i].nim_present) { sfp_nim_state_t new_state; - NT_LOG(DBG, NTNIC, "%s: NIM module inserted\n", + NT_LOG(DBG, NTNIC, "%s: NIM module inserted", drv->mp_port_id_str[i]); if (_port_init(drv, fpga, i)) { NT_LOG(ERR, NTNIC, - "%s: Failed to initialize NIM module\n", + "%s: Failed to initialize NIM module", drv->mp_port_id_str[i]); continue; } if (nim_state_build(&nim_ctx[i], &new_state)) { - NT_LOG(ERR, NTNIC, "%s: Cannot read basic NIM data\n", + NT_LOG(ERR, NTNIC, "%s: Cannot read basic NIM data", drv->mp_port_id_str[i]); continue; } assert(new_state.br); /* Cannot be zero if NIM is present */ NT_LOG(DBG, NTNIC, - "%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'\n", + "%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'", drv->mp_port_id_str[i], nim_ctx->nim_id, nim_id_to_text(nim_ctx->nim_id), (unsigned int)new_state.br, nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no); @@ -605,13 +605,13 @@ static int _common_ptp_nim_state_machine(void *data) (void)_link_state_build(drv, &mac_pcs[i], &gpio_phy[i], i, &link_state[i], is_port_disabled); - NT_LOG(DBG, NTNIC, "%s: NIM module initialized\n", + NT_LOG(DBG, NTNIC, "%s: NIM module initialized", drv->mp_port_id_str[i]); continue; } if (reported_link[i] != new_link_state.link_up) { - NT_LOG(INF, NTNIC, "%s: link is %s\n", drv->mp_port_id_str[i], + NT_LOG(INF, NTNIC, "%s: link is %s", drv->mp_port_id_str[i], (new_link_state.link_up ? "up" : "down")); link_info->link_info[i].link_speed = (new_link_state.link_up ? NT_LINK_SPEED_100G @@ -629,7 +629,7 @@ static int _common_ptp_nim_state_machine(void *data) NT4GA_LINK_100G_MON_EXIT: - NT_LOG(DBG, NTNIC, "%s: Stopped NT4GA 100 Gbps link monitoring thread.\n", + NT_LOG(DBG, NTNIC, "%s: Stopped NT4GA 100 Gbps link monitoring thread.", drv->mp_adapter_id_str); return 0; @@ -656,7 +656,7 @@ static int nt4ga_link_100g_ports_init(struct adapter_info_s *p_adapter_info, nth const int nb_ports = fpga_info->n_phy_ports; int res = 0; - NT_LOG(DBG, NTNIC, "%s: Initializing ports\n", p_adapter_info->mp_adapter_id_str); + NT_LOG(DBG, NTNIC, "%s: Initializing ports", p_adapter_info->mp_adapter_id_str); /* * Initialize global variables diff --git a/drivers/net/ntnic/nim/i2c_nim.c b/drivers/net/ntnic/nim/i2c_nim.c index e6e256b062..e6f7755ded 100644 --- a/drivers/net/ntnic/nim/i2c_nim.c +++ b/drivers/net/ntnic/nim/i2c_nim.c @@ -28,7 +28,7 @@ static bool page_addressing(nt_nim_identifier_t id) return true; default: - NT_LOG(DBG, NTNIC, "Unknown NIM identifier %d\n", id); + NT_LOG(DBG, NTNIC, "Unknown NIM identifier %d", id); return false; } } @@ -160,14 +160,14 @@ static int nim_read_write_data_lin(nim_i2c_ctx_p ctx, bool m_page_addressing, ui if (use_page_select) { if (nim_setup_page(ctx, (uint8_t)((lin_addr / 128) - 1)) != 0) { NT_LOG(ERR, NTNIC, - "Cannot set up page for linear address %u\n", lin_addr); + "Cannot set up page for linear address %u", lin_addr); return -1; } } if (nim_read_write_i2c_data(ctx, do_write, lin_addr, i2c_addr, a_reg_addr, (uint8_t)seq_cnt, p_data) != 0) { - NT_LOG(ERR, NTNIC, " Call to nim_read_write_i2c_data failed\n"); + NT_LOG(ERR, NTNIC, " Call to nim_read_write_i2c_data failed"); return -1; } @@ -219,7 +219,7 @@ static int i2c_nim_common_construct(nim_i2c_ctx_p ctx) res = -1; if (res) { - NT_LOG(ERR, PMD, "Can't read NIM id."); + NT_LOG(ERR, NTNIC, "Can't read NIM id."); return res; } @@ -308,7 +308,7 @@ static int qsfp_nim_state_build(nim_i2c_ctx_t *ctx, sfp_nim_state_t *state) break; default: - NT_LOG(INF, NIM, "nim_id = %u is not an QSFP/QSFP+/QSFP28 module\n", ctx->nim_id); + NT_LOG(INF, NTNIC, "nim_id = %u is not an QSFP/QSFP+/QSFP28 module", ctx->nim_id); res = -1; } @@ -405,7 +405,7 @@ static int qsfpplus_read_basic_data(nim_i2c_ctx_t *ctx) uint16_t nim_units[5] = { 1000, 2, 1, 1, 1 }; /* QSFP MSA units in meters */ const char *yes_no[2] = { "No", "Yes" }; (void)yes_no; - NT_LOG(DBG, NTNIC, "Instance %d: NIM id: %s (%d)\n", ctx->instance, + NT_LOG(DBG, NTNIC, "Instance %d: NIM id: %s (%d)", ctx->instance, nim_id_to_text(ctx->nim_id), ctx->nim_id); /* Read DMI options */ @@ -415,12 +415,12 @@ static int qsfpplus_read_basic_data(nim_i2c_ctx_t *ctx) } ctx->avg_pwr = options & QSFP_DMI_AVG_PWR_BIT; - NT_LOG(DBG, NTNIC, "Instance %d: NIM options: (DMI: Yes, AvgPwr: %s)\n", ctx->instance, + NT_LOG(DBG, NTNIC, "Instance %d: NIM options: (DMI: Yes, AvgPwr: %s)", ctx->instance, yes_no[ctx->avg_pwr]); qsfp_read_vendor_info(ctx); - NT_LOG(DBG, PMD, - "Instance %d: NIM info: (Vendor: %s, PN: %s, SN: %s, Date: %s, Rev: %s)\n", + NT_LOG(DBG, NTNIC, + "Instance %d: NIM info: (Vendor: %s, PN: %s, SN: %s, Date: %s, Rev: %s)", ctx->instance, ctx->vendor_name, ctx->prod_no, ctx->serial_no, ctx->date, ctx->rev); if (nim_read_write_data_lin(ctx, pg_addr, QSFP_SUP_LEN_INFO_LIN_ADDR, sizeof(nim_len_info), @@ -540,7 +540,7 @@ static bool qsfp28_is_rate_selection_enabled(nim_i2c_ctx_p ctx) (read_byte(ctx, enh_options_reg_addr) >> 2) & 0x03; /* bit 3..2 */ if (rate_select_type != 2) { - NT_LOG(DBG, PMD, "NIM has unhandled rate select type (%d)", rate_select_type); + NT_LOG(DBG, NTNIC, "NIM has unhandled rate select type (%d)", rate_select_type); return false; } @@ -548,7 +548,7 @@ static bool qsfp28_is_rate_selection_enabled(nim_i2c_ctx_p ctx) read_byte(ctx, ext_rate_select_compl_reg_addr) & 0x03; /* bit 1..0 */ if (ext_rate_select_ver != 0x02) { - NT_LOG(DBG, PMD, "NIM has unhandled extended rate select version (%d)", + NT_LOG(DBG, NTNIC, "NIM has unhandled extended rate select version (%d)", ext_rate_select_ver); return false; } @@ -790,7 +790,7 @@ int construct_and_preinit_nim(nim_i2c_ctx_p ctx, void *extra) default: res = 1; - NT_LOG(ERR, NTHW, "NIM type %s is not supported.\n", nim_id_to_text(ctx->nim_id)); + NT_LOG(ERR, NTHW, "NIM type %s is not supported.", nim_id_to_text(ctx->nim_id)); } return res; diff --git a/drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c b/drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c index 3009e30670..670bbd3f7e 100644 --- a/drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +++ b/drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c @@ -18,7 +18,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info) const struct rst_nt200a0x_ops *rst_nt200a0x_ops = get_rst_nt200a0x_ops(); if (rst_nt200a0x_ops == NULL) { - NT_LOG(ERR, NTHW, "RST NT200A0X NOT INCLUDED\n"); + NT_LOG(ERR, NTHW, "RST NT200A0X NOT INCLUDED"); return -1; } @@ -26,7 +26,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info) res = rst_nt200a0x_ops->nthw_fpga_rst_nt200a0x_init(p_fpga_info, &rst); if (res) { - NT_LOG_DBGX(ERR, NTHW, "%s: FPGA=%04d res=%d\n", p_adapter_id_str, + NT_LOG_DBGX(ERR, NTHW, "%s: FPGA=%04d res=%d", p_adapter_id_str, p_fpga_info->n_fpga_prod_id, res); return res; } @@ -46,20 +46,20 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info) break; default: - NT_LOG(ERR, NTHW, "%s: Unsupported FPGA product: %04d\n", p_adapter_id_str, + NT_LOG(ERR, NTHW, "%s: Unsupported FPGA product: %04d", p_adapter_id_str, p_fpga_info->n_fpga_prod_id); res = -1; break; } if (!included) { - NT_LOG(ERR, NTHW, "%s: NOT INCLUDED FPGA product: %04d\n", p_adapter_id_str, + NT_LOG(ERR, NTHW, "%s: NOT INCLUDED FPGA product: %04d", p_adapter_id_str, p_fpga_info->n_fpga_prod_id); res = -1; } if (res) { - NT_LOG_DBGX(ERR, NTHW, "%s: FPGA=%04d res=%d\n", p_adapter_id_str, + NT_LOG_DBGX(ERR, NTHW, "%s: FPGA=%04d res=%d", p_adapter_id_str, p_fpga_info->n_fpga_prod_id, res); return res; } @@ -71,6 +71,6 @@ static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpga void nt200a0x_ops_init(void) { - NT_LOG(INF, NTHW, "NT200A0X OPS INIT\n"); + NT_LOG(DBG, NTHW, "NT200A0X OPS INIT"); register_nt200a0x_ops(&nt200a0x_ops); } diff --git a/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c b/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c index 380f877096..319b7bde52 100644 --- a/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +++ b/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c @@ -26,20 +26,20 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mn_fpga_version = n_fpga_version; p->mn_fpga_revision = n_fpga_revision; - NT_LOG_DBGX(DEBUG, NTHW, "%s: FPGA reset setup: FPGA %04d-%02d-%02d\n", p_adapter_id_str, + NT_LOG_DBGX(DBG, NTHW, "%s: FPGA reset setup: FPGA %04d-%02d-%02d", p_adapter_id_str, n_fpga_product_id, n_fpga_version, n_fpga_revision); p_mod_rst = nthw_fpga_query_module(p_fpga, MOD_RST9563, 0); if (p_mod_rst == NULL) { - NT_LOG(ERR, NTHW, "%s: RST %d: no such instance\n", p_adapter_id_str, 0); + NT_LOG(ERR, NTHW, "%s: RST %d: no such instance", p_adapter_id_str, 0); return -1; } p_mod_rst = nthw_fpga_query_module(p_fpga, MOD_RST9563, 0); if (p_mod_rst == NULL) { - NT_LOG(ERR, NTHW, "%s: RST %d: no such instance\n", p_adapter_id_str, 0); + NT_LOG(ERR, NTHW, "%s: RST %d: no such instance", p_adapter_id_str, 0); return -1; } @@ -70,10 +70,10 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mp_fld_rst_tmc = nthw_register_query_field(p_curr_reg, RST9563_RST_TMC); if (!p->mp_fld_rst_tsm_ref_mmcm) - NT_LOG(DBG, NTHW, "%s: No RST9563_RST_TSM_REF_MMCM found\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: No RST9563_RST_TSM_REF_MMCM found", p_adapter_id_str); if (!p->mp_fld_rst_tmc) - NT_LOG(DBG, NTHW, "%s: No RST9563_RST_TMC found\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: No RST9563_RST_TMC found", p_adapter_id_str); nthw_register_update(p_curr_reg); @@ -105,7 +105,7 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mp_fld_stat_tsm_ref_mmcm_locked = NULL; /* Field not present on 9563 */ if (!p->mp_fld_stat_tsm_ref_mmcm_locked) { - NT_LOG(DBG, NTHW, "%s: No RST9563_STAT_TSM_REF_MMCM_LOCKED found\n", + NT_LOG(DBG, NTHW, "%s: No RST9563_STAT_TSM_REF_MMCM_LOCKED found", p_adapter_id_str); } @@ -127,7 +127,7 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mp_fld_sticky_tsm_ref_mmcm_unlocked = NULL; /* Field not present on 9563 */ if (!p->mp_fld_sticky_tsm_ref_mmcm_unlocked) { - NT_LOG(DBG, NTHW, "%s: No RST9563_STICKY_TSM_REF_MMCM_UNLOCKED found\n", + NT_LOG(DBG, NTHW, "%s: No RST9563_STICKY_TSM_REF_MMCM_UNLOCKED found", p_adapter_id_str); } @@ -151,7 +151,7 @@ static int nthw_fpga_rst9563_periph_reset(nthw_fpga_t *p_fpga) if (p_mod_rst) { nthw_register_t *p_reg_rst; nthw_field_t *p_fld_rst_periph; - NT_LOG(DBG, NTHW, "%s: PERIPH RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: PERIPH RST", p_adapter_id_str); p_reg_rst = nthw_module_get_register(p_mod_rst, RST9563_RST); p_fld_rst_periph = nthw_register_get_field(p_reg_rst, RST9563_RST_PERIPH); nthw_field_set_flush(p_fld_rst_periph); @@ -174,7 +174,7 @@ static int nthw_fpga_rst9563_clock_synth_init(nthw_fpga_t *p_fpga, const struct clk9563_ops *clk9563_ops = get_clk9563_ops(); if (clk9563_ops == NULL) { - NT_LOG(INF, NTNIC, "CLK9563 module not included\n"); + NT_LOG(INF, NTNIC, "CLK9563 module not included"); return -1; } @@ -184,7 +184,7 @@ static int nthw_fpga_rst9563_clock_synth_init(nthw_fpga_t *p_fpga, *clk9563_ops->get_n_data_9563_si5340_nt200a02_u23_v5()); } else { - NT_LOG(ERR, NTHW, "%s: Fpga %d: Unsupported clock synth model (%d)\n", + NT_LOG(ERR, NTHW, "%s: Fpga %d: Unsupported clock synth model (%d)", p_adapter_id_str, n_fpga_product_id, n_si_labs_clock_synth_model); res = -1; } @@ -212,7 +212,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, res = nthw_fpga_rst9563_periph_reset(p_fpga); if (res) { - NT_LOG_DBGX(DEBUG, NTHW, "%s: ERROR: res=%d\n", p_adapter_id_str, res); + NT_LOG_DBGX(DBG, NTHW, "%s: ERROR: res=%d", p_adapter_id_str, res); return res; } @@ -220,14 +220,14 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, n_si_labs_clock_synth_i2c_addr); if (res) { - NT_LOG_DBGX(DEBUG, NTHW, "%s: ERROR: res=%d\n", p_adapter_id_str, res); + NT_LOG_DBGX(DBG, NTHW, "%s: ERROR: res=%d", p_adapter_id_str, res); return res; } res = nthw_fpga_rst9563_setup(p_fpga, p_rst); if (res) { - NT_LOG_DBGX(DEBUG, NTHW, "%s: ERROR: res=%d\n", p_adapter_id_str, res); + NT_LOG_DBGX(DBG, NTHW, "%s: ERROR: res=%d", p_adapter_id_str, res); return res; } @@ -235,7 +235,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, res = rst_ops != NULL ? rst_ops->nthw_fpga_rst_nt200a0x_reset(p_fpga, p_rst) : -1; if (res) { - NT_LOG_DBGX(DEBUG, NTHW, "%s: ERROR: res=%d\n", p_adapter_id_str, res); + NT_LOG_DBGX(DBG, NTHW, "%s: ERROR: res=%d", p_adapter_id_str, res); return res; } @@ -246,6 +246,6 @@ static struct rst9563_ops rst9563_ops = { .nthw_fpga_rst9563_init = nthw_fpga_rs void rst9563_ops_init(void) { - NT_LOG(INF, NTHW, "RST9563 OPS INIT\n"); + NT_LOG(DBG, NTHW, "RST9563 OPS INIT"); register_rst9563_ops(&rst9563_ops); } diff --git a/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c b/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c index aa0d97dafd..d35618c6ba 100644 --- a/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +++ b/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c @@ -25,7 +25,7 @@ static int nthw_fpga_rst_nt200a0x_wait_ddr4_pll_locked(nthw_fpga_t *p_fpga, uint32_t retrycount = 5; uint32_t timeout = 50000; /* initial timeout must be set to 5 sec. */ /* 14: wait until DDR4 PLL LOCKED */ - NT_LOG(DBG, NTHW, "%s: Waiting for DDR4 PLL to lock\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Waiting for DDR4 PLL to lock", p_adapter_id_str); /* * The following retry count gives a total timeout of 1 * 5 + 5 * 8 = 45sec @@ -39,11 +39,11 @@ static int nthw_fpga_rst_nt200a0x_wait_ddr4_pll_locked(nthw_fpga_t *p_fpga, break; } else { - NT_LOG(DBG, NTHW, "%s: Waiting for DDR4 PLL to lock - timeout\n", + NT_LOG(DBG, NTHW, "%s: Waiting for DDR4 PLL to lock - timeout", p_adapter_id_str); if (retrycount <= 0) { - NT_LOG(ERR, NTHW, "%s: Waiting for DDR4 PLL to lock failed (%d)\n", + NT_LOG(ERR, NTHW, "%s: Waiting for DDR4 PLL to lock failed (%d)", p_adapter_id_str, locked); break; } @@ -55,28 +55,28 @@ static int nthw_fpga_rst_nt200a0x_wait_ddr4_pll_locked(nthw_fpga_t *p_fpga, } } - NT_LOG(DBG, NTHW, "%s: Waiting for DDR4 MMCM to lock\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Waiting for DDR4 MMCM to lock", p_adapter_id_str); locked = nthw_field_wait_set_any32(p->mp_fld_stat_ddr4_mmcm_locked, -1, -1); if (locked != 0) { - NT_LOG(ERR, NTHW, "%s: Waiting for DDR4 MMCM to lock failed (%d)\n", + NT_LOG(ERR, NTHW, "%s: Waiting for DDR4 MMCM to lock failed (%d)", p_adapter_id_str, locked); return -1; } if (true && p->mp_fld_stat_tsm_ref_mmcm_locked) { - NT_LOG(DBG, NTHW, "%s: Waiting for TSM REF MMCM to lock\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Waiting for TSM REF MMCM to lock", p_adapter_id_str); locked = nthw_field_wait_set_any32(p->mp_fld_stat_tsm_ref_mmcm_locked, -1, -1); if (locked != 0) { - NT_LOG(ERR, NTHW, "%s: Waiting for TSM REF MMCM to lock failed (%d)\n", + NT_LOG(ERR, NTHW, "%s: Waiting for TSM REF MMCM to lock failed (%d)", p_adapter_id_str, locked); return -1; } } /* 10: Clear all MMCM/PLL lock sticky bits before testing them */ - NT_LOG(DBG, NTHW, "%s: Clear sticky MMCM unlock bits\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Clear sticky MMCM unlock bits", p_adapter_id_str); nthw_field_update_register(p->mp_fld_sticky_ptp_mmcm_unlocked); /* Clear all sticky bits */ nthw_field_set_flush(p->mp_fld_sticky_ptp_mmcm_unlocked); @@ -93,12 +93,12 @@ static int nthw_fpga_rst_nt200a0x_wait_ddr4_pll_locked(nthw_fpga_t *p_fpga, /* 11: Ensure sticky bits are not unlocked except PTP MMCM and TS MMCM */ if (nthw_field_get_updated(p->mp_fld_sticky_ddr4_mmcm_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_ddr4_mmcm_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_ddr4_mmcm_unlocked() returned true", p_adapter_id_str); } if (nthw_field_get_updated(p->mp_fld_sticky_ddr4_pll_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_ddr4_pll_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_ddr4_pll_unlocked() returned true", p_adapter_id_str); } @@ -127,7 +127,7 @@ static int nthw_fpga_rst_nt200a0x_wait_sdc_calibrated(nthw_fpga_t *p_fpga, res = nthw_sdc_init(p_nthw_sdc, p_fpga, 0); if (res) { - NT_LOG_DBGX(ERR, NTHW, "%s: SDC init failed: res=%d\n", + NT_LOG_DBGX(ERR, NTHW, "%s: SDC init failed: res=%d", p_adapter_id_str, res); nthw_sdc_delete(p_nthw_sdc); p_nthw_sdc = NULL; @@ -140,7 +140,7 @@ static int nthw_fpga_rst_nt200a0x_wait_sdc_calibrated(nthw_fpga_t *p_fpga, } } else { - NT_LOG(DBG, NTHW, "%s: No SDC found\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: No SDC found", p_adapter_id_str); } n_retry_cnt = 0; @@ -156,7 +156,7 @@ static int nthw_fpga_rst_nt200a0x_wait_sdc_calibrated(nthw_fpga_t *p_fpga, * Wait for SDRAM controller has been calibrated * On some adapters we have seen calibration time of 2.3 seconds */ - NT_LOG(DBG, NTHW, "%s: Waiting for SDRAM to calibrate\n", + NT_LOG(DBG, NTHW, "%s: Waiting for SDRAM to calibrate", p_adapter_id_str); res = nthw_sdc_wait_states(p_nthw_sdc, 10000, 1000); { @@ -165,7 +165,7 @@ static int nthw_fpga_rst_nt200a0x_wait_sdc_calibrated(nthw_fpga_t *p_fpga, nthw_sdc_get_states(p_nthw_sdc, &n_result_mask); (void)n_state_code; NT_LOG(DBG, NTHW, - "%s: SDRAM state=0x%08lX state_code=%d retry=%d code=%d\n", + "%s: SDRAM state=0x%08lX state_code=%d retry=%d code=%d", p_adapter_id_str, n_result_mask, n_state_code, n_retry_cnt, res); } @@ -180,13 +180,13 @@ static int nthw_fpga_rst_nt200a0x_wait_sdc_calibrated(nthw_fpga_t *p_fpga, (void)n_state_code; NT_LOG(DBG, NTHW, - "%s: SDRAM state=0x%08lX state_code=%d retry=%d code=%d\n", + "%s: SDRAM state=0x%08lX state_code=%d retry=%d code=%d", p_adapter_id_str, n_result_mask, n_state_code, n_retry_cnt, res); if (res != 0) { NT_LOG(ERR, NTHW, - "%s: Timeout waiting for SDRAM controller calibration\n", + "%s: Timeout waiting for SDRAM controller calibration", p_adapter_id_str); } } @@ -221,7 +221,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, int locked; int res = -1; - NT_LOG_DBGX(DEBUG, NTHW, "%s: FPGA reset sequence: FPGA %04d-%02d-%02d @ HWId%d\n", + NT_LOG_DBGX(DBG, NTHW, "%s: FPGA reset sequence: FPGA %04d-%02d-%02d @ HWId%d", p_adapter_id_str, n_fpga_product_id, n_fpga_version, n_fpga_revision, n_hw_id); assert(n_fpga_product_id == p_fpga->mn_product_id); @@ -236,7 +236,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, * reset to defaults * 1: Reset all domains */ - NT_LOG(DBG, NTHW, "%s: RST defaults\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: RST defaults", p_adapter_id_str); nthw_field_update_register(p->mp_fld_rst_sys); nthw_field_set_flush(p->mp_fld_rst_sys); @@ -288,35 +288,35 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, * 2: Force use of 50 MHz reference clock for timesync; * NOTE: From 9508-05-18 this is a 20 MHz clock */ - NT_LOG(DBG, NTHW, "%s: Setting TS CLK SEL OVERRIDE\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Setting TS CLK SEL OVERRIDE", p_adapter_id_str); nthw_field_update_register(p->mp_fld_ctrl_ts_clk_sel_override); nthw_field_set_flush(p->mp_fld_ctrl_ts_clk_sel_override); - NT_LOG(DBG, NTHW, "%s: Setting TS CLK SEL\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Setting TS CLK SEL", p_adapter_id_str); nthw_field_update_register(p->mp_fld_ctrl_ts_clk_sel); nthw_field_set_flush(p->mp_fld_ctrl_ts_clk_sel); /* 4: De-assert sys reset, CORE and SYS MMCM resets */ - NT_LOG(DBG, NTHW, "%s: De-asserting SYS, CORE and SYS MMCM resets\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting SYS, CORE and SYS MMCM resets", p_adapter_id_str); nthw_field_update_register(p->mp_fld_rst_sys); nthw_field_clr_flush(p->mp_fld_rst_sys); nthw_field_clr_flush(p->mp_fld_rst_sys_mmcm); nthw_field_clr_flush(p->mp_fld_rst_core_mmcm); /* 5: wait until CORE MMCM and SYS MMCM are LOCKED */ - NT_LOG(DBG, NTHW, "%s: Waiting for SYS MMCM to lock\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Waiting for SYS MMCM to lock", p_adapter_id_str); locked = nthw_field_wait_set_any32(p->mp_fld_stat_sys_mmcm_locked, -1, -1); if (locked != 0) { - NT_LOG(ERR, NTHW, "%s: Waiting for SYS MMCM to lock failed (%d)\n", + NT_LOG(ERR, NTHW, "%s: Waiting for SYS MMCM to lock failed (%d)", p_adapter_id_str, locked); } - NT_LOG(DBG, NTHW, "%s: Waiting for CORE MMCM to lock\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Waiting for CORE MMCM to lock", p_adapter_id_str); locked = nthw_field_wait_set_any32(p->mp_fld_stat_core_mmcm_locked, -1, -1); if (locked != 0) { - NT_LOG(ERR, NTHW, "%s: Waiting for CORE MMCM to lock failed (%d)\n", + NT_LOG(ERR, NTHW, "%s: Waiting for CORE MMCM to lock failed (%d)", p_adapter_id_str, locked); } @@ -326,29 +326,29 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, */ { nthw_rac_t *p_nthw_rac = p_fpga_info->mp_nthw_rac; - NT_LOG(DBG, NTHW, "%s: De-asserting remaining RAB buses\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting remaining RAB buses", p_adapter_id_str); nthw_rac_rab_init(p_nthw_rac, 0); } if (true && p->mp_fld_rst_tsm_ref_mmcm) { - NT_LOG(DBG, NTHW, "%s: De-asserting TSM REF MMCM\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting TSM REF MMCM", p_adapter_id_str); nthw_field_clr_flush(p->mp_fld_rst_tsm_ref_mmcm); if (p->mp_fld_stat_tsm_ref_mmcm_locked) { - NT_LOG(DBG, NTHW, "%s: Waiting for TSM REF MMCM to lock\n", + NT_LOG(DBG, NTHW, "%s: Waiting for TSM REF MMCM to lock", p_adapter_id_str); locked = nthw_field_wait_set_any32(p->mp_fld_stat_tsm_ref_mmcm_locked, -1, -1); if (locked != 0) { NT_LOG(ERR, NTHW, - "%s: Waiting for TSM REF MMCM to lock failed (%d)\n", + "%s: Waiting for TSM REF MMCM to lock failed (%d)", p_adapter_id_str, locked); } } } - NT_LOG(DBG, NTHW, "%s: De-asserting all PHY resets\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting all PHY resets", p_adapter_id_str); nthw_field_update_register(p->mp_fld_rst_phy); nthw_field_clr_flush(p->mp_fld_rst_phy); @@ -356,27 +356,27 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, * 8: De-assert reset for remaining domains/modules resets except * TS, PTP, PTP_MMCM and TS_MMCM */ - NT_LOG(DBG, NTHW, "%s: De-asserting TMC RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting TMC RST", p_adapter_id_str); if (p->mp_fld_rst_tmc) { nthw_field_update_register(p->mp_fld_rst_tmc); nthw_field_clr_flush(p->mp_fld_rst_tmc); } - NT_LOG(DBG, NTHW, "%s: De-asserting RPP RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting RPP RST", p_adapter_id_str); nthw_field_update_register(p->mp_fld_rst_rpp); nthw_field_clr_flush(p->mp_fld_rst_rpp); - NT_LOG(DBG, NTHW, "%s: De-asserting DDR4 RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting DDR4 RST", p_adapter_id_str); nthw_field_update_register(p->mp_fld_rst_ddr4); nthw_field_clr_flush(p->mp_fld_rst_ddr4); - NT_LOG(DBG, NTHW, "%s: De-asserting SDC RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting SDC RST", p_adapter_id_str); nthw_field_update_register(p->mp_fld_rst_sdc); nthw_field_clr_flush(p->mp_fld_rst_sdc); /* NOTE: 9522 implements PHY10G_QPLL reset and lock at this stage in mac_rx_rst() */ - NT_LOG(DBG, NTHW, "%s: De-asserting MAC RX RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting MAC RX RST", p_adapter_id_str); if (p->mp_fld_rst_mac_rx) { nthw_field_update_register(p->mp_fld_rst_mac_rx); @@ -388,20 +388,20 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, if (res) { NT_LOG(ERR, NTHW, - "%s: nthw_fpga_rst_nt200a0x_wait_sdc_calibrated() returned true\n", + "%s: nthw_fpga_rst_nt200a0x_wait_sdc_calibrated() returned true", p_adapter_id_str); return -1; } if (nthw_field_get_updated(p->mp_fld_sticky_core_mmcm_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_core_mmcm_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_core_mmcm_unlocked() returned true", p_adapter_id_str); return -1; } if (p->mp_fld_sticky_pci_sys_mmcm_unlocked && nthw_field_get_updated(p->mp_fld_sticky_pci_sys_mmcm_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_pci_sys_mmcm_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_pci_sys_mmcm_unlocked() returned true", p_adapter_id_str); return -1; } @@ -410,19 +410,19 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, * Timesync/PTP reset sequence * De-assert TS_MMCM reset */ - NT_LOG(DBG, NTHW, "%s: De-asserting TS MMCM RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting TS MMCM RST", p_adapter_id_str); nthw_field_clr_flush(p->mp_fld_rst_ts_mmcm); /* Wait until TS_MMCM LOCKED (NT_RAB0_REG_P9508_RST9508_STAT_TS_MMCM_LOCKED=1); */ - NT_LOG(DBG, NTHW, "%s: Waiting for TS MMCM to lock\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Waiting for TS MMCM to lock", p_adapter_id_str); locked = nthw_field_wait_set_any32(p->mp_fld_stat_ts_mmcm_locked, -1, -1); if (locked != 0) { - NT_LOG(ERR, NTHW, "%s: Waiting for TS MMCM to lock failed (%d)\n", + NT_LOG(ERR, NTHW, "%s: Waiting for TS MMCM to lock failed (%d)", p_adapter_id_str, locked); } - NT_LOG(DBG, NTHW, "%s: Calling clear_sticky_mmcm_unlock_bits()\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Calling clear_sticky_mmcm_unlock_bits()", p_adapter_id_str); nthw_field_update_register(p->mp_fld_sticky_ptp_mmcm_unlocked); /* Clear all sticky bits */ nthw_field_set_flush(p->mp_fld_sticky_ptp_mmcm_unlocked); @@ -438,36 +438,36 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, nthw_field_set_flush(p->mp_fld_sticky_pci_sys_mmcm_unlocked); /* De-assert TS reset bit */ - NT_LOG(DBG, NTHW, "%s: De-asserting TS RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting TS RST", p_adapter_id_str); nthw_field_clr_flush(p->mp_fld_rst_ts); if (nthw_field_get_updated(p->mp_fld_sticky_ts_mmcm_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_ts_mmcm_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_ts_mmcm_unlocked() returned true", p_adapter_id_str); return -1; } if (nthw_field_get_updated(p->mp_fld_sticky_ddr4_mmcm_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_ddr4_mmcm_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_ddr4_mmcm_unlocked() returned true", p_adapter_id_str); return -1; } if (nthw_field_get_updated(p->mp_fld_sticky_ddr4_pll_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_ddr4_pll_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_ddr4_pll_unlocked() returned true", p_adapter_id_str); return -1; } if (nthw_field_get_updated(p->mp_fld_sticky_core_mmcm_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_core_mmcm_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_core_mmcm_unlocked() returned true", p_adapter_id_str); return -1; } if (p->mp_fld_sticky_pci_sys_mmcm_unlocked && nthw_field_get_updated(p->mp_fld_sticky_pci_sys_mmcm_unlocked)) { - NT_LOG(ERR, NTHW, "%s: get_sticky_pci_sys_mmcm_unlocked() returned true\n", + NT_LOG(ERR, NTHW, "%s: get_sticky_pci_sys_mmcm_unlocked() returned true", p_adapter_id_str); return -1; } @@ -475,37 +475,37 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga, if (false) { /* Deassert PTP_MMCM */ - NT_LOG(DBG, NTHW, "%s: De-asserting PTP MMCM RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting PTP MMCM RST", p_adapter_id_str); nthw_field_clr_flush(p->mp_fld_rst_ptp_mmcm); /* Switch PTP MMCM sel to use ptp clk */ - NT_LOG(DBG, NTHW, "%s: Setting PTP MMCM CLK SEL\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Setting PTP MMCM CLK SEL", p_adapter_id_str); nthw_field_set_flush(p->mp_fld_ctrl_ptp_mmcm_clk_sel); /* Wait until TS_MMCM LOCKED (NT_RAB0_REG_P9508_RST9508_STAT_TS_MMCM_LOCKED=1); */ - NT_LOG(DBG, NTHW, "%s: Waiting for TS MMCM to re-lock\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Waiting for TS MMCM to re-lock", p_adapter_id_str); locked = nthw_field_wait_set_any32(p->mp_fld_stat_ts_mmcm_locked, -1, -1); if (locked != 0) { - NT_LOG(ERR, NTHW, "%s: Waiting for TS MMCM to re-lock failed (%d)\n", + NT_LOG(ERR, NTHW, "%s: Waiting for TS MMCM to re-lock failed (%d)", p_adapter_id_str, locked); } } - NT_LOG(DBG, NTHW, "%s: De-asserting PTP RST\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: De-asserting PTP RST", p_adapter_id_str); nthw_field_clr_flush(p->mp_fld_rst_ptp); /* POWER staging introduced in 9508-05-09 and always for 9512 */ if (n_fpga_product_id == 9508 && n_fpga_version <= 5 && n_fpga_revision <= 8) { - NT_LOG(DBG, NTHW, "%s: No power staging\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: No power staging", p_adapter_id_str); } else { - NT_LOG(DBG, NTHW, "%s: Staging power\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Staging power", p_adapter_id_str); nthw_field_set_flush(p->mp_fld_power_pu_phy); /* PHY power up */ nthw_field_clr_flush(p->mp_fld_power_pu_nseb); /* NSEB power down */ } - NT_LOG_DBGX(DEBUG, NTHW, "%s END\n", p_adapter_id_str); + NT_LOG_DBGX(DBG, NTHW, "%s END", p_adapter_id_str); return 0; } @@ -523,7 +523,7 @@ static int nthw_fpga_rst_nt200a0x_init(struct fpga_info_s *p_fpga_info, p_fpga = p_fpga_info->mp_fpga; - NT_LOG_DBGX(DEBUG, NTHW, "%s: RAB init/reset\n", p_adapter_id_str); + NT_LOG_DBGX(DBG, NTHW, "%s: RAB init/reset", p_adapter_id_str); nthw_rac_rab_reset(p_fpga_info->mp_nthw_rac); nthw_rac_rab_setup(p_fpga_info->mp_nthw_rac); @@ -545,7 +545,7 @@ static int nthw_fpga_rst_nt200a0x_init(struct fpga_info_s *p_fpga_info, nthw_fpga_silabs_detect(p_fpga, 0, n_si_labs_clock_synth_i2c_addr, 255); if (n_si_labs_clock_synth_model == -1) { - NT_LOG(ERR, NTHW, "%s: Failed to detect clock synth model (%d)\n", + NT_LOG(ERR, NTHW, "%s: Failed to detect clock synth model (%d)", p_adapter_id_str, n_si_labs_clock_synth_model); return -1; } @@ -554,7 +554,7 @@ static int nthw_fpga_rst_nt200a0x_init(struct fpga_info_s *p_fpga_info, p_rst->mn_si_labs_clock_synth_model = n_si_labs_clock_synth_model; p_rst->mn_si_labs_clock_synth_i2c_addr = n_si_labs_clock_synth_i2c_addr; p_rst->mn_hw_id = p_fpga_info->nthw_hw_info.hw_id; - NT_LOG_DBGX(DEBUG, NTHW, "%s: Si%04d @ 0x%02x\n", p_adapter_id_str, + NT_LOG_DBGX(DBG, NTHW, "%s: Si%04d @ 0x%02x", p_adapter_id_str, p_rst->mn_si_labs_clock_synth_model, p_rst->mn_si_labs_clock_synth_i2c_addr); return res; @@ -568,6 +568,6 @@ static struct rst_nt200a0x_ops rst_nt200a0x_ops = { .nthw_fpga_rst_nt200a0x_init void rst_nt200a0x_ops_init(void) { - NT_LOG(INF, NTHW, "RST NT200A0X OPS INIT\n"); + NT_LOG(DBG, NTHW, "RST NT200A0X OPS INIT"); register_rst_nt200a0x_ops(&rst_nt200a0x_ops); } diff --git a/drivers/net/ntnic/nthw/core/nthw_fpga.c b/drivers/net/ntnic/nthw/core/nthw_fpga.c index 082d3950bb..9448c29de1 100644 --- a/drivers/net/ntnic/nthw/core/nthw_fpga.c +++ b/drivers/net/ntnic/nthw/core/nthw_fpga.c @@ -145,7 +145,7 @@ int nthw_fpga_silabs_detect(nthw_fpga_t *p_fpga, const int n_instance_no, const } } - NT_LOG(DBG, NTHW, "%s: %016" PRIX64 ": %d\n", p_adapter_id_str, ident, res); + NT_LOG(DBG, NTHW, "%s: %016" PRIX64 ": %d", p_adapter_id_str, ident, res); return res; } @@ -210,7 +210,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) "%04d-%04d-%02d-%02d", n_fpga_type_id, n_fpga_prod_id, n_fpga_ver_id, n_fpga_rev_id); - NT_LOG(INF, NTHW, "%s: FPGA %s (%" PRIX64 ") [%08X]\n", p_adapter_id_str, + NT_LOG(INF, NTHW, "%s: FPGA %s (%" PRIX64 ") [%08X]", p_adapter_id_str, s_fpga_prod_ver_rev_str, n_fpga_ident, n_fpga_build_time); } @@ -225,7 +225,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) p_fpga_info->mp_fpga = p_fpga; if (p_fpga == NULL) { - NT_LOG(ERR, NTHW, "%s: Unsupported FPGA: %s (%08X)\n", p_adapter_id_str, + NT_LOG(ERR, NTHW, "%s: Unsupported FPGA: %s (%08X)", p_adapter_id_str, s_fpga_prod_ver_rev_str, p_fpga_info->n_fpga_build_time); return -1; } @@ -238,20 +238,20 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) nthw_fpga_get_param_info(p_fpga_info, p_fpga); /* debug: report params */ - NT_LOG(DBG, NTHW, "%s: NT_NIMS=%d\n", p_adapter_id_str, p_fpga_info->n_nims); - NT_LOG(DBG, NTHW, "%s: NT_PHY_PORTS=%d\n", p_adapter_id_str, p_fpga_info->n_phy_ports); - NT_LOG(DBG, NTHW, "%s: NT_PHY_QUADS=%d\n", p_adapter_id_str, p_fpga_info->n_phy_quads); - NT_LOG(DBG, NTHW, "%s: NT_RX_PORTS=%d\n", p_adapter_id_str, p_fpga_info->n_rx_ports); - NT_LOG(DBG, NTHW, "%s: NT_TX_PORTS=%d\n", p_adapter_id_str, p_fpga_info->n_tx_ports); - NT_LOG(DBG, NTHW, "%s: nProfile=%d\n", p_adapter_id_str, (int)p_fpga_info->profile); - NT_LOG(DBG, NTHW, "%s: bHasMcu=%d\n", p_adapter_id_str, p_mcu_info->mb_has_mcu); - NT_LOG(DBG, NTHW, "%s: McuType=%d\n", p_adapter_id_str, p_mcu_info->mn_mcu_type); - NT_LOG(DBG, NTHW, "%s: McuDramSize=%d\n", p_adapter_id_str, p_mcu_info->mn_mcu_dram_size); + NT_LOG(DBG, NTHW, "%s: NT_NIMS=%d", p_adapter_id_str, p_fpga_info->n_nims); + NT_LOG(DBG, NTHW, "%s: NT_PHY_PORTS=%d", p_adapter_id_str, p_fpga_info->n_phy_ports); + NT_LOG(DBG, NTHW, "%s: NT_PHY_QUADS=%d", p_adapter_id_str, p_fpga_info->n_phy_quads); + NT_LOG(DBG, NTHW, "%s: NT_RX_PORTS=%d", p_adapter_id_str, p_fpga_info->n_rx_ports); + NT_LOG(DBG, NTHW, "%s: NT_TX_PORTS=%d", p_adapter_id_str, p_fpga_info->n_tx_ports); + NT_LOG(DBG, NTHW, "%s: nProfile=%d", p_adapter_id_str, (int)p_fpga_info->profile); + NT_LOG(DBG, NTHW, "%s: bHasMcu=%d", p_adapter_id_str, p_mcu_info->mb_has_mcu); + NT_LOG(DBG, NTHW, "%s: McuType=%d", p_adapter_id_str, p_mcu_info->mn_mcu_type); + NT_LOG(DBG, NTHW, "%s: McuDramSize=%d", p_adapter_id_str, p_mcu_info->mn_mcu_dram_size); p_nthw_rac = nthw_rac_new(); if (p_nthw_rac == NULL) { - NT_LOG(ERR, NTHW, "%s: Unsupported FPGA: RAC is not found: %s (%08X)\n", + NT_LOG(ERR, NTHW, "%s: Unsupported FPGA: RAC is not found: %s (%08X)", p_adapter_id_str, s_fpga_prod_ver_rev_str, p_fpga_info->n_fpga_build_time); return -1; } @@ -273,20 +273,20 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) break; default: - NT_LOG(ERR, NTHW, "%s: Unsupported HW product id: %d\n", p_adapter_id_str, + NT_LOG(ERR, NTHW, "%s: Unsupported HW product id: %d", p_adapter_id_str, p_fpga_info->n_nthw_adapter_id); res = -1; break; } if (!included) { - NT_LOG(ERR, NTHW, "%s: NOT INCLUDED HW product: %d\n", p_adapter_id_str, + NT_LOG(ERR, NTHW, "%s: NOT INCLUDED HW product: %d", p_adapter_id_str, p_fpga_info->n_nthw_adapter_id); res = -1; } if (res) { - NT_LOG(ERR, NTHW, "%s: status: 0x%08X\n", p_adapter_id_str, res); + NT_LOG(ERR, NTHW, "%s: status: 0x%08X", p_adapter_id_str, res); return res; } @@ -299,7 +299,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) res = nthw_pcie3_init(p_nthw_pcie3, p_fpga, 0); if (res == 0) { - NT_LOG(DBG, NTHW, "%s: Pcie3 module found\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Pcie3 module found", p_adapter_id_str); nthw_pcie3_trigger_sample_time(p_nthw_pcie3); } else { @@ -318,7 +318,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) res = nthw_hif_init(p_nthw_hif, p_fpga, 0); if (res == 0) { - NT_LOG(DBG, NTHW, "%s: Hif module found\n", p_adapter_id_str); + NT_LOG(DBG, NTHW, "%s: Hif module found", p_adapter_id_str); nthw_hif_trigger_sample_time(p_nthw_hif); } else { diff --git a/drivers/net/ntnic/nthw/core/nthw_gpio_phy.c b/drivers/net/ntnic/nthw/core/nthw_gpio_phy.c index 754a8ca5a4..29bdddb514 100644 --- a/drivers/net/ntnic/nthw/core/nthw_gpio_phy.c +++ b/drivers/net/ntnic/nthw/core/nthw_gpio_phy.c @@ -19,7 +19,7 @@ int nthw_gpio_phy_init(nthw_gpio_phy_t *p, nthw_fpga_t *p_fpga, int n_instance) return p_mod == NULL ? -1 : 0; if (p_mod == NULL) { - NT_LOG(ERR, NTHW, "%s: GPIO_PHY %d: no such instance\n", + NT_LOG(ERR, NTHW, "%s: GPIO_PHY %d: no such instance", p_fpga->p_fpga_info->mp_adapter_id_str, n_instance); return -1; } diff --git a/drivers/net/ntnic/nthw/core/nthw_hif.c b/drivers/net/ntnic/nthw/core/nthw_hif.c index cc2aaf83e4..9f699e4f94 100644 --- a/drivers/net/ntnic/nthw/core/nthw_hif.c +++ b/drivers/net/ntnic/nthw/core/nthw_hif.c @@ -39,7 +39,7 @@ int nthw_hif_init(nthw_hif_t *p, nthw_fpga_t *p_fpga, int n_instance) return mod == NULL ? -1 : 0; if (mod == NULL) { - NT_LOG(ERR, NTHW, "%s: HIF %d: no such instance\n", + NT_LOG(ERR, NTHW, "%s: HIF %d: no such instance", p_fpga->p_fpga_info->mp_adapter_id_str, n_instance); return -1; } @@ -76,10 +76,10 @@ int nthw_hif_init(nthw_hif_t *p, nthw_fpga_t *p_fpga, int n_instance) p->mn_fpga_id_build_no = nthw_field_get_updated(p->mp_fld_prod_id_msb_build_no); p->mn_fpga_id_item = nthw_field_get_updated(p->mp_fld_prod_id_msb_type_id); - NT_LOG(DBG, NTHW, "%s: HIF %d: %d-%d-%d-%d-%d\n", p_adapter_id_str, p->mn_instance, + NT_LOG(DBG, NTHW, "%s: HIF %d: %d-%d-%d-%d-%d", p_adapter_id_str, p->mn_instance, p->mn_fpga_id_item, p->mn_fpga_id_prod, p->mn_fpga_id_ver, p->mn_fpga_id_rev, p->mn_fpga_id_build_no); - NT_LOG(DBG, NTHW, "%s: HIF %d: HIF ref clock: %d Hz (%d ticks/ps)\n", p_adapter_id_str, + NT_LOG(DBG, NTHW, "%s: HIF %d: HIF ref clock: %d Hz (%d ticks/ps)", p_adapter_id_str, p->mn_instance, p->mn_fpga_hif_ref_clk_freq, p->mn_fpga_param_hif_per_ps); p->mp_reg_build_seed = NULL; /* Reg/Fld not present on HIF */ diff --git a/drivers/net/ntnic/nthw/core/nthw_iic.c b/drivers/net/ntnic/nthw/core/nthw_iic.c index 7f324dec78..269754c24a 100644 --- a/drivers/net/ntnic/nthw/core/nthw_iic.c +++ b/drivers/net/ntnic/nthw/core/nthw_iic.c @@ -161,7 +161,7 @@ int nthw_iic_init(nthw_iic_t *p, nthw_fpga_t *p_fpga, int n_iic_instance, return mod == NULL ? -1 : 0; if (mod == NULL) { - NT_LOG(ERR, NTHW, "%s: I2C %d: no such instance\n", p_adapter_id_str, + NT_LOG(ERR, NTHW, "%s: I2C %d: no such instance", p_adapter_id_str, n_iic_instance); return -1; } @@ -239,7 +239,7 @@ int nthw_iic_init(nthw_iic_t *p, nthw_fpga_t *p_fpga, int n_iic_instance, /* Setup controller timing */ if (p->mn_iic_cycle_time) { - NT_LOG(DBG, NTHW, "%s: I2C%d: cycletime=%d\n", p_adapter_id_str, + NT_LOG(DBG, NTHW, "%s: I2C%d: cycletime=%d", p_adapter_id_str, p->mn_iic_instance, p->mn_iic_cycle_time); nthw_iic_reg_set_timing(p, p->mn_iic_cycle_time); } @@ -284,7 +284,7 @@ int nthw_iic_read_data(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uint int retry = (p->mn_read_data_retry >= 0 ? p->mn_read_data_retry : 10); if (n_debug_mode == 0xff) { - NT_LOG(DBG, NTHW, "%s: adr=0x%2.2x, reg=%d, len=%d\n", p_adapter_id_str, dev_addr, + NT_LOG(DBG, NTHW, "%s: adr=0x%2.2x, reg=%d, len=%d", p_adapter_id_str, dev_addr, a_reg_addr, data_len); } @@ -293,18 +293,18 @@ int nthw_iic_read_data(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uint if (retry <= 0) { NT_LOG(ERR, NTHW, - "%s: I2C%d: Read retry exhausted (dev_addr=%d a_reg_addr=%d)\n", + "%s: I2C%d: Read retry exhausted (dev_addr=%d a_reg_addr=%d)", p_adapter_id_str, p->mn_iic_instance, dev_addr, a_reg_addr); return -1; } else { - NT_LOG(DBG, NTHW, "%s: I2C%d: Read retry=%d (dev_addr=%d a_reg_addr=%d)\n", + NT_LOG(DBG, NTHW, "%s: I2C%d: Read retry=%d (dev_addr=%d a_reg_addr=%d)", p_adapter_id_str, p->mn_iic_instance, retry, dev_addr, a_reg_addr); } } if (n_debug_mode == 0xff) { - NT_LOG(DBG, NTHW, "%s: adr=0x%2.2x, reg=%d, len=%d, retries remaining: %d\n", + NT_LOG(DBG, NTHW, "%s: adr=0x%2.2x, reg=%d, len=%d, retries remaining: %d", p_adapter_id_str, dev_addr, a_reg_addr, data_len, retry); } @@ -331,7 +331,7 @@ int nthw_iic_readbyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uint8 nthw_iic_reg_tx_fifo_write(p, a_reg_addr, 0, 1); if (!nthw_iic_bus_ready(p)) { - NT_LOG_DBGX(ERR, NTHW, "%s: error:\n", p_adapter_id_str); + NT_LOG_DBGX(ERR, NTHW, "%s: error:", p_adapter_id_str); return -1; } @@ -355,7 +355,7 @@ int nthw_iic_readbyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uint8 return 0; } else { - NT_LOG_DBGX(ERR, NTHW, "%s: error\n", p_adapter_id_str); + NT_LOG_DBGX(ERR, NTHW, "%s: error", p_adapter_id_str); return -1; } @@ -374,13 +374,13 @@ int nthw_iic_write_data(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uin if (retry <= 0) { NT_LOG(ERR, NTHW, - "%s: I2C%d: Write retry exhausted (dev_addr=%d a_reg_addr=%d)\n", + "%s: I2C%d: Write retry exhausted (dev_addr=%d a_reg_addr=%d)", p_adapter_id_str, p->mn_iic_instance, dev_addr, a_reg_addr); return -1; } else { NT_LOG(DBG, NTHW, - "%s: I2C%d: Write retry=%d (dev_addr=%d a_reg_addr=%d)\n", + "%s: I2C%d: Write retry=%d (dev_addr=%d a_reg_addr=%d)", p_adapter_id_str, p->mn_iic_instance, retry, dev_addr, a_reg_addr); } } @@ -422,11 +422,11 @@ int nthw_iic_writebyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uint nthw_iic_reg_tx_fifo_write(p, *p_byte, 0, 1); if (!nthw_iic_bus_ready(p)) { - NT_LOG_DBGX(WARNING, NTHW, "%s: warn: !busReady\n", p_adapter_id_str); + NT_LOG_DBGX(WRN, NTHW, "%s: warn: !busReady", p_adapter_id_str); while (true) if (nthw_iic_bus_ready(p)) { - NT_LOG_DBGX(DEBUG, NTHW, "%s: info: busReady\n", + NT_LOG_DBGX(DBG, NTHW, "%s: info: busReady", p_adapter_id_str); break; } @@ -435,7 +435,7 @@ int nthw_iic_writebyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uint return 0; } else { - NT_LOG_DBGX(WARNING, NTHW, "%s\n", p_adapter_id_str); + NT_LOG_DBGX(WRN, NTHW, "%s", p_adapter_id_str); return -1; } } @@ -508,7 +508,7 @@ int nthw_iic_scan_dev_addr(nthw_iic_t *p, int n_dev_addr, int n_reg_addr) if (res == 0) { NT_LOG(DBG, NTHW, - "%s: I2C%d: devaddr=0x%02X (%03d) regaddr=%02X val=%02X (%03d) res=%d\n", + "%s: I2C%d: devaddr=0x%02X (%03d) regaddr=%02X val=%02X (%03d) res=%d", p_adapter_id_str, p->mn_iic_instance, n_dev_addr, n_dev_addr, n_reg_addr, data_val, data_val, res); } diff --git a/drivers/net/ntnic/nthw/core/nthw_mac_pcs.c b/drivers/net/ntnic/nthw/core/nthw_mac_pcs.c index 398f4ffd15..d0fee5dcd0 100644 --- a/drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +++ b/drivers/net/ntnic/nthw/core/nthw_mac_pcs.c @@ -35,7 +35,7 @@ int nthw_mac_pcs_init(nthw_mac_pcs_t *p, nthw_fpga_t *p_fpga, int n_instance) return mod == NULL ? -1 : 0; if (mod == NULL) { - NT_LOG(ERR, NTHW, "%s: MAC_PCS %d: no such instance\n", + NT_LOG(ERR, NTHW, "%s: MAC_PCS %d: no such instance", p_fpga->p_fpga_info->mp_adapter_id_str, n_instance); return -1; } @@ -596,7 +596,7 @@ bool nthw_mac_pcs_reset_required(nthw_mac_pcs_t *p) void nthw_mac_pcs_set_fec(nthw_mac_pcs_t *p, bool enable) { - NT_LOG(DBG, NTHW, "Port %u: Set FEC: %u\n", p->m_port_no, enable); + NT_LOG(DBG, NTHW, "Port %u: Set FEC: %u", p->m_port_no, enable); nthw_field_get_updated(p->mp_field_fec_ctrl_reg_rs_fec_ctrl_in); @@ -646,12 +646,12 @@ void nthw_mac_pcs_reset_fec_counters(nthw_mac_pcs_t *p) nthw_register_update(p->mp_reg_fec_ucw_cnt); if (nthw_field_get_val32(p->mp_field_fec_cw_cnt_cw_cnt)) { - NT_LOG(DBG, NTHW, "Port %u: FEC_CW_CNT: %u\n", p->m_port_no, + NT_LOG(DBG, NTHW, "Port %u: FEC_CW_CNT: %u", p->m_port_no, nthw_field_get_val32(p->mp_field_fec_cw_cnt_cw_cnt)); } if (nthw_field_get_val32(p->mp_field_fec_ucw_cnt_ucw_cnt)) { - NT_LOG(DBG, NTHW, "Port %u: FEC_UCW_CNT: %u\n", p->m_port_no, + NT_LOG(DBG, NTHW, "Port %u: FEC_UCW_CNT: %u", p->m_port_no, nthw_field_get_val32(p->mp_field_fec_ucw_cnt_ucw_cnt)); } } @@ -735,7 +735,7 @@ void nthw_mac_pcs_set_gty_tx_tuning(nthw_mac_pcs_t *p, uint8_t lane, uint8_t tx_ } NT_LOG(DBG, NTHW, - "Port %u, lane %u: GTY tx_pre_csr: %d, tx_diff_ctl: %d, tx_post_csr: %d\n", + "Port %u, lane %u: GTY tx_pre_csr: %d, tx_diff_ctl: %d, tx_post_csr: %d", p->m_port_no, lane, tx_pre_csr, tx_diff_ctl, tx_post_csr); } @@ -768,7 +768,7 @@ void nthw_mac_pcs_set_receiver_equalization_mode(nthw_mac_pcs_t *p, uint8_t mode nthw_field_set_val32(p->mp_field_gty_ctl_rx_equa_rst2, 0); nthw_field_set_val_flush32(p->mp_field_gty_ctl_rx_equa_rst3, 0); - NT_LOG(DBG, NTHW, "Port %u: GTY receiver mode: %s\n", p->m_port_no, + NT_LOG(DBG, NTHW, "Port %u: GTY receiver mode: %s", p->m_port_no, (mode == c_mac_pcs_receiver_mode_dfe ? "DFE" : "LPM")); } @@ -794,7 +794,7 @@ void nthw_mac_pcs_swap_gty_tx_polarity(nthw_mac_pcs_t *p, uint8_t lane, bool swa break; } - NT_LOG(DBG, NTHW, "Port %u: set GTY Tx lane (%d) polarity: %d\n", p->m_port_no, lane, + NT_LOG(DBG, NTHW, "Port %u: set GTY Tx lane (%d) polarity: %d", p->m_port_no, lane, swap); } @@ -820,7 +820,7 @@ void nthw_mac_pcs_swap_gty_rx_polarity(nthw_mac_pcs_t *p, uint8_t lane, bool swa break; } - NT_LOG(DBG, NTHW, "Port %u: set GTY Rx lane (%d) polarity: %d\n", p->m_port_no, lane, + NT_LOG(DBG, NTHW, "Port %u: set GTY Rx lane (%d) polarity: %d", p->m_port_no, lane, swap); } diff --git a/drivers/net/ntnic/nthw/core/nthw_pcie3.c b/drivers/net/ntnic/nthw/core/nthw_pcie3.c index c6cb3ce8de..5997ebb419 100644 --- a/drivers/net/ntnic/nthw/core/nthw_pcie3.c +++ b/drivers/net/ntnic/nthw/core/nthw_pcie3.c @@ -38,7 +38,7 @@ int nthw_pcie3_init(nthw_pcie3_t *p, nthw_fpga_t *p_fpga, int n_instance) return mod == NULL ? -1 : 0; if (mod == NULL) { - NT_LOG(ERR, NTHW, "%s: PCIE3 %d: no such instance\n", + NT_LOG(ERR, NTHW, "%s: PCIE3 %d: no such instance", p_fpga->p_fpga_info->mp_adapter_id_str, n_instance); return -1; } @@ -250,7 +250,7 @@ int nthw_pcie3_get_stat_rate(nthw_pcie3_t *p, uint64_t *p_pci_rx_rate, uint64_t int nthw_pcie3_end_point_counters_sample_post(nthw_pcie3_t *p, struct nthw_hif_end_point_counters *epc) { - NT_LOG_DBGX(DEBUG, NTHW); + NT_LOG_DBGX(DBG, NTHW); assert(epc); nthw_pcie3_get_stat_rate(p, &epc->cur_tx, &epc->cur_rx, &epc->n_ref_clk_cnt, &epc->n_tags_in_use, &epc->cur_pci_nt_util, diff --git a/drivers/net/ntnic/nthw/core/nthw_sdc.c b/drivers/net/ntnic/nthw/core/nthw_sdc.c index 7666af7e5a..fc73e6957c 100644 --- a/drivers/net/ntnic/nthw/core/nthw_sdc.c +++ b/drivers/net/ntnic/nthw/core/nthw_sdc.c @@ -37,7 +37,7 @@ int nthw_sdc_init(nthw_sdc_t *p, nthw_fpga_t *p_fpga, int n_instance) return mod == NULL ? -1 : 0; if (mod == NULL) { - NT_LOG(ERR, NTHW, "%s: SDC %d: no such instance\n", p_adapter_id_str, n_instance); + NT_LOG(ERR, NTHW, "%s: SDC %d: no such instance", p_adapter_id_str, n_instance); return -1; } diff --git a/drivers/net/ntnic/nthw/core/nthw_si5340.c b/drivers/net/ntnic/nthw/core/nthw_si5340.c index 10bd4d8105..05cadc0bf4 100644 --- a/drivers/net/ntnic/nthw/core/nthw_si5340.c +++ b/drivers/net/ntnic/nthw/core/nthw_si5340.c @@ -102,7 +102,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt, uint8_t value; uint8_t ctrl_value; - NT_LOG(DBG, NTHW, "%s: data_cnt = %d, data_format = %d\n", p_adapter_id_str, + NT_LOG(DBG, NTHW, "%s: data_cnt = %d, data_format = %d", p_adapter_id_str, data_cnt, data_format); for (i = 0; i < data_cnt; i++) { @@ -117,7 +117,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt, p_data = ((const clk_profile_data_fmt2_t *)p_data) + 1; } else { - NT_LOG(ERR, NTHW, "%s: Unhandled Si5340 data format (%d)\n", + NT_LOG(ERR, NTHW, "%s: Unhandled Si5340 data format (%d)", p_adapter_id_str, data_format); return -1; } @@ -138,7 +138,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt, if (ctrl_value != value) { NT_LOG(ERR, NTHW, - "%s: Si5340 configuration readback check failed. (Addr = 0x%04X, Write = 0x%02X, Read = 0x%02X)\n", + "%s: Si5340 configuration readback check failed. (Addr = 0x%04X, Write = 0x%02X, Read = 0x%02X)", p_adapter_id_str, addr, value, ctrl_value); return -1; } @@ -175,7 +175,7 @@ int nthw_si5340_config(nthw_si5340_t *p, const void *p_data, int data_cnt, if (!success) { NT_LOG(ERR, NTHW, - "%s: Si5340 configuration failed. (Status = 0x%02X, Sticky = 0x%02X)\n", + "%s: Si5340 configuration failed. (Status = 0x%02X, Sticky = 0x%02X)", p_adapter_id_str, status, sticky); return -1; } @@ -186,7 +186,7 @@ int nthw_si5340_config(nthw_si5340_t *p, const void *p_data, int data_cnt, design_id[sizeof(design_id) - 1] = 0; (void)design_id;/* Only used in debug mode */ - NT_LOG(DBG, NTHW, "%s: Si5340.Design_id = %s\n", p_adapter_id_str, design_id); + NT_LOG(DBG, NTHW, "%s: Si5340.Design_id = %s", p_adapter_id_str, design_id); return 0; } diff --git a/drivers/net/ntnic/nthw/model/nthw_fpga_model.c b/drivers/net/ntnic/nthw/model/nthw_fpga_model.c index 14d1ebf5fa..4d495f5b96 100644 --- a/drivers/net/ntnic/nthw/model/nthw_fpga_model.c +++ b/drivers/net/ntnic/nthw/model/nthw_fpga_model.c @@ -238,7 +238,7 @@ nthw_fpga_t *nthw_fpga_mgr_query_fpga(nthw_fpga_mgr_t *p_fpga_mgr, uint64_t n_fp if (p_fpga) { } else { - NT_LOG(ERR, NTHW, "FPGA Id 0x%" PRIX64 ": %04d: %d.%d: no match found\n", + NT_LOG(ERR, NTHW, "FPGA Id 0x%" PRIX64 ": %04d: %d.%d: no match found", n_fpga_id, n_fpga_prod_id, n_fpga_ver, n_fpga_rev); } @@ -250,12 +250,12 @@ void nthw_fpga_mgr_log_dump(nthw_fpga_mgr_t *p) { int i; - NT_LOG_DBGX(DEBUG, NTHW, "fpgas=%d\n", p->mn_fpgas); + NT_LOG_DBGX(DBG, NTHW, "fpgas=%d", p->mn_fpgas); for (i = 0; i < p->mn_fpgas; i++) { nthw_fpga_prod_init_s *p_init = p->mpa_fpga_prod_init[i]; (void)p_init; - NT_LOG_DBGX(DEBUG, NTHW, "fpga=%d/%d: %04d-%02d-%02d\n", i, p->mn_fpgas, + NT_LOG_DBGX(DBG, NTHW, "fpga=%d/%d: %04d-%02d-%02d", i, p->mn_fpgas, p_init->fpga_product_id, p_init->fpga_version, p_init->fpga_revision); } } @@ -496,14 +496,14 @@ nthw_register_t *nthw_module_get_register(nthw_module_t *p, nthw_id_t id) nthw_register_t *p_register; if (p == NULL) { - NT_LOG(ERR, NTHW, "Illegal module context for register %u\n", id); + NT_LOG(ERR, NTHW, "Illegal module context for register %u", id); return NULL; } p_register = nthw_module_lookup_register(p, id); if (!p_register) { - NT_LOG(ERR, NTHW, "Register %u not found in module: %s (%u)\n", id, + NT_LOG(ERR, NTHW, "Register %u not found in module: %s (%u)", id, nthw_fpga_mod_id_to_str(p->mn_mod_id), p->mn_mod_id); } @@ -634,14 +634,14 @@ nthw_field_t *nthw_register_get_field(const nthw_register_t *p, nthw_id_t id) nthw_field_t *p_field; if (p == NULL) { - NT_LOG(ERR, NTHW, "Illegal register context for field %u\n", id); + NT_LOG(ERR, NTHW, "Illegal register context for field %u", id); return NULL; } p_field = nthw_register_lookup_field(p, id); if (!p_field) { - NT_LOG(ERR, NTHW, "Field %u not found in module: %s (%u)\n", id, + NT_LOG(ERR, NTHW, "Field %u not found in module: %s (%u)", id, nthw_fpga_mod_id_to_str(p->mp_owner->mn_mod_id), p->mp_owner->mn_mod_id); } @@ -846,7 +846,7 @@ void nthw_register_flush(const nthw_register_t *p, uint32_t cnt) rc = nthw_register_write_data(p, cnt); if (rc) - NT_LOG(ERR, NTHW, "Register write error %d\n", rc); + NT_LOG(ERR, NTHW, "Register write error %d", rc); for (i = 0; i < cnt; i++) p->mp_dirty[i] = false; @@ -903,8 +903,8 @@ void nthw_field_init(nthw_field_t *p, nthw_register_t *p_reg, const nthw_fpga_fi p->mn_tail_mask = (1 << bits_remaining) - 1; if (p->mn_debug_mode >= 0x100) { - NT_LOG_DBGX(DEBUG, NTHW, - "fldid=%08d: [%08d:%08d] %08d/%08d: (%08d,%08d) (0x%08X,%08d,0x%08X)\n", + NT_LOG_DBGX(DBG, NTHW, + "fldid=%08d: [%08d:%08d] %08d/%08d: (%08d,%08d) (0x%08X,%08d,0x%08X)", p_init->id, p_init->low, (p_init->low + p_init->bw), p_init->bw, ((p_init->bw + 31) / 32), p->mn_first_word, p->mn_first_bit, p->mn_front_mask, p->mn_body_length, @@ -1143,7 +1143,7 @@ static int nthw_field_wait_cond32(const nthw_field_t *p, enum nthw_field_match e (void)n_reg_mask; NT_LOG(DBG, NTHW, - "Register::Field::wait%s32(Dev: %s, Bus: %s, Addr: 0x%08X, Mask: 0x%08X, Iterations: %d, Interval: %d)\n", + "Register::Field::wait%s32(Dev: %s, Bus: %s, Addr: 0x%08X, Mask: 0x%08X, Iterations: %d, Interval: %d)", p_cond_name, p_dev_name, p_bus_name, n_reg_addr, n_reg_mask, n_poll_iterations, n_poll_interval); } diff --git a/drivers/net/ntnic/nthw/nthw_rac.c b/drivers/net/ntnic/nthw/nthw_rac.c index 2aef0c148f..219d6d1a35 100644 --- a/drivers/net/ntnic/nthw/nthw_rac.c +++ b/drivers/net/ntnic/nthw/nthw_rac.c @@ -46,7 +46,7 @@ int nthw_rac_init(nthw_rac_t *p, nthw_fpga_t *p_fpga, struct fpga_info_s *p_fpga return p_mod == NULL ? -1 : 0; if (p_mod == NULL) { - NT_LOG(ERR, NTHW, "%s: RAC %d: no such instance\n", p_adapter_id_str, 0); + NT_LOG(ERR, NTHW, "%s: RAC %d: no such instance", p_adapter_id_str, 0); return -1; } @@ -55,12 +55,12 @@ int nthw_rac_init(nthw_rac_t *p, nthw_fpga_t *p_fpga, struct fpga_info_s *p_fpga p->mn_param_rac_rab_interfaces = nthw_fpga_get_product_param(p->mp_fpga, NT_RAC_RAB_INTERFACES, 3); - NT_LOG(DBG, NTHW, "%s: NT_RAC_RAB_INTERFACES=%d\n", p_adapter_id_str, + NT_LOG(DBG, NTHW, "%s: NT_RAC_RAB_INTERFACES=%d", p_adapter_id_str, p->mn_param_rac_rab_interfaces); p->mn_param_rac_rab_ob_update = nthw_fpga_get_product_param(p->mp_fpga, NT_RAC_RAB_OB_UPDATE, 0); - NT_LOG(DBG, NTHW, "%s: NT_RAC_RAB_OB_UPDATE=%d\n", p_adapter_id_str, + NT_LOG(DBG, NTHW, "%s: NT_RAC_RAB_OB_UPDATE=%d", p_adapter_id_str, p->mn_param_rac_rab_ob_update); /* Optional dummy test registers */ @@ -262,7 +262,7 @@ static inline int _nthw_rac_wait_for_rab_done(const nthw_rac_t *p, uint32_t addr } if (used < word_cnt) { - NT_LOG(ERR, NTHW, "%s: Fail rab bus r/w addr=0x%08X used=%x wordcount=%d\n", + NT_LOG(ERR, NTHW, "%s: Fail rab bus r/w addr=0x%08X used=%x wordcount=%d", p_adapter_id_str, address, used, word_cnt); return -1; } @@ -307,7 +307,7 @@ int nthw_rac_rab_reset(nthw_rac_t *p) const int n_rac_rab_bus_count = nthw_rac_get_rab_interface_count(p); const int n_rac_rab_bus_mask = (1 << n_rac_rab_bus_count) - 1; - NT_LOG(DBG, NTHW, "%s: NT_RAC_RAB_INTERFACES=%d (0x%02X)\n", p_adapter_id_str, + NT_LOG(DBG, NTHW, "%s: NT_RAC_RAB_INTERFACES=%d (0x%02X)", p_adapter_id_str, n_rac_rab_bus_count, n_rac_rab_bus_mask); assert(n_rac_rab_bus_count); assert(n_rac_rab_bus_mask); @@ -337,7 +337,7 @@ int nthw_rac_rab_setup(nthw_rac_t *p) vfio_dma = nt_dma_alloc(align_size, 0x1000, numa_node); if (vfio_dma == NULL) { - NT_LOG(ERR, NTNIC, "nt_dma_alloc failed\n"); + NT_LOG(ERR, NTNIC, "nt_dma_alloc failed"); return -1; } @@ -398,25 +398,25 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint int res = 0; if (address > (1 << RAB_ADDR_BW)) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal address: value too large %d - max %d\n", + NT_LOG(ERR, NTHW, "%s: RAB: Illegal address: value too large %d - max %d", p_adapter_id_str, address, (1 << RAB_ADDR_BW)); return -1; } if (bus_id > (1 << RAB_BUSID_BW)) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal bus id: value too large %d - max %d\n", + NT_LOG(ERR, NTHW, "%s: RAB: Illegal bus id: value too large %d - max %d", p_adapter_id_str, bus_id, (1 << RAB_BUSID_BW)); return -1; } if (word_cnt == 0) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal word count: value is zero (%d)\n", + NT_LOG(ERR, NTHW, "%s: RAB: Illegal word count: value is zero (%d)", p_adapter_id_str, word_cnt); return -1; } if (word_cnt > (1 << RAB_CNT_BW)) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal word count: value too large %d - max %d\n", + NT_LOG(ERR, NTHW, "%s: RAB: Illegal word count: value too large %d - max %d", p_adapter_id_str, word_cnt, (1 << RAB_CNT_BW)); return -1; } @@ -424,7 +424,7 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint pthread_mutex_lock(&p->m_mutex); if (p->m_dma_active) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal operation: DMA enabled\n", p_adapter_id_str); + NT_LOG(ERR, NTHW, "%s: RAB: Illegal operation: DMA enabled", p_adapter_id_str); res = -1; goto exit_unlock_res; } @@ -489,7 +489,7 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint if (rab_oper_wr != rab_echo_oper_wr) { NT_LOG(ERR, NTHW, - "%s: expected rab read echo oper (0x%08X) - read (0x%08X)\n", + "%s: expected rab read echo oper (0x%08X) - read (0x%08X)", p_adapter_id_str, rab_oper_wr, rab_echo_oper_wr); } } @@ -533,7 +533,7 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint if (rab_echo_oper_cmpl != rab_oper_cmpl) { NT_LOG(ERR, NTHW, - "%s: RAB: Unexpected value of completion (0x%08X)- inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X\n", + "%s: RAB: Unexpected value of completion (0x%08X)- inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X", p_adapter_id_str, rab_echo_oper_cmpl, in_buf_free, out_buf_free, buf_used); res = -1; @@ -547,7 +547,7 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint /* Clear Timeout and overflow bits */ nthw_rac_reg_write32(p_fpga_info, p->RAC_RAB_BUF_FREE_ADDR, 0x0); NT_LOG(ERR, NTHW, - "%s: RAB: timeout - Access outside register - bus: %d addr: 0x%08X - inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X\n", + "%s: RAB: timeout - Access outside register - bus: %d addr: 0x%08X - inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X", p_adapter_id_str, bus_id, address, in_buf_free, out_buf_free, buf_used); res = -1; @@ -559,7 +559,7 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint } else { NT_LOG(ERR, NTHW, - "%s: RAB: Fail rab bus buffer check - bus: %d addr: 0x%08X wordcount: %d - inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X\n", + "%s: RAB: Fail rab bus buffer check - bus: %d addr: 0x%08X wordcount: %d - inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X", p_adapter_id_str, bus_id, address, word_cnt, in_buf_free, out_buf_free, buf_used); res = -1; @@ -585,28 +585,28 @@ int nthw_rac_rab_read32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint3 pthread_mutex_lock(&p->m_mutex); if (address > (1 << RAB_ADDR_BW)) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal address: value too large %d - max %d\n", + NT_LOG(ERR, NTHW, "%s: RAB: Illegal address: value too large %d - max %d", p_adapter_id_str, address, (1 << RAB_ADDR_BW)); res = -1; goto exit_unlock_res; } if (bus_id > (1 << RAB_BUSID_BW)) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal bus id: value too large %d - max %d\n", + NT_LOG(ERR, NTHW, "%s: RAB: Illegal bus id: value too large %d - max %d", p_adapter_id_str, bus_id, (1 << RAB_BUSID_BW)); res = -1; goto exit_unlock_res; } if (word_cnt == 0) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal word count: value is zero (%d)\n", + NT_LOG(ERR, NTHW, "%s: RAB: Illegal word count: value is zero (%d)", p_adapter_id_str, word_cnt); res = -1; goto exit_unlock_res; } if (word_cnt > (1 << RAB_CNT_BW)) { - NT_LOG(ERR, NTHW, "%s: RAB: Illegal word count: value too large %d - max %d\n", + NT_LOG(ERR, NTHW, "%s: RAB: Illegal word count: value too large %d - max %d", p_adapter_id_str, word_cnt, (1 << RAB_CNT_BW)); res = -1; goto exit_unlock_res; @@ -666,7 +666,7 @@ int nthw_rac_rab_read32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint3 if (rab_oper_rd != rab_echo_oper_rd) { NT_LOG(ERR, NTHW, - "%s: RAB: expected rab read echo oper (0x%08X) - read (0x%08X)\n", + "%s: RAB: expected rab read echo oper (0x%08X) - read (0x%08X)", p_adapter_id_str, rab_oper_rd, rab_echo_oper_rd); } } @@ -708,7 +708,7 @@ int nthw_rac_rab_read32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint3 if (rab_read_oper_cmpl != rab_oper_cmpl) { NT_LOG(ERR, NTHW, - "%s: RAB: Unexpected value of completion (0x%08X)- inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X\n", + "%s: RAB: Unexpected value of completion (0x%08X)- inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X", p_adapter_id_str, rab_read_oper_cmpl, in_buf_free, out_buf_free, buf_used); res = -1; @@ -722,7 +722,7 @@ int nthw_rac_rab_read32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint3 /* Clear Timeout and overflow bits */ nthw_rac_reg_write32(p_fpga_info, p->RAC_RAB_BUF_FREE_ADDR, 0x0); NT_LOG(ERR, NTHW, - "%s: RAB: timeout - Access outside register - bus: %d addr: 0x%08X - inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X\n", + "%s: RAB: timeout - Access outside register - bus: %d addr: 0x%08X - inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X", p_adapter_id_str, bus_id, address, in_buf_free, out_buf_free, buf_used); res = -1; @@ -734,7 +734,7 @@ int nthw_rac_rab_read32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint3 } else { NT_LOG(ERR, NTHW, - "%s: RAB: Fail rab bus buffer check - bus: %d addr: 0x%08X wordcount: %d - inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X\n", + "%s: RAB: Fail rab bus buffer check - bus: %d addr: 0x%08X wordcount: %d - inBufFree: 0x%08X, outBufFree: 0x%08X, bufUsed: 0x%08X", p_adapter_id_str, bus_id, address, word_cnt, in_buf_free, out_buf_free, buf_used); res = -1; @@ -772,7 +772,7 @@ int nthw_rac_rab_flush(nthw_rac_t *p) } if (data != p->RAC_RAB_BUF_USED_FLUSH_MASK) { - NT_LOG(ERR, NTHW, "%s: RAB: Rab bus flush error.\n", p_adapter_id_str); + NT_LOG(ERR, NTHW, "%s: RAB: Rab bus flush error.", p_adapter_id_str); res = -1; } diff --git a/drivers/net/ntnic/ntlog/ntlog.c b/drivers/net/ntnic/ntlog/ntlog.c index 2e4fba799d..7b7f583364 100644 --- a/drivers/net/ntnic/ntlog/ntlog.c +++ b/drivers/net/ntnic/ntlog/ntlog.c @@ -16,8 +16,6 @@ #define NTLOG_HELPER_STR_SIZE_MAX (1024) -RTE_LOG_REGISTER_DEFAULT(nt_logtype, NOTICE) - char *ntlog_helper_str_alloc(const char *sinit) { char *s = malloc(NTLOG_HELPER_STR_SIZE_MAX); diff --git a/drivers/net/ntnic/ntlog/ntlog.h b/drivers/net/ntnic/ntlog/ntlog.h index 58dcce0580..fd839e5cff 100644 --- a/drivers/net/ntnic/ntlog/ntlog.h +++ b/drivers/net/ntnic/ntlog/ntlog.h @@ -10,30 +10,55 @@ #include #include -extern int nt_logtype; +extern int nt_log_general; +#define RTE_LOGTYPE_GENERAL nt_log_general +extern int nt_log_nthw; +#define RTE_LOGTYPE_NTHW nt_log_nthw +extern int nt_log_filter; +#define RTE_LOGTYPE_FILTER nt_log_filter +extern int nt_log_ntnic; +#define RTE_LOGTYPE_NTNIC nt_log_ntnic #define NT_DRIVER_NAME "ntnic" -#define NT_PMD_DRV_LOG(level, ...) \ - rte_log(RTE_LOG_ ## level, nt_logtype, \ - RTE_FMT(NT_DRIVER_NAME ": " \ - RTE_FMT_HEAD(__VA_ARGS__, ""), \ - RTE_FMT_TAIL(__VA_ARGS__, ""))) +/* Common log format */ +#define NT_LOG_TEMPLATE_COM(level, module, ...) \ + RTE_LOG_LINE_PREFIX(level, module, "%s: ", NT_DRIVER_NAME, __VA_ARGS__) +/* Extended log format */ +#define NT_LOG_TEMPLATE_EXT(level, module, ...) \ + RTE_LOG_LINE_PREFIX(level, module, "[%s:%u] ", __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__) -#define NT_LOG_ERR(...) NT_PMD_DRV_LOG(ERR, __VA_ARGS__) -#define NT_LOG_WRN(...) NT_PMD_DRV_LOG(WARNING, __VA_ARGS__) -#define NT_LOG_INF(...) NT_PMD_DRV_LOG(INFO, __VA_ARGS__) -#define NT_LOG_DBG(...) NT_PMD_DRV_LOG(DEBUG, __VA_ARGS__) +#define NT_PMD_DRV_GENERAL_LOG(level, module, format, ...) \ + NT_LOG_TEMPLATE_##format(level, module, __VA_ARGS__) -#define NT_LOG(level, module, ...) \ - NT_LOG_##level(#module ": " #level ":" __VA_ARGS__) +#define NT_PMD_DRV_NTHW_LOG(level, module, format, ...) \ + NT_LOG_TEMPLATE_##format(level, module, __VA_ARGS__) + +#define NT_PMD_DRV_FILTER_LOG(level, module, format, ...) \ + NT_LOG_TEMPLATE_##format(level, module, __VA_ARGS__) + +#define NT_PMD_DRV_NTNIC_LOG(level, module, format, ...) \ + NT_LOG_TEMPLATE_##format(level, module, __VA_ARGS__) + +#define NT_LOG_ERR(level, module, ...) NT_PMD_DRV_##module##_LOG(ERR, module, COM, __VA_ARGS__) +#define NT_LOG_WRN(level, module, ...) NT_PMD_DRV_##module##_LOG(WARNING, module, COM, __VA_ARGS__) +#define NT_LOG_INF(level, module, ...) NT_PMD_DRV_##module##_LOG(INFO, module, COM, __VA_ARGS__) +#define NT_LOG_DBG(level, module, ...) NT_PMD_DRV_##module##_LOG(DEBUG, module, COM, __VA_ARGS__) + +#define NT_LOG_DBGX_ERR(level, module, ...) \ + NT_PMD_DRV_##module##_LOG(ERR, module, EXT, __VA_ARGS__) +#define NT_LOG_DBGX_WRN(level, module, ...) \ + NT_PMD_DRV_##module##_LOG(WARNING, module, EXT, __VA_ARGS__) +#define NT_LOG_DBGX_INF(level, module, ...) \ + NT_PMD_DRV_##module##_LOG(INFO, module, EXT, __VA_ARGS__) +#define NT_LOG_DBGX_DBG(level, module, ...) \ + NT_PMD_DRV_##module##_LOG(DEBUG, module, EXT, __VA_ARGS__) + +#define NT_LOG(level, module, ...) NT_LOG_##level(level, module, __VA_ARGS__) + +#define NT_LOG_DBGX(level, module, ...) NT_LOG_DBGX_##level(level, module, __VA_ARGS__) -#define NT_LOG_DBGX(level, module, ...) \ - rte_log(RTE_LOG_ ##level, nt_logtype, \ - RTE_FMT(NT_DRIVER_NAME #module ": [%s:%u]" \ - RTE_FMT_HEAD(__VA_ARGS__, ""), __func__, __LINE__, \ - RTE_FMT_TAIL(__VA_ARGS__, ""))) /* * nt log helper functions * to create a string for NT_LOG usage to output a one-liner log @@ -41,9 +66,7 @@ extern int nt_logtype; * you do not know the number of parameters at programming time or it is variable */ char *ntlog_helper_str_alloc(const char *sinit); - void ntlog_helper_str_add(char *s, const char *format, ...); - void ntlog_helper_str_free(char *s); #endif /* NTOSS_SYSTEM_NTLOG_H */ diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c index 52ca8f2844..b261444e8e 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -44,7 +44,7 @@ store_pdrv(struct drv_s *p_drv) { if (p_drv->adapter_no >= NUM_ADAPTER_MAX) { NT_LOG(ERR, NTNIC, - "Internal error adapter number %u out of range. Max number of adapters: %u\n", + "Internal error adapter number %u out of range. Max number of adapters: %u", p_drv->adapter_no, NUM_ADAPTER_MAX); return; } @@ -52,7 +52,7 @@ store_pdrv(struct drv_s *p_drv) if (_g_p_drv[p_drv->adapter_no] != 0) { NT_LOG(WRN, NTNIC, "Overwriting adapter structure for PCI " PCIIDENT_PRINT_STR - " with adapter structure for PCI " PCIIDENT_PRINT_STR "\n", + " with adapter structure for PCI " PCIIDENT_PRINT_STR, PCIIDENT_TO_DOMAIN(_g_p_drv[p_drv->adapter_no]->ntdrv.pciident), PCIIDENT_TO_BUSNR(_g_p_drv[p_drv->adapter_no]->ntdrv.pciident), PCIIDENT_TO_DEVNR(_g_p_drv[p_drv->adapter_no]->ntdrv.pciident), @@ -95,7 +95,7 @@ eth_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete __rte_unused) const struct port_ops *port_ops = get_port_ops(); if (port_ops == NULL) { - NT_LOG(ERR, NTNIC, "Link management module uninitialized\n"); + NT_LOG(ERR, NTNIC, "Link management module uninitialized"); return -1; } @@ -133,7 +133,7 @@ eth_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *dev_info const struct port_ops *port_ops = get_port_ops(); if (port_ops == NULL) { - NT_LOG(ERR, NTNIC, "Link management module uninitialized\n"); + NT_LOG(ERR, NTNIC, "Link management module uninitialized"); return -1; } @@ -174,7 +174,7 @@ eth_mac_addr_add(struct rte_eth_dev *eth_dev, if (index >= NUM_MAC_ADDRS_PER_PORT) { const struct pmd_internals *const internals = (struct pmd_internals *)eth_dev->data->dev_private; - NT_LOG_DBGX(DEBUG, NTNIC, "Port %i: illegal index %u (>= %u)\n", + NT_LOG_DBGX(DBG, NTNIC, "Port %i: illegal index %u (>= %u)", internals->n_intf_no, index, NUM_MAC_ADDRS_PER_PORT); return -1; } @@ -204,8 +204,8 @@ eth_set_mc_addr_list(struct rte_eth_dev *eth_dev, size_t i; if (nb_mc_addr >= NUM_MULTICAST_ADDRS_PER_PORT) { - NT_LOG_DBGX(DEBUG, NTNIC, - "Port %i: too many multicast addresses %u (>= %u)\n", + NT_LOG_DBGX(DBG, NTNIC, + "Port %i: too many multicast addresses %u (>= %u)", internals->n_intf_no, nb_mc_addr, NUM_MULTICAST_ADDRS_PER_PORT); return -1; } @@ -223,7 +223,7 @@ eth_set_mc_addr_list(struct rte_eth_dev *eth_dev, static int eth_dev_configure(struct rte_eth_dev *eth_dev) { - NT_LOG_DBGX(DEBUG, NTNIC, "Called for eth_dev %p\n", eth_dev); + NT_LOG_DBGX(DBG, NTNIC, "Called for eth_dev %p", eth_dev); /* The device is ALWAYS running promiscuous mode. */ eth_dev->data->promiscuous ^= ~eth_dev->data->promiscuous; @@ -236,7 +236,7 @@ eth_dev_start(struct rte_eth_dev *eth_dev) const struct port_ops *port_ops = get_port_ops(); if (port_ops == NULL) { - NT_LOG(ERR, NTNIC, "Link management module uninitialized\n"); + NT_LOG(ERR, NTNIC, "Link management module uninitialized"); return -1; } @@ -245,7 +245,7 @@ eth_dev_start(struct rte_eth_dev *eth_dev) const int n_intf_no = internals->n_intf_no; struct adapter_info_s *p_adapter_info = &internals->p_drv->ntdrv.adapter_info; - NT_LOG_DBGX(DEBUG, NTNIC, "Port %u\n", internals->n_intf_no); + NT_LOG_DBGX(DBG, NTNIC, "Port %u", internals->n_intf_no); if (internals->type == PORT_TYPE_VIRTUAL || internals->type == PORT_TYPE_OVERRIDE) { eth_dev->data->dev_link.link_status = RTE_ETH_LINK_UP; @@ -264,8 +264,8 @@ eth_dev_start(struct rte_eth_dev *eth_dev) while (port_ops->get_link_status(p_adapter_info, n_intf_no) == RTE_ETH_LINK_DOWN) { /* break out after 5 sec */ if (++loop >= 50) { - NT_LOG_DBGX(DEBUG, NTNIC, - "TIMEOUT No link on port %i (5sec timeout)\n", + NT_LOG_DBGX(DBG, NTNIC, + "TIMEOUT No link on port %i (5sec timeout)", internals->n_intf_no); break; } @@ -294,7 +294,7 @@ eth_dev_stop(struct rte_eth_dev *eth_dev) { struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; - NT_LOG_DBGX(DEBUG, NTNIC, "Port %u\n", internals->n_intf_no); + NT_LOG_DBGX(DBG, NTNIC, "Port %u", internals->n_intf_no); eth_dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN; return 0; @@ -306,7 +306,7 @@ eth_dev_set_link_up(struct rte_eth_dev *eth_dev) const struct port_ops *port_ops = get_port_ops(); if (port_ops == NULL) { - NT_LOG(ERR, NTNIC, "Link management module uninitialized\n"); + NT_LOG(ERR, NTNIC, "Link management module uninitialized"); return -1; } @@ -332,7 +332,7 @@ eth_dev_set_link_down(struct rte_eth_dev *eth_dev) const struct port_ops *port_ops = get_port_ops(); if (port_ops == NULL) { - NT_LOG(ERR, NTNIC, "Link management module uninitialized\n"); + NT_LOG(ERR, NTNIC, "Link management module uninitialized"); return -1; } @@ -358,7 +358,7 @@ drv_deinit(struct drv_s *p_drv) const struct adapter_ops *adapter_ops = get_adapter_ops(); if (adapter_ops == NULL) { - NT_LOG(ERR, NTNIC, "Adapter module uninitialized\n"); + NT_LOG(ERR, NTNIC, "Adapter module uninitialized"); return; } @@ -424,7 +424,7 @@ eth_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version, size_t fw_size static int promiscuous_enable(struct rte_eth_dev __rte_unused(*dev)) { - NT_LOG(DBG, NTHW, "The device always run promiscuous mode."); + NT_LOG(DBG, NTHW, "The device always run promiscuous mode"); return 0; } @@ -451,14 +451,14 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) const struct port_ops *port_ops = get_port_ops(); if (port_ops == NULL) { - NT_LOG(ERR, NTNIC, "Link management module uninitialized\n"); + NT_LOG(ERR, NTNIC, "Link management module uninitialized"); return -1; } const struct adapter_ops *adapter_ops = get_adapter_ops(); if (adapter_ops == NULL) { - NT_LOG(ERR, NTNIC, "Adapter module uninitialized\n"); + NT_LOG(ERR, NTNIC, "Adapter module uninitialized"); return -1; } @@ -472,7 +472,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) int n_phy_ports; struct port_link_speed pls_mbps[NUM_ADAPTER_PORTS_MAX] = { 0 }; int num_port_speeds = 0; - NT_LOG_DBGX(DEBUG, NTNIC, "Dev %s PF #%i Init : %02x:%02x:%i\n", pci_dev->name, + NT_LOG_DBGX(DBG, NTNIC, "Dev %s PF #%i Init : %02x:%02x:%i", pci_dev->name, pci_dev->addr.function, pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); @@ -482,7 +482,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) pci_dev->device.numa_node); if (!p_drv) { - NT_LOG_DBGX(ERR, NTNIC, "%s: error %d\n", + NT_LOG_DBGX(ERR, NTNIC, "%s: error %d", (pci_dev->name[0] ? pci_dev->name : "NA"), -1); return -1; } @@ -491,7 +491,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) int vfio = nt_vfio_setup(pci_dev); if (vfio < 0) { - NT_LOG_DBGX(ERR, TNIC, "%s: vfio_setup error %d\n", + NT_LOG_DBGX(ERR, NTNIC, "%s: vfio_setup error %d", (pci_dev->name[0] ? pci_dev->name : "NA"), -1); rte_free(p_drv); return -1; @@ -522,7 +522,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) p_nt_drv->adapter_info.hw_info.pci_sub_vendor_id = pci_dev->id.subsystem_vendor_id; p_nt_drv->adapter_info.hw_info.pci_sub_device_id = pci_dev->id.subsystem_device_id; - NT_LOG(DBG, NTNIC, "%s: " PCIIDENT_PRINT_STR " %04X:%04X: %04X:%04X:\n", + NT_LOG(DBG, NTNIC, "%s: " PCIIDENT_PRINT_STR " %04X:%04X: %04X:%04X:", p_nt_drv->adapter_info.mp_adapter_id_str, PCIIDENT_TO_DOMAIN(p_nt_drv->pciident), PCIIDENT_TO_BUSNR(p_nt_drv->pciident), PCIIDENT_TO_DEVNR(p_nt_drv->pciident), PCIIDENT_TO_FUNCNR(p_nt_drv->pciident), @@ -547,7 +547,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) int err = adapter_ops->init(&p_nt_drv->adapter_info); if (err != 0) { - NT_LOG(ERR, NTNIC, "%s: Cannot initialize the adapter instance\n", + NT_LOG(ERR, NTNIC, "%s: Cannot initialize the adapter instance", p_nt_drv->adapter_info.mp_adapter_id_str); return -1; } @@ -558,7 +558,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) const char *const p_adapter_id_str = p_nt_drv->adapter_info.mp_adapter_id_str; (void)p_adapter_id_str; NT_LOG(DBG, NTNIC, - "%s: %s: AdapterPCI=" PCIIDENT_PRINT_STR " Hw=0x%02X_rev%d PhyPorts=%d\n", + "%s: %s: AdapterPCI=" PCIIDENT_PRINT_STR " Hw=0x%02X_rev%d PhyPorts=%d", (pci_dev->name[0] ? pci_dev->name : "NA"), p_adapter_id_str, PCIIDENT_TO_DOMAIN(p_nt_drv->adapter_info.fpga_info.pciident), PCIIDENT_TO_BUSNR(p_nt_drv->adapter_info.fpga_info.pciident), @@ -568,7 +568,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) fpga_info->n_phy_ports); } else { - NT_LOG_DBGX(ERR, NTNIC, "%s: error=%d\n", + NT_LOG_DBGX(ERR, NTNIC, "%s: error=%d", (pci_dev->name[0] ? pci_dev->name : "NA"), err); return -1; } @@ -583,21 +583,21 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) char name[32]; if ((1 << n_intf_no) & ~n_port_mask) { - NT_LOG_DBGX(DEBUG, NTNIC, - "%s: interface #%d: skipping due to portmask 0x%02X\n", + NT_LOG_DBGX(DBG, NTNIC, + "%s: interface #%d: skipping due to portmask 0x%02X", p_port_id_str, n_intf_no, n_port_mask); continue; } snprintf(name, sizeof(name), "ntnic%d", n_intf_no); - NT_LOG_DBGX(DEBUG, NTNIC, "%s: interface #%d: %s: '%s'\n", p_port_id_str, + NT_LOG_DBGX(DBG, NTNIC, "%s: interface #%d: %s: '%s'", p_port_id_str, n_intf_no, (pci_dev->name[0] ? pci_dev->name : "NA"), name); internals = rte_zmalloc_socket(name, sizeof(struct pmd_internals), RTE_CACHE_LINE_SIZE, pci_dev->device.numa_node); if (!internals) { - NT_LOG_DBGX(ERR, NTNIC, "%s: %s: error=%d\n", + NT_LOG_DBGX(ERR, NTNIC, "%s: %s: error=%d", (pci_dev->name[0] ? pci_dev->name : "NA"), name, -1); return -1; } @@ -612,13 +612,13 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) /* Setup queue_ids */ if (nb_rx_queues > 1) { NT_LOG(DBG, NTNIC, - "(%i) NTNIC configured with Rx multi queues. %i queues\n", + "(%i) NTNIC configured with Rx multi queues. %i queues", internals->n_intf_no, nb_rx_queues); } if (nb_tx_queues > 1) { NT_LOG(DBG, NTNIC, - "(%i) NTNIC configured with Tx multi queues. %i queues\n", + "(%i) NTNIC configured with Tx multi queues. %i queues", internals->n_intf_no, nb_tx_queues); } @@ -637,7 +637,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) eth_dev = rte_eth_dev_allocate(name); if (!eth_dev) { - NT_LOG_DBGX(ERR, NTNIC, "%s: %s: error=%d\n", + NT_LOG_DBGX(ERR, NTNIC, "%s: %s: error=%d", (pci_dev->name[0] ? pci_dev->name : "NA"), name, -1); return -1; } @@ -674,7 +674,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) static int nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused) { - NT_LOG_DBGX(DEBUG, NTNIC, "PCI device deinitialization\n"); + NT_LOG_DBGX(DBG, NTNIC, "PCI device deinitialization"); int i; char name[32]; @@ -701,31 +701,31 @@ nthw_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, { int ret; - NT_LOG_DBGX(DEBUG, NTNIC, "pcidev: name: '%s'\n", pci_dev->name); - NT_LOG_DBGX(DEBUG, NTNIC, "devargs: name: '%s'\n", pci_dev->device.name); + NT_LOG_DBGX(DBG, NTNIC, "pcidev: name: '%s'", pci_dev->name); + NT_LOG_DBGX(DBG, NTNIC, "devargs: name: '%s'", pci_dev->device.name); if (pci_dev->device.devargs) { - NT_LOG_DBGX(DEBUG, NTNIC, "devargs: args: '%s'\n", + NT_LOG_DBGX(DBG, NTNIC, "devargs: args: '%s'", (pci_dev->device.devargs->args ? pci_dev->device.devargs->args : "NULL")); - NT_LOG_DBGX(DEBUG, NTNIC, "devargs: data: '%s'\n", + NT_LOG_DBGX(DBG, NTNIC, "devargs: data: '%s'", (pci_dev->device.devargs->data ? pci_dev->device.devargs->data : "NULL")); } const int n_rte_vfio_no_io_mmu_enabled = rte_vfio_noiommu_is_enabled(); - NT_LOG(DBG, NTNIC, "vfio_no_iommu_enabled=%d\n", n_rte_vfio_no_io_mmu_enabled); + NT_LOG(DBG, NTNIC, "vfio_no_iommu_enabled=%d", n_rte_vfio_no_io_mmu_enabled); if (n_rte_vfio_no_io_mmu_enabled) { - NT_LOG(ERR, NTNIC, "vfio_no_iommu_enabled=%d: this PMD needs VFIO IOMMU\n", + NT_LOG(ERR, NTNIC, "vfio_no_iommu_enabled=%d: this PMD needs VFIO IOMMU", n_rte_vfio_no_io_mmu_enabled); return -1; } const enum rte_iova_mode n_rte_io_va_mode = rte_eal_iova_mode(); - NT_LOG(DBG, NTNIC, "iova mode=%d\n", n_rte_io_va_mode); + NT_LOG(DBG, NTNIC, "iova mode=%d", n_rte_io_va_mode); NT_LOG(DBG, NTNIC, "busid=" PCI_PRI_FMT - " pciid=%04x:%04x_%04x:%04x locstr=%s @ numanode=%d: drv=%s drvalias=%s\n", + " pciid=%04x:%04x_%04x:%04x locstr=%s @ numanode=%d: drv=%s drvalias=%s", pci_dev->addr.domain, pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function, pci_dev->id.vendor_id, pci_dev->id.device_id, pci_dev->id.subsystem_vendor_id, pci_dev->id.subsystem_device_id, @@ -737,14 +737,14 @@ nthw_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, ret = nthw_pci_dev_init(pci_dev); - NT_LOG_DBGX(DEBUG, NTNIC, "leave: ret=%d\n", ret); + NT_LOG_DBGX(DBG, NTNIC, "leave: ret=%d", ret); return ret; } static int nthw_pci_remove(struct rte_pci_device *pci_dev) { - NT_LOG_DBGX(DEBUG, NTNIC); + NT_LOG_DBGX(DBG, NTNIC); struct drv_s *p_drv = get_pdrv_from_pci(pci_dev->addr); drv_deinit(p_drv); @@ -762,3 +762,8 @@ static struct rte_pci_driver rte_nthw_pmd = { RTE_PMD_REGISTER_PCI(net_ntnic, rte_nthw_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ntnic, nthw_pci_id_map); RTE_PMD_REGISTER_KMOD_DEP(net_ntnic, "* vfio-pci"); + +RTE_LOG_REGISTER_SUFFIX(nt_log_general, general, INFO); +RTE_LOG_REGISTER_SUFFIX(nt_log_nthw, nthw, INFO); +RTE_LOG_REGISTER_SUFFIX(nt_log_filter, filter, INFO); +RTE_LOG_REGISTER_SUFFIX(nt_log_ntnic, ntnic, INFO); diff --git a/drivers/net/ntnic/ntnic_vfio.c b/drivers/net/ntnic/ntnic_vfio.c index 0542b1ce62..a62234353b 100644 --- a/drivers/net/ntnic/ntnic_vfio.c +++ b/drivers/net/ntnic/ntnic_vfio.c @@ -55,14 +55,14 @@ nt_vfio_setup(struct rte_pci_device *dev) int vf_num; struct vfio_dev *vfio; - NT_LOG(INF, NTNIC, "NT VFIO device setup %s\n", dev->name); + NT_LOG(INF, NTNIC, "NT VFIO device setup %s", dev->name); vf_num = nt_vfio_vf_num(dev); vfio = vfio_get(vf_num); if (vfio == NULL) { - NT_LOG(ERR, NTNIC, "VFIO device setup failed. Illegal device id\n"); + NT_LOG(ERR, NTNIC, "VFIO device setup failed. Illegal device id"); return -1; } @@ -85,7 +85,7 @@ nt_vfio_setup(struct rte_pci_device *dev) if (vfio->container_fd < 0) { NT_LOG(ERR, NTNIC, - "VFIO device setup failed. VFIO container creation failed.\n"); + "VFIO device setup failed. VFIO container creation failed."); return -1; } } @@ -94,14 +94,14 @@ nt_vfio_setup(struct rte_pci_device *dev) if (vfio->group_fd < 0) { NT_LOG(ERR, NTNIC, - "VFIO device setup failed. VFIO container group bind failed.\n"); + "VFIO device setup failed. VFIO container group bind failed."); goto err; } if (vf_num > 0) { if (rte_pci_map_device(dev)) { NT_LOG(ERR, NTNIC, - "Map VFIO device failed. is the vfio-pci driver loaded?\n"); + "Map VFIO device failed. is the vfio-pci driver loaded?"); goto err; } } @@ -109,7 +109,7 @@ nt_vfio_setup(struct rte_pci_device *dev) vfio->dev_fd = rte_intr_dev_fd_get(dev->intr_handle); NT_LOG(DBG, NTNIC, - "%s: VFIO id=%d, dev_fd=%d, container_fd=%d, group_fd=%d, iommu_group_num=%d\n", + "%s: VFIO id=%d, dev_fd=%d, container_fd=%d, group_fd=%d, iommu_group_num=%d", dev->name, vf_num, vfio->dev_fd, vfio->container_fd, vfio->group_fd, iommu_group_num); @@ -128,12 +128,12 @@ nt_vfio_remove(int vf_num) { struct vfio_dev *vfio; - NT_LOG(DBG, NTNIC, "NT VFIO device remove VF=%d\n", vf_num); + NT_LOG(DBG, NTNIC, "NT VFIO device remove VF=%d", vf_num); vfio = vfio_get(vf_num); if (!vfio) { - NT_LOG(ERR, NTNIC, "VFIO device remove failed. Illegal device id\n"); + NT_LOG(ERR, NTNIC, "VFIO device remove failed. Illegal device id"); return -1; } @@ -161,24 +161,24 @@ nt_vfio_dma_map(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size) vfio = vfio_get(vf_num); if (vfio == NULL) { - NT_LOG(ERR, NTNIC, "VFIO MAP: VF number %d invalid\n", vf_num); + NT_LOG(ERR, NTNIC, "VFIO MAP: VF number %d invalid", vf_num); return -1; } NT_LOG(DBG, NTNIC, "VFIO MMAP VF=%d VirtAddr=%p HPA=%" PRIX64 " VirtBase=%" PRIX64 - " IOVA Addr=%" PRIX64 " size=%" PRIX64 "\n", + " IOVA Addr=%" PRIX64 " size=%" PRIX64, vf_num, virt_addr, rte_malloc_virt2iova(virt_addr), gp_virt_base, vfio->iova_addr, size); int res = rte_vfio_container_dma_map(vfio->container_fd, gp_virt_base, vfio->iova_addr, size); - NT_LOG(DBG, NTNIC, "VFIO MMAP res %i, container_fd %i, vf_num %i\n", res, + NT_LOG(DBG, NTNIC, "VFIO MMAP res %i, container_fd %i, vf_num %i", res, vfio->container_fd, vf_num); if (res) { - NT_LOG(ERR, NTNIC, "rte_vfio_container_dma_map failed: res %d\n", res); + NT_LOG(ERR, NTNIC, "rte_vfio_container_dma_map failed: res %d", res); return -1; } @@ -208,7 +208,7 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size vfio = vfio_get(vf_num); if (vfio == NULL) { - NT_LOG(ERR, NTNIC, "VFIO UNMAP: VF number %d invalid\n", vf_num); + NT_LOG(ERR, NTNIC, "VFIO UNMAP: VF number %d invalid", vf_num); return -1; } @@ -220,7 +220,7 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size if (res != 0) { NT_LOG(ERR, NTNIC, "VFIO UNMMAP FAILED! res %i, container_fd %i, vf_num %i, virt_base=%" PRIX64 - ", IOVA=%" PRIX64 ", size=%" PRIX64 "\n", + ", IOVA=%" PRIX64 ", size=%" PRIX64, res, vfio->container_fd, vf_num, gp_virt_base, iova_addr, size); return -1; } diff --git a/drivers/net/ntnic/ntutil/nt_util.c b/drivers/net/ntnic/ntutil/nt_util.c index a69a8e10c1..476bea9316 100644 --- a/drivers/net/ntnic/ntutil/nt_util.c +++ b/drivers/net/ntnic/ntutil/nt_util.c @@ -48,7 +48,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa) vfio_addr = rte_malloc(NULL, sizeof(struct nt_dma_s), 0); if (!vfio_addr) { - NT_LOG(ERR, GENERAL, "VFIO rte_malloc failed\n"); + NT_LOG(ERR, GENERAL, "VFIO rte_malloc failed"); return NULL; } @@ -56,7 +56,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa) if (!addr) { rte_free(vfio_addr); - NT_LOG(ERR, GENERAL, "VFIO rte_malloc_socket failed\n"); + NT_LOG(ERR, GENERAL, "VFIO rte_malloc_socket failed"); return NULL; } @@ -65,7 +65,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa) if (res != 0) { rte_free(addr); rte_free(vfio_addr); - NT_LOG(ERR, GENERAL, "VFIO nt_dma_map failed\n"); + NT_LOG(ERR, GENERAL, "VFIO nt_dma_map failed"); return NULL; } @@ -74,7 +74,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa) NT_LOG(DBG, GENERAL, "VFIO DMA alloc addr=%" PRIX64 ", iova=%" PRIX64 - ", size=%" PRIX64 "align=0x%" PRIX64 "\n", + ", size=%" PRIX64 "align=0x%" PRIX64, vfio_addr->addr, vfio_addr->iova, vfio_addr->size, align); return vfio_addr; @@ -82,7 +82,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa) void nt_dma_free(struct nt_dma_s *vfio_addr) { - NT_LOG(DBG, GENERAL, "VFIO DMA free addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64 "\n", + NT_LOG(DBG, GENERAL, "VFIO DMA free addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64, vfio_addr->addr, vfio_addr->iova, vfio_addr->size); int res = vfio_cb.vfio_dma_unmap(0, (void *)vfio_addr->addr, vfio_addr->iova, @@ -90,7 +90,7 @@ void nt_dma_free(struct nt_dma_s *vfio_addr) if (res != 0) { NT_LOG(WRN, GENERAL, - "VFIO DMA free FAILED addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64 "\n", + "VFIO DMA free FAILED addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64, vfio_addr->addr, vfio_addr->iova, vfio_addr->size); } -- 2.45.0