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 0BF3341D40; Wed, 22 Feb 2023 17:33:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0067143024; Wed, 22 Feb 2023 17:33:02 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id E4F7B410DF for ; Wed, 22 Feb 2023 17:32:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677083581; x=1708619581; h=message-id:date:subject:to:references:from:in-reply-to: content-transfer-encoding:mime-version; bh=I2FB7f6X8oihB8IbTayY8ovKgIDtLwoBY3v1iPbOyz0=; b=CnCawTeZLYkW3wmzu16NoUbvV6RnM+09eN0SK0a/9zcZqnJ1u6WgTA51 4ZTb+qw73bOzI9fHvbwAvKYxj+O2MS/5p2y4d5iWlHlc3gcmNpKXLtpCl DLjiGwqjMcFnnjW4ceabj9jp6wAEHVCVqIZg4IPKkjDuexY2fCvuN79ch eMDgGkAKNjtWJmbnQvOPhzP1ZaHn658fZ5sPBFdav1rGeKF/otYagrkhP B0TUvVkRpUgK8aW4oViQ7GxYm4hljlLXuVZtkx24XZfInQKT8sqCj7HoZ T04ueAP03tKiwBfKxltUpfdsAawm0tW35zyIJMR8m1yXnzFmweawa+nV2 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10629"; a="335171243" X-IronPort-AV: E=Sophos;i="5.97,319,1669104000"; d="scan'208";a="335171243" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2023 08:32:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10629"; a="846198022" X-IronPort-AV: E=Sophos;i="5.97,319,1669104000"; d="scan'208";a="846198022" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga005.jf.intel.com with ESMTP; 22 Feb 2023 08:32:58 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 22 Feb 2023 08:32:58 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 22 Feb 2023 08:32:57 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 22 Feb 2023 08:32:57 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 22 Feb 2023 08:32:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iXvyMejoZAc+SyIEFDtAknJX/bFdONYKE8I2PceGp6OqAongoxabC4nPePvOXqDV/1Ba8Eux630UoozZLak0HU5vAOfvZz3aV3qUT1tvAAFFan6QQI8h/77GlmbIf38zdIcKzoGb+BeFaA0jGHAKU7mUFOxIllcA3zPUZzcWm6SlmYx+SOfKR2BQEr2rWOaduGLvoUnBdvOKF+2Dg77kdvLoupPBnMfT6xK9uLqoVdkHI2D7tRY3Y+0iwbluccwg4KjmRjn6iXm3neZ750rshYTI57j+RcyaOdil5lmqColETHRuYZCb+fay1O+x4TAqKaybWVt7ajwpJ4S1onnIZQ== 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=ae7JoF29KKhKHNHl1G9POC8yGm4f3KfVlJpqtniwFVA=; b=lBrE+bbz056vZQ7CJDfBm5eKu6/sfvPuCTZlz3ALexzlCKx9wCT2rKMrKjdN9teUp2vUFBXkrgoqDkwTprOSh0Fabnrj+QVLyewmGVfHTmVr+6Dexl1PUzSep7/gIryKLPjidtNKQjwpn1/7wOzq2AtcAV8T/CcG1Ci8jXO00bMc3ytOiqoTdverSdDkJOLSbTPaaoJSn5+5e2iNgX31RHscnPtRd5sJ5RfL4CM4bGGRWmG6/JfFJg7OHXUrqPCmWRFWVXYl2ooJoD6mISVfi6SfIYEOqUzwYMI91y2dQnfmmZPP9a6INYY2NBnP8snFGQ3Hro28cIA034dp4fkahA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) by SN7PR11MB6826.namprd11.prod.outlook.com (2603:10b6:806:2a1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Wed, 22 Feb 2023 16:32:56 +0000 Received: from BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::4242:36e2:5a81:ff49]) by BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::4242:36e2:5a81:ff49%7]) with mapi id 15.20.6111.021; Wed, 22 Feb 2023 16:32:56 +0000 Message-ID: <969647fa-e061-5f2e-a79d-3db6168278a8@intel.com> Date: Wed, 22 Feb 2023 16:32:51 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v9 09/22] power: replace RTE_LOGTYPE_POWER with dynamic type Content-Language: en-US To: Stephen Hemminger , References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230221190208.514276-1-stephen@networkplumber.org> <20230221190208.514276-10-stephen@networkplumber.org> From: "Hunt, David" In-Reply-To: <20230221190208.514276-10-stephen@networkplumber.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0138.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:193::17) To BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR11MB3799:EE_|SN7PR11MB6826:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a826baf-88fd-43dd-f162-08db14f273aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P8ltQBXmVPFCF2vyBKPHYkuHA+3r2NvbIFsqCqi4l+YsMx2Vm2StD1XB+VTEd+fp1LmPPQXR6NsHtfwEEc3pCDNz01rbkgTEGXjJV4LD0o4xo8uELbx3WdE8dFtspcXQoTAx13BLJbnZrigv0Ud3bBXnOArmj2V5hfq01nxtFZjSK0ztQ9wLvFemqXqySpUwxEooLp4VQEoVDjcr8nxFoktnAGqfhjNSX7klxdTMIdbkJDkMsLu+Lzqnf7RBnh8F5ZC6X8V5PJwbGAUMzqM0LSWJjvGtdWNv2vo672BHIjzNybWO/wmbx/A23r3DVrsxdhuwTMHuAqYyUG42ydWpSHoQrE6zxjbDFzeVso/KlD492+niab1eM5bkC3JiyC9q0MvajmBpFZPfn4tTdJJZyjbwhpIhhyhu8c9OSRp7u4iQ8aTSUtLXV71vN8kL73Yi65ZQiMffi65MXzsOP2PsUqEtG5lTJcn8T8t9poKBYjuO4Mw2xssfjw5q8aNAs6u6fJ9Z3C/Zen0Dz9arDbUy2OBVuuGj66Gahn0ddV83QfAfh7aI6J3fnTLJxRlcFijloKDCKzCfUh0682fwtMsNApN3H4pjwjudgbXTvYs8eElSq+klZdssnuj6SnWV1cXW/uGlpeuflLdqEVn8nPF/oPvnqj0H0/z1yPIyCc/rWyhelO/VQUsZAND06pSXOuM4HbIFKAOEOKo6zwXMZpm0k+f3QbNxpO9CCcObrYfZ0MA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3799.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(366004)(136003)(346002)(376002)(396003)(451199018)(6512007)(31686004)(6506007)(6666004)(6486002)(36756003)(31696002)(86362001)(478600001)(66946007)(316002)(2616005)(8676002)(66556008)(66476007)(83380400001)(53546011)(26005)(186003)(41300700001)(8936002)(5660300002)(2906002)(82960400001)(38100700002)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K3NqblZVWUpYZyt0c1o3QXhiQ3ltQjNZbXVXaXFob3pVdWJHYnBXYUw2WlRD?= =?utf-8?B?aTI2UldPRUVvOUlCNGpGUStyVEFWMVJmd0ZVQnVOdnA0ODI0K1NEREhVQ3d5?= =?utf-8?B?ZFlCZ2IvSTlOVTNZNFdEc3d4OEt2bXhNK1cycXVVYnJvc3NWZXlzM3NONkdY?= =?utf-8?B?dG5XY3VSSkZpMzVJMXI3YkRBQzFHdExxNWZhYUNkcTM0ZFk5eHFpUWxnQ2wr?= =?utf-8?B?SHdjNm12eVlFUEdLM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jMW55dUN2YlhtM0hrK1RzeTBlRStGV2ZFS2l2c1VqdG01UG9DVVVD?= =?utf-8?B?dkF4bXM4OHFjQ2JWUnVqSGJubWtUNXRFbWliUDlLTlMzdHp1TjJLNi82NXRN?= =?utf-8?B?dHc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 7a826baf-88fd-43dd-f162-08db14f273aa X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3799.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2023 16:32:56.1405 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FGcO5/fIDX6y5NSk+SRl68cYxe2/xx5tQDYz+/1TuRO4FBaxlzc0s6CWWADjDOVqiAZeDYMYFUFSj4wRf3a9WQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6826 X-OriginatorOrg: intel.com 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 On 21/02/2023 19:01, Stephen Hemminger wrote: > Use dynamic log type for power library. > Also replace use of RTE_LOGTYPE_USER1 with lib.power.guest. > > Signed-off-by: Stephen Hemminger > --- > lib/eal/common/eal_common_log.c | 1 - > lib/eal/include/rte_log.h | 2 +- > lib/power/guest_channel.c | 3 ++- > lib/power/power_common.c | 2 ++ > lib/power/power_common.h | 3 ++- > lib/power/power_kvm_vm.c | 1 + > lib/power/rte_power.c | 1 + > 7 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c > index 9e853addb717..39e1e6680dea 100644 > --- a/lib/eal/common/eal_common_log.c > +++ b/lib/eal/common/eal_common_log.c > @@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = { > {RTE_LOGTYPE_HASH, "lib.hash"}, > {RTE_LOGTYPE_LPM, "lib.lpm"}, > {RTE_LOGTYPE_KNI, "lib.kni"}, > - {RTE_LOGTYPE_POWER, "lib.power"}, > {RTE_LOGTYPE_METER, "lib.meter"}, > {RTE_LOGTYPE_SCHED, "lib.sched"}, > {RTE_LOGTYPE_PORT, "lib.port"}, > diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h > index 1408722b2c2f..7d4345acceca 100644 > --- a/lib/eal/include/rte_log.h > +++ b/lib/eal/include/rte_log.h > @@ -36,7 +36,7 @@ extern "C" { > #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ > #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ > /* was RTE_LOGTYPE_ACL */ > -#define RTE_LOGTYPE_POWER 10 /**< Log related to power. */ > + /* was RTE_LOGTYPE_POWER */ > #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ > #define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ > #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ > diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c > index 969a9e5aaa06..efc326d520ca 100644 > --- a/lib/power/guest_channel.c > +++ b/lib/power/guest_channel.c > @@ -17,7 +17,8 @@ > > #include "guest_channel.h" > > -#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1 > +RTE_LOG_REGISTER_SUFFIX(guest_channel_logtype, guest, INFO); > +#define RTE_LOGTYPE_GUEST_CHANNEL guest_channel_logtype > > /* Timeout for incoming message in milliseconds. */ > #define TIMEOUT 10 > diff --git a/lib/power/power_common.c b/lib/power/power_common.c > index 1e09facb863f..bf77eafa886b 100644 > --- a/lib/power/power_common.c > +++ b/lib/power/power_common.c > @@ -12,6 +12,8 @@ > > #include "power_common.h" > > +RTE_LOG_REGISTER_DEFAULT(power_logtype, INFO); > + > #define POWER_SYSFILE_SCALING_DRIVER \ > "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_driver" > #define POWER_SYSFILE_GOVERNOR \ > diff --git a/lib/power/power_common.h b/lib/power/power_common.h > index c1c713927621..63a3a443509e 100644 > --- a/lib/power/power_common.h > +++ b/lib/power/power_common.h > @@ -5,11 +5,12 @@ > #ifndef _POWER_COMMON_H_ > #define _POWER_COMMON_H_ > > - > #include > > #define RTE_POWER_INVALID_FREQ_INDEX (~0) > > +extern int power_logtype; > +#define RTE_LOGTYPE_POWER power_logtype > > #ifdef RTE_LIBRTE_POWER_DEBUG > #define POWER_DEBUG_TRACE(fmt, args...) \ > diff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c > index 6a8109d44959..db031f43105a 100644 > --- a/lib/power/power_kvm_vm.c > +++ b/lib/power/power_kvm_vm.c > @@ -8,6 +8,7 @@ > > #include "rte_power_guest_channel.h" > #include "guest_channel.h" > +#include "power_common.h" > #include "power_kvm_vm.h" > > #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent" > diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c > index 63a43bd8f5ae..db0e7705a9ef 100644 > --- a/lib/power/rte_power.c > +++ b/lib/power/rte_power.c > @@ -10,6 +10,7 @@ > #include "rte_power.h" > #include "power_acpi_cpufreq.h" > #include "power_cppc_cpufreq.h" > +#include "power_common.h" > #include "power_kvm_vm.h" > #include "power_pstate_cpufreq.h" Acked-by: David Hunt >