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 8168E45459; Fri, 14 Jun 2024 10:04:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D3DF402F0; Fri, 14 Jun 2024 10:04:12 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 74E37402DD for ; Fri, 14 Jun 2024 10:04:10 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 5AB9B201F5; Fri, 14 Jun 2024 10:04:09 +0200 (CEST) Content-class: urn:content-classes:message Subject: RE: [PATCH v2 1/2] power: introduce PM QoS API on CPU wide MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 14 Jun 2024 10:04:07 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F520@smartserver.smartshare.dk> In-Reply-To: <20240613112038.14271-2-lihuisong@huawei.com> X-MS-Has-Attach: X-MimeOLE: Produced By Microsoft Exchange V6.5 X-MS-TNEF-Correlator: Thread-Topic: [PATCH v2 1/2] power: introduce PM QoS API on CPU wide Thread-Index: Adq9hO2H9lJ5qR7YRA6JUTDxATgT2AAqRlzw References: <20240320105529.5626-1-lihuisong@huawei.com> <20240613112038.14271-1-lihuisong@huawei.com> <20240613112038.14271-2-lihuisong@huawei.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Huisong Li" , , Cc: , , , , , 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 > +#define PM_QOS_SYSFILE_RESUME_LATENCY_US \ > + "/sys/devices/system/cpu/cpu%u/power/pm_qos_resume_latency_us" Is it OK to access this path using the lcore_id as CPU parameter to = open_core_sysfs_file(), or must it be mapped through = rte_lcore_to_cpu_id(lcore_id) first? @David, do you know? > + > +int > +rte_power_qos_set_cpu_resume_latency(uint16_t lcore_id, int latency) > +{ > + char buf[BUFSIZ] =3D {0}; > + FILE *f; > + int ret; > + > + if (lcore_id >=3D RTE_MAX_LCORE) { > + POWER_LOG(ERR, "Lcore id %u can not exceeds %u", > + lcore_id, RTE_MAX_LCORE - 1U); > + return -EINVAL; > + } The lcore_id could be a registered non-EAL thread. You should probably fail in that case. Same comment for rte_power_qos_get_cpu_resume_latency(). > +#define PM_QOS_STRICT_LATENCY_VALUE 0 > +#define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT ((int)(UINT32_MAX >> = 1)) These definitions are in the public header file, and thus should be = RTE_POWER_ prefixed and have comments describing them.