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 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 <dev@dpdk.org>; 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 <anatoly.burakov@intel.com>, dev@dpdk.org, Timothy McDaniel <timothy.mcdaniel@intel.com>, Beilei Xing <beilei.xing@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Qiming Yang <qiming.yang@intel.com>, Qi Zhang <qi.z.zhang@intel.com>, Haiyue Wang <haiyue.wang@intel.com>, Matan Azrad <matan@nvidia.com>, Shahaf Shuler <shahafs@nvidia.com>, Viacheslav Ovsiienko <viacheslavo@nvidia.com>, Bruce Richardson <bruce.richardson@intel.com>, Konstantin Ananyev <konstantin.ananyev@intel.com> Cc: ciara.loftus@intel.com References: <cover.1625498488.git.anatoly.burakov@intel.com> <cover.1625654882.git.anatoly.burakov@intel.com> <9a51491b78f728f8f8c647bef81784f12a35138a.1625654882.git.anatoly.burakov@intel.com> From: David Hunt <david.hunt@intel.com> 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 <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 Sender: "dev" <dev-bounces@dpdk.org> 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 <konstantin.ananyev@intel.com> > Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> > --- > > 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 <david.hunt@intel.com>