From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id DEB737CEB for ; Wed, 26 Sep 2018 15:41:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 06:41:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,306,1534834800"; d="scan'208";a="83404401" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.223.64]) by FMSMGA003.fm.intel.com with ESMTP; 26 Sep 2018 06:41:29 -0700 From: David Hunt To: dev@dpdk.org Cc: john.mcnamara@intel.com, stephen@networkplumber.org, lei.a.yao@intel.com, anatoly.burakov@intel.com, David Hunt Date: Wed, 26 Sep 2018 14:40:32 +0100 Message-Id: <20180926134037.43606-7-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926134037.43606-1-david.hunt@intel.com> References: <20180914135406.52190-1-david.hunt@intel.com> <20180926134037.43606-1-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v4 06/11] examples/power: increase allowed number of clients X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2018 13:41:31 -0000 Now that we're handling host policies, containers and virtual machines, we'll rename MAX_VMS to MAX_CLIENTS, and increase from 4 to 64 Signed-off-by: David Hunt --- examples/vm_power_manager/channel_manager.h | 4 ++-- examples/vm_power_manager/channel_monitor.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h index e32235b07..d948b304c 100644 --- a/examples/vm_power_manager/channel_manager.h +++ b/examples/vm_power_manager/channel_manager.h @@ -37,7 +37,7 @@ struct sockaddr_un _sockaddr_un; #define UNIX_PATH_MAX sizeof(_sockaddr_un.sun_path) #endif -#define MAX_VMS 4 +#define MAX_CLIENTS 64 #define MAX_VCPUS 20 @@ -47,7 +47,7 @@ struct libvirt_vm_info { uint8_t num_cpus; }; -struct libvirt_vm_info lvm_info[MAX_VMS]; +struct libvirt_vm_info lvm_info[MAX_CLIENTS]; /* Communication Channel Status */ enum channel_status { CHANNEL_MGR_CHANNEL_DISCONNECTED = 0, CHANNEL_MGR_CHANNEL_CONNECTED, diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c index c3c3d7bb1..53a4efe45 100644 --- a/examples/vm_power_manager/channel_monitor.c +++ b/examples/vm_power_manager/channel_monitor.c @@ -41,7 +41,7 @@ static volatile unsigned run_loop = 1; static int global_event_fd; static unsigned int policy_is_set; static struct epoll_event *global_events_list; -static struct policy policies[MAX_VMS]; +static struct policy policies[MAX_CLIENTS]; void channel_monitor_exit(void) { @@ -199,7 +199,7 @@ update_policy(struct channel_packet *pkt) RTE_LOG(INFO, CHANNEL_MONITOR, "Applying policy for %s\n", pkt->vm_name); - for (i = 0; i < MAX_VMS; i++) { + for (i = 0; i < MAX_CLIENTS; i++) { if (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) { /* Copy the contents of *pkt into the policy.pkt */ policies[i].pkt = *pkt; @@ -214,7 +214,7 @@ update_policy(struct channel_packet *pkt) } } if (!updated) { - for (i = 0; i < MAX_VMS; i++) { + for (i = 0; i < MAX_CLIENTS; i++) { if (policies[i].enabled == 0) { policies[i].pkt = *pkt; get_pcpu_to_control(&policies[i]); @@ -238,7 +238,7 @@ remove_policy(struct channel_packet *pkt __rte_unused) * Disabling the policy is simply a case of setting * enabled to 0 */ - for (i = 0; i < MAX_VMS; i++) { + for (i = 0; i < MAX_CLIENTS; i++) { if (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) { policies[i].enabled = 0; return 0; @@ -609,7 +609,7 @@ run_channel_monitor(void) if (policy_is_set) { int j; - for (j = 0; j < MAX_VMS; j++) { + for (j = 0; j < MAX_CLIENTS; j++) { if (policies[j].enabled == 1) apply_policy(&policies[j]); } -- 2.17.1