[dpdk-dev] [PATCH v7 1/7] power_intrinsics: use callbacks for comparison

David Hunt david.hunt at intel.com
Wed Jul 7 13:56:58 CEST 2021


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 at intel.com>
> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev at 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 at intel.com>





More information about the dev mailing list