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 D4F2F4548D; Tue, 18 Jun 2024 14:19:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF2EE40E17; Tue, 18 Jun 2024 14:19:22 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id 1ABCF402B4 for ; Tue, 18 Jun 2024 14:19:21 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4W3QkT0jxSz1xsbL; Tue, 18 Jun 2024 20:17:53 +0800 (CST) Received: from kwepemm600004.china.huawei.com (unknown [7.193.23.242]) by mail.maildlp.com (Postfix) with ESMTPS id 142CA1A016C; Tue, 18 Jun 2024 20:19:19 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 18 Jun 2024 20:19:18 +0800 Message-ID: Date: Tue, 18 Jun 2024 20:19:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v2 1/2] power: introduce PM QoS API on CPU wide To: =?UTF-8?Q?Morten_Br=c3=b8rup?= , , CC: , , , , , References: <20240320105529.5626-1-lihuisong@huawei.com> <20240613112038.14271-1-lihuisong@huawei.com> <20240613112038.14271-2-lihuisong@huawei.com> <98CBD80474FA8B44BF855DF32C47DC35E9F520@smartserver.smartshare.dk> From: "lihuisong (C)" In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F520@smartserver.smartshare.dk> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600004.china.huawei.com (7.193.23.242) 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 Hi Morten, Thanks for your review. 在 2024/6/14 16:04, Morten Brørup 写道: >> +#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? The cpu_id getting by rte_lcore_to_cpu_id() is from lcore_config[lcore_id].core_id which is from "/sys/devices/system/cpu/cpuX/topology/core_id" file, please see the function eal_cpu_core_id(). So I think the number in above "cpuX" must be the lcore_id in DPDK. And the similar interface in power lib also directly use the locore_id. > > @David, do you know? > >> + >> +int >> +rte_power_qos_set_cpu_resume_latency(uint16_t lcore_id, int latency) >> +{ >> + char buf[BUFSIZ] = {0}; >> + FILE *f; >> + int ret; >> + >> + if (lcore_id >= 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. right, how about use rte_lcore_is_enabled(locore_id)? > > 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. Ack > > > .