From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A752A0531 for ; Wed, 12 Feb 2020 00:48:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1273F2B87; Wed, 12 Feb 2020 00:48:51 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 7538A2952; Wed, 12 Feb 2020 00:48:47 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 15:48:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="380598251" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 11 Feb 2020 15:48:46 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Feb 2020 15:48:44 -0800 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 12 Feb 2020 07:48:42 +0800 Received: from shsmsx602.ccr.corp.intel.com ([10.109.6.142]) by SHSMSX602.ccr.corp.intel.com ([10.109.6.142]) with mapi id 15.01.1713.004; Wed, 12 Feb 2020 07:48:42 +0800 From: "Yao, Lei A" To: "Hunt, David" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH] examples/power: fix ack for enable/disable turbo Thread-Index: AQHV4MkWqKEx24yKj0SGDxEaoo4POKgWqdrw Date: Tue, 11 Feb 2020 23:48:42 +0000 Message-ID: <8602f94e1cfd4d469656ba0153f36de0@intel.com> References: <20200211105008.4540-1-david.hunt@intel.com> In-Reply-To: <20200211105008.4540-1-david.hunt@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-reaction: no-action dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH] examples/power: fix ack for enable/disable turbo X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > -----Original Message----- > From: Hunt, David > Sent: Tuesday, February 11, 2020 6:50 PM > To: dev@dpdk.org; Hunt, David > Cc: Yao, Lei A ; stable@dpdk.org > Subject: [PATCH] examples/power: fix ack for enable/disable turbo >=20 > 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. >=20 > Fix the handling of the return code to treat ">=3D 0" as success, and sen= d an > ACK. Only send NACK when < 0 (failure). >=20 > Fixes: 0de94bcac7fc ("examples/vm_power: send confirmation cmd to > guest") > Signed-off-by: David Hunt Acked-by: Lei Yao > --- > examples/vm_power_manager/channel_monitor.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 =3D send_ack_for_received_cmd(pkt, > chan_info, > - scale_res > 0 ? > + scale_res >=3D 0 ? > CPU_POWER_CMD_ACK : > CPU_POWER_CMD_NACK); > if (ret < 0) > -- > 2.17.1