From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yliu84x@shecgisg003.sh.intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 052A1567F
 for <dev@dpdk.org>; Tue,  7 Jul 2015 10:36:46 +0200 (CEST)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga103.fm.intel.com with ESMTP; 07 Jul 2015 01:36:45 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.15,421,1432623600"; d="scan'208";a="759699256"
Received: from shvmail01.sh.intel.com ([10.239.29.42])
 by orsmga002.jf.intel.com with ESMTP; 07 Jul 2015 01:36:44 -0700
Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com
 [10.239.29.90])
 by shvmail01.sh.intel.com with ESMTP id t678agGI009467;
 Tue, 7 Jul 2015 16:36:42 +0800
Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1])
 by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id
 t678aeOQ009329; Tue, 7 Jul 2015 16:36:42 +0800
Received: (from yliu84x@localhost)
 by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t678ad73009325;
 Tue, 7 Jul 2015 16:36:39 +0800
From: Yong Liu <yong.liu@intel.com>
To: dev@dpdk.org
Date: Tue,  7 Jul 2015 16:36:38 +0800
Message-Id: <1436258198-9293-1-git-send-email-yong.liu@intel.com>
X-Mailer: git-send-email 1.7.4.1
Subject: [dpdk-dev] [PATCH] rte_power: fix sample vm_power_mgr not work with
	Haswell cpus
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 07 Jul 2015 08:36:47 -0000

From: Marvin Liu <yong.liu@intel.com>

Two socket Haswell cpus on cottonwoodPass have 72 cores totally. And this
number oversize the default value of maximum core number 64.

Total number of channels should also increased for match core number.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/examples/vm_power_manager/power_manager.h b/examples/vm_power_manager/power_manager.h
index 1b45bab..f8a680a 100644
--- a/examples/vm_power_manager/power_manager.h
+++ b/examples/vm_power_manager/power_manager.h
@@ -39,7 +39,7 @@ extern "C" {
 #endif
 
 /* Maximum number of CPUS to manage */
-#define POWER_MGR_MAX_CPUS 64
+#define POWER_MGR_MAX_CPUS RTE_MAX_LCORE
 /**
  * Initialize power management.
  * Initializes resources and verifies the number of CPUs on the system.
diff --git a/lib/librte_power/channel_commands.h b/lib/librte_power/channel_commands.h
index 7e78a8b..aac4668 100644
--- a/lib/librte_power/channel_commands.h
+++ b/lib/librte_power/channel_commands.h
@@ -41,17 +41,10 @@ extern "C" {
 #include <stdint.h>
 
 /* Maximum number of CPUs */
-#define CHANNEL_CMDS_MAX_CPUS        64
-#if CHANNEL_CMDS_MAX_CPUS > 64
-#error Maximum number of cores is 64, overflow is guaranteed to \
-	cause problems with VM Power Management
-#endif
-
-/* Maximum number of channels per VM */
-#define CHANNEL_CMDS_MAX_VM_CHANNELS 64
+#define CHANNEL_CMDS_MAX_CPUS           RTE_MAX_LCORE
 
 /* Maximum number of channels per VM */
-#define CHANNEL_CMDS_MAX_VM_CHANNELS 64
+#define CHANNEL_CMDS_MAX_VM_CHANNELS    RTE_MAX_LCORE
 
 /* Valid Commands */
 #define CPU_POWER               1
-- 
1.9.3