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.anan...@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
Acked-by: Konstantin Ananyev <konstantin.anan...@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.h...@intel.com>



Reply via email to