[v1,2/7] lib/power: add changes for host commands/policies

Message ID 20180830105422.1198-3-david.hunt@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series add json power policy interface for containers |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hunt, David Aug. 30, 2018, 10:54 a.m. UTC
  Signed-off-by: David Hunt <david.hunt@intel.com>
---
 lib/librte_power/channel_commands.h | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Stephen Hemminger Aug. 30, 2018, 4:59 p.m. UTC | #1
On Thu, 30 Aug 2018 11:54:17 +0100
David Hunt <david.hunt@intel.com> wrote:

> Signed-off-by: David Hunt <david.hunt@intel.com>
> ---
>  lib/librte_power/channel_commands.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/librte_power/channel_commands.h b/lib/librte_power/channel_commands.h
> index ee638eefa..a82724911 100644
> --- a/lib/librte_power/channel_commands.h
> +++ b/lib/librte_power/channel_commands.h
> @@ -19,6 +19,7 @@ extern "C" {
>  #define CPU_POWER               1
>  #define CPU_POWER_CONNECT       2
>  #define PKT_POLICY              3
> +#define PKT_POLICY_REMOVE       4
>  
>  /* CPU Power Command Scaling */
>  #define CPU_POWER_SCALE_UP      1
> @@ -58,6 +59,8 @@ struct traffic {
>  	uint32_t max_max_packet_thresh;
>  };
>  
> +enum core_type { VIRTUAL = 0, PHYSICAL };
> +

Why this enum, looks like a boolean to me.
  
Hunt, David Sept. 12, 2018, 10:51 a.m. UTC | #2
Hi Stephen,

On 30/8/2018 5:59 PM, Stephen Hemminger wrote:
> On Thu, 30 Aug 2018 11:54:17 +0100
> David Hunt <david.hunt@intel.com> wrote:
>
>> Signed-off-by: David Hunt <david.hunt@intel.com>
>> ---
>>   lib/librte_power/channel_commands.h | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/lib/librte_power/channel_commands.h b/lib/librte_power/channel_commands.h
>> index ee638eefa..a82724911 100644
>> --- a/lib/librte_power/channel_commands.h
>> +++ b/lib/librte_power/channel_commands.h
>> @@ -19,6 +19,7 @@ extern "C" {
>>   #define CPU_POWER               1
>>   #define CPU_POWER_CONNECT       2
>>   #define PKT_POLICY              3
>> +#define PKT_POLICY_REMOVE       4
>>   
>>   /* CPU Power Command Scaling */
>>   #define CPU_POWER_SCALE_UP      1
>> @@ -58,6 +59,8 @@ struct traffic {
>>   	uint32_t max_max_packet_thresh;
>>   };
>>   
>> +enum core_type { VIRTUAL = 0, PHYSICAL };
>> +
> Why this enum, looks like a boolean to me.

I'll change this to a 'bool' in the next version.

Thanks,
Dave.
  

Patch

diff --git a/lib/librte_power/channel_commands.h b/lib/librte_power/channel_commands.h
index ee638eefa..a82724911 100644
--- a/lib/librte_power/channel_commands.h
+++ b/lib/librte_power/channel_commands.h
@@ -19,6 +19,7 @@  extern "C" {
 #define CPU_POWER               1
 #define CPU_POWER_CONNECT       2
 #define PKT_POLICY              3
+#define PKT_POLICY_REMOVE       4
 
 /* CPU Power Command Scaling */
 #define CPU_POWER_SCALE_UP      1
@@ -58,6 +59,8 @@  struct traffic {
 	uint32_t max_max_packet_thresh;
 };
 
+enum core_type { VIRTUAL = 0, PHYSICAL };
+
 struct channel_packet {
 	uint64_t resource_id; /**< core_num, device */
 	uint32_t unit;        /**< scale down/up/min/max */
@@ -70,6 +73,7 @@  struct channel_packet {
 	uint8_t vcpu_to_control[MAX_VCPU_PER_VM];
 	uint8_t num_vcpu;
 	struct timer_profile timer_policy;
+	enum core_type core_type;
 	enum workload workload;
 	enum policy_to_use policy_to_use;
 	struct t_boost_status t_boost_status;