eal: use callbacks for power monitoring comparison
authorAnatoly Burakov <anatoly.burakov@intel.com>
Fri, 9 Jul 2021 16:08:10 +0000 (16:08 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 9 Jul 2021 19:13:13 +0000 (21:13 +0200)
commit6afc4baf4ffb90427208746f8484c7c3c430ae86
tree8c7a5f67130f9ebcf332e9d103a46cfd61c722fe
parent76e6f99c0085811720b12780064241f4f6604947
eal: use callbacks for power monitoring comparison

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>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
doc/guides/rel_notes/release_21_08.rst
drivers/event/dlb2/dlb2.c
drivers/net/i40e/i40e_rxtx.c
drivers/net/iavf/iavf_rxtx.c
drivers/net/ice/ice_rxtx.c
drivers/net/ixgbe/ixgbe_rxtx.c
drivers/net/mlx5/mlx5_rx.c
lib/eal/include/generic/rte_power_intrinsics.h
lib/eal/x86/rte_power_intrinsics.c