DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Kevin Laatz <kevin.laatz@intel.com>, <dev@dpdk.org>
Cc: Ray Kinsella <mdr@ashroe.eu>, David Hunt <david.hunt@intel.com>
Subject: Re: [PATCH v3 3/4] lib/power: add get and set API for scaling freq min and max with pstate mode
Date: Tue, 24 May 2022 11:00:53 +0100	[thread overview]
Message-ID: <0a86735b-ade8-57b2-5bc5-a1f8060033ae@intel.com> (raw)
In-Reply-To: <20220523202124.293865-4-kevin.laatz@intel.com>

On 23-May-22 9:21 PM, Kevin Laatz wrote:
> Add new get/set API to allow the user or application to set the minimum
> and maximum frequencies to use when scaling.
> Previously, the frequency range was determined by the HW capabilities of
> the CPU. With this new API, the user or application can constrain this
> if required.
> 
> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
> Acked-by: Ray Kinsella <mdr@ashroe.eu>
> 
> ---

<snip>

> +int
> +rte_power_pmd_mgmt_get_scaling_freq_max(unsigned int lcore)
> +{
> +	if (lcore >= RTE_MAX_LCORE) {
> +		RTE_LOG(ERR, POWER, "Invalid lcore ID: %u\n", lcore);
> +		return -EINVAL;
> +	}
> +
> +	if (scale_freq_max[lcore] == UINT32_MAX)
> +		RTE_LOG(DEBUG, POWER, "Scaling freq max config not set. Using sysfs max freq.\n");
> +
> +	return scale_freq_max[lcore];

If you're using 0 as "not set" you should return 0 when it's not set :)

> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
> + *
> + * Set the min frequency to be used for frequency scaling.

...or zero to use defaults?

> + *
> + * @note Supported by: Pstate mode.
> + *
> + * @param lcore
> + *   The ID of the lcore to set the min frequency for.
> + * @param min
> + *   The value, in KiloHertz, to set the minimum frequency to.
> + * @return
> + *   0 on success
> + *   <0 on error
> + */
> +__rte_experimental
> +int
> +rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min);
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
> + *
> + * Set the max frequency to be used for frequency scaling.

...or zero to use defaults?

> + *
> + * @note Supported by: Pstate mode.
> + *
> + * @param lcore
> + *   The ID of the lcore to set the max frequency for.
> + * @param max
> + *   The value, in KiloHertz, to set the maximum frequency to.
> + *   If 'max' is 0, it is considered 'not set'.
> + * @return
> + *   0 on success
> + *   <0 on error
> + */
> +__rte_experimental
> +int
> +rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max);
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
> + *
> + * Get the current configured min frequency used for frequency scaling.
> + *
> + * @note Supported by: Pstate mode.
> + *
> + * @param lcore
> + *   The ID of the lcore to get the min frequency for.
> + * @return
> + *   0 if no value has been configured via the 'set' API.
> + *   >0 if a minimum frequency has been configured. Value is the minimum frequency
> + *   , in KiloHertz, used for frequency scaling.
> + *   <0 on error
> + */
> +__rte_experimental
> +int
> +rte_power_pmd_mgmt_get_scaling_freq_min(unsigned int lcore);
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
> + *
> + * Get the current configured max frequency used for frequency scaling.
> + *
> + * @note Supported by: Pstate mode.
> + *
> + * @param lcore
> + *   The ID of the lcore to get the max frequency for.
> + * @return
> + *   UINT32_MAX if no value has been configured via the 'set' API.

The comment now mismatches the code.

Once the above is fixed,

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

  reply	other threads:[~2022-05-24 10:01 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 14:08 [PATCH 0/4] Add APIs for configurable power options Kevin Laatz
2022-04-08 14:08 ` [PATCH 1/4] lib/power: add get and set API for emptypoll max Kevin Laatz
2022-04-15 14:43   ` Ray Kinsella
2022-04-19 11:25     ` Kevin Laatz
2022-04-08 14:08 ` [PATCH 2/4] lib/power: add get and set API for pause duration Kevin Laatz
2022-04-08 14:08 ` [PATCH 3/4] lib/power: add get and set API for scaling freq min and max with pstate mode Kevin Laatz
2022-04-08 14:08 ` [PATCH 4/4] examples/l3fwd_power: add cli for configurable options Kevin Laatz
2022-04-19 11:24 ` [PATCH v2 0/4] Add APIs for configurable power options Kevin Laatz
2022-04-19 11:24   ` [PATCH v2 1/4] lib/power: add get and set API for emptypoll max Kevin Laatz
2022-04-19 15:42     ` Ray Kinsella
2022-04-19 11:24   ` [PATCH v2 2/4] lib/power: add get and set API for pause duration Kevin Laatz
2022-04-19 15:42     ` Ray Kinsella
2022-05-18  8:58     ` Burakov, Anatoly
2022-04-19 11:25   ` [PATCH v2 3/4] lib/power: add get and set API for scaling freq min and max with pstate mode Kevin Laatz
2022-04-19 15:43     ` Ray Kinsella
2022-05-18  9:05     ` Burakov, Anatoly
2022-05-23 16:25       ` Kevin Laatz
2022-04-19 11:25   ` [PATCH v2 4/4] examples/l3fwd_power: add cli for configurable options Kevin Laatz
2022-05-18  9:11     ` Burakov, Anatoly
2022-05-23 16:54       ` Kevin Laatz
2022-05-23 20:21   ` [PATCH v3 0/4] Add APIs for configurable power options Kevin Laatz
2022-05-23 20:21     ` [PATCH v3 1/4] lib/power: add get and set API for emptypoll max Kevin Laatz
2022-05-24 13:45       ` Ray Kinsella
2022-05-23 20:21     ` [PATCH v3 2/4] lib/power: add get and set API for pause duration Kevin Laatz
2022-05-23 20:21     ` [PATCH v3 3/4] lib/power: add get and set API for scaling freq min and max with pstate mode Kevin Laatz
2022-05-24 10:00       ` Burakov, Anatoly [this message]
2022-05-23 20:21     ` [PATCH v3 4/4] examples/l3fwd_power: add cli for configurable options Kevin Laatz
2022-05-24 10:03       ` Burakov, Anatoly
2022-05-24 13:14 ` [PATCH v4 0/4] Add APIs for configurable power options Kevin Laatz
2022-05-24 13:14   ` [PATCH v4 1/4] lib/power: add get and set API for emptypoll max Kevin Laatz
2022-05-24 14:40     ` David Hunt
2022-05-24 13:14   ` [PATCH v4 2/4] lib/power: add get and set API for pause duration Kevin Laatz
2022-05-24 14:39     ` David Hunt
2022-05-24 13:14   ` [PATCH v4 3/4] lib/power: add get and set API for scaling freq min and max with pstate mode Kevin Laatz
2022-05-24 14:39     ` David Hunt
2022-05-24 13:14   ` [PATCH v4 4/4] examples/l3fwd_power: add cli for configurable options Kevin Laatz
2022-05-24 14:38     ` David Hunt
2022-05-27 16:04   ` [PATCH v4 0/4] Add APIs for configurable power options Burakov, Anatoly
2022-05-31  9:59 ` [PATCH v5 " Kevin Laatz
2022-05-31  9:59   ` [PATCH v5 1/4] lib/power: add get and set API for emptypoll max Kevin Laatz
2022-05-31  9:59   ` [PATCH v5 2/4] lib/power: add get and set API for pause duration Kevin Laatz
2022-06-02 14:01     ` Burakov, Anatoly
2022-06-02 14:53       ` Kevin Laatz
2022-05-31  9:59   ` [PATCH v5 3/4] lib/power: add get and set API for scaling freq min and max with pstate mode Kevin Laatz
2022-05-31  9:59   ` [PATCH v5 4/4] examples/l3fwd_power: add cli for configurable options Kevin Laatz
2022-06-02 15:13 ` [PATCH v6 0/4] Add APIs for configurable power options Kevin Laatz
2022-06-02 15:13   ` [PATCH v6 1/4] lib/power: add get and set API for emptypoll max Kevin Laatz
2022-06-02 15:13   ` [PATCH v6 2/4] lib/power: add get and set API for pause duration Kevin Laatz
2022-06-02 15:13   ` [PATCH v6 3/4] lib/power: add get and set API for scaling freq min and max with pstate mode Kevin Laatz
2022-06-02 15:13   ` [PATCH v6 4/4] examples/l3fwd_power: add cli for configurable options Kevin Laatz
2022-06-04 20:43   ` [PATCH v6 0/4] Add APIs for configurable power options Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a86735b-ade8-57b2-5bc5-a1f8060033ae@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=kevin.laatz@intel.com \
    --cc=mdr@ashroe.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).