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 95416A0C49; Wed, 7 Jul 2021 13:57:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E5BC406FF; Wed, 7 Jul 2021 13:57:08 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 7B2E5406B4 for ; Wed, 7 Jul 2021 13:57:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="209108156" X-IronPort-AV: E=Sophos;i="5.83,331,1616482800"; d="scan'208";a="209108156" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 04:57:02 -0700 X-IronPort-AV: E=Sophos;i="5.83,331,1616482800"; d="scan'208";a="482143668" Received: from dhunt5-mobl5.ger.corp.intel.com (HELO [10.252.24.114]) ([10.252.24.114]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 04:56:59 -0700 To: Anatoly Burakov , dev@dpdk.org, Timothy McDaniel , Beilei Xing , Jingjing Wu , Qiming Yang , Qi Zhang , Haiyue Wang , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Bruce Richardson , Konstantin Ananyev Cc: ciara.loftus@intel.com References: <9a51491b78f728f8f8c647bef81784f12a35138a.1625654882.git.anatoly.burakov@intel.com> From: David Hunt Message-ID: <64fbc03e-b845-85fa-d5b0-7ab0eebe9e8d@intel.com> Date: Wed, 7 Jul 2021 12:56:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <9a51491b78f728f8f8c647bef81784f12a35138a.1625654882.git.anatoly.burakov@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [dpdk-dev] [PATCH v7 1/7] power_intrinsics: use callbacks for comparison 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 Sender: "dev" On 7/7/2021 11:48 AM, Anatoly Burakov wrote: > Previously, the semantics of power monitor were such that we were > checking current value against the expected value, and if they matched, > then the sleep was aborted. This is somewhat inflexible, because it only > allowed us to check for a specific value in a specific way. > > This commit replaces the comparison with a user callback mechanism, so > that any PMD (or other code) using `rte_power_monitor()` can define > their own comparison semantics and decision making on how to detect the > need to abort the entering of power optimized state. > > Existing implementations are adjusted to follow the new semantics. > > Suggested-by: Konstantin Ananyev > Signed-off-by: Anatoly Burakov > Acked-by: Konstantin Ananyev > --- > > Notes: > v4: > - Return error if callback is set to NULL > - Replace raw number with a macro in monitor condition opaque data > > v2: > - Use callback mechanism for more flexibility > - Address feedback from Konstantin > > Tested-by: David Hunt