From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Hunt, David" Subject: Re: [PATCH v1 4/7] examples/power: add host channel to power manager Date: Wed, 12 Sep 2018 13:07:49 +0100 Message-ID: References: <20180830105422.1198-1-david.hunt@intel.com> <20180830105422.1198-5-david.hunt@intel.com> <2DBBFF226F7CF64BAFCA79B681719D953A53C342@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "Mcnamara, John" To: "Yao, Lei A" , "dev@dpdk.org" Return-path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 218A54C94 for ; Wed, 12 Sep 2018 14:07:51 +0200 (CEST) In-Reply-To: <2DBBFF226F7CF64BAFCA79B681719D953A53C342@shsmsx102.ccr.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Lei, On 4/9/2018 8:31 AM, Yao, Lei A wrote: > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Hunt >> Sent: Thursday, August 30, 2018 6:54 PM >> To: dev@dpdk.org >> Cc: Mcnamara, John ; Hunt, David >> >> Subject: [dpdk-dev] [PATCH v1 4/7] examples/power: add host channel to >> power manager >> >> This patch adds a fifo channel to the vm_power_manager app through which >> we can send commands and polices. Intended for sending JSON strings. >> The fifo is at /tmp/powermonitor/fifo.0 >> >> Signed-off-by: David Hunt >> --- >> examples/vm_power_manager/channel_manager.c | 108 >> +++++++++++++++ >> examples/vm_power_manager/channel_manager.h | 17 ++- >> examples/vm_power_manager/channel_monitor.c | 146 >> +++++++++++++++----- >> examples/vm_power_manager/main.c | 2 + >> 4 files changed, 238 insertions(+), 35 deletions(-) >> >> diff --git a/examples/vm_power_manager/channel_manager.c >> b/examples/vm_power_manager/channel_manager.c >> index 2bb8641d3..bcd106be1 100644 >> --- a/examples/vm_power_manager/channel_manager.c >> +++ b/examples/vm_power_manager/channel_manager.c >> @@ -13,6 +13,7 @@ --snip-- >> >> @@ -160,8 +199,13 @@ update_policy(struct channel_packet *pkt) >> unsigned int updated = 0; >> int i; >> >> + >> + RTE_LOG(INFO, CHANNEL_MONITOR, >> + "Updating policy for %s\n", pkt->vm_name); >> + >> for (i = 0; i < MAX_VMS; i++) { >> if (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) { > I suggest add warning log here when no VM can match the policy name > which we send through the fifo.0. Otherwise, the user can't aware the > policy won't be applied. There's already a flag here called "updated" that if it falls through this loop without finding the policy name, it adds a new one, so no need for the message. I will however re-word the "Updating policy" message to read "Applying policy". "Applying" is less confusing. Thanks, Dave. ---snip---