* [dpdk-dev] [PATCH] examples/power: fix ack for enable/disable turbo
@ 2020-02-11 10:50 David Hunt
2020-02-11 23:48 ` Yao, Lei A
2020-02-13 15:25 ` [dpdk-dev] [dpdk-stable] " David Marchand
0 siblings, 2 replies; 3+ messages in thread
From: David Hunt @ 2020-02-11 10:50 UTC (permalink / raw)
To: dev, david.hunt; +Cc: lei.a.yao, stable
When a VM sends a command through virtio-serial to enable/disable
turbo, it is successfully enabled or disabled, yet the response to the
VM is NACK. This is because all the library frequency change APIs return
1 for success (change in frequency), 0 for success (no change in
frequency) and -1 for failure. However the turbo enable/disable APIs just
return 0 for success and -1 for failure.
Fix the handling of the return code to treat ">= 0" as success, and
send an ACK. Only send NACK when < 0 (failure).
Fixes: 0de94bcac7fc ("examples/vm_power: send confirmation cmd to guest")
Signed-off-by: David Hunt <david.hunt@intel.com>
---
examples/vm_power_manager/channel_monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 090c2a98b..1d00a6cf6 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -868,7 +868,7 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)
if (valid_unit) {
ret = send_ack_for_received_cmd(pkt,
chan_info,
- scale_res > 0 ?
+ scale_res >= 0 ?
CPU_POWER_CMD_ACK :
CPU_POWER_CMD_NACK);
if (ret < 0)
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/power: fix ack for enable/disable turbo
2020-02-11 10:50 [dpdk-dev] [PATCH] examples/power: fix ack for enable/disable turbo David Hunt
@ 2020-02-11 23:48 ` Yao, Lei A
2020-02-13 15:25 ` [dpdk-dev] [dpdk-stable] " David Marchand
1 sibling, 0 replies; 3+ messages in thread
From: Yao, Lei A @ 2020-02-11 23:48 UTC (permalink / raw)
To: Hunt, David, dev; +Cc: stable
> -----Original Message-----
> From: Hunt, David <david.hunt@intel.com>
> Sent: Tuesday, February 11, 2020 6:50 PM
> To: dev@dpdk.org; Hunt, David <david.hunt@intel.com>
> Cc: Yao, Lei A <lei.a.yao@intel.com>; stable@dpdk.org
> Subject: [PATCH] examples/power: fix ack for enable/disable turbo
>
> When a VM sends a command through virtio-serial to enable/disable turbo, it
> is successfully enabled or disabled, yet the response to the VM is NACK. This
> is because all the library frequency change APIs return
> 1 for success (change in frequency), 0 for success (no change in
> frequency) and -1 for failure. However the turbo enable/disable APIs just
> return 0 for success and -1 for failure.
>
> Fix the handling of the return code to treat ">= 0" as success, and send an
> ACK. Only send NACK when < 0 (failure).
>
> Fixes: 0de94bcac7fc ("examples/vm_power: send confirmation cmd to
> guest")
> Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Lei Yao<lei.a.yao@intel.com>
> ---
> examples/vm_power_manager/channel_monitor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/examples/vm_power_manager/channel_monitor.c
> b/examples/vm_power_manager/channel_monitor.c
> index 090c2a98b..1d00a6cf6 100644
> --- a/examples/vm_power_manager/channel_monitor.c
> +++ b/examples/vm_power_manager/channel_monitor.c
> @@ -868,7 +868,7 @@ process_request(struct channel_packet *pkt, struct
> channel_info *chan_info)
> if (valid_unit) {
> ret = send_ack_for_received_cmd(pkt,
> chan_info,
> - scale_res > 0 ?
> + scale_res >= 0 ?
> CPU_POWER_CMD_ACK :
> CPU_POWER_CMD_NACK);
> if (ret < 0)
> --
> 2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH] examples/power: fix ack for enable/disable turbo
2020-02-11 10:50 [dpdk-dev] [PATCH] examples/power: fix ack for enable/disable turbo David Hunt
2020-02-11 23:48 ` Yao, Lei A
@ 2020-02-13 15:25 ` David Marchand
1 sibling, 0 replies; 3+ messages in thread
From: David Marchand @ 2020-02-13 15:25 UTC (permalink / raw)
To: David Hunt; +Cc: dev, lei.a.yao, dpdk stable
On Tue, Feb 11, 2020 at 11:50 AM David Hunt <david.hunt@intel.com> wrote:
> When a VM sends a command through virtio-serial to enable/disable
> turbo, it is successfully enabled or disabled, yet the response to the
> VM is NACK. This is because all the library frequency change APIs return
> 1 for success (change in frequency), 0 for success (no change in
> frequency) and -1 for failure. However the turbo enable/disable APIs just
> return 0 for success and -1 for failure.
>
> Fix the handling of the return code to treat ">= 0" as success, and
> send an ACK. Only send NACK when < 0 (failure).
>
> Fixes: 0de94bcac7fc ("examples/vm_power: send confirmation cmd to guest")
Cc: stable@dpdk.org
> Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Lei Yao<lei.a.yao@intel.com>
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-13 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 10:50 [dpdk-dev] [PATCH] examples/power: fix ack for enable/disable turbo David Hunt
2020-02-11 23:48 ` Yao, Lei A
2020-02-13 15:25 ` [dpdk-dev] [dpdk-stable] " David Marchand
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).