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 06FC841CB7; Fri, 17 Feb 2023 03:46:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48D2642BD9; Fri, 17 Feb 2023 03:46:17 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2097.outbound.protection.outlook.com [40.107.220.97]) by mails.dpdk.org (Postfix) with ESMTP id EEA5440A8B for ; Fri, 17 Feb 2023 03:46:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QBLaRAx2600gpYNiNu2rhAPLLkGwQj0J4I6jVpjOAm7XcG8XFaF24lAVhTNPzpPIYloZ/G85aiWo/7QnExRvonNE+oDvS4iDRd91RmpYNrtxiXsd4VOHTAZB+ZvzMLiK975RbKj+BPg5ibYla1pEAgyxXFJLQpm9X6eNK/qbgQKo3oqLBXXX05TGY9WIXCN4/oirsQ1u+NO9v93T/7F6iE5ufuTQm+g33FulSj0AtE8Z5y4WLEir42tI1PrJRZ07Wb4mcpJ+DcMzcOe7IMudyqvEVOPVrWRXu9Ap/yNtisuy/Wu2qv021+MJym6KW9KMHQFwZD12Uff3VtUnLfFANg== 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=bhidpfAq+oVnz/8GbotcbTD8VIKzK7KtTY5JtfI/ckQ=; b=cHbO/9b8qwOhmDJL3WnbkvekIdHWcnFtAimHZ4AqgYMBbhtSQHhehCT9UVevJpZ0pvvDBztDHqEdSwpPoGBZ93J8+Qx1pdE7ymTcBdcmsc83gkT31UI+ceG/CT1X3GLtBvDJeCkeDPqNz/d66ns4WFqUvFmlMPf4ydUCu+NUQzZOtgigCyYANs8E6EDxX9YXRluDJtPuxiQlkDOS3CYkeNURzMMnFwTcJtZHJ3d7x7WxM9iQlyyLacOw1Z1CFbb96Kh7d26UAO/KKb7RfRKHsE/aong6MHbt6GtqVgMJuT9uKdhwFjkomyH3wBBII4C+t2MJTWRY5lvhHiqNWZsuFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bhidpfAq+oVnz/8GbotcbTD8VIKzK7KtTY5JtfI/ckQ=; b=DXP5JYDqpe7mCrQS+ylIz9d/W/sTJJl/Hv0zMnSIZsfIEIo0mJr2vHHmmU3wF0s9RTpMr7dkOeQt4SPg8qZrGYrYcs/kkTIvahywXcPmYPk68VmTMKn/dwmKQ5skAuPfYMJ6SovV1bVzrqZvnqRpiVEhiTEmLTiXvNBd2OFez0k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by BN0PR13MB4567.namprd13.prod.outlook.com (2603:10b6:408:127::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Fri, 17 Feb 2023 02:46:11 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d%5]) with mapi id 15.20.6086.026; Fri, 17 Feb 2023 02:46:11 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 2/3] net/nfp: get rid of the usage of RTE log level type Date: Fri, 17 Feb 2023 10:45:38 +0800 Message-Id: <20230217024539.16514-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20230217024539.16514-1-chaoyong.he@corigine.com> References: <20230217024539.16514-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR04CA0005.apcprd04.prod.outlook.com (2603:1096:4:197::16) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BN0PR13MB4567:EE_ X-MS-Office365-Filtering-Correlation-Id: efa80192-fe3a-4f20-1d48-08db109120df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OtgW0qiue6FNf93kCpJjstNWO+cX4Vbd9zg5++iZipfNUFNERj/NzPASKEDLzGdhKJ+5mHB0rgqhaAzZBtipryYBjtvn2KRTtt0Ky/O3gRt8Xv/CwemdvRpgd2yCiH9yBXKfHkcgMPgca7SiIKvsq5Jr8I2kM4S14Q2/OxFwHd3rCS3iduqpXHbqsfye6FAni9rdYXwbDXbFbF+C97oh0FoYWmzO17nqCvcWmH9uxfUCsemVlvosbrEs/tkwm6xu1Jmn2dDUixBafeTcRFvGe2Bw/hR4fiL+Q1naSbKtWOj9OCGWx+ccg84uTLuRHLYVIkw8hkfkx3E7+DIk0OT0C2w3wpJtlrULkIeZUG+t8ri7MliqlL03TlQ7CkX8pDnLSgaMoWmSk+laPXpTxhnvj5n2ApLfjQjtyO3W4qeRDnDJWVl5H0Ev6HwPtz3Y4ectyASdKt/GOEUGLmpRyO4U8uS0gRuUc77DsBRMZ7JwZHpsRol/LQSMpb2Ao3ogeW1DK2oGYuZmyB2twoMsRIXs2ykUxR1MLpr7qBUO7MbwYgFgK5+5GNtvSbMNEQkSkHB4RjqVV897K5YTAd1ZtzWDrMuYj6WXT/uMP3iJlclR/NyRrbFEJM7JIz9kAiGs0RfxK/maFkP582RcGTiPGWs4r3IzcfDtkKHScHV7xZJxVm0RitKrDr3Bst9fvDDUGF/TSzYqZ1IigACreIAoDN/JXpgIKvGs3zO2fxWM7rcXeUe2rw7ojTYWPcy6YHNABqaAZy528UPx3gDJ/X/wG3GAAQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(39840400004)(366004)(396003)(136003)(346002)(451199018)(2616005)(107886003)(66574015)(36756003)(2906002)(86362001)(6916009)(66476007)(38100700002)(44832011)(41300700001)(5660300002)(66946007)(38350700002)(66556008)(8676002)(1076003)(6486002)(6512007)(83380400001)(478600001)(4326008)(52116002)(8936002)(26005)(6666004)(186003)(316002)(6506007)(26583001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MWhxcDhSRW5GeWJkNS92MjYvbnlKNVNDTjVkSXpmMnhjOURQdmxEM244Z0hr?= =?utf-8?B?YlBkQXBtNE91Uk92ZkdQN1Y0SExuelZEeUllY3hXMW93ZFZ3MEVLbXBpWm1i?= =?utf-8?B?eGQzckVUeGR4Y1ZYZkZiNnZEZFNmTUJWU1hmZjFNK0Fkdk1PR3N5T1A5RFl0?= =?utf-8?B?Z0Rnbk11b1Q5UXl4REovZmViSGhEQm9zaDlnUDVMYlEycW51Zm9kYW5TTEVX?= =?utf-8?B?UTZIVldjeFlwNHVkV1g0OEVLRU9QY1Q4VkRWVjVNN2JPbUZLSjgyTGVN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y9sVmpYT25WVnVCQllESGdlOWFDK29FRWh0cHpOV2l6NGNpS3FK?= =?utf-8?B?QXNMZ1QxbEdFcktuUUMrNE81cjB0TXJMODR0T1hVWXY0VkZ6akhuQjV2bEtG?= =?utf-8?B?anc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: efa80192-fe3a-4f20-1d48-08db109120df X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2023 02:46:11.3195 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HPiBdGGRrU57hGTFfHhqAYopkX9ixmJ9eVfpi4Dx2sVHFCHvHHYXu9UEgowhD4BuxOGhoxGXrZZh5hkG7Z+ye3tQTsKbvIv2jmsSL7v8Dq8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR13MB4567 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 Register the own RX/TX debug log level type, and get rid of the usage of RTE_LOGTYPE_*. Then we can control the log by a independent switch. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_logs.c | 10 ++++++++++ drivers/net/nfp/nfp_logs.h | 8 ++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_logs.c b/drivers/net/nfp/nfp_logs.c index 48c42fe53f..cd58bcee43 100644 --- a/drivers/net/nfp/nfp_logs.c +++ b/drivers/net/nfp/nfp_logs.c @@ -5,6 +5,16 @@ #include "nfp_logs.h" +#include + RTE_LOG_REGISTER_SUFFIX(nfp_logtype_init, init, NOTICE); RTE_LOG_REGISTER_SUFFIX(nfp_logtype_driver, driver, NOTICE); RTE_LOG_REGISTER_SUFFIX(nfp_logtype_cpp, cpp, NOTICE); + +#ifdef RTE_ETHDEV_DEBUG_RX +RTE_LOG_REGISTER_SUFFIX(nfp_logtype_rx, rx, DEBUG) +#endif + +#ifdef RTE_ETHDEV_DEBUG_TX +RTE_LOG_REGISTER_SUFFIX(nfp_logtype_tx, tx, DEBUG) +#endif diff --git a/drivers/net/nfp/nfp_logs.h b/drivers/net/nfp/nfp_logs.h index b7632ee72c..315a57811c 100644 --- a/drivers/net/nfp/nfp_logs.h +++ b/drivers/net/nfp/nfp_logs.h @@ -15,15 +15,19 @@ extern int nfp_logtype_init; #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") #ifdef RTE_ETHDEV_DEBUG_RX +extern int nfp_logtype_rx; #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, nfp_logtype_rx, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_RX_LOG(level, fmt, args...) do { } while (0) #endif #ifdef RTE_ETHDEV_DEBUG_TX +extern int nfp_logtype_tx; #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, nfp_logtype_tx, \ + "%s(): " fmt "\n", __func__, ## args) #else #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif -- 2.29.3