From patchwork Fri Apr 19 20:25:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 139559 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0807843EB3; Fri, 19 Apr 2024 22:26:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC1CB40698; Fri, 19 Apr 2024 22:26:09 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2045.outbound.protection.outlook.com [40.107.93.45]) by mails.dpdk.org (Postfix) with ESMTP id B52E040696 for ; Fri, 19 Apr 2024 22:26:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vaxn7mUMO5aC+gzFgPV0ymloO582kMfPxcmiJnp2M2v3QAliKFhS7lMWO3oUOAk/GGgtHjR4uCmPbtssHiBhfOGsqMpNyqnAPhPui+bX/rcyFKV/rWfKcRsJC9iC1BryVr/avmY6nMZIZfZtm6X6soBK6HRFc1v1I8rpFwE3aYMq+GlYUD2y8RGZ635GfjWGPo97jH5Eshj2BjlqazzZiw89AHvhf9xKrnUaA9OxBBksCOijEnIrcvvQlBPcgZuOgyM3eAbeZgCsc2UlBCRI5141lHZgD2YW3raGayXPD+3iVDs/jVrt2sEM5oxORBFVTcma96wLDLhHsz/O1jI5Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sMGiDVY844yoPmqLdpcEOayBs6zC0l+KMd2igNJsZC8=; b=bG+ZwTSbAA2R3oZ+ihZcwJ5aYxcz92Xq6X9X608WQG7ntO3+FsJeGXrNTSUmINxqhUBoP48H5nVaFgAoWPbKaAyBwvY02Tx2R/L0wJUFTTSazjlsNPWEg4CHOsEKWQTxj0XlyYTVZWgKm2cSBQLgGE0qkEagSlFg1VHy0M5hDjs+UB1AGKqURiH67392LwLeOloBYOb/dv6rvDd7RreuXKZrQzsP5coohwx3n1TSv1dG2hOu1TLPSBw5Ds99jEXgnbDp+fuaJZ7t/U2tquhnPiQf/O9wlBxwqflIvSl6HLYK/1ej1kEt3jIpdDS9HRG9pfX9sEGK0vqkNwpByEYEIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sMGiDVY844yoPmqLdpcEOayBs6zC0l+KMd2igNJsZC8=; b=F8IM8BmKXuagrL1fP8WZ84EXRy3/SRKvaWEW8wUYhCI9a+TZ6nHDsx8vGacl+tml+zNJtqCbUxsGt1qZlsbp67R8GfZVOU3tUj2HVN55w+sl4OI6IP+7JFGoZHOujJKHcB75gcAd0PmmvAjLk6gCsNvK4VMMkShZ1LEQ3olRo5s= Received: from BN0PR03CA0054.namprd03.prod.outlook.com (2603:10b6:408:e7::29) by IA1PR12MB6436.namprd12.prod.outlook.com (2603:10b6:208:3ac::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.40; Fri, 19 Apr 2024 20:26:06 +0000 Received: from BN2PEPF000044A0.namprd02.prod.outlook.com (2603:10b6:408:e7:cafe::fe) by BN0PR03CA0054.outlook.office365.com (2603:10b6:408:e7::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.31 via Frontend Transport; Fri, 19 Apr 2024 20:26:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000044A0.mail.protection.outlook.com (10.167.243.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 19 Apr 2024 20:26:06 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 19 Apr 2024 15:26:05 -0500 From: Andrew Boyer To: CC: Andrew Boyer Subject: [PATCH] net/ionic: clean up logging issues Date: Fri, 19 Apr 2024 13:25:56 -0700 Message-ID: <20240419202556.46188-1-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A0:EE_|IA1PR12MB6436:EE_ X-MS-Office365-Filtering-Correlation-Id: 913301db-ed03-48b2-87da-08dc60aef0dc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +canCdQbMtzqh5EzR/5RN4bzqDWTSbkZqcYRytD/2siM6pP6E7DLffh+x92T3Rm3ei1R7PuAHymYEjz0ByU21hpyNNT3Xug91DrH+XLkC+ubwvGYEYDS/9SCmvN8Jx+/umW6JX8mIOWopBvUumj+Zoejb/fNr/EyvxrhGdLJGEKzUSBl+2vDBIDH5dfkVfy9lhOirQnKp5FiNaLFqNaeN5uQ+4CKAFuJEnNLDdRBLmMWb1dMAvRKiXKx4HLzI3rTyA4cPakMnxrI+tIZENnW53mL/BTDztRDhoXW7r3/1dUMpAV+YvzUGOw6soLOyRGVmDPY4YqHBjVFhN2TCgM7gYf4EpsK0kGodLdqb3UkWA1sPJeaX3T8xO0nvvEMylIE6qY1+Cky0xhJF8NzgaT2pksd2l7xzz8kbiJsCqGf3fgFiHREJaL0dENstky60ZtryVoew5emGy0rJP9b2mnxVHt+7LbcPq2eAES6hw+8c+vanvLY00DrjCJigf5mcAZCQDZp9z+Tfm0l4xa0x5moweGMWOupHgbXpgSMLUcTGcC0P0Inu0yAZYVZ+hrXXdIaQ2WujZOHdbqWW1wgrYcia2SlXdjctHG4DrUIBjZD7hY8FbS4WlOE469rw2bmc5wuyEakoHmZzW51iyhy8aANdLlyjRiCpPkxb4tGYJJ7PG5HRAKus/H897vM9FGB10G7jggjbrcFbhzkwC1Z8mwRcQlKKrE5AdtvwGmIot1ZIWEwwLLziJyjrQ3IMaFGWty4 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(36860700004)(1800799015)(376005)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 20:26:06.0859 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 913301db-ed03-48b2-87da-08dc60aef0dc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A0.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6436 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 Switch to the new RTE_LOG_LINE_PREFIX logging macro. While here, fix up some trailing-newline issues reported by the new macro. Signed-off-by: Andrew Boyer Acked-by: Stephen Hemminger --- drivers/net/ionic/ionic_dev_pci.c | 7 +++---- drivers/net/ionic/ionic_lif.c | 8 ++++---- drivers/net/ionic/ionic_logs.h | 14 +++----------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/net/ionic/ionic_dev_pci.c b/drivers/net/ionic/ionic_dev_pci.c index 2d7b4f223e..76235cad51 100644 --- a/drivers/net/ionic/ionic_dev_pci.c +++ b/drivers/net/ionic/ionic_dev_pci.c @@ -43,13 +43,12 @@ ionic_pci_setup(struct ionic_adapter *adapter) /* BAR0: dev_cmd and interrupts */ if (num_bars < 1) { - IONIC_PRINT(ERR, "No bars found, aborting\n"); + IONIC_PRINT(ERR, "No bars found, aborting"); return -EFAULT; } if (bar->len < IONIC_BAR0_SIZE) { - IONIC_PRINT(ERR, - "Resource bar size %lu too small, aborting\n", + IONIC_PRINT(ERR, "Resource bar size %lu too small, aborting", bar->len); return -EFAULT; } @@ -84,7 +83,7 @@ ionic_pci_setup(struct ionic_adapter *adapter) /* BAR1: doorbells */ bar++; if (num_bars < IONIC_BARS_MIN) { - IONIC_PRINT(ERR, "Doorbell bar missing, aborting\n"); + IONIC_PRINT(ERR, "Doorbell bar missing, aborting"); return -EFAULT; } diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c index 7f02b67610..b4dc118fef 100644 --- a/drivers/net/ionic/ionic_lif.c +++ b/drivers/net/ionic/ionic_lif.c @@ -990,13 +990,13 @@ ionic_lif_queue_identify(struct ionic_lif *lif) qtype, ionic_qtype_vers[qtype]); err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT); if (err == -EINVAL) { - IONIC_PRINT(ERR, "qtype %d not supported\n", qtype); + IONIC_PRINT(ERR, "qtype %d not supported", qtype); continue; } else if (err == -EIO) { - IONIC_PRINT(ERR, "q_ident failed, older FW\n"); + IONIC_PRINT(ERR, "q_ident failed, older FW"); return; } else if (err) { - IONIC_PRINT(ERR, "q_ident failed, qtype %d: %d\n", + IONIC_PRINT(ERR, "q_ident failed, qtype %d: %d", qtype, err); return; } @@ -1380,7 +1380,7 @@ ionic_lif_handle_fw_down(struct ionic_lif *lif) if (lif->state & IONIC_LIF_F_UP) { IONIC_PRINT(NOTICE, - "Surprise FW stop, stopping %s\n", lif->name); + "Surprise FW stop, stopping %s", lif->name); ionic_lif_stop(lif); } diff --git a/drivers/net/ionic/ionic_logs.h b/drivers/net/ionic/ionic_logs.h index c10b06c051..739de00af8 100644 --- a/drivers/net/ionic/ionic_logs.h +++ b/drivers/net/ionic/ionic_logs.h @@ -8,19 +8,11 @@ #include extern int ionic_logtype; +#define RTE_LOGTYPE_IONIC ionic_logtype -#define IONIC_PRINT(level, fmt, args...) rte_log(RTE_LOG_ ## level, \ - ionic_logtype, "%s(): " fmt "\n", __func__, ##args) +#define IONIC_PRINT(level, ...) \ + RTE_LOG_LINE_PREFIX(level, IONIC, "%s(): ", __func__, __VA_ARGS__) #define IONIC_PRINT_CALL() IONIC_PRINT(DEBUG, " >>") -#ifndef IONIC_WARN_ON -#define IONIC_WARN_ON(x) do { \ - int ret = !!(x); \ - if (unlikely(ret)) \ - IONIC_PRINT(WARNING, "WARN_ON: \"" #x "\" at %s:%d\n", \ - __func__, __LINE__); \ -} while (0) -#endif - #endif /* _IONIC_LOGS_H_ */