From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 32CB245923;
	Thu, 12 Sep 2024 03:15:37 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 14E074027D;
	Thu, 12 Sep 2024 03:15:37 +0200 (CEST)
Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])
 by mails.dpdk.org (Postfix) with ESMTP id 26A9940267
 for <dev@dpdk.org>; Thu, 12 Sep 2024 03:15:32 +0200 (CEST)
Received: from mail.maildlp.com (unknown [172.19.163.252])
 by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4X3zvx6lZ6zfbm3;
 Thu, 12 Sep 2024 09:13:17 +0800 (CST)
Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10])
 by mail.maildlp.com (Postfix) with ESMTPS id C3E281800D4;
 Thu, 12 Sep 2024 09:15:28 +0800 (CST)
Received: from [10.67.121.161] (10.67.121.161) by
 dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 12 Sep 2024 09:15:28 +0800
Message-ID: <3bf73294-830a-418a-9b37-c1f3ad556107@huawei.com>
Date: Thu, 12 Sep 2024 09:15:27 +0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v9 2/2] examples/l3fwd-power: add PM QoS configuration
To: "lihuisong (C)" <lihuisong@huawei.com>, <dev@dpdk.org>
CC: <mb@smartsharesystems.com>, <thomas@monjalon.net>, <ferruh.yigit@amd.com>, 
 <anatoly.burakov@intel.com>, <david.hunt@intel.com>,
 <sivaprasad.tummala@amd.com>, <stephen@networkplumber.org>,
 <david.marchand@redhat.com>, <liuyonglong@huawei.com>
References: <20240320105529.5626-1-lihuisong@huawei.com>
 <20240809095012.16717-1-lihuisong@huawei.com>
 <20240809095012.16717-3-lihuisong@huawei.com>
 <baef7ad6-8676-3ddf-bbc4-3ae7d393d93a@huawei.com>
 <ff6bfc08-8d8a-bdae-752b-1b729ac11c06@huawei.com>
Content-Language: en-US
From: fengchengwen <fengchengwen@huawei.com>
In-Reply-To: <ff6bfc08-8d8a-bdae-752b-1b729ac11c06@huawei.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.67.121.161]
X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To
 dggpeml500024.china.huawei.com (7.185.36.10)
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On 2024/9/10 20:07, lihuisong (C) wrote:
> Hi chengwen,
> 
> 在 2024/9/10 10:26, fengchengwen 写道:
>> Hi Huisong,
>>
>> On 2024/8/9 17:50, Huisong Li wrote:
>>> Add PM QoS configuration to declease the delay after sleep in case of
>>> entering deeper idle state.
>>>
>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>>> Acked-by: Morten Brørup <mb@smartsharesystems.com>
>>> ---
>>>   examples/l3fwd-power/main.c | 24 ++++++++++++++++++++++++
>>>   1 file changed, 24 insertions(+)
>>>
>>> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
>>> index 2bb6b092c3..9b386c3710 100644
>>> --- a/examples/l3fwd-power/main.c
>>> +++ b/examples/l3fwd-power/main.c
>>> @@ -47,6 +47,7 @@
>>>   #include <rte_telemetry.h>
>>>   #include <rte_power_pmd_mgmt.h>
>>>   #include <rte_power_uncore.h>
>>> +#include <rte_power_qos.h>
>>>     #include "perf_core.h"
>>>   #include "main.h"
>>> @@ -2260,6 +2261,22 @@ init_power_library(void)
>>>               return -1;
>>>           }
>>>       }
>>> +
>>> +    RTE_LCORE_FOREACH(lcore_id) {
>>> +        /*
>>> +         * Set the worker lcore's to have strict latency limit to allow
>>> +         * the CPU to enter the shallowest idle state.
>>> +         */
>>> +        ret = rte_power_qos_set_cpu_resume_latency(lcore_id,
>>> +                    RTE_POWER_QOS_STRICT_LATENCY_VALUE);
>>> +        if (ret < 0) {
>>> +            RTE_LOG(ERR, L3FWD_POWER,
>>> +                "Failed to set strict resume latency on CPU%u.\n",
>> suggest on core%u and use if (ret != 0)
> Ack
>>
>> and how about use warning, if current system don't support it, we just give a warning message
>> but let's it continue.
> 
> 
> Because power lib is just supported and compiled on Linux.
> And Linux always enable this feature. So Linux always support it.
> I don't know what it would be like to compile l3fwd-power on windows.
> But this is the another issue and other power APIs, like rte_power_init, are used directly in l3fwd-power without any condition.
> So how about contiue to use error message?

ok

>>
>>
>>> +                lcore_id);
>>> +            return ret;
>>> +        }
>>> +    }
>>> +
>>>       return ret;
>>>   }
>>>   @@ -2299,6 +2316,13 @@ deinit_power_library(void)
>>>               }
>>>           }
>>>       }
>>> +
>>> +    RTE_LCORE_FOREACH(lcore_id) {
>>> +        /* Restore the original value in kernel. */
>>> +        rte_power_qos_set_cpu_resume_latency(lcore_id,
>>> +                RTE_POWER_QOS_RESUME_LATENCY_NO_CONSTRAINT);
>>> +    }
>>> +
>>>       return ret;
>>>   }
>>>  
>> .